about summary refs log tree commit diff
path: root/pkgs/os-specific/windows
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2023-06-07 23:43:37 +0100
committerSergei Trofimovich <slyich@gmail.com>2023-06-08 07:43:56 +0100
commitc6132dcf238b8ddc01174290fe31ed5001a58c01 (patch)
tree808208ac3df5da0b9525eb84f482330020c23950 /pkgs/os-specific/windows
parent8820dd8b7b1e71c3b65ff8887ff1405812237f65 (diff)
pkgsCross.mingwW64.windows.mcfgthreads: add gcc13 compatible version
Upstream `gcc-13` merged `mcfgthreads` support with a caveat: it's
headers interface is not compatible with the patch `nixpkgs` was
carrying in `gcc-12` and before.

To keep both new (`gcc13`) and old (`_pre_gcc13`) version I held back
previous `windows.mcfgthreads` attribute as
`windows.mcfgthreads_pre_gcc_13`. It is used for `gcc` before 13.

The change fixes the build of `pkgsCross.mingwW64.stdenv` itself and
example program:

    $ nix build --impure --expr 'with import ./. {}; pkgsCross.mingwW64.re2c.override { stdenv = pkgsCross.mingwW64.gcc11Stdenv; }'
Diffstat (limited to 'pkgs/os-specific/windows')
-rw-r--r--pkgs/os-specific/windows/default.nix4
-rw-r--r--pkgs/os-specific/windows/mcfgthreads/default.nix11
-rw-r--r--pkgs/os-specific/windows/mcfgthreads/pre_gcc_13.nix24
3 files changed, 31 insertions, 8 deletions
diff --git a/pkgs/os-specific/windows/default.nix b/pkgs/os-specific/windows/default.nix
index c34f97a17db25..8d6dd50548e51 100644
--- a/pkgs/os-specific/windows/default.nix
+++ b/pkgs/os-specific/windows/default.nix
@@ -33,6 +33,10 @@ lib.makeScope newScope (self: with self; {
     stdenv = crossThreadsStdenv;
   };
 
+  mcfgthreads_pre_gcc_13 = callPackage ./mcfgthreads/pre_gcc_13.nix {
+    stdenv = crossThreadsStdenv;
+  };
+
   mcfgthreads = callPackage ./mcfgthreads {
     stdenv = crossThreadsStdenv;
   };
diff --git a/pkgs/os-specific/windows/mcfgthreads/default.nix b/pkgs/os-specific/windows/mcfgthreads/default.nix
index 45c80ab89796f..e0635efd0a540 100644
--- a/pkgs/os-specific/windows/mcfgthreads/default.nix
+++ b/pkgs/os-specific/windows/mcfgthreads/default.nix
@@ -2,22 +2,17 @@
 
 stdenv.mkDerivation {
   pname = "mcfgthreads";
-  version = "git";
+  version = "unstable-2023-06-06";
 
   src = fetchFromGitHub {
     owner = "lhmouse";
     repo = "mcfgthread";
-    rev = "c446cf4fcdc262fc899a188a4bb7136284c34222";
-    sha256 = "1ib90lrd4dz8irq4yvzwhxqa86i5vxl2q2z3z04sf1i8hw427p2f";
+    rev = "f0a335ce926906d634c787249a89220045bf0f7e";
+    hash = "sha256-PLGIyoLdWgWvkHgRe0vHLIvnCxFpmHtbjS8xRhNM9Xw=";
   };
 
   outputs = [ "out" "dev" ];
 
-  # Don't want prebuilt binaries sneaking in.
-  postUnpack = ''
-    rm -r "$sourceRoot/debug" "$sourceRoot/release"
-  '';
-
   nativeBuildInputs = [
     autoreconfHook
   ];
diff --git a/pkgs/os-specific/windows/mcfgthreads/pre_gcc_13.nix b/pkgs/os-specific/windows/mcfgthreads/pre_gcc_13.nix
new file mode 100644
index 0000000000000..6be64814c93aa
--- /dev/null
+++ b/pkgs/os-specific/windows/mcfgthreads/pre_gcc_13.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation {
+  pname = "mcfgthreads";
+  version = "git"; # unstable-2021-03-12, not in any branch
+
+  src = fetchFromGitHub {
+    owner = "lhmouse";
+    repo = "mcfgthread";
+    rev = "c446cf4fcdc262fc899a188a4bb7136284c34222";
+    sha256 = "1ib90lrd4dz8irq4yvzwhxqa86i5vxl2q2z3z04sf1i8hw427p2f";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  # Don't want prebuilt binaries sneaking in.
+  postUnpack = ''
+    rm -r "$sourceRoot/debug" "$sourceRoot/release"
+  '';
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+}