From bee3b6c52f71ac81f6b75862b029ec3027bbb007 Mon Sep 17 00:00:00 2001 From: whispers Date: Sat, 25 Jul 2026 23:16:53 -0400 Subject: [PATCH] texlive-bin-big: autoreconf to fix build with gcc 16 (texlive-bin-big is not a real attribute, but it does not appear to be actually exposed as an attribute. we're building this as a dependency of `texlivePackages.texlive-scripts`.) autoconf 2.72 has a bug where AC_PROG_CXX would reject c++20 compilers, and attempts to switch to c++98 or c++11 instead of using the compiler's default. when using gcc 16, which defaults to c++20, this causes texlive-bin-big to be built with c++20, causing issues with some of the included icu4c headers. this bug was fixed in autoconf 2.73, so we regenerate the autoconf declarations with the newest version of autconf (currently 2.73). once the configure scripts distributed with the source are regenerated with autoconf 2.73+, the `reautoconf` call should be removed. --- pkgs/tools/typesetting/tex/texlive/bin.nix | 28 +++++++++++++++---- .../tools/typesetting/tex/texlive/default.nix | 3 ++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index 9ebe2d90d7d9..b13dd6c3eec3 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -26,6 +26,9 @@ perlPackages, python3Packages, pkg-config, + autoconf, + automake, + libtool, cmake, ninja, libpaper, @@ -415,7 +418,12 @@ rec { hardeningDisable = [ "format" ]; - inherit (core) nativeBuildInputs depsBuildBuild; + inherit (core) depsBuildBuild; + nativeBuildInputs = core.nativeBuildInputs ++ [ + autoconf + automake + libtool + ]; buildInputs = core.buildInputs ++ [ core cairo @@ -426,11 +434,21 @@ rec { potrace ]; - /* - deleting the unused packages speeds up configure by a considerable margin - and ensures we do not rebuild existing libraries by mistake - */ + # autoconf 2.72 has a bug where AC_PROG_CXX would reject c++20 compilers, + # and attempts to switch to c++98 or c++11 instead of using the compiler's + # default. when using gcc 16, which defaults to c++20, this causes + # texlive-bin-big to be built with c++11, leading to issues with some of + # the included icu4c headers. this bug was fixed in autoconf 2.73, so we + # regenerate the autoconf declarations with the newest version of autconf. + # once the configure scripts distributed with the source are regenerated + # with autoconf 2.73+, the `reautoconf` call should be removed. + # + # deleting the unused packages speeds up configure by a considerable margin + # and ensures we do not rebuild existing libraries by mistake preConfigure = '' + substituteInPlace ./reautoconf --replace-fail "/bin/pwd" "pwd" + ./reautoconf + rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \ libs/{mpfr,pixman,xpdf,zlib,zziplib} \ texk/{afm2pl,bibtex-x,chktex,cjkutils,detex,dtl,dvi2tty,dvidvi,dviljk,dviout-util} \ diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index ceba25edf09c..12de9b6345b5 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -53,6 +53,9 @@ perlPackages, python3Packages, pkg-config, + autoconf, + automake, + libtool, cmake, ninja, libpaper,