about summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2024-06-18 15:50:48 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2024-06-21 11:47:27 -0400
commit9abf384c54e1db517e8fa394a75da29213029099 (patch)
tree59f4061d7139d918faf86704023aa512f3518f62 /pkgs/os-specific
parentc80fa3159a02c011c649703814ade3015b94890f (diff)
windows.mingw_w64*: Fetch common attrs from the headers package
This is the most upstream one, and so to avoid infinite recursion we
should get the things from it. This isn't needed per-se now, but will be
after the next commit.

(cherry picked from commit 4bd76beac0eee70381663d2ef0e84aa2ae2ac29d)
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/windows/mingw-w64/default.nix16
-rw-r--r--pkgs/os-specific/windows/mingw-w64/headers.nix18
-rw-r--r--pkgs/os-specific/windows/mingw-w64/pthreads.nix6
3 files changed, 19 insertions, 21 deletions
diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix
index 706186c8e2f15..ba2b243a9408a 100644
--- a/pkgs/os-specific/windows/mingw-w64/default.nix
+++ b/pkgs/os-specific/windows/mingw-w64/default.nix
@@ -3,18 +3,12 @@
 , windows
 , fetchurl
 , autoreconfHook
+, mingw_w64_headers
 }:
 
-let
-  version = "11.0.1";
-in stdenv.mkDerivation {
+stdenv.mkDerivation {
   pname = "mingw-w64";
-  inherit version;
-
-  src = fetchurl {
-    url = "mirror://sourceforge/mingw-w64/mingw-w64-v${version}.tar.bz2";
-    hash = "sha256-P2a84Gnui+10OaGhPafLkaXmfqYXDyExesf1eUYl7hA=";
-  };
+  inherit (mingw_w64_headers) version src meta;
 
   outputs = [ "out" "dev" ];
 
@@ -30,8 +24,4 @@ in stdenv.mkDerivation {
   nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ windows.mingw_w64_headers ];
   hardeningDisable = [ "stackprotector" "fortify" ];
-
-  meta = {
-    platforms = lib.platforms.windows;
-  };
 }
diff --git a/pkgs/os-specific/windows/mingw-w64/headers.nix b/pkgs/os-specific/windows/mingw-w64/headers.nix
index 1fd27a8c4573f..d5edaeaa2bd1e 100644
--- a/pkgs/os-specific/windows/mingw-w64/headers.nix
+++ b/pkgs/os-specific/windows/mingw-w64/headers.nix
@@ -1,11 +1,19 @@
-{ stdenvNoCC, mingw_w64 }:
+{ lib, stdenvNoCC, fetchurl }:
 
-stdenvNoCC.mkDerivation {
-  name = "${mingw_w64.name}-headers";
-  inherit (mingw_w64) src meta;
+stdenvNoCC.mkDerivation (finalAttrs: {
+  pname = "mingw_w64-headers";
+  version = "11.0.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mingw-w64/mingw-w64-v${finalAttrs.version}.tar.bz2";
+    hash = "sha256-P2a84Gnui+10OaGhPafLkaXmfqYXDyExesf1eUYl7hA=";
+  };
 
   preConfigure = ''
     cd mingw-w64-headers
   '';
 
-}
+  meta = {
+    platforms = lib.platforms.windows;
+  };
+})
diff --git a/pkgs/os-specific/windows/mingw-w64/pthreads.nix b/pkgs/os-specific/windows/mingw-w64/pthreads.nix
index 3b143efed1d70..3c5fab4fa708f 100644
--- a/pkgs/os-specific/windows/mingw-w64/pthreads.nix
+++ b/pkgs/os-specific/windows/mingw-w64/pthreads.nix
@@ -1,8 +1,8 @@
-{ stdenv, mingw_w64 }:
+{ stdenv, mingw_w64_headers }:
 
 stdenv.mkDerivation {
-  name = "${mingw_w64.name}-pthreads";
-  inherit (mingw_w64) src meta;
+  pname = "mingw_w64-pthreads";
+  inherit (mingw_w64_headers) version src meta;
 
   configureFlags = [
     # Rustc require 'libpthread.a' when targeting 'x86_64-pc-windows-gnu'.