Paczesiowa/hsenv — pull request #38 by tmhedberg (2012-10-30 01:22:12+00:00)
Title: Wrap `ghc` and `ghci` to use `-package-db` option instead of `GHC_PACKAGE_PATH`

This introduces 2 new skeleton scripts which wrap the `ghc` and `ghci` commands. Since cabal-install dies if `GHC_PACKAGE_PATH` is set in the environment, we can no longer use that variable to control where the compiler looks for installed packages. Instead, these wrappers provide the `-package-db` option when the compiler is invoked in order to point it to hsenv's package database in a more palatable manner.

Unfortunately, cabal-install looks for some of its auxiliary helper programs, such as ghc-pkg and hsc2hs, exclusively in the same directory as GHC itself. Even if these programs are on the system's `PATH`, cabal-install will fail to run if they are not in the same file system location as the GHC binary. To work around this, we create symlinks from hsenv's `bin` directory to the real file system locations of these helper programs, if they exist on the user's system. Creation of these symlinks necessitates the introduction of a new package dependency on `unix`.