nixpkgs/pkgs/development/compilers/ghc/setup-hook.sh
Eelco Dolstra ffcd38403e * Install the package config files under
$out/lib/ghc-pkgs/ghc-<version>/<package>.conf instead of under
  $out/nix-support/ghc-package.conf.  This makes them visible in the
  user's profile when installed with nix-env.

svn path=/nixpkgs/trunk/; revision=15135
2009-04-18 20:24:36 +00:00

18 lines
438 B
Bash

# Create isolated package config
packages_db=$TMPDIR/.package.conf
cp @ghc@/lib/ghc-*/package.conf $packages_db
chmod u+w $packages_db
export GHC_PACKAGE_PATH=$packages_db
# Env hook to add packages to the package config
addLibToPackageConf () {
local fn
shopt -s nullglob
for fn in $1/lib/ghc-pkgs/ghc-@ghcVersion@/*.conf; do
@ghc@/bin/ghc-pkg register $fn
done
}
envHooks=(${envHooks[@]} addLibToPackageConf)