From 35963d7d7d8c4984e89c828670e45c85f324b664 Mon Sep 17 00:00:00 2001 From: Xuefeng Ding Date: Thu, 9 Jan 2025 00:40:06 +0800 Subject: [PATCH] geant4-data: support G4TENDL (#48310) * add parse tool, json, and load json bug fix add variants and conflictions for g4tendl * correct format * correct format * update version mapping * remove 1.0 * Update var/spack/repos/builtin/packages/geant4-data/package.py Co-authored-by: Seth R. Johnson * add options * depends on it * fix typo --------- Co-authored-by: Seth R. Johnson --- .../builtin/packages/geant4-data/package.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/geant4-data/package.py b/var/spack/repos/builtin/packages/geant4-data/package.py index c30f2cebd5c..86364265c83 100644 --- a/var/spack/repos/builtin/packages/geant4-data/package.py +++ b/var/spack/repos/builtin/packages/geant4-data/package.py @@ -56,8 +56,6 @@ class Geant4Data(BundlePackage): "g4incl@1.2", "g4ensdfstate@3.0", "g4channeling@1.0", - "g4nudexlib@1.0", - "g4urrpt@1.1", ], "11.2.2:11.2": [ "g4ndl@4.7.1", @@ -195,6 +193,23 @@ class Geant4Data(BundlePackage): for _d in _dsets: depends_on(_d, type=("build", "run"), when=_vers) + _datasets_tendl = { + "11.0:11.3": "g4tendl@1.4", + "10.4:10.7": "g4tendl@1.3.2", + "10.3:10.3": "g4tendl@1.3", + } + + variant("tendl", default=True, when="@10.3:", description="Enable G4TENDL") + with when("+tendl"): + for _vers, _d in _datasets_tendl.items(): + depends_on(_d, type=("build", "run"), when="@" + _vers) + variant("nudexlib", default=True, when="@11.3.0:11.3", description="Enable G4NUDEXLIB") + with when("+nudexlib"): + depends_on("g4nudexlib@1.0", type=("build", "run")) + variant("urrpt", default=True, when="@11.3.0:11.3", description="Enable G4URRPT") + with when("+urrpt"): + depends_on("g4urrpt@1.1", type=("build", "run")) + @property def datadir(self): spec = self.spec