diff options
author | Hadrien G <knights_of_ni@gmx.com> | 2020-01-23 18:42:25 +0100 |
---|---|---|
committer | Chris Green <greenc@fnal.gov> | 2020-01-23 11:42:25 -0600 |
commit | 1a385a5178bb8f78f93c1eb215ad497337729128 (patch) | |
tree | 601f9dbde59037ac5da6adbb0e0d8893bd5791d7 | |
parent | c9e01ff9d76f5e1e645b01f5021c469f436b260c (diff) | |
download | spack-1a385a5178bb8f78f93c1eb215ad497337729128.tar.gz spack-1a385a5178bb8f78f93c1eb215ad497337729128.tar.bz2 spack-1a385a5178bb8f78f93c1eb215ad497337729128.tar.xz spack-1a385a5178bb8f78f93c1eb215ad497337729128.zip |
root: Fix root+x breakage from #11129 (#14224)
* Fix root+x breakage from #11129
* Separate out +opengl breakage
* Not strictly X11-related, but more breakage from #11129
* Another X11 breakage found while building 6.08.x
* Don't put system headers in SPACK_INCLUDE_DIRS + deduplicate
* xextproto is only a dependency in +x builds
-rw-r--r-- | var/spack/repos/builtin/packages/root/package.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/root/package.py b/var/spack/repos/builtin/packages/root/package.py index 4384e0e2b0..6d461fc843 100644 --- a/var/spack/repos/builtin/packages/root/package.py +++ b/var/spack/repos/builtin/packages/root/package.py @@ -5,6 +5,7 @@ from spack import * +from spack.util.environment import is_system_path import sys @@ -427,8 +428,36 @@ class Root(CMakePackage): if 'lz4' in self.spec: env.append_path('CMAKE_PREFIX_PATH', self.spec['lz4'].prefix) + + # This hack is made necessary by a header name collision between + # asimage's "import.h" and Python's "import.h" headers... env.set('SPACK_INCLUDE_DIRS', '', force=True) + # ...but it breaks header search for any ROOT dependency which does not + # use CMake. To resolve this, we must bring back those dependencies's + # include paths into SPACK_INCLUDE_DIRS. + # + # But in doing so, we must be careful not to inject system header paths + # into SPACK_INCLUDE_DIRS, even in a deprioritized form, because some + # system/compiler combinations don't like having -I/usr/include around. + def add_include_path(dep_name): + include_path = self.spec[dep_name].prefix.include + if not is_system_path(include_path): + env.append_path('SPACK_INCLUDE_DIRS', include_path) + + # With that done, let's go fixing those deps + if self.spec.satisfies('+x @:6.08.99'): + add_include_path('xextproto') + if self.spec.satisfies('@:6.12.99'): + add_include_path('zlib') + if '+x' in self.spec: + add_include_path('fontconfig') + add_include_path('libx11') + add_include_path('xproto') + if '+opengl' in self.spec: + add_include_path('glew') + add_include_path('mesa-glu') + def setup_run_environment(self, env): env.set('ROOTSYS', self.prefix) env.set('ROOT_VERSION', 'v{0}'.format(self.version.up_to(1))) |