Prevent link collisions by linking only Haskell packages.

svn path=/nixpkgs/trunk/; revision=30727
This commit is contained in:
Andres Löh 2011-12-04 17:45:12 +00:00
parent f237a3a418
commit de5d98eff8

View File

@ -38,20 +38,24 @@ stdenv.mkDerivation rec {
for currentPath in ${stdenv.lib.concatStringsSep " " allPackages}; do for currentPath in ${stdenv.lib.concatStringsSep " " allPackages}; do
currentPkgDir="$currentPath/lib/ghc-pkgs/ghc-${ghc.version}" currentPkgDir="$currentPath/lib/ghc-pkgs/ghc-${ghc.version}"
echo -n "Linking $currentPath " # Check if current path is a Cabal package for the current GHC
for f in $currentPath/bin/*; do if test -d $currentPkgDir; then
ln -s $f $out/bin echo -n "Linking $currentPath "
echo -n . for f in $currentPath/bin/*; do
done ln -s $f $out/bin
for f in $currentPkgDir/*.conf; do echo -n .
ln -s $f $linkedPkgDir done
echo -n . for f in $currentPkgDir/*.conf; do
done ln -s $f $linkedPkgDir
echo echo -n .
done
echo
fi
done done
echo "Generating package cache ..." echo -n "Generating package cache "
${ghc}/bin/ghc-pkg --global-conf $linkedPkgDir recache ${ghc}/bin/ghc-pkg --global-conf $linkedPkgDir recache
echo .
echo -n "Generating wrappers " echo -n "Generating wrappers "
@ -71,7 +75,9 @@ stdenv.mkDerivation rec {
done done
for prg in hp2ps hpc hasktags hsc2hs haddock haddock-${ghc.version}; do for prg in hp2ps hpc hasktags hsc2hs haddock haddock-${ghc.version}; do
test -x ${ghc}/bin/$prg && ln -s ${ghc}/bin/$prg $out/bin/$prg && echo -n . if test -x ${ghc}/bin/$prg -a ! -x $out/bin/$prg; then
ln -s ${ghc}/bin/$prg $out/bin/$prg && echo -n .
fi
done done
echo echo
''; '';