From 4af6cbccfe454235507a27ab63356526a76f4928 Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 10 Aug 2022 07:25:12 +0300 Subject: [PATCH] texlive.bin.core: fix cross-compilation depsBuildBuild for 'ar: command not found' BUILDCC for failure during 'checking whether the C compiler works...' there's still a issue but it maybe wont cause reverse dependency issues? so overall its still an improvement ``` cd texk/texlive/tl_support && make run-texlinks make[1]: Entering directory '/build/texlive-20210325-source/WorkDir/texk/texlive/tl_support' if test -s /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/texlinks && test -s /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/share/texmf-dist/web2c/fmtutil.cnf; then \ echo "running texlinks in `pwd` via: /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/texlinks -v -f /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/share/texmf-dist/web2c/fmtutil.cnf -e "" /nix/stor> PATH="/nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin:/nix/store/146229z6ingpiz0g1yxs2jpq1h546ms3-gcc-wrapper-11.3.0/bin:/nix/store/sc50c3qvzlw6dmfbhxw96j9yrj47pv1v-gcc-11.3.0/bin:/nix/store/20navlfxxadg2qvkqh3vc55z27divi40-glibc-2.35-163> else :; fi running texlinks in /build/texlive-20210325-source/WorkDir/texk/texlive/tl_support via: /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/texlinks -v -f /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/s> /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpsewhich: line 1: syntax error: unexpected word (expecting ")") /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 1: ^?ELF^B^A^A^B^A<80>: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 1: ^]: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 1: ^]A^B^B^A^B^Fp^]p^]Ap^]A^P^B^P^B^H^D^D^B^B@^B@: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 1: ^]A: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 2: @@<9A>@8: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 5: syntax error: unterminated quoted string /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin: no write permissions. Skipping... /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 1: ^?ELF^B^A^A^B^A<80>: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 1: ^]: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 1: ^]A^B^B^A^B^Fp^]p^]Ap^]A^P^B^P^B^H^D^D^B^B@^B@: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 1: ^]A: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 2: @@<9A>@8: not found /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: line 5: syntax error: unterminated quoted string make[1]: Leaving directory '/build/texlive-20210325-source/WorkDir/texk/texlive/tl_support' /nix/store/j00iibma3wqn88f8bi9x2c9dns3ww98v-texlinks/bin/texlinks: line 252: /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpsewhich: cannot execute binary file: Exec format error /nix/store/j00iibma3wqn88f8bi9x2c9dns3ww98v-texlinks/bin/texlinks: line 298: /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: cannot execute binary file: Exec format error /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin: no write permissions. Skipping... /nix/store/j00iibma3wqn88f8bi9x2c9dns3ww98v-texlinks/bin/texlinks: line 192: /nix/store/1hs29hn23cdh2qbyws95plk1fyhqyzpx-texlive-bin-aarch64-unknown-linux-gnu-2021/bin/kpseaccess: cannot execute binary file: Exec format error @nix { "action": "setPhase", "phase": "fixupPhase" } ``` --- pkgs/tools/typesetting/tex/texlive/bin.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index c99face8d7d8..3710a37ee403 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -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"