Aded Option to Disable Shared Lua library Generation (#15758)

* Aded Option to Disable Shared Lua library

Added option to disable generation of shared object library for lua to
avoid build issues on static only platforms

* Fixed Flake8 Issue with Lua Spackage

Fixed indentation issue with lua spackage
This commit is contained in:
Robert Pavel 2020-03-30 10:56:23 -06:00 committed by GitHub
parent abdada03a8
commit 8d1e88658d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,9 @@ class Lua(Package):
version('5.1.4', sha256='b038e225eaf2a5b57c9bcc35cd13aa8c6c8288ef493d52970c9545074098af3a') version('5.1.4', sha256='b038e225eaf2a5b57c9bcc35cd13aa8c6c8288ef493d52970c9545074098af3a')
version('5.1.3', sha256='6b5df2edaa5e02bf1a2d85e1442b2e329493b30b0c0780f77199d24f087d296d') version('5.1.3', sha256='6b5df2edaa5e02bf1a2d85e1442b2e329493b30b0c0780f77199d24f087d296d')
variant('shared', default=True,
description='Builds a shared version of the library')
extendable = True extendable = True
depends_on('ncurses') depends_on('ncurses')
@ -58,10 +61,11 @@ def install(self, spec, prefix):
make('INSTALL_TOP=%s' % prefix, make('INSTALL_TOP=%s' % prefix,
'install') 'install')
static_to_shared_library(join_path(prefix.lib, 'liblua.a'), if '+shared' in spec:
arguments=['-lm', '-ldl'], static_to_shared_library(join_path(prefix.lib, 'liblua.a'),
version=self.version, arguments=['-lm', '-ldl'],
compat_version=self.version.up_to(2)) version=self.version,
compat_version=self.version.up_to(2))
# compatibility with ax_lua.m4 from autoconf-archive # compatibility with ax_lua.m4 from autoconf-archive
# https://www.gnu.org/software/autoconf-archive/ax_lua.html # https://www.gnu.org/software/autoconf-archive/ax_lua.html