From 6b236f130c907bb3c43586a46832c34ea547fefc Mon Sep 17 00:00:00 2001 From: Sergey Kosukhin Date: Thu, 2 Nov 2023 20:28:31 +0100 Subject: eccodes: rename variant 'definitions' to 'extra_definitions' (#36186) --- .../repos/builtin/packages/eccodes/package.py | 33 ++++------------------ 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/var/spack/repos/builtin/packages/eccodes/package.py b/var/spack/repos/builtin/packages/eccodes/package.py index 8d18055a4c..1c24effccc 100644 --- a/var/spack/repos/builtin/packages/eccodes/package.py +++ b/var/spack/repos/builtin/packages/eccodes/package.py @@ -81,17 +81,9 @@ class Eccodes(CMakePackage): variant("shared", default=True, description="Build shared versions of the libraries") variant( - "definitions", - values=disjoint_sets(("auto",), ("default",) + tuple(_definitions.keys())).with_default( - "auto" - ), - description="List of definitions to install", - ) - - variant( - "samples", - values=disjoint_sets(("auto",), ("default",)).with_default("auto"), - description="List of samples to install", + "extra_definitions", + values=any_combination_of(*_definitions.keys()), + description="List of extra definitions to install", ) depends_on("netcdf-c", when="+netcdf") @@ -132,7 +124,7 @@ class Eccodes(CMakePackage): for center, definitions in _definitions.items(): kwargs = definitions.get("conflicts", None) if kwargs: - conflicts("definitions={0}".format(center), **kwargs) + conflicts("extra_definitions={0}".format(center), **kwargs) for kwargs in definitions.get("resources", []): resource( name=center, @@ -357,25 +349,12 @@ class Eccodes(CMakePackage): if "+memfs" in self.spec: args.append(self.define("PYTHON_EXECUTABLE", python.path)) - definitions = self.spec.variants["definitions"].value - - if "auto" not in definitions: - args.append( - self.define("ENABLE_INSTALL_ECCODES_DEFINITIONS", "default" in definitions) - ) - - samples = self.spec.variants["samples"].value - - if "auto" not in samples: - args.append(self.define("ENABLE_INSTALL_ECCODES_SAMPLES", "default" in samples)) - return args @run_after("install") def install_extra_definitions(self): - noop = set(["auto", "none", "default"]) - for center in self.spec.variants["definitions"].value: - if center not in noop: + for center in self.spec.variants["extra_definitions"].value: + if center != "none": center_dir = "definitions.{0}".format(center) install_tree( join_path(self.stage.source_path, "spack-definitions", center_dir), -- cgit v1.2.3-70-g09d2