From c3b0806f6ce5b62fa2f08924ea0b130bf37c7e16 Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Tue, 4 Apr 2023 09:56:10 +0200 Subject: [PATCH] lhapdfsets: fix an error by avoiding the lhapdf command (#35997) Co-authored-by: Wouter Deconinck --- .../repos/builtin/packages/lhapdf/package.py | 2 ++ .../builtin/packages/lhapdfsets/package.py | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/lhapdf/package.py b/var/spack/repos/builtin/packages/lhapdf/package.py index ef906c2da8..35ab60c089 100644 --- a/var/spack/repos/builtin/packages/lhapdf/package.py +++ b/var/spack/repos/builtin/packages/lhapdf/package.py @@ -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") diff --git a/var/spack/repos/builtin/packages/lhapdfsets/package.py b/var/spack/repos/builtin/packages/lhapdfsets/package.py index f6d8f5905b..996eda271c 100644 --- a/var/spack/repos/builtin/packages/lhapdfsets/package.py +++ b/var/spack/repos/builtin/packages/lhapdfsets/package.py @@ -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)