Perl package: detect opcode support in externals (#38618)

Spack-installed Perl always has opcode support, but external Perl
installations might not. This commit adds a +opcode variant and
updates the external detection logic to check for opcode support.

The postgresql package is updated to require perl+opcode (in
combination with the above, this helps detect when an external
Perl instance is sufficient for a Spack build of postgreqsql, or
if Spack needs to build its own Perl).
This commit is contained in:
Chris Green 2023-07-10 12:01:20 -05:00 committed by GitHub
parent 30b077e63c
commit 8fdd8fcf63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -179,6 +179,7 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
variant("shared", default=True, description="Build a shared libperl.so library")
variant("threads", default=True, description="Build perl with threads support")
variant("open", default=True, description="Support open.pm")
variant("opcode", default=True, description="Support Opcode.pm")
resource(
name="cpanm",
@ -241,6 +242,10 @@ def determine_variants(cls, exes, version):
fail_on_error=False,
)
variants += "+open" if perl.returncode == 0 else "~open"
# this is just to detect incomplete installs
# normally perl installs Opcode.pm
perl("-e", "use Opcode", output=os.devnull, error=os.devnull, fail_on_error=False)
variants += "+opcode" if perl.returncode == 0 else "~opcode"
return variants
# On a lustre filesystem, patch may fail when files

View File

@ -57,7 +57,7 @@ class Postgresql(AutotoolsPackage):
depends_on("libedit", when="lineedit=libedit")
depends_on("openssl")
depends_on("tcl", when="+tcl")
depends_on("perl", when="+perl")
depends_on("perl+opcode", when="+perl")
depends_on("python", when="+python")
depends_on("libxml2", when="+xml")