zsh: fix cross-compiling support

This commit is contained in:
Jörg Thalheim 2019-08-02 09:24:29 +01:00
parent 4e99e554b0
commit 84d2202a46
No known key found for this signature in database
GPG key ID: B3F5D81B0C6967C4

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, ncurses, pcre }:
{ stdenv, fetchurl, ncurses, pcre, buildPackages }:
let
version = "5.7.1";
@ -7,7 +7,6 @@ let
url = "mirror://sourceforge/zsh/zsh-${version}-doc.tar.xz";
sha256 = "1d1r88n1gfdavx4zy3svl1gljrvzim17jb2r834hafg2a016flrh";
};
in
stdenv.mkDerivation {
@ -61,7 +60,11 @@ else
fi
fi
EOF
$out/bin/zsh -c "zcompile $out/etc/zprofile"
${if stdenv.hostPlatform == stdenv.buildPlatform then ''
$out/bin/zsh -c "zcompile $out/etc/zprofile"
'' else ''
${stdenv.lib.getBin buildPackages.zsh}/bin/zsh -c "zcompile $out/etc/zprofile"
''}
mv $out/etc/zprofile $out/etc/zprofile_zwc_is_used
'';
# XXX: patch zsh to take zwc if newer _or equal_