summaryrefslogtreecommitdiff
path: root/pkgs/os-specific/windows/default.nix
blob: 086f05147f0ddb14f45c380dcc848e7b95556e74 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
  lib,
  config,
  stdenv,
  buildPackages,
  pkgsHostTarget,
  newScope,
  overrideCC,
  stdenvNoLibc,
  libc,
  makeScopeWithSplicing',
  generateSplicesForMkScope,
}:

makeScopeWithSplicing' {
  otherSplices = generateSplicesForMkScope "windows";
  f =
    self:
    let
      inherit (self) callPackage;
    in
    {
      dlfcn = callPackage ./dlfcn { };

      mingw_w64 = callPackage ./mingw-w64 {
        stdenv = stdenvNoLibc;
      };

      # FIXME untested with llvmPackages_16 was using llvmPackages_8
      crossThreadsStdenv = overrideCC stdenvNoLibc (
        if stdenv.hostPlatform.useLLVM or false then
          buildPackages.llvmPackages.clangNoLibcxx
        else
          buildPackages.gccWithoutTargetLibc.override (old: {
            bintools = old.bintools.override {
              libc = pkgsHostTarget.libc;
              noLibc = libc == null;
              nativeLibc = false;
            };
            libc = pkgsHostTarget.libc;
            noLibc = libc == null;
            nativeLibc = false;
          })
      );

      mingw_w64_headers = callPackage ./mingw-w64/headers.nix { };

      mcfgthreads = callPackage ./mcfgthreads { stdenv = self.crossThreadsStdenv; };

      npiperelay = callPackage ./npiperelay { };

      pthreads = callPackage ./mingw-w64/pthreads.nix { stdenv = self.crossThreadsStdenv; };

      libgnurx = callPackage ./libgnurx { };

      sdk = callPackage ./msvcSdk { };
    }
    // lib.optionalAttrs config.allowAliases {
      mingw_w64_pthreads = lib.warn "windows.mingw_w64_pthreads is deprecated, windows.pthreads should be preferred" self.pthreads;
    };
}