mingw-w64: Clean up, especially clarifying staging
This commit is contained in:
parent
c2e2152afc
commit
bb7067f882
11
pkgs/os-specific/windows/mingw-w64/common.nix
Normal file
11
pkgs/os-specific/windows/mingw-w64/common.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ fetchurl }:
|
||||||
|
|
||||||
|
rec {
|
||||||
|
version = "4.0.6";
|
||||||
|
name = "mingw-w64-${version}";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "mirror://sourceforge/mingw-w64/mingw-w64-v${version}.tar.bz2";
|
||||||
|
sha256 = "0p01vm5kx1ixc08402z94g1alip4vx66gjpvyi9maqyqn2a76h0c";
|
||||||
|
};
|
||||||
|
}
|
@ -1,36 +1,6 @@
|
|||||||
{ stdenv, fetchurl, binutils ? null, gccCross ? null
|
{ stdenv, callPackage }:
|
||||||
, onlyHeaders ? false
|
|
||||||
, onlyPthreads ? false
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "4.0.6";
|
|
||||||
name = "mingw-w64-${version}";
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation ({
|
|
||||||
inherit name;
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "mirror://sourceforge/mingw-w64/mingw-w64-v${version}.tar.bz2";
|
|
||||||
sha256 = "0p01vm5kx1ixc08402z94g1alip4vx66gjpvyi9maqyqn2a76h0c";
|
|
||||||
};
|
|
||||||
} //
|
|
||||||
(if onlyHeaders then {
|
|
||||||
name = name + "-headers";
|
|
||||||
preConfigure = ''
|
|
||||||
cd mingw-w64-headers
|
|
||||||
'';
|
|
||||||
configureFlags = "--without-crt";
|
|
||||||
} else if onlyPthreads then {
|
|
||||||
name = name + "-pthreads";
|
|
||||||
preConfigure = ''
|
|
||||||
cd mingw-w64-libraries/winpthreads
|
|
||||||
'';
|
|
||||||
} else {
|
|
||||||
buildInputs = [ gccCross binutils ];
|
|
||||||
|
|
||||||
crossConfig = gccCross.crossConfig;
|
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit (callPackage ./common.nix {}) name src;
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
})
|
}
|
||||||
)
|
|
||||||
|
13
pkgs/os-specific/windows/mingw-w64/headers.nix
Normal file
13
pkgs/os-specific/windows/mingw-w64/headers.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ stdenvNoCC, callPackage }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (callPackage ./common.nix {}) name src;
|
||||||
|
|
||||||
|
in stdenvNoCC.mkDerivation {
|
||||||
|
name = name + "-headers";
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
cd mingw-w64-headers
|
||||||
|
'';
|
||||||
|
}
|
13
pkgs/os-specific/windows/mingw-w64/pthreads.nix
Normal file
13
pkgs/os-specific/windows/mingw-w64/pthreads.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ stdenvNoCC, callPackage }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (callPackage ./common.nix {}) name src;
|
||||||
|
|
||||||
|
in stdenvNoCC.mkDerivation {
|
||||||
|
name = name + "-pthreads";
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
cd mingw-w64-libraries/winpthreads
|
||||||
|
'';
|
||||||
|
}
|
@ -5163,9 +5163,17 @@ with pkgs;
|
|||||||
|
|
||||||
gccApple = throw "gccApple is no longer supported";
|
gccApple = throw "gccApple is no longer supported";
|
||||||
|
|
||||||
|
# Can't just overrideCC, because then the stdenv-cross mkDerivation will be
|
||||||
|
# thrown away. TODO: find a better solution for this.
|
||||||
|
crossLibcStdenv = buildPackages.makeStdenvCross {
|
||||||
|
inherit (buildPackages.buildPackages) stdenv;
|
||||||
|
inherit buildPlatform hostPlatform targetPlatform;
|
||||||
|
cc = buildPackages.gccCrossStageStatic;
|
||||||
|
};
|
||||||
|
|
||||||
gccCrossStageStatic = assert targetPlatform != buildPlatform; let
|
gccCrossStageStatic = assert targetPlatform != buildPlatform; let
|
||||||
libcCross1 =
|
libcCross1 =
|
||||||
if targetPlatform.libc == "msvcrt" then windows.mingw_w64_headers
|
if targetPlatform.libc == "msvcrt" then __targetPackages.windows.mingw_w64_headers
|
||||||
else if targetPlatform.libc == "libSystem" then darwin.xcode
|
else if targetPlatform.libc == "libSystem" then darwin.xcode
|
||||||
else null;
|
else null;
|
||||||
in wrapCCCross {
|
in wrapCCCross {
|
||||||
@ -7800,13 +7808,7 @@ with pkgs;
|
|||||||
# Being redundant to avoid cycles on boot. TODO: find a better way
|
# Being redundant to avoid cycles on boot. TODO: find a better way
|
||||||
glibcCross = callPackage ../development/libraries/glibc {
|
glibcCross = callPackage ../development/libraries/glibc {
|
||||||
installLocales = config.glibc.locales or false;
|
installLocales = config.glibc.locales or false;
|
||||||
# Can't just overrideCC, because then the stdenv-cross mkDerivation will be
|
stdenv = crossLibcStdenv;
|
||||||
# thrown away. TODO: find a better solution for this.
|
|
||||||
stdenv = buildPackages.makeStdenvCross {
|
|
||||||
inherit (buildPackages.buildPackages) stdenv;
|
|
||||||
inherit buildPlatform hostPlatform targetPlatform;
|
|
||||||
cc = buildPackages.gccCrossStageStatic;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# We can choose:
|
# We can choose:
|
||||||
@ -7815,7 +7817,7 @@ with pkgs;
|
|||||||
# hack fixes the hack, *sigh*.
|
# hack fixes the hack, *sigh*.
|
||||||
/**/ if name == "glibc" then __targetPackages.glibcCross or glibcCross
|
/**/ if name == "glibc" then __targetPackages.glibcCross or glibcCross
|
||||||
else if name == "uclibc" then uclibcCross
|
else if name == "uclibc" then uclibcCross
|
||||||
else if name == "msvcrt" then windows.mingw_w64
|
else if name == "msvcrt" then __targetPackages.windows.mingw_w64 or windows.mingw_w64
|
||||||
else if name == "libSystem" then darwin.xcode
|
else if name == "libSystem" then darwin.xcode
|
||||||
else throw "Unknown libc";
|
else throw "Unknown libc";
|
||||||
|
|
||||||
@ -12561,17 +12563,12 @@ with pkgs;
|
|||||||
};
|
};
|
||||||
|
|
||||||
mingw_w64 = callPackage ../os-specific/windows/mingw-w64 {
|
mingw_w64 = callPackage ../os-specific/windows/mingw-w64 {
|
||||||
gccCross = gccCrossStageStatic;
|
stdenv = crossLibcStdenv;
|
||||||
binutils = binutils;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mingw_w64_headers = callPackage ../os-specific/windows/mingw-w64 {
|
mingw_w64_headers = callPackage ../os-specific/windows/mingw-w64/headers.nix { };
|
||||||
onlyHeaders = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
mingw_w64_pthreads = callPackage ../os-specific/windows/mingw-w64 {
|
mingw_w64_pthreads = callPackage ../os-specific/windows/mingw-w64/pthreads.nix { };
|
||||||
onlyPthreads = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
pthreads = callPackage ../os-specific/windows/pthread-w32 {
|
pthreads = callPackage ../os-specific/windows/pthread-w32 {
|
||||||
mingw_headers = mingw_headers3;
|
mingw_headers = mingw_headers3;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user