Merge #185861: texlive.bin.core: fix cross-compilation

...into staging
This commit is contained in:
Vladimír Čunát 2022-09-28 10:33:23 +02:00
commit a338d9b3a9
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, fetchpatch
{ lib, stdenv, fetchurl, fetchpatch, buildPackages
, texlive
, zlib, libiconv, libpng, libX11
, freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext
@ -77,7 +77,13 @@ core = stdenv.mkDerivation rec {
outputs = [ "out" "doc" ];
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [
pkg-config
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# configure: error: tangle was not found but is required when cross-compiling.
texlive.bin.core
];
buildInputs = [
/*teckit*/ zziplib mpfr gmp
pixman gd freetype libpng libpaper zlib
@ -94,7 +100,10 @@ core = stdenv.mkDerivation rec {
'';
configureScript = "../configure";
depsBuildBuild = [ buildPackages.stdenv.cc ];
configureFlags = common.configureFlags
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "BUILDCC=${buildPackages.stdenv.cc.targetPrefix}cc" ]
++ [ "--without-x" ] # disable xdvik and xpdfopen
++ map (what: "--disable-${what}") [
"chktex"
@ -113,7 +122,7 @@ core = stdenv.mkDerivation rec {
# TODO: perhaps improve texmf.cnf search locations
postInstall = /* links format -> engine will be regenerated in texlive.combine */ ''
PATH="$out/bin:$PATH" ${texlinks}/bin/texlinks --cnffile "$out/share/texmf-dist/web2c/fmtutil.cnf" --unlink "$out/bin"
PATH="$out/bin:$PATH" ${buildPackages.texlive.bin.texlinks}/bin/texlinks --cnffile "$out/share/texmf-dist/web2c/fmtutil.cnf" --unlink "$out/bin"
'' + /* a few texmf-dist files are useful; take the rest from pkgs */ ''
mv "$out/share/texmf-dist/web2c/texmf.cnf" .
rm -r "$out/share/texmf-dist"