summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorValentin Volkl <valentin.volkl@cern.ch>2021-05-08 13:44:43 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2021-05-10 21:59:38 -0700
commitfb207b80cea1cf2df419afd61dbc672bcbcf3c05 (patch)
tree3c7bb3686370e95353660617b04d38c4e9b219ec /var
parentd25455277b5ce5d0d30ca5a44ae091bd636c5831 (diff)
downloadspack-fb207b80cea1cf2df419afd61dbc672bcbcf3c05.tar.gz
spack-fb207b80cea1cf2df419afd61dbc672bcbcf3c05.tar.bz2
spack-fb207b80cea1cf2df419afd61dbc672bcbcf3c05.tar.xz
spack-fb207b80cea1cf2df419afd61dbc672bcbcf3c05.zip
root: add first `spack external find` support
only parses the version, variant parsing will follow.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/root/package.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/root/package.py b/var/spack/repos/builtin/packages/root/package.py
index 455e87263f..de63c15eb2 100644
--- a/var/spack/repos/builtin/packages/root/package.py
+++ b/var/spack/repos/builtin/packages/root/package.py
@@ -16,6 +16,8 @@ class Root(CMakePackage):
url = "https://root.cern/download/root_v6.16.00.source.tar.gz"
git = "https://github.com/root-project/root.git"
+ executables = ['^root$', '^root-config$']
+
tags = ['hep']
maintainers = ['chissg', 'HadrienG2', 'drbenmorgan', 'vvolkl']
@@ -297,6 +299,25 @@ class Root(CMakePackage):
conflicts('+' + pkg, when='@6.18.00:',
msg='Obsolete option +{0} selected.'.format(pkg))
+ @classmethod
+ def filter_detected_exes(cls, prefix, exes_in_prefix):
+ result = []
+ for exe in exes_in_prefix:
+ # no need to check the root executable itself
+ # we can get all information from root-config
+ if exe.endswith('root'):
+ continue
+ result.append(exe)
+ return result
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)('--version', output=str, error=str)
+ # turn the output of root-config --version
+ # (something like 6.22/06)
+ # into the format used in this recipe (6.22.06)
+ return output.strip().replace('/', '.')
+
def cmake_args(self):
spec = self.spec
define = self.define