2022-10-11 18:31:17 +03:00
|
|
|
self: super:
|
|
|
|
let
|
|
|
|
versions = import ../versions.nix { pkgs = super; };
|
|
|
|
|
2023-06-06 16:27:46 +03:00
|
|
|
ghcName = "ghc${builtins.replaceStrings ["."] [""] versions.ghcVersion}";
|
2022-10-11 18:31:17 +03:00
|
|
|
ghcPatches =
|
|
|
|
if super.stdenv.targetPlatform.isDarwin
|
|
|
|
then [
|
|
|
|
# Copied from https://github.com/NixOS/nixpkgs/pull/149942
|
2023-06-06 16:27:46 +03:00
|
|
|
# If the GHC version is updated, we must update the patch too.
|
2022-10-11 18:31:17 +03:00
|
|
|
# ---
|
|
|
|
# Reverts the linking behavior of GHC to not resolve `-libc++` to `c++`.
|
|
|
|
# Without this, we get the following error on macOS:
|
|
|
|
# ghc: loadArchive: Neither an archive, nor a fat archive: `/path/to/clang++'
|
2023-06-06 16:27:46 +03:00
|
|
|
./ghc-9.4-macOS-loadArchive-fix.patch
|
2022-10-11 18:31:17 +03:00
|
|
|
] else [ ];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
haskell = super.haskell // {
|
|
|
|
compiler = super.haskell.compiler // {
|
|
|
|
${ghcName} = (versions.ensureVersion super.haskell.compiler.${ghcName}).overrideAttrs (oldAttrs: {
|
|
|
|
patches = (if oldAttrs ? patches then oldAttrs.patches else [ ]) ++ ghcPatches;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
packages = super.haskell.packages // {
|
|
|
|
${ghcName} = super.haskell.packages.${ghcName}.override {
|
2023-06-06 16:27:46 +03:00
|
|
|
overrides = hself: hsuper: {
|
|
|
|
# ghcid tests are broken on GHC 9.4
|
|
|
|
ghcid = super.haskell.lib.dontCheck hsuper.ghcid;
|
|
|
|
};
|
2022-10-11 18:31:17 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-06-06 16:27:46 +03:00
|
|
|
inherit (versions) ghcVersion;
|
|
|
|
inherit ghcName;
|
2022-10-11 18:31:17 +03:00
|
|
|
}
|