diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/gettext/package.py | 26 |
1 files changed, 21 insertions, 5 deletions
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 <sys/cdefs.h>\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 <sys/cdefs.h>\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): |