diff options
author | Peter Scheibel <scheibel1@llnl.gov> | 2019-03-04 12:36:51 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-04 12:36:51 -0600 |
commit | af4a36c4d99d7953200d369bbeba6303ad87dcf7 (patch) | |
tree | fca08e8d4d5bcee231eb880ac66e33c46f1fe0c6 | |
parent | 0ce15003763b3c05c0d77b1875d10f7c295b2936 (diff) | |
download | spack-af4a36c4d99d7953200d369bbeba6303ad87dcf7.tar.gz spack-af4a36c4d99d7953200d369bbeba6303ad87dcf7.tar.bz2 spack-af4a36c4d99d7953200d369bbeba6303ad87dcf7.tar.xz spack-af4a36c4d99d7953200d369bbeba6303ad87dcf7.zip |
Header subdirectories for Python and Eigen (#10773)
Fixes #10769
This updates the .headers property to include header subdirectories
for Python and Eigen (as is recommended by these packages).
#10623 updated the default behavior of .headers.directories to
exclude subdirectories (since this can cause clashes with system
headers). This broke some packages which depended on the old behavior
of .headers.directories: for example if you had
<package-prefix>/include/subdir/ex1.h, .headers.directories would
include <package-prefix>/include/subdir.
-rw-r--r-- | var/spack/repos/builtin/packages/eigen/package.py | 6 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/python/package.py | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py index 7a11c68c00..e3b7c151a7 100644 --- a/var/spack/repos/builtin/packages/eigen/package.py +++ b/var/spack/repos/builtin/packages/eigen/package.py @@ -46,3 +46,9 @@ class Eigen(CMakePackage): depends_on('gmp', when='+mpfr') patch('find-ptscotch.patch', when='@3.3.4') + + @property + def headers(self): + headers = find_all_headers(self.prefix.include) + headers.directories = [self.prefix.include.eigen3] + return headers diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 30f2c2571e..5c43ef0773 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -619,13 +619,15 @@ class Python(AutotoolsPackage): def headers(self): config_h = self.get_config_h_filename() - if os.path.exists(config_h): - return HeaderList(config_h) - else: + if not os.path.exists(config_h): includepy = self.get_config_var('INCLUDEPY') msg = 'Unable to locate {0} headers in {1}' raise RuntimeError(msg.format(self.name, includepy)) + headers = HeaderList(config_h) + headers.directories = [os.path.dirname(config_h)] + return headers + @property def python_lib_dir(self): return join_path('lib', 'python{0}'.format(self.version.up_to(2))) |