From ffae0db11574d953f4512e7ce274c2eab3ce0dde Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 12 Jan 2023 16:41:31 +0100 Subject: Add dummy perl+open variant, use it in external find, require it in libxcrypt (#34867) --- var/spack/repos/builtin/packages/libxcrypt/package.py | 15 +++++++++------ var/spack/repos/builtin/packages/perl/package.py | 13 +++++++++++-- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/libxcrypt/package.py b/var/spack/repos/builtin/packages/libxcrypt/package.py index 2e2ef94c65..fbb2db83e7 100644 --- a/var/spack/repos/builtin/packages/libxcrypt/package.py +++ b/var/spack/repos/builtin/packages/libxcrypt/package.py @@ -32,6 +32,15 @@ class Libxcrypt(AutotoolsPackage): patch("truncating-conversion.patch", when="@4.4.30") + with when("@:4.4.17"): + depends_on("autoconf", type="build") + depends_on("automake@1.14:", type="build") + depends_on("libtool", type="build") + depends_on("m4", type="build") + + # Some distros have incomplete perl installs, +open catches that. + depends_on("perl@5.14.0: +open", type="build", when="@4.4.18:") + def configure_args(self): args = [ # Disable test dependency on Python (Python itself depends on libxcrypt). @@ -45,9 +54,3 @@ class Libxcrypt(AutotoolsPackage): @property def libs(self): return find_libraries("libcrypt", root=self.prefix, recursive=True) - - with when("@:4.4.17"): - depends_on("autoconf", type="build") - depends_on("automake@1.14:", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index cca48bf2cf..14ce904e85 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -159,10 +159,9 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package # having it in core increases the "energy of activation" for doing # things cleanly. variant("cpanm", default=True, description="Optionally install cpanm with the core packages.") - 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") resource( name="cpanm", @@ -211,6 +210,16 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package variants += "+cpanm" else: variants += "~cpanm" + # this is just to detect incomplete installs + # normally perl installs open.pm + perl( + "-e", + "use open OUT => qw(:raw)", + output=os.devnull, + error=os.devnull, + fail_on_error=False, + ) + variants += "+open" if perl.returncode == 0 else "~open" return variants # On a lustre filesystem, patch may fail when files -- cgit v1.2.3-70-g09d2