nixpkgs/pkgs/development/compilers/ghc/ghc-wrapper/default.nix
Marc Weber bad0d45562 jdk updated to 1.5.0.15
updated bleeding edge stuff (should now work for the bulidfarm as well because
  dist files are stored on my server)
moved experimental my_env into its own file

svn path=/nixpkgs/trunk/; revision=11026
2008-03-09 00:08:45 +00:00

34 lines
910 B
Nix

args: with args; with lib;
stdenv.mkDerivation {
inherit suffix name ghc readline ncurses;
buildInputs = (libraries ++ [ghcPkgUtil]);
tags = map (x : sourceWithTagsDerivation (x.passthru.sourceWithTags))
(uniqList { inputList= filter annotatedWithSourceAndTagInfo libraries; } );
phases="installPhase";
installPhase="
ensureDir \$out/bin
if test -n \"\$ghcPackagedLibs\"; then
g=:\$(echo \$ghc/lib/ghc-*/package.conf)
fi
for a in ghc ghci ghc-pkg; do
app=$(ls -al $ghc/bin/$a | sed -n 's%.*-> \\(.*\\)%\\1%p');
cat > \"\$out/bin/\$a$suffix\" << EOF
#!`type -f sh | gawk '{ print $3; }'`
export LIBRARY_PATH=\$readline/lib:\$ncurses/lib
GHC_PACKAGE_PATH=\${GHC_PACKAGE_PATH}\${g} \$ghc/bin/$app \"\\\$@\"
EOF
chmod +x \"\$out/bin/\$a$suffix\"
done
ensureDir \$out/src
for i in \$tags; do
ln -s \$i/src/* \$out/src
done
";
}