diff --git a/pkgs/misc/dxvk/default.nix b/pkgs/misc/dxvk/default.nix index e553d9b365cb..49b6c4d0bebd 100644 --- a/pkgs/misc/dxvk/default.nix +++ b/pkgs/misc/dxvk/default.nix @@ -27,8 +27,8 @@ stdenvNoCC.mkDerivation (finalAttrs: --subst-var-by bash ${bash} \ --subst-var-by dxvk32 ${dxvk32} \ --subst-var-by dxvk64 ${dxvk64} \ - --subst-var-by mcfgthreads32 "${pkgsCross.mingw32.windows.mcfgthreads}" \ - --subst-var-by mcfgthreads64 "${pkgsCross.mingwW64.windows.mcfgthreads}" + --subst-var-by mcfgthreads32 "${pkgsCross.mingw32.windows.mcfgthreads_pre_gcc_13}" \ + --subst-var-by mcfgthreads64 "${pkgsCross.mingwW64.windows.mcfgthreads_pre_gcc_13}" chmod a+x $out/bin/setup_dxvk.sh declare -A dxvks=( [x32]=${dxvk32} [x64]=${dxvk64} ) for arch in "''${!dxvks[@]}"; do diff --git a/pkgs/os-specific/windows/default.nix b/pkgs/os-specific/windows/default.nix index c34f97a17db2..8d6dd50548e5 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 45c80ab89796..e0635efd0a54 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 000000000000..6be64814c93a --- /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 + ]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c1459ff76fa6..6a1bad2a8857 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15114,7 +15114,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; isl = if !stdenv.isDarwin then isl_0_14 else null; cloog = if !stdenv.isDarwin then cloog else null; @@ -15128,7 +15128,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; isl = if !stdenv.isDarwin then isl_0_11 else null; @@ -15145,7 +15145,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; # gcc 10 is too strict to cross compile gcc <= 8 stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv; @@ -15164,7 +15164,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; # gcc 10 is too strict to cross compile gcc <= 8 stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv; @@ -15179,7 +15179,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; # gcc 10 is too strict to cross compile gcc <= 8 stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv; @@ -15194,7 +15194,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; isl = if !stdenv.isDarwin then isl_0_20 else null; })); @@ -15206,7 +15206,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; isl = if !stdenv.isDarwin then isl_0_20 else null; })); @@ -15218,7 +15218,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; isl = if !stdenv.isDarwin then isl_0_20 else null; })); @@ -15230,7 +15230,7 @@ with pkgs; profiledCompiler = false; libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross_pre_gcc_13 else { }; isl = if !stdenv.isDarwin then isl_0_20 else null; })); @@ -16841,7 +16841,10 @@ with pkgs; # want the C++ library to be explicitly chosen by the caller, and null by # default. libcxx ? null - , extraPackages ? lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) threadsCross.package + , extraPackages ? lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) + (if lib.versionAtLeast cc.version "13" + then threadsCross.package + else threadsCross_pre_gcc_13.package) , nixSupport ? {} , ... } @ extraArgs: @@ -20814,6 +20817,14 @@ with pkgs; libcCross = assert stdenv.targetPlatform != stdenv.buildPlatform; libcCrossChooser stdenv.targetPlatform.libc; + threadsCross_pre_gcc_13 = if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false) + then { + # other possible values: win32 or posix + model = "mcf"; + # For win32 or posix set this to null + package = targetPackages.windows.mcfgthreads_pre_gcc_13 or windows.mcfgthreads_pre_gcc_13; + } else { }; + threadsCross = if stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false) then { # other possible values: win32 or posix