summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTiziano Müller <tiziano.mueller@chem.uzh.ch>2021-04-13 22:42:00 +0200
committerGitHub <noreply@github.com>2021-04-13 13:42:00 -0700
commitc6a08981a776e883beb0db7a1a2791ecead6de99 (patch)
tree2dd1a4cf488ee35e0fc13c39877c54929e7f11b8 /var
parentdee030618f39ca6f4c92402547c8ac57772fa324 (diff)
downloadspack-c6a08981a776e883beb0db7a1a2791ecead6de99.tar.gz
spack-c6a08981a776e883beb0db7a1a2791ecead6de99.tar.bz2
spack-c6a08981a776e883beb0db7a1a2791ecead6de99.tar.xz
spack-c6a08981a776e883beb0db7a1a2791ecead6de99.zip
gaussian-view/vmd: add deps on X11/GL libraries (#22322)
Both binary packages would otherwise require X11 and Mesa libraries to be installed on the host to run. Make sure they use the Spack-provided libraries by patching the `rpath` via `patchelf`.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/gaussian-view/package.py21
-rw-r--r--var/spack/repos/builtin/packages/libice/package.py5
-rw-r--r--var/spack/repos/builtin/packages/libsm/package.py5
-rw-r--r--var/spack/repos/builtin/packages/libxext/package.py5
-rw-r--r--var/spack/repos/builtin/packages/libxinerama/package.py5
-rw-r--r--var/spack/repos/builtin/packages/libxrender/package.py5
-rw-r--r--var/spack/repos/builtin/packages/vmd/package.py16
7 files changed, 62 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gaussian-view/package.py b/var/spack/repos/builtin/packages/gaussian-view/package.py
index 28d1ce136a..680ce8c51a 100644
--- a/var/spack/repos/builtin/packages/gaussian-view/package.py
+++ b/var/spack/repos/builtin/packages/gaussian-view/package.py
@@ -44,6 +44,15 @@ class GaussianView(Package):
conflicts('+gaussian-src', when='@:6.0.99')
+ depends_on('libx11', type=('run', 'link'))
+ depends_on('libxext', type=('run', 'link'))
+ depends_on('gl@3:', type=('run', 'link'))
+ depends_on('glu@1.3', type=('run', 'link'))
+ depends_on('libxrender', type=('run', 'link'))
+ depends_on('libsm', type=('run', 'link'))
+ depends_on('libice', type=('run', 'link'))
+ depends_on('patchelf', type='build')
+
def url_for_version(self, version):
return "file://{0}/gv{1}-linux-x86_64.tbz".format(
os.getcwd(),
@@ -52,6 +61,18 @@ class GaussianView(Package):
def install(self, spec, prefix):
install_tree('.', prefix)
+ # make sure the executable finds and uses the Spack-provided
+ # libraries, otherwise the executable may or may not run depending
+ # on what is installed on the host
+ # the $ORIGIN prefix is required for the executable to find its
+ # own bundled shared libraries
+ patchelf = which('patchelf')
+ rpath = '$ORIGIN:$ORIGIN/lib' + ':'.join(
+ self.spec[dep].libs.directories[0]
+ for dep in ['libx11', 'libxext', 'libxrender', 'libice', 'libsm',
+ 'gl', 'glu'])
+ patchelf('--set-rpath', rpath, join_path(self.prefix, 'gview.exe'))
+
@run_after('install')
def caveats(self):
perm_script = 'spack_perms_fix.sh'
diff --git a/var/spack/repos/builtin/packages/libice/package.py b/var/spack/repos/builtin/packages/libice/package.py
index 67576bfbf2..bb210343bf 100644
--- a/var/spack/repos/builtin/packages/libice/package.py
+++ b/var/spack/repos/builtin/packages/libice/package.py
@@ -18,3 +18,8 @@ class Libice(AutotoolsPackage, XorgPackage):
depends_on('xtrans')
depends_on('pkgconfig', type='build')
depends_on('util-macros', type='build')
+
+ @property
+ def libs(self):
+ return find_libraries('libICE', self.prefix,
+ shared=True, recursive=True)
diff --git a/var/spack/repos/builtin/packages/libsm/package.py b/var/spack/repos/builtin/packages/libsm/package.py
index 71389de1c0..aec4fe364e 100644
--- a/var/spack/repos/builtin/packages/libsm/package.py
+++ b/var/spack/repos/builtin/packages/libsm/package.py
@@ -22,3 +22,8 @@ class Libsm(AutotoolsPackage, XorgPackage):
depends_on('xtrans')
depends_on('pkgconfig', type='build')
depends_on('util-macros', type='build')
+
+ @property
+ def libs(self):
+ return find_libraries('libSM', self.prefix,
+ shared=True, recursive=True)
diff --git a/var/spack/repos/builtin/packages/libxext/package.py b/var/spack/repos/builtin/packages/libxext/package.py
index c66327225b..4fbcf089d0 100644
--- a/var/spack/repos/builtin/packages/libxext/package.py
+++ b/var/spack/repos/builtin/packages/libxext/package.py
@@ -20,3 +20,8 @@ class Libxext(AutotoolsPackage, XorgPackage):
depends_on('xextproto@7.1.99:')
depends_on('pkgconfig', type='build')
depends_on('util-macros', type='build')
+
+ @property
+ def libs(self):
+ return find_libraries('libXext', self.prefix,
+ shared=True, recursive=True)
diff --git a/var/spack/repos/builtin/packages/libxinerama/package.py b/var/spack/repos/builtin/packages/libxinerama/package.py
index 773802d8fe..e6c6fb04ca 100644
--- a/var/spack/repos/builtin/packages/libxinerama/package.py
+++ b/var/spack/repos/builtin/packages/libxinerama/package.py
@@ -21,3 +21,8 @@ class Libxinerama(AutotoolsPackage, XorgPackage):
depends_on('xineramaproto@1.1.99.1:')
depends_on('pkgconfig', type='build')
depends_on('util-macros', type='build')
+
+ @property
+ def libs(self):
+ return find_libraries('libXinerama', self.prefix,
+ shared=True, recursive=True)
diff --git a/var/spack/repos/builtin/packages/libxrender/package.py b/var/spack/repos/builtin/packages/libxrender/package.py
index b1a6facdfc..c991c8d9ca 100644
--- a/var/spack/repos/builtin/packages/libxrender/package.py
+++ b/var/spack/repos/builtin/packages/libxrender/package.py
@@ -20,3 +20,8 @@ class Libxrender(AutotoolsPackage, XorgPackage):
depends_on('renderproto@0.9:')
depends_on('pkgconfig', type='build')
depends_on('util-macros', type='build')
+
+ @property
+ def libs(self):
+ return find_libraries('libXrender', self.prefix,
+ shared=True, recursive=True)
diff --git a/var/spack/repos/builtin/packages/vmd/package.py b/var/spack/repos/builtin/packages/vmd/package.py
index 7a0d3e949a..1746d7bce8 100644
--- a/var/spack/repos/builtin/packages/vmd/package.py
+++ b/var/spack/repos/builtin/packages/vmd/package.py
@@ -27,6 +27,12 @@ class Vmd(Package):
phases = ['configure', 'install']
+ depends_on('libx11', type=('run', 'link'))
+ depends_on('libxi', type=('run', 'link'))
+ depends_on('libxinerama', type=('run', 'link'))
+ depends_on('gl@3:', type=('run', 'link'))
+ depends_on('patchelf', type='build')
+
def setup_build_environment(self, env):
env.set('VMDINSTALLBINDIR', self.prefix.bin)
env.set('VMDINSTALLLIBRARYDIR', self.prefix.lib64)
@@ -39,5 +45,15 @@ class Vmd(Package):
with working_dir(join_path(self.stage.source_path, 'src')):
make('install')
+ # make sure the executable finds and uses the Spack-provided
+ # libraries, otherwise the executable may or may not run depending
+ # on what is installed on the host
+ patchelf = which('patchelf')
+ rpath = ':'.join(
+ self.spec[dep].libs.directories[0]
+ for dep in ['libx11', 'libxi', 'libxinerama', 'gl'])
+ patchelf('--set-rpath', rpath,
+ join_path(self.prefix, 'lib64', 'vmd_LINUXAMD64'))
+
def setup_run_environment(self, env):
env.set('PLUGINDIR', self.spec.prefix.lib64.plugins)