lzo, lz4, xz, binutils: add libs multi-valued variant (#23474)

This commit is contained in:
Harmen Stoppels 2021-05-12 12:31:02 +02:00 committed by GitHub
parent e7219db93d
commit b768d7bb09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 6 deletions

View file

@ -39,6 +39,8 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
variant('ld', default=False, description='Enable ld.')
variant('gas', default=False, description='Enable as assembler.')
variant('interwork', default=False, description='Enable interwork.')
variant('libs', default='shared,static', values=('shared', 'static'),
multi=True, description='Build shared libs, static libs or both')
patch('cr16.patch', when='@:2.29.1')
patch('update_symbol-2.26.patch', when='@2.26')
@ -78,13 +80,13 @@ def configure_args(self):
'--disable-dependency-tracking',
'--disable-werror',
'--enable-multilib',
'--enable-shared',
'--enable-64-bit-bfd',
'--enable-targets=all',
'--with-system-zlib',
'--with-sysroot=/',
]
args += self.enable_or_disable('libs')
args += self.enable_or_disable('lto')
args += self.enable_or_disable('ld')
args += self.enable_or_disable('gas')

View file

@ -26,6 +26,9 @@ class Lz4(MakefilePackage):
depends_on('valgrind', type='test')
variant('libs', default='shared,static', values=('shared', 'static'),
multi=True, description='Build shared libs, static libs or both')
def url_for_version(self, version):
url = "https://github.com/lz4/lz4/archive"
@ -47,7 +50,10 @@ def build(self, spec, prefix):
make(parallel=par)
def install(self, spec, prefix):
make('install', 'PREFIX={0}'.format(prefix))
make('install',
'PREFIX={0}'.format(prefix),
'BUILD_SHARED={0}'.format('yes' if 'libs=shared' in self.spec else 'no'),
'BUILD_STATIC={0}'.format('yes' if 'libs=static' in self.spec else 'no'))
def patch(self):
# Remove flags not recognized by the NVIDIA compiler

View file

@ -19,8 +19,10 @@ class Lzo(AutotoolsPackage):
version('2.06', sha256='ff79e6f836d62d3f86ef6ce893ed65d07e638ef4d3cb952963471b4234d43e73')
version('2.05', sha256='449f98186d76ba252cd17ff1241ca2a96b7f62e0d3e4766f88730dab0ea5f333')
variant('libs', default='shared,static', values=('shared', 'static'),
multi=True, description='Build shared libs, static libs or both')
def configure_args(self):
return [
'--disable-dependency-tracking',
'--enable-shared'
]
args = ['--disable-dependency-tracking']
args += self.enable_or_disable('libs')
return args

View file

@ -29,6 +29,12 @@ class Xz(AutotoolsPackage, SourceforgePackage):
variant('pic', default=False,
description='Compile with position independent code.')
variant('libs', default='shared,static', values=('shared', 'static'),
multi=True, description='Build shared libs, static libs or both')
def configure_args(self):
return self.enable_or_disable('libs')
def flag_handler(self, name, flags):
if name == 'cflags' and '+pic' in self.spec:
flags.append(self.compiler.cc_pic_flag)