diff options
author | iarspider <iarspider@gmail.com> | 2022-11-15 18:36:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 09:36:15 -0800 |
commit | 0811f81a09bbe87274a9aae093245ff7d8a4af9c (patch) | |
tree | 8c43dfdb960df84f675d4165b60dbed68cb276d3 /var | |
parent | af74680405c931dab16c6674f9b97a32bf3f1122 (diff) | |
download | spack-0811f81a09bbe87274a9aae093245ff7d8a4af9c.tar.gz spack-0811f81a09bbe87274a9aae093245ff7d8a4af9c.tar.bz2 spack-0811f81a09bbe87274a9aae093245ff7d8a4af9c.tar.xz spack-0811f81a09bbe87274a9aae093245ff7d8a4af9c.zip |
thepeg: make rivet dependency optional... (#33912)
* thepeg: make rivet dependency optional...
* add "libs" variant, move compiler flags to flag_handler
Co-authored-by: iarspider <iarspider@users.noreply.github.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/thepeg/package.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/thepeg/package.py b/var/spack/repos/builtin/packages/thepeg/package.py index 0ecb52018d..1c933cae53 100644 --- a/var/spack/repos/builtin/packages/thepeg/package.py +++ b/var/spack/repos/builtin/packages/thepeg/package.py @@ -66,7 +66,7 @@ class Thepeg(AutotoolsPackage): depends_on("hepmc3", when="hepmc=3") conflicts("hepmc=3", when="@:2.1", msg="HepMC3 support was added in 2.2.0") depends_on("fastjet", when="@2.0.0:") - depends_on("rivet", when="@2.0.3:") + depends_on("rivet", when="@2.0.3: +rivet") depends_on("boost +test", when="@2.1.1:") depends_on("autoconf", type="build") @@ -76,9 +76,23 @@ class Thepeg(AutotoolsPackage): depends_on("zlib") variant("hepmc", default="2", values=("2", "3"), description="HepMC interface to build ") + variant("rivet", default=True, description="Add rivet integration") + variant( + "libs", + default="shared", + values=("shared", "static"), + multi=True, + description="Build shared libs, static libs or both", + ) install_targets = ["install-strip"] + def flag_handler(self, name, flags): + if name in ("cxxflags", "cflags", "fflags", "cppflags"): + flags.append("-O2") + + return (None, None, flags) + def configure_args(self): args = ["--with-gsl=" + self.spec["gsl"].prefix, "--without-javagui"] args += ["--with-zlib=" + self.spec["zlib"].prefix] @@ -99,12 +113,12 @@ class Thepeg(AutotoolsPackage): if self.spec.satisfies("@2.0.0:"): args += ["--with-fastjet=" + self.spec["fastjet"].prefix] - if self.spec.satisfies("@2.0.3:"): + if self.spec.satisfies("@2.0.3: +rivet"): args += ["--with-rivet=" + self.spec["rivet"].prefix] if self.spec.satisfies("@2.1.1:"): args += ["--with-boost=" + self.spec["boost"].prefix] - args += ["CFLAGS=-O2", "CXXFLAGS=-O2", "FFLAGS=-O2"] + args += self.enable_or_disable("libs") return args |