diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index c62b1165bba5..b48886e10096 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -102,6 +102,12 @@ core = stdenv.mkDerivation rec { perl ]; + patches = [ + # Fix implicit `int` on `main`, which results in an error when building with clang 16. + # This is fixed upstream and can be dropped with the 2023 release. + ./fix-implicit-int.patch + ]; + hardeningDisable = [ "format" ]; preConfigure = '' @@ -224,6 +230,9 @@ core-big = stdenv.mkDerivation { #TODO: upmendex stripLen = 1; extraPrefix = "libs/luajit/LuaJIT-src/"; }) + # Fix implicit `int` on `main`, which results in an error when building with clang 16. + # This is fixed upstream and can be dropped with the 2023 release. + ./fix-implicit-int.patch ]; hardeningDisable = [ "format" ]; diff --git a/pkgs/tools/typesetting/tex/texlive/fix-implicit-int.patch b/pkgs/tools/typesetting/tex/texlive/fix-implicit-int.patch new file mode 100644 index 000000000000..f74409fe1066 --- /dev/null +++ b/pkgs/tools/typesetting/tex/texlive/fix-implicit-int.patch @@ -0,0 +1,22 @@ +diff -ur a/utils/m-tx/mtx-src/prepmx.c b/utils/m-tx/mtx-src/prepmx.c +--- a/utils/m-tx/mtx-src/prepmx.c 2018-04-28 17:56:18.000000000 -0600 ++++ b/utils/m-tx/mtx-src/prepmx.c 2023-07-11 15:21:26.351024424 -0600 +@@ -769,6 +769,7 @@ + } + + ++int + main(int argc, Char *argv[]) + { /* ---- Main program ------------------------ */ + PASCAL_MAIN(argc, argv); +diff -ur a/utils/pmx/pmx-src/libf2c/main.c b/utils/pmx/pmx-src/libf2c/main.c +--- a/utils/pmx/pmx-src/libf2c/main.c 2016-02-09 22:31:26.000000000 -0700 ++++ b/utils/pmx/pmx-src/libf2c/main.c 2023-07-11 15:49:35.043438384 -0600 +@@ -106,6 +106,7 @@ + #ifdef KR_headers + main(argc, argv) int argc; char **argv; + #else ++int + main(int argc, char **argv) + #endif + {