summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorRobert Pavel <rspavel@lanl.gov>2020-04-01 11:31:01 -0600
committerGitHub <noreply@github.com>2020-04-01 12:31:01 -0500
commit6ad717cc9df8799a56d6a126180cbc380f4e57c1 (patch)
tree6862dccaec4b143fa81e9007e71770c45fabf346 /var
parent917c0a0efd4258b76fe62f66233a9cca3186c5d4 (diff)
downloadspack-6ad717cc9df8799a56d6a126180cbc380f4e57c1.tar.gz
spack-6ad717cc9df8799a56d6a126180cbc380f4e57c1.tar.bz2
spack-6ad717cc9df8799a56d6a126180cbc380f4e57c1.tar.xz
spack-6ad717cc9df8799a56d6a126180cbc380f4e57c1.zip
Fixed Remaining Shared Objects in Static Lua (#15787)
Fixed removal of remaining references and symlinks to so files when building lua with static libraries
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/lua/package.py57
1 files changed, 31 insertions, 26 deletions
diff --git a/var/spack/repos/builtin/packages/lua/package.py b/var/spack/repos/builtin/packages/lua/package.py
index c8fe652c39..420e3b041a 100644
--- a/var/spack/repos/builtin/packages/lua/package.py
+++ b/var/spack/repos/builtin/packages/lua/package.py
@@ -69,24 +69,25 @@ class Lua(Package):
# compatibility with ax_lua.m4 from autoconf-archive
# https://www.gnu.org/software/autoconf-archive/ax_lua.html
- with working_dir(prefix.lib):
- # e.g., liblua.so.5.1.5
- src_path = 'liblua.{0}.{1}'.format(dso_suffix,
- str(self.version.up_to(3)))
-
- # For lua version 5.1.X, the symlinks should be:
- # liblua5.1.so
- # liblua51.so
- # liblua-5.1.so
- # liblua-51.so
- version_formats = [str(self.version.up_to(2)),
- Version(str(self.version.up_to(2))).joined]
- for version_str in version_formats:
- for joiner in ['', '-']:
- dest_path = 'liblua{0}{1}.{2}'.format(joiner,
- version_str,
- dso_suffix)
- os.symlink(src_path, dest_path)
+ if '+shared' in spec:
+ with working_dir(prefix.lib):
+ # e.g., liblua.so.5.1.5
+ src_path = 'liblua.{0}.{1}'.format(dso_suffix,
+ str(self.version.up_to(3)))
+
+ # For lua version 5.1.X, the symlinks should be:
+ # liblua5.1.so
+ # liblua51.so
+ # liblua-5.1.so
+ # liblua-51.so
+ version_formats = [str(self.version.up_to(2)),
+ Version(str(self.version.up_to(2))).joined]
+ for version_str in version_formats:
+ for joiner in ['', '-']:
+ dest_path = 'liblua{0}{1}.{2}'.format(joiner,
+ version_str,
+ dso_suffix)
+ os.symlink(src_path, dest_path)
with working_dir(os.path.join('luarocks', 'luarocks')):
configure('--prefix=' + prefix, '--with-lua=' + prefix)
@@ -96,7 +97,8 @@ class Lua(Package):
def append_paths(self, paths, cpaths, path):
paths.append(os.path.join(path, '?.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):
lua_paths = []
@@ -126,7 +128,8 @@ class Lua(Package):
env, dependent_spec)
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):
# For run time environment set only the path for dependent_spec and
@@ -136,8 +139,9 @@ class Lua(Package):
if dependent_spec.package.extends(self.spec):
env.prepend_path('LUA_PATH', ';'.join(lua_patterns), separator=';')
- env.prepend_path('LUA_CPATH', ';'.join(lua_cpatterns),
- separator=';')
+ if '+shared' in spec:
+ env.prepend_path('LUA_CPATH', ';'.join(lua_cpatterns),
+ separator=';')
def setup_run_environment(self, env):
env.prepend_path(
@@ -156,10 +160,11 @@ class Lua(Package):
'LUA_PATH',
os.path.join(self.spec.prefix, self.lua_lib_dir, '?', 'init.lua'),
separator=';')
- env.prepend_path(
- 'LUA_CPATH',
- os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'),
- separator=';')
+ if '+shared' in self.spec:
+ env.prepend_path(
+ 'LUA_CPATH',
+ os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'),
+ separator=';')
@property
def lua_lib_dir(self):