@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, ncurses, pcre }:
1+{ stdenv, fetchurl, ncurses, pcre, buildPackages }:
22
33let
44 version = "5.7.1";
@@ -7,7 +7,6 @@ let
77 url = "mirror://sourceforge/zsh/zsh-${version}-doc.tar.xz";
88 sha256 = "1d1r88n1gfdavx4zy3svl1gljrvzim17jb2r834hafg2a016flrh";
99 };
10−
1110in
1211
1312stdenv.mkDerivation {
@@ -61,7 +60,11 @@ else
6160 fi
6261fi
6362EOF
64− $out/bin/zsh -c "zcompile $out/etc/zprofile"
63+ ${if stdenv.hostPlatform == stdenv.buildPlatform then ''
64+ $out/bin/zsh -c "zcompile $out/etc/zprofile"
65+ '' else ''
66+ ${stdenv.lib.getBin buildPackages.zsh}/bin/zsh -c "zcompile $out/etc/zprofile"
67+ ''}
6568 mv $out/etc/zprofile $out/etc/zprofile_zwc_is_used
6669 '';
6770 # XXX: patch zsh to take zwc if newer _or equal_