eccodes: rename variant 'definitions' to 'extra_definitions' (#36186)

This commit is contained in:
Sergey Kosukhin 2023-11-02 20:28:31 +01:00 committed by GitHub
parent fa08de669e
commit 6b236f130c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,17 +81,9 @@ class Eccodes(CMakePackage):
variant("shared", default=True, description="Build shared versions of the libraries") variant("shared", default=True, description="Build shared versions of the libraries")
variant( variant(
"definitions", "extra_definitions",
values=disjoint_sets(("auto",), ("default",) + tuple(_definitions.keys())).with_default( values=any_combination_of(*_definitions.keys()),
"auto" description="List of extra definitions to install",
),
description="List of definitions to install",
)
variant(
"samples",
values=disjoint_sets(("auto",), ("default",)).with_default("auto"),
description="List of samples to install",
) )
depends_on("netcdf-c", when="+netcdf") depends_on("netcdf-c", when="+netcdf")
@ -132,7 +124,7 @@ class Eccodes(CMakePackage):
for center, definitions in _definitions.items(): for center, definitions in _definitions.items():
kwargs = definitions.get("conflicts", None) kwargs = definitions.get("conflicts", None)
if kwargs: if kwargs:
conflicts("definitions={0}".format(center), **kwargs) conflicts("extra_definitions={0}".format(center), **kwargs)
for kwargs in definitions.get("resources", []): for kwargs in definitions.get("resources", []):
resource( resource(
name=center, name=center,
@ -357,25 +349,12 @@ def cmake_args(self):
if "+memfs" in self.spec: if "+memfs" in self.spec:
args.append(self.define("PYTHON_EXECUTABLE", python.path)) 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 return args
@run_after("install") @run_after("install")
def install_extra_definitions(self): def install_extra_definitions(self):
noop = set(["auto", "none", "default"]) for center in self.spec.variants["extra_definitions"].value:
for center in self.spec.variants["definitions"].value: if center != "none":
if center not in noop:
center_dir = "definitions.{0}".format(center) center_dir = "definitions.{0}".format(center)
install_tree( install_tree(
join_path(self.stage.source_path, "spack-definitions", center_dir), join_path(self.stage.source_path, "spack-definitions", center_dir),