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 <bkaindl@gmail.com>
This commit is contained in:
Bernhard Kaindl 2023-04-21 03:56:49 +02:00 committed by GitHub
parent 0b606b01dc
commit e3109a96d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(