diff --git a/pkgs/development/tools/misc/texinfo/common.nix b/pkgs/development/tools/misc/texinfo/common.nix index e5814e9bda4c2..df3b12ea5b688 100644 --- a/pkgs/development/tools/misc/texinfo/common.nix +++ b/pkgs/development/tools/misc/texinfo/common.nix @@ -36,8 +36,7 @@ stdenv.mkDerivation { strictDeps = true; enableParallelBuilding = true; - # We need a native compiler to build perl XS extensions - # when cross-compiling. + # A native compiler is needed to build tools needed at build time depsBuildBuild = [ buildPackages.stdenv.cc perl ]; buildInputs = [ xz.bin bash libintl ] @@ -45,6 +44,9 @@ stdenv.mkDerivation { ++ optional interactive ncurses; configureFlags = [ "PERL=${buildPackages.perl}/bin/perl" ] + # Perl XS modules are difficult to cross-compile and texinfo has pure Perl + # fallbacks. + ++ optional crossBuildTools "--enable-perl-xs=no" ++ lib.optional stdenv.isSunOS "AWK=${gawk}/bin/awk"; installFlags = [ "TEXMF=$(out)/texmf-dist" ]; @@ -62,6 +64,13 @@ stdenv.mkDerivation { "XFAIL_TESTS=test_scripts/layout_formatting_fr_icons.sh" ]; + postFixup = optionalString crossBuildTools '' + for f in "$out"/bin/{pod2texi,texi2any}; do + substituteInPlace "$f" \ + --replace ${buildPackages.perl}/bin/perl ${perl}/bin/perl + done + ''; + meta = { homepage = "https://www.gnu.org/software/texinfo/"; description = "The GNU documentation system"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 61f2b45b2dfdf..a49ab8311282b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23224,7 +23224,7 @@ with pkgs; # latest 6.8 mysteriously fails to parse '@headings single': # https://lists.gnu.org/archive/html/bug-texinfo/2021-09/msg00011.html - texinfo = texinfo6_7; + texinfo = buildPackages.texinfo6_7; }; gpm-ncurses = gpm.override { inherit ncurses; };