summaryrefslogtreecommitdiffstats
path: root/pkgs/os-specific/windows/mingw-w64/headers.nix
blob: 2e30bb95657fe0391e0ce5490bbe0cfb41b31749 (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
{
  lib,
  nixosTests,
  stdenvNoCC,
  fetchurl,
  crt ? stdenvNoCC.hostPlatform.libc,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "mingw_w64-headers";
  version = "14.0.0";

  src = fetchurl {
    url = "mirror://sourceforge/mingw-w64/mingw-w64-v${finalAttrs.version}.tar.bz2";
    hash = "sha256-bq+SHZ65h9OCCzZOqXdbwZuWXsgUkLb91xZSbCjhmVw=";
  };

  configureFlags = [
    (lib.withFeatureAs true "default-msvcrt" crt)
  ];

  preConfigure = ''
    cd mingw-w64-headers
  '';

  passthru = {
    # Headers-only stand-in used to bootstrap a toolchain before the real libc
    # exists: runtimes can compile against it, but not link.
    headersOnly = true;
    tests = {
      inherit (nixosTests) wine;
    };
    updateScript = ./update.nu;
  };

  meta = {
    homepage = "https://www.mingw-w64.org/";
    downloadPage = "https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/";
    description = "Collection of headers and libraries for building native Windows applications";
    license = with lib.licenses; [
      # Primarily under
      zpl21
      # A couple files
      mit
      # Certain headers imported from Wine
      lgpl21Plus
    ];
    platforms = lib.platforms.windows;
    teams = [ lib.teams.windows ];
  };
})