Skip to content

Commit

Permalink
pythia8: add a cxxstd variant (#44077)
Browse files Browse the repository at this point in the history
* pythia8: add a cxxstd variant
* Add multi=False, fix regexp

---------

Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
  • Loading branch information
jmcarcell and jmcarcell committed May 9, 2024
1 parent 2ed0e3d commit d88fa5c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions var/spack/repos/builtin/packages/pythia8/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 = []

Expand Down

0 comments on commit d88fa5c

Please sign in to comment.