From e28738a01e3ae15ade768514c15a433538d69f2a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 28 Dec 2022 15:20:53 -0800 Subject: 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 --- var/spack/repos/builtin/packages/texinfo/package.py | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v1.2.3-70-g09d2