root: add first spack external find support

only parses the version, variant parsing will follow.
This commit is contained in:
Valentin Volkl 2021-05-08 13:44:43 +02:00 committed by Todd Gamblin
parent d25455277b
commit fb207b80ce

View File

@ -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