Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texinfo: fix build references when cross-compiling #178352

Merged
merged 2 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions pkgs/development/tools/misc/texinfo/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ 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 ]
++ optionals stdenv.isSunOS [ libiconv gawk ]
++ 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" ];
Expand All @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why this is needed. gpm seems to put texinfo into nativeBuildInputs. I would expect it to be enough.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

};

gpm-ncurses = gpm.override { inherit ncurses; };
Expand Down