From e3109a96d4e6ed0d82ec6ed8c540c63da9cd94ed Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com> Date: Fri, 21 Apr 2023 03:56:49 +0200 Subject: bcache: Simplify check if -lintl shall be added to LDFLAGS (#36569) Replace my initial libintl check with the much nicer check for "intl" in self.spec["gettext"].libs.names. Thanks to Chris Green! Co-authored-by: Bernhard Kaindl --- var/spack/repos/builtin/packages/bcache/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/bcache/package.py b/var/spack/repos/builtin/packages/bcache/package.py index 3ce4dc1da1..4f24bd9cd7 100644 --- a/var/spack/repos/builtin/packages/bcache/package.py +++ b/var/spack/repos/builtin/packages/bcache/package.py @@ -26,7 +26,7 @@ class Bcache(MakefilePackage): def setup_build_environment(self, env): # Add -lintl if provided by gettext, otherwise libintl is provided by the system's glibc: - if any("libintl." in filename.split("/")[-1] for filename in self.spec["gettext"].libs): + if "gettext" in self.spec and "intl" in self.spec["gettext"].libs.names: env.append_flags("LDFLAGS", "-lintl") patch( -- cgit v1.2.3-70-g09d2