From 65563946e3d937966ea462b3920fa631f2ee0a83 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 8 Apr 2021 14:11:40 +0200 Subject: squashfs: ensure we install with required options (#22863) Currently the make install step uses the default variables, which causes things to rebuild with default options. --- .../repos/builtin/packages/squashfs/package.py | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/var/spack/repos/builtin/packages/squashfs/package.py b/var/spack/repos/builtin/packages/squashfs/package.py index a5fb61e4d3..03d01dca30 100644 --- a/var/spack/repos/builtin/packages/squashfs/package.py +++ b/var/spack/repos/builtin/packages/squashfs/package.py @@ -49,19 +49,23 @@ class Squashfs(MakefilePackage): patch('gcc-10.patch', when="%gcc@10:") patch('gcc-10.patch', when="%clang@11:") + def make_options(self, spec): + default = spec.variants['default_compression'].value + return [ + 'GZIP_SUPPORT={0}'.format(1 if '+gzip' in spec else 0), + 'LZ4_SUPPORT={0}' .format(1 if '+lz4' in spec else 0), + 'LZO_SUPPORT={0}' .format(1 if '+lzo' in spec else 0), + 'XZ_SUPPORT={0}' .format(1 if '+xz' in spec else 0), + 'ZSTD_SUPPORT={0}'.format(1 if '+zstd' in spec else 0), + 'COMP_DEFAULT={0}'.format(default), + ] + def build(self, spec, prefix): + options = self.make_options(spec) with working_dir('squashfs-tools'): - default = spec.variants['default_compression'].value - make( - 'GZIP_SUPPORT={0}'.format(1 if '+gzip' in spec else 0), - 'LZ4_SUPPORT={0}' .format(1 if '+lz4' in spec else 0), - 'LZO_SUPPORT={0}' .format(1 if '+lzo' in spec else 0), - 'XZ_SUPPORT={0}' .format(1 if '+xz' in spec else 0), - 'ZSTD_SUPPORT={0}'.format(1 if '+zstd' in spec else 0), - 'COMP_DEFAULT={0}'.format(default), - parallel=False - ) + make(*options, parallel=False) def install(self, spec, prefix): + options = self.make_options(spec) with working_dir('squashfs-tools'): - make('install', 'INSTALL_DIR=%s' % prefix.bin, parallel=False) + make('install', 'INSTALL_DIR=%s' % prefix.bin, *options, parallel=False) -- cgit v1.2.3-70-g09d2