haskell.nix/overlays/wine.nix
Hamish Mackenzie 2812ae6745
Use targetPackages.ncurses for ghc cross compiler (#1513)
We have been disabling terminfo in our GHC builds for cross compilers (windows and musl).  This leads to an interesting problem when we `cabal configure` a project that needs `ghc`. The resulting `plan.json` might suggest that we should use the preexisting `ghc`.  When it does though it does not include the `flags` needed to build it.

One fix would be to default the the `ghc` `terminfo` flag to `false` for cross compilers.

It turns out though that the reason we could not get the `terminfo` package to work with our cross compilers was that we were providing the `hostPlatform` `ncursers` when we needed the `targetPlatform` `ncursers`.  Fixing that makes the cross compilers more like the native ones.

Also stops pinning wine to 5.4 on macOS (pinned version does not work there)
2022-06-11 08:37:16 +12:00

18 lines
847 B
Nix

# fix wine at 5.4; later versions build with ucrt and this can break TH code (for instance accessing
# files from TH code) for GHC built with msvcrt (ghc<9.6).
# This will inevitably replace *any* wine version. Thus this might not really be what we ultimately want.
# Wine 5.4 does not build on macOS so that is not pinned and TH code will probably break.
final: prev:
prev.lib.optionalAttrs (!prev.stdenv.hostPlatform.isDarwin) {
winePackages = prev.winePackages // {
minimal = prev.winePackages.minimal.overrideAttrs (oldAttrs: {
name = "wine-5.4";
version = "5.4";
src = prev.fetchurl {
url = "https://dl.winehq.org/wine/source/5.x/wine-5.4.tar.xz";
sha256 = "sha256-Sz4rD/pUFfGZVA5gUcKMOXb86R6lv7LPSgmcJXMXBSw="; };
patches = [];
});
};
}