summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMark W. Krentel <krentel@rice.edu>2021-07-07 04:25:57 -0500
committerGitHub <noreply@github.com>2021-07-07 11:25:57 +0200
commit3c9a58bd0bde1e53aa6803dd82aaf8540d91097b (patch)
tree3f13225810e7bc95b7625ea7592661829d95ff55 /var
parent59eea2859a998bbf7ab1b669002e6b3fe26b71d5 (diff)
downloadspack-3c9a58bd0bde1e53aa6803dd82aaf8540d91097b.tar.gz
spack-3c9a58bd0bde1e53aa6803dd82aaf8540d91097b.tar.bz2
spack-3c9a58bd0bde1e53aa6803dd82aaf8540d91097b.tar.xz
spack-3c9a58bd0bde1e53aa6803dd82aaf8540d91097b.zip
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.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/perl/package.py17
1 files 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 <justin@doubleotoo.com>
# 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