summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathon Anderson <17242663+blue42u@users.noreply.github.com>2022-11-16 19:55:02 -0600
committerGitHub <noreply@github.com>2022-11-17 02:55:02 +0100
commit497682260fd465888e653c6b72620a7a352a0dbe (patch)
tree091a52b1430127450103c1c3d2619189a965b36e
parente47beceb8a665aba360813fb55aa08cc8bd86dbe (diff)
downloadspack-497682260fd465888e653c6b72620a7a352a0dbe.tar.gz
spack-497682260fd465888e653c6b72620a7a352a0dbe.tar.bz2
spack-497682260fd465888e653c6b72620a7a352a0dbe.tar.xz
spack-497682260fd465888e653c6b72620a7a352a0dbe.zip
gettext: On ppc64le, for older versions, use system cdefs.h (#33411)
Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
-rw-r--r--var/spack/repos/builtin/packages/gettext/package.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gettext/package.py b/var/spack/repos/builtin/packages/gettext/package.py
index b528e8a8b0..de077821f2 100644
--- a/var/spack/repos/builtin/packages/gettext/package.py
+++ b/var/spack/repos/builtin/packages/gettext/package.py
@@ -58,6 +58,13 @@ 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")
+
@classmethod
def determine_version(cls, exe):
gettext = Executable(exe)