p7zip: fix build on macOS

This commit is contained in:
Adam J. Stewart 2020-10-01 17:06:04 -05:00 committed by Peter Scheibel
parent e760f16cf8
commit db794ea201

View file

@ -3,8 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class P7zip(MakefilePackage):
"""A Unix port of the 7z file archiver"""
@ -17,6 +15,13 @@ class P7zip(MakefilePackage):
# all3 includes 7z, 7za, and 7zr
build_targets = ['all3']
def edit(self, spec, prefix):
if 'platform=darwin' in self.spec:
if '%gcc' in self.spec:
copy('makefile.macosx_gcc_64bits', 'makefile.machine')
elif '%apple-clang' in self.spec or '%clang' in self.spec:
copy('makefile.macosx_llvm_64bits', 'makefile.machine')
@property
def install_targets(self):
return ['DEST_HOME={0}'.format(self.prefix), 'install']