2009-04-25 16:23:00 +02:00
|
|
|
{stdenv, ghc, makeWrapper}:
|
2009-04-18 14:47:11 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2009-04-25 16:23:00 +02:00
|
|
|
name = "ghc-${ghc.version}-wrapper";
|
2009-04-18 14:47:11 +02:00
|
|
|
|
2009-04-25 16:23:00 +02:00
|
|
|
buildInputs = [makeWrapper];
|
2009-04-18 14:47:11 +02:00
|
|
|
propagatedBuildInputs = [ghc];
|
|
|
|
|
|
|
|
unpackPhase = "true";
|
2009-04-25 16:23:00 +02:00
|
|
|
installPhase = ''
|
|
|
|
ensureDir $out/bin
|
|
|
|
cp $GHCGetPackages $out/bin/ghc-get-packages.sh
|
|
|
|
chmod 755 $out/bin/ghc-get-packages.sh
|
2009-05-28 21:06:29 +02:00
|
|
|
for prg in ghc ghci ghc-${ghc.version} ghci-${ghc.version}; do
|
2009-04-25 16:23:00 +02:00
|
|
|
makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\")"
|
|
|
|
done
|
2009-05-28 21:06:29 +02:00
|
|
|
for prg in runghc runhaskell; do
|
|
|
|
makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\" \" -package-conf --ghc-arg=\")"
|
|
|
|
done
|
2009-04-25 16:23:00 +02:00
|
|
|
for prg in ghc-pkg ghc-pkg-${ghc.version}; do
|
|
|
|
makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\" --package-conf=)"
|
|
|
|
done
|
|
|
|
ensureDir $out/nix-support
|
|
|
|
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
|
|
|
'';
|
2009-04-18 14:47:11 +02:00
|
|
|
|
2009-04-25 16:23:00 +02:00
|
|
|
GHCGetPackages = ./ghc-get-packages.sh;
|
2009-04-18 14:47:11 +02:00
|
|
|
|
|
|
|
inherit ghc;
|
2009-04-18 22:24:36 +02:00
|
|
|
ghcVersion = ghc.version;
|
2009-04-18 14:47:11 +02:00
|
|
|
}
|