From 7f1351822505f3b6c227d73c1238c1f3a4ef2be1 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Sat, 13 Apr 2024 12:01:38 +0200 Subject: gettext: unvendor libxml (#43622) --- .../repos/builtin/packages/gettext/package.py | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/gettext/package.py b/var/spack/repos/builtin/packages/gettext/package.py index 0c600821dc..3e58ba6783 100644 --- a/var/spack/repos/builtin/packages/gettext/package.py +++ b/var/spack/repos/builtin/packages/gettext/package.py @@ -68,12 +68,28 @@ class Gettext(AutotoolsPackage, GNUMirrorPackage): patch("nvhpc-export-symbols.patch", when="%nvhpc") patch("nvhpc-long-width.patch", when="%nvhpc") - # Apply this only where we know that the system libc is glibc, be very careful: - @when("@:0.21.0 target=ppc64le:") def patch(self): - for fn in ("gettext-tools/gnulib-lib/cdefs.h", "gettext-tools/libgrep/cdefs.h"): - with open(fn, "w") as f: - f.write("#include \n") + # Apply this only where we know that the system libc is glibc, be very careful: + if self.spec.satisfies("@:0.21.0 target=ppc64le"): + for fn in ("gettext-tools/gnulib-lib/cdefs.h", "gettext-tools/libgrep/cdefs.h"): + with open(fn, "w") as f: + f.write("#include \n") + + # From the configure script: "we don't want to use an external libxml, because its + # dependencies and their dynamic relocations have an impact on the startup time", well, + # *we* do. + filter_file( + "gl_cv_libxml_force_included=yes", + "gl_cv_libxml_force_included=no", + "libtextstyle/configure", + string=True, + ) + + def flag_handler(self, name, flags): + # this goes together with gl_cv_libxml_force_included=no + if name == "ldflags": + flags.append("-lxml2") + return (flags, None, None) @classmethod def determine_version(cls, exe): -- cgit v1.2.3-70-g09d2