summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-04-13 12:01:38 +0200
committerGitHub <noreply@github.com>2024-04-13 12:01:38 +0200
commit7f1351822505f3b6c227d73c1238c1f3a4ef2be1 (patch)
tree6e2b8fd9678b01ff8f9e56fa1f7a5c53fafc7c0f
parent96a13a97e63438870ccfeef954eb9b5583b143e1 (diff)
downloadspack-7f1351822505f3b6c227d73c1238c1f3a4ef2be1.tar.gz
spack-7f1351822505f3b6c227d73c1238c1f3a4ef2be1.tar.bz2
spack-7f1351822505f3b6c227d73c1238c1f3a4ef2be1.tar.xz
spack-7f1351822505f3b6c227d73c1238c1f3a4ef2be1.zip
gettext: unvendor libxml (#43622)
-rw-r--r--var/spack/repos/builtin/packages/gettext/package.py26
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):