summaryrefslogtreecommitdiffstats
path: root/pkgs/development/haskell-modules/configuration-windows.nix
blob: 735a55ca4068e7b7afe91c73e29cf707d42f3db5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ pkgs, haskellLib }:

let
  inherit (pkgs) fetchpatch lib;
in

with haskellLib;

(self: super: {
  # cabal2nix doesn't properly add dependencies conditional on os(windows)
  digest = addBuildDepends [ self.zlib ] super.digest;
  echo = addBuildDepends [ self.mintty ] super.echo;
  http-client = addBuildDepends [ self.safe ] super.http-client;
  regex-posix = addBuildDepends [ self.regex-posix-clib ] super.regex-posix;
  simple-sendfile =
    with self;
    addBuildDepends [ conduit conduit-extra resourcet ] super.simple-sendfile;
  snap-core = addBuildDepends [ self.time-locale-compat ] super.snap-core;
  tar-conduit = addBuildDepends [ self.unix-compat ] super.tar-conduit;
  unix-time = addBuildDepends [ pkgs.windows.pthreads ] super.unix-time;
  warp = addBuildDepends [ self.unix-compat ] super.warp;

  network = lib.pipe super.network [
    (addBuildDepends [ self.temporary ])

    # https://github.com/haskell/network/pull/605
    (appendPatch (fetchpatch {
      name = "dont-frag-wine.patch";
      url = "https://github.com/haskell/network/commit/ecd94408696117d34d4c13031c30d18033504827.patch";
      sha256 = "sha256-8LtAkBmgMMMIW6gPYDVuwYck/4fcOf08Hp2zLmsRW2w=";
    }))
  ];

  # Workaround for
  #   Mingw-w64 runtime failure:
  #   32 bit pseudo relocation at 00000001400EB99E out of range, targeting 00006FFFFFEB8170, yielding the value 00006FFEBFDCC7CE.
  # Root cause seems to be undefined references to libffi as shown by linking errors if we instead use "-Wl,--disable-auto-import"
  # See https://github.com/rust-lang/rust/issues/132226#issuecomment-2445100058
  iserv-proxy = appendConfigureFlag "--ghc-option=-optl=-Wl,--disable-runtime-pseudo-reloc" super.iserv-proxy;
})