Work around buildEnv sometimes deciding to make bin a symlink

This commit is contained in:
Michael Raskin 2015-01-09 21:38:10 +03:00
parent ad632cc9c8
commit e67bb36821

View File

@ -40,6 +40,13 @@ stdenv.lib.addPassthru (buildEnv {
postBuild = '' postBuild = ''
. ${makeWrapper}/nix-support/setup-hook . ${makeWrapper}/nix-support/setup-hook
if test -L "$out/bin"; then
binTarget="$(readlink -f "$out/bin")"
rm "$out/bin"
cp -r "$binTarget" "$out/bin"
chmod u+w "$out/bin"
fi
for prg in ghc ghci ghc-${ghc.version} ghci-${ghc.version}; do for prg in ghc ghci ghc-${ghc.version} ghci-${ghc.version}; do
rm -f $out/bin/$prg rm -f $out/bin/$prg
makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ makeWrapper ${ghc}/bin/$prg $out/bin/$prg \