From d88fa5cf8e7d4de2f40735b2aa9dd02ac81542ab Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Thu, 9 May 2024 18:32:38 +0200 Subject: pythia8: add a cxxstd variant (#44077) * pythia8: add a cxxstd variant * Add multi=False, fix regexp --------- Co-authored-by: jmcarcell --- var/spack/repos/builtin/packages/pythia8/package.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/var/spack/repos/builtin/packages/pythia8/package.py b/var/spack/repos/builtin/packages/pythia8/package.py index f762c01226..0086f2b730 100644 --- a/var/spack/repos/builtin/packages/pythia8/package.py +++ b/var/spack/repos/builtin/packages/pythia8/package.py @@ -58,6 +58,14 @@ class Pythia8(AutotoolsPackage): deprecated=True, ) + variant( + "cxxstd", + default="11", + values=("11", "17", "20", "23"), + multi=False, + description="Use the specified C++ standard when building", + ) + variant("shared", default=True, description="Build shared library") variant("gzip", default=False, description="Build with gzip support, for reading lhe.gz files") variant( @@ -120,6 +128,12 @@ class Pythia8(AutotoolsPackage): filter_compiler_wrappers("Makefile.inc", relative_root="share/Pythia8/examples") + @run_before("configure") + def setup_cxxstd(self): + filter_file( + r"-std=c\+\+[0-9][0-9]", f"-std=c++{self.spec.variants['cxxstd'].value}", "configure" + ) + def configure_args(self): args = [] -- cgit v1.2.3-70-g09d2