Fixed Remaining Shared Objects in Static Lua (#15787)
Fixed removal of remaining references and symlinks to so files when building lua with static libraries
This commit is contained in:
parent
917c0a0efd
commit
6ad717cc9d
@ -69,24 +69,25 @@ def install(self, spec, prefix):
|
|||||||
|
|
||||||
# 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
|
||||||
with working_dir(prefix.lib):
|
if '+shared' in spec:
|
||||||
# e.g., liblua.so.5.1.5
|
with working_dir(prefix.lib):
|
||||||
src_path = 'liblua.{0}.{1}'.format(dso_suffix,
|
# e.g., liblua.so.5.1.5
|
||||||
str(self.version.up_to(3)))
|
src_path = 'liblua.{0}.{1}'.format(dso_suffix,
|
||||||
|
str(self.version.up_to(3)))
|
||||||
|
|
||||||
# For lua version 5.1.X, the symlinks should be:
|
# For lua version 5.1.X, the symlinks should be:
|
||||||
# liblua5.1.so
|
# liblua5.1.so
|
||||||
# liblua51.so
|
# liblua51.so
|
||||||
# liblua-5.1.so
|
# liblua-5.1.so
|
||||||
# liblua-51.so
|
# liblua-51.so
|
||||||
version_formats = [str(self.version.up_to(2)),
|
version_formats = [str(self.version.up_to(2)),
|
||||||
Version(str(self.version.up_to(2))).joined]
|
Version(str(self.version.up_to(2))).joined]
|
||||||
for version_str in version_formats:
|
for version_str in version_formats:
|
||||||
for joiner in ['', '-']:
|
for joiner in ['', '-']:
|
||||||
dest_path = 'liblua{0}{1}.{2}'.format(joiner,
|
dest_path = 'liblua{0}{1}.{2}'.format(joiner,
|
||||||
version_str,
|
version_str,
|
||||||
dso_suffix)
|
dso_suffix)
|
||||||
os.symlink(src_path, dest_path)
|
os.symlink(src_path, dest_path)
|
||||||
|
|
||||||
with working_dir(os.path.join('luarocks', 'luarocks')):
|
with working_dir(os.path.join('luarocks', 'luarocks')):
|
||||||
configure('--prefix=' + prefix, '--with-lua=' + prefix)
|
configure('--prefix=' + prefix, '--with-lua=' + prefix)
|
||||||
@ -96,7 +97,8 @@ def install(self, spec, prefix):
|
|||||||
def append_paths(self, paths, cpaths, path):
|
def append_paths(self, paths, cpaths, path):
|
||||||
paths.append(os.path.join(path, '?.lua'))
|
paths.append(os.path.join(path, '?.lua'))
|
||||||
paths.append(os.path.join(path, '?', 'init.lua'))
|
paths.append(os.path.join(path, '?', 'init.lua'))
|
||||||
cpaths.append(os.path.join(path, '?.so'))
|
if '+shared' in self.spec:
|
||||||
|
cpaths.append(os.path.join(path, '?.so'))
|
||||||
|
|
||||||
def _setup_dependent_env_helper(self, env, dependent_spec):
|
def _setup_dependent_env_helper(self, env, dependent_spec):
|
||||||
lua_paths = []
|
lua_paths = []
|
||||||
@ -126,7 +128,8 @@ def setup_dependent_build_environment(self, env, dependent_spec):
|
|||||||
env, dependent_spec)
|
env, dependent_spec)
|
||||||
|
|
||||||
env.set('LUA_PATH', ';'.join(lua_patterns), separator=';')
|
env.set('LUA_PATH', ';'.join(lua_patterns), separator=';')
|
||||||
env.set('LUA_CPATH', ';'.join(lua_cpatterns), separator=';')
|
if '+shared' in self.spec:
|
||||||
|
env.set('LUA_CPATH', ';'.join(lua_cpatterns), separator=';')
|
||||||
|
|
||||||
def setup_dependent_run_environment(self, env, dependent_spec):
|
def setup_dependent_run_environment(self, env, dependent_spec):
|
||||||
# For run time environment set only the path for dependent_spec and
|
# For run time environment set only the path for dependent_spec and
|
||||||
@ -136,8 +139,9 @@ def setup_dependent_run_environment(self, env, dependent_spec):
|
|||||||
|
|
||||||
if dependent_spec.package.extends(self.spec):
|
if dependent_spec.package.extends(self.spec):
|
||||||
env.prepend_path('LUA_PATH', ';'.join(lua_patterns), separator=';')
|
env.prepend_path('LUA_PATH', ';'.join(lua_patterns), separator=';')
|
||||||
env.prepend_path('LUA_CPATH', ';'.join(lua_cpatterns),
|
if '+shared' in spec:
|
||||||
separator=';')
|
env.prepend_path('LUA_CPATH', ';'.join(lua_cpatterns),
|
||||||
|
separator=';')
|
||||||
|
|
||||||
def setup_run_environment(self, env):
|
def setup_run_environment(self, env):
|
||||||
env.prepend_path(
|
env.prepend_path(
|
||||||
@ -156,10 +160,11 @@ def setup_run_environment(self, env):
|
|||||||
'LUA_PATH',
|
'LUA_PATH',
|
||||||
os.path.join(self.spec.prefix, self.lua_lib_dir, '?', 'init.lua'),
|
os.path.join(self.spec.prefix, self.lua_lib_dir, '?', 'init.lua'),
|
||||||
separator=';')
|
separator=';')
|
||||||
env.prepend_path(
|
if '+shared' in self.spec:
|
||||||
'LUA_CPATH',
|
env.prepend_path(
|
||||||
os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'),
|
'LUA_CPATH',
|
||||||
separator=';')
|
os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'),
|
||||||
|
separator=';')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lua_lib_dir(self):
|
def lua_lib_dir(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user