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:
parent
30b077e63c
commit
8fdd8fcf63
@ -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("shared", default=True, description="Build a shared libperl.so library")
|
||||||
variant("threads", default=True, description="Build perl with threads support")
|
variant("threads", default=True, description="Build perl with threads support")
|
||||||
variant("open", default=True, description="Support open.pm")
|
variant("open", default=True, description="Support open.pm")
|
||||||
|
variant("opcode", default=True, description="Support Opcode.pm")
|
||||||
|
|
||||||
resource(
|
resource(
|
||||||
name="cpanm",
|
name="cpanm",
|
||||||
@ -241,6 +242,10 @@ def determine_variants(cls, exes, version):
|
|||||||
fail_on_error=False,
|
fail_on_error=False,
|
||||||
)
|
)
|
||||||
variants += "+open" if perl.returncode == 0 else "~open"
|
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
|
return variants
|
||||||
|
|
||||||
# On a lustre filesystem, patch may fail when files
|
# On a lustre filesystem, patch may fail when files
|
||||||
|
@ -57,7 +57,7 @@ class Postgresql(AutotoolsPackage):
|
|||||||
depends_on("libedit", when="lineedit=libedit")
|
depends_on("libedit", when="lineedit=libedit")
|
||||||
depends_on("openssl")
|
depends_on("openssl")
|
||||||
depends_on("tcl", when="+tcl")
|
depends_on("tcl", when="+tcl")
|
||||||
depends_on("perl", when="+perl")
|
depends_on("perl+opcode", when="+perl")
|
||||||
depends_on("python", when="+python")
|
depends_on("python", when="+python")
|
||||||
depends_on("libxml2", when="+xml")
|
depends_on("libxml2", when="+xml")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user