From 113733d9fb84084bd4b16bbe5b3c39e3d70ff28c Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Fri, 7 Feb 2025 11:42:46 +0100 Subject: [PATCH] trexio: fix issues with autotools build system (#48923) --- var/spack/repos/builtin/packages/trexio/package.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/trexio/package.py b/var/spack/repos/builtin/packages/trexio/package.py index eb8261181cb..7c0684ec4cd 100644 --- a/var/spack/repos/builtin/packages/trexio/package.py +++ b/var/spack/repos/builtin/packages/trexio/package.py @@ -47,18 +47,16 @@ class Trexio(AutotoolsPackage, CMakePackage): depends_on("hdf5@1.8:+hl", when="@:2.3.0 +hdf5") depends_on("hdf5@1.8:", when="+hdf5") - # Append -lhdf5_hl to LIBS when hdf5 variant is activated - # or use --without-hdf5 option otherwise. - class AutotoolsBuilder(autotools.AutotoolsBuilder): def configure_args(self): config_args = [] if "+hdf5" in self.spec: - if self.spec("@:2.3.0"): + if self.spec.satisfies("@:2.3.0"): + # Autotools should take care of adding the necessary flags for HDF5 + # In older versions, it is not always the case for "hdf5_hl" + # Append -lhdf5_hl to LIBS when hdf5 variant is activated config_args.append("LIBS=-lhdf5_hl") - else: - config.args.append("LIBS=-lhdf5") else: config_args.append("--without-hdf5")