From 3c9a58bd0bde1e53aa6803dd82aaf8540d91097b Mon Sep 17 00:00:00 2001 From: "Mark W. Krentel" Date: Wed, 7 Jul 2021 04:25:57 -0500 Subject: perl: add dependencies for bzip2 and zlib (#24743) Perl keeps copies of the bzip2 and zlib source code in its own source tree and by default uses them in favor of outside libraries. Instead, put these dependencies under control of spack and tell perl to use the spack-built versions. --- var/spack/repos/builtin/packages/perl/package.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index 68caa4b58a..60a93164b8 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -11,12 +11,11 @@ # Author: Justin Too # Date: September 6, 2015 # -import re import os +import re from contextlib import contextmanager from llnl.util.lang import match_predicate - from spack import * @@ -65,6 +64,8 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package depends_on('gdbm') depends_on('berkeley-db') + depends_on('bzip2+shared') + depends_on('zlib+shared') # there has been a long fixed issue with 5.22.0 with regard to the ccflags # definition. It is well documented here: @@ -270,12 +271,22 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package mkdirp(module.perl_lib_dir) def setup_build_environment(self, env): + spec = self.spec + # This is to avoid failures when using -mmacosx-version-min=11.1 # since not all Apple Clang compilers support that version range # See https://eclecticlight.co/2020/07/21/big-sur-is-both-10-16-and-11-0-its-official/ - if self.spec.satisfies('os=bigsur'): + if spec.satisfies('os=bigsur'): env.set('SYSTEM_VERSION_COMPAT', 1) + # This is how we tell perl the locations of bzip and zlib. + env.set('BUILD_BZIP2', 0) + env.set('BZIP2_INCLUDE', spec['bzip2'].prefix.include) + env.set('BZIP2_LIB', spec['bzip2'].prefix.lib) + env.set('BUILD_ZLIB', 0) + env.set('ZLIB_INCLUDE', spec['zlib'].prefix.include) + env.set('ZLIB_LIB', spec['zlib'].prefix.lib) + @run_after('install') def filter_config_dot_pm(self): """Run after install so that Config.pm records the compiler that Spack -- cgit v1.2.3-70-g09d2