summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2022-12-28 15:20:53 -0800
committerGitHub <noreply@github.com>2022-12-28 15:20:53 -0800
commite28738a01e3ae15ade768514c15a433538d69f2a (patch)
tree60ab421ce384693d2b1fc3db36cbab08da0d4076
parent5f8c706128387b1258bd65010e4e06ef662283d9 (diff)
downloadspack-e28738a01e3ae15ade768514c15a433538d69f2a.tar.gz
spack-e28738a01e3ae15ade768514c15a433538d69f2a.tar.bz2
spack-e28738a01e3ae15ade768514c15a433538d69f2a.tar.xz
spack-e28738a01e3ae15ade768514c15a433538d69f2a.zip
bugfix: make texinfo build properly with gettext (#34312)
`texinfo` depends on `gettext`, and it builds a perl module that uses gettext via XS module FFI. Unfortunately, the XS modules build asks perl to tell it what compiler to use instead of respecting the one passed to configure. Without this change, the build fails with this error: ``` parsetexi/api.c:33:10: fatal error: 'libintl.h' file not found ^~~~~~~~~~~ ``` We need the gettext dependency and the spack wrappers to ensure XS builds properly. - [x] Add needed `gettext` dependency to `texinfo` - [x] Override XS compiler with `PERL_EXT_CC` Co-authored-by: Paul Kuberry <pakuber@sandia.gov>
-rw-r--r--var/spack/repos/builtin/packages/texinfo/package.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/texinfo/package.py b/var/spack/repos/builtin/packages/texinfo/package.py
index 1b393ca6f9..c0719fd4bf 100644
--- a/var/spack/repos/builtin/packages/texinfo/package.py
+++ b/var/spack/repos/builtin/packages/texinfo/package.py
@@ -34,6 +34,7 @@ class Texinfo(AutotoolsPackage, GNUMirrorPackage):
version("5.0", sha256="2c579345a39a2a0bb4b8c28533f0b61356504a202da6a25d17d4d866af7f5803")
depends_on("perl")
+ depends_on("gettext")
# sanity check
sanity_check_is_file = [
@@ -61,6 +62,12 @@ class Texinfo(AutotoolsPackage, GNUMirrorPackage):
targets.append("CFLAGS={}".format(self.compiler.c11_flag))
return targets
+ def setup_build_environment(self, env):
+ # texinfo builds Perl XS modules internally, and by default it overrides the
+ # CC that the top-level configure reports. This loses the Spack wrappers unless
+ # we set PERL_EXT_CC
+ env.set("PERL_EXT_CC", spack_cc)
+
@classmethod
def determine_version(cls, exe):
output = Executable(exe)("--version", output=str, error=str)