hepmcanalysis: propagate cxxstd from root (#29512)

* Use same cxx value as root

* Remove pointer syntax from non-pointer type in source

* Run patch function before build

* Use raw string in filter_file and merge edit function with patch

* Escape parentheses

* Use gDirectory from ROOT instead of CurrentDirectory function
This commit is contained in:
haralmha 2022-03-18 13:52:05 +01:00 committed by GitHub
parent dd67f46c6b
commit 56ba61c52f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,17 +22,14 @@ class Hepmcanalysis(MakefilePackage):
depends_on('root')
depends_on('clhep')
variant('cxxstd',
default='11',
values=('11', '14', '17'),
multi=False,
description='Use the specified C++ standard when building.')
patch('lcg.patch')
def edit(self, spec, prefix):
def patch(self):
filter_file(r"TDirectory::CurrentDirectory\(\)",
r"gDirectory",
"src/baseAnalysis.cc")
filter_file(r"CXXFLAGS(.*)", r"CXXFLAGS\1 -std=c++" +
self.spec.variants['cxxstd'].value, "config.mk")
self.spec['root'].variants['cxxstd'].value, "config.mk")
def setup_build_environment(self, env):
env.set("HepMCdir", self.spec['hepmc'].prefix)