This is necessary because otherwise the linker flags given at pkgs/build-support/cabal/default.nix:201-203 are ineffective, which causes the built binary to be unable to find its .so file at runtime. This appears to only affect executables that are built in the same cabal package as the library they require.
Note: In order to run ghcjs, you must set LD_LIBRARY_PATH=${ghcjs}/lib/ghc-7.8.2/ghcjs-0.1.0:$LD_LIBRARY_PATH so that it can find libHSghcjs-0.1.0-ghc7.8.2.so
* ghcjs itself (as opposed to ghcjs-built libraries) must be built with the non-ghcjs version of cabal. I'm not sure whether this is strictly necessary, but it prevented an error.
* CabalGhcjs and cabalInstallGhcjs must be explicitly provided to ghcjs-boot
* Since ghcjs-boot writes to its home directory, we set the home directory to our working directory
* To enable ghcjs-boot to find a particular .h file, we must create a symlink in ghcjs-boot/boot to its parent directory
* gmp must be provided. Adding it to the LD_LIBRARY_PATH is necessary, but I am not sure whether the uses in buildDepends and the arguments to ghcjs-boot are necessary
* If ghcjs-boot cannot find the shims package, it will attempt (and fail) to download it, so we must put it in place ahead of time