* Fix bzip2 static build for musl
* Enable static builds for xz/lzma
This is (currently) the same package on nixpkgs, so we make it the same
package here too.
For ghc 9.0.2 Haskell.nix will use the `stm`and `filepath` source that came with `ghc` when the version desired matches. This is because 9.0.2 shipped with packages that differ from the same version in hackage.
`reinstallableLibGhc` is fixed for GHC 8.10 and above. Rather than including a patch file this works by:
* Setting the `subDir` to the `compiler` directory when building. That way relative paths to other parts of the `ghc` source tree (outside the `compiler` directory) still work.
* Files that are needed, but generated when `ghc` builds are added from the `generated` output of the ghc derivation.
`nonReinstallablePkgs` is now sorted and deduplicated before it is used (this reduces the chance of rebuilds when the list is refactored).
There's a typo in the table of supported versions: two of the 21.11 rows should say `nixpkgs-2111` rather than `nixpkgs-2105`. This threw me off for a bit earlier because I skimmed the table and thought 21.11 wasn't supported yet.
When downloading a `repository` block we get a number of files (not just the index). For some repositories these files will be necessary for `cabal configure` and the vanilla ones created by haskell.nix will not work. This change keeps these extra files and combines them with the main hackage index using `lndir`, so that changes to the repo will not require a new copy of the hackage index in the store.
This change also introduces `inputMap` that allows flake or niv inputs to be used to pin repository. It also works with `source-repository-package` blocks.
When not on Windows, the `configureFlags` attr of `libmpc` is set to
`(drv.configureFlags or [])`. Since `drv.configureFlags` seems to be equal to
`["--enable-static" "--disable-shared"]` (at least on my machine),
`configureFlags` appears to be merged with itself and in the end, it is equal
to:
`["--enable-static" "--disable-shared" "--enable-static" "--disable-shared"]`.
You can verify this by comparing the derivations of `libmpc` with and without
this patch.
This changes the derivation of `libmpc` as well the derivation of all dependent
packages, like `gcc`, causing cache misses from https://cache.nixos.org/.
Because these packages are built and stored in the IOHK cache, users don't
notice this, until they use a different version of `nixpkgs` than the one pinned
by `haskell.nix`, e.g., one with a different version of `glibc` so that the IOHK
cache cannot be used. This results in `gcc` and other packages being built from
scratch instead of being downloaded from https://cache.nixos.org/.
Fix this by hoisting the conditional one level higher so that `overrideAttrs`
isn't even called on non-Windows OSes. Do the same for `mpfr` for consistency.
I haven't tested this on Windows. I'm not sure whether I have hoisted the
conditional too high, see the first comment in the file.