nixpkgs/pkgs/development/compilers/ghc/createGhcWrapper/default.nix
Marc Weber fff1ba967e New proposal on howto library dependencies could be handled.
Just install ghc68_wrapper which will install the required dependencies ghc
(and libraries) itself.
The list libraries given in the wrapper attribute set can be user tuned in the future ?
An alternative would be creating something similar to the gcc/g++ include/ lib/ scheme which
is could be used by ghc to find installed packages..

svn path=/nixpkgs/trunk/; revision=9581
2007-11-05 09:27:36 +00:00

26 lines
581 B
Nix

args: with args;
stdenv.mkDerivation {
inherit suffix name ghc ;
buildInputs = libraries ++ [ghcPkgUtil];
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; }'`
GHC_PACKAGE_PATH=\${GHC_PACKAGE_PATH}\${g} \$ghc/bin/$app \"\\\$@\"
EOF
chmod +x \"\$out/bin/\$a$suffix\"
done
";
}