summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Green <greenc@fnal.gov>2019-07-19 08:36:58 -0500
committerGitHub <noreply@github.com>2019-07-19 08:36:58 -0500
commit9b763980b6f3ac94b4644829c96abded3f7104ff (patch)
tree8fb9dd42d874194e3da45ef8cc33215d21cce00d
parentba0cd4d912ef66908a0e560cdbdc6f8cbf633390 (diff)
downloadspack-9b763980b6f3ac94b4644829c96abded3f7104ff.tar.gz
spack-9b763980b6f3ac94b4644829c96abded3f7104ff.tar.bz2
spack-9b763980b6f3ac94b4644829c96abded3f7104ff.tar.xz
spack-9b763980b6f3ac94b4644829c96abded3f7104ff.zip
libxpm: cope with system gettext if configured. (#10881)
* If gettext is installed in the system it won't be in the spec tree.
-rw-r--r--var/spack/repos/builtin/packages/libxpm/package.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/libxpm/package.py b/var/spack/repos/builtin/packages/libxpm/package.py
index 7cc339f92c..24a49f0436 100644
--- a/var/spack/repos/builtin/packages/libxpm/package.py
+++ b/var/spack/repos/builtin/packages/libxpm/package.py
@@ -27,5 +27,9 @@ class Libxpm(AutotoolsPackage):
depends_on('util-macros', type='build')
def setup_environment(self, spack_env, run_env):
- spack_env.append_flags('LDFLAGS', '-L{0} -lintl'.format(
- self.spec['gettext'].prefix.lib))
+ # If libxpm is installed as an external package, gettext won't
+ # be available in the spec. See
+ # https://github.com/spack/spack/issues/9149 for details.
+ if 'gettext' in self.spec:
+ spack_env.append_flags('LDFLAGS', '-L{0} -lintl'.format(
+ self.spec['gettext'].prefix.lib))