* 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
This commit is contained in:
Eelco Dolstra 2009-04-18 20:24:36 +00:00
parent 4ce5419f17
commit ffcd38403e
4 changed files with 17 additions and 8 deletions

View File

@ -7,10 +7,11 @@ export GHC_PACKAGE_PATH=$packages_db
# Env hook to add packages to the package config # Env hook to add packages to the package config
addLibToPackageConf () { addLibToPackageConf () {
local confFile=$1/nix-support/ghc-package.conf local fn
if test -f $confFile; then shopt -s nullglob
@ghc@/bin/ghc-pkg register $confFile for fn in $1/lib/ghc-pkgs/ghc-@ghcVersion@/*.conf; do
fi @ghc@/bin/ghc-pkg register $fn
done
} }
envHooks=(${envHooks[@]} addLibToPackageConf) envHooks=(${envHooks[@]} addLibToPackageConf)

View File

@ -11,4 +11,5 @@ stdenv.mkDerivation {
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
inherit ghc; inherit ghc;
ghcVersion = ghc.version;
} }

View File

@ -79,8 +79,9 @@ attrs :
./Setup copy ./Setup copy
ensureDir $out/nix-support local confDir=$out/lib/ghc-pkgs/ghc-${attrs.ghc.ghc.version}
./Setup register --gen-pkg-config=$out/nix-support/ghc-package.conf ensureDir $confDir
./Setup register --gen-pkg-config=$confDir/${self.fname}.conf
eval "$postInstall" eval "$postInstall"
''; '';

View File

@ -1,12 +1,18 @@
{pkgs, ghc}: {pkgs, ghc}:
let ghcOrig = ghc; in let ghcReal = ghc; in
rec { rec {
inherit ghcReal;
# In the remainder, `ghc' refers to the wrapper. This is because
# it's never useful to use the wrapped GHC (`ghcReal'), as the
# wrapper provides essential functionality: the ability to find
# Haskell packages in the buildInputs automatically.
ghc = import ../development/compilers/ghc/wrapper.nix { ghc = import ../development/compilers/ghc/wrapper.nix {
inherit (pkgs) stdenv; inherit (pkgs) stdenv;
ghc = ghcOrig; ghc = ghcReal;
}; };
cabal = import ../development/libraries/haskell/cabal/cabal.nix { cabal = import ../development/libraries/haskell/cabal/cabal.nix {