diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/lua/package.py | 57 |
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): |