This makes it easier to ensure that the list of stage 1 packages accurately matches the given version of ghcjs, and makes it possible for this list to be overridden
Previously, the stage2 information was stored in haskell-modules, and imported directly from there. However, the correct stage2 information is determined by the version of ghcjs-boot repository. This commit makes the stage2 information part of the ghcjs derivation, which improves organization and makes it possible to override stage2 when overriding ghcjs.
GHCJS uses integer-gmp, but cabal2nix generates a dependency list that
includes integer-simple instead. This tweaks the stage2 generator to
replace any instance of integer-simple with integer-gmp.
Things currently still work without this change (assuming
integer-simple is defined as null), as ghcjs includes integer-gmp in
its stage1 packages - so it's always available.
However, this change makes things a bit more explicit, rather than
leaving things to chance. If at any point the stage1 packages are also
split up into separate derivations, the integer-gmp package will need to
be passed along to the packages that depend on it. This change should
prevent some confusion going forward.
Previously, we were compiling Setup.hs with ghcjs (instead of ghc),
and that required that Cabal be available, otherwise the Setup.hs would
fail to compile.
Now that we are compiling Setup.hs with ghc, it's no longer necessary
to add Cabal as a dependency to all ghcjs packages.
When building `reflex-dom` for GHCJS, the following dependencies are not
needed and will fail to build: glib, gtk3, webkitgtk3,
webkitgtk3-javascriptcore. Now we explicitely need the dependencies
needed for building for GHCJS.
This also:
1 Builds Setup.hs with ghcjs, which (among other things) defines
__GHCJS__ and ghcjs_HOST_OS during pre-processing.
2 Fixes ghc-paths to point at ghcjs and use NIX_GHCJS_* env-vars.
3 Boots ghcjs into $prefix/lib/$compiler.