lhapdfsets: fix an error by avoiding the lhapdf command (#35997)

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
This commit is contained in:
Valentin Volkl 2023-04-04 09:56:10 +02:00 committed by GitHub
parent 77d55ebbd1
commit c3b0806f6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View file

@ -19,6 +19,8 @@ class Lhapdf(AutotoolsPackage):
tags = ["hep"]
maintainers("vvolkl", "wdconinc")
version("6.5.4", sha256="ace8913781044ad542e378697fcd95a8535d510818bb74a6665f9fd2b132ac0f")
version("6.5.3", sha256="90fe7254d5a48a9b2d424fcbac1bf9708b0e54690efec4c78e9ad28b9203bfcd")
version("6.5.2", sha256="23972ec46289c82a63df60b55b62f219418b4d80f94b8d570feb2b5e48014054")

View file

@ -16,11 +16,13 @@ class Lhapdfsets(BundlePackage):
tags = ["hep"]
maintainers("vvolkl")
maintainers("vvolkl", "wdconinc")
version("6.3.0")
depends_on("lhapdf", type="build")
depends_on("tar", type="build")
depends_on("curl", type="build")
phases = ["install"]
@ -36,7 +38,8 @@ class Lhapdfsets(BundlePackage):
def install(self, spec, prefix):
mkdirp(self.prefix.share.lhapdfsets)
lhapdf = which("lhapdf")
tar = which("tar")
curl = which("curl")
sets = self.spec.variants["sets"].value
if sets == "all":
# parse set names from index file
@ -50,7 +53,17 @@ def install(self, spec, prefix):
elif sets == "default":
default_sets = ["MMHT2014lo68cl", "MMHT2014nlo68cl", "CT14lo", "CT14nlo"]
sets = default_sets
lhapdf("--pdfdir=" + self.prefix.share.lhapdfsets, "install", *sets)
with working_dir(self.prefix.share.lhapdfsets):
for s in sets:
_filename = "%s.tar.gz" % s
curl(
"-L",
"-o",
_filename,
"http://lhapdfsets.web.cern.ch/lhapdfsets/current/%s" % _filename,
)
tar("xfz", _filename)
os.remove(_filename)
def setup_dependent_build_environment(self, env, dependent_spec):
env.set("LHAPDF_DATA_PATH", self.prefix.share.lhapdfsets)