catch: fix paths for [email protected]:+single_header#9876
catch: fix paths for [email protected]:+single_header#9876goxberry wants to merge 1 commit intospack:developfrom
Conversation
65eb124 to
1935e58
Compare
1935e58 to
c13eb0d
Compare
|
|
||
| @when('@2.0.0:2.4.0+single_header') | ||
| def install(self, spec, prefix): | ||
| mkdirp(prefix.include) |
There was a problem hiding this comment.
This should be prefix.include.catch2. It won't crash as is, but it will rename the catch.hpp file to catch2 instead of placing it in a directory with that name.
There was a problem hiding this comment.
Wait, the doc string here is not trivial.
As I added above in the comments, it was changed in 2.3.0+:
releases 2.3.0+ changed to "catch2/catch.hpp" header
and is as such also documented in the change logs: https://github.com/catchorg/Catch2/releases/tag/v2.3.0
Why should we change this for older releases? I would not do that. Just edit for 2.3.0+ maybe?
There was a problem hiding this comment.
I think that diff should be better:
diff --git a/var/spack/repos/builtin/packages/catch/package.py b/var/spack/repos/builtin/packages/catch/package.py
index 0db27a853..557f135bf 100644
--- a/var/spack/repos/builtin/packages/catch/package.py
+++ b/var/spack/repos/builtin/packages/catch/package.py
@@ -63,6 +63,9 @@ class Catch(CMakePackage):
@when('+single_header')
def install(self, spec, prefix):
mkdirp(prefix.include)
- install(join_path('single_include', 'catch.hpp'), prefix.include)
+ if spec.satisfies('@2.3.0:'):
+ install_tree('single_include', prefix.include)
+ else:
+ install(join_path('single_include', 'catch.hpp'), prefix.include)
# fakes out spack so it installs a module file
mkdirp(join_path(prefix, 'bin'))| install(join_path('single_include', 'catch2', 'catch.hpp'), | ||
| prefix.include.catch2) | ||
| # fakes out spack so it installs a module file | ||
| mkdirp(join_path(prefix, 'bin')) |
There was a problem hiding this comment.
Can you confirm if this is actually necessary? I'm not aware of Spack failing to generate a module file just because there is no prefix.bin directory.
|
I will close this for now. Please report back if something is not working with #10022 |
This pull request updates the header source location and install prefix for a single-header installation of Catch2.