From 56ba61c52fe9ce1f9323817e9199da3339722089 Mon Sep 17 00:00:00 2001 From: haralmha <47558670+haralmha@users.noreply.github.com> Date: Fri, 18 Mar 2022 13:52:05 +0100 Subject: 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 --- var/spack/repos/builtin/packages/hepmcanalysis/package.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hepmcanalysis/package.py b/var/spack/repos/builtin/packages/hepmcanalysis/package.py index 860c6c71bc..168316f894 100644 --- a/var/spack/repos/builtin/packages/hepmcanalysis/package.py +++ b/var/spack/repos/builtin/packages/hepmcanalysis/package.py @@ -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) -- cgit v1.2.3-60-g2f50