diff --git a/pkgs/stdenv/mingw/default.nix b/pkgs/stdenv/mingw/default.nix index 65597dc6161c..515e56eb12a4 100644 --- a/pkgs/stdenv/mingw/default.nix +++ b/pkgs/stdenv/mingw/default.nix @@ -79,6 +79,21 @@ let { inherit fetchurl; }; + gcc = (import ../../build-support/gcc-wrapper) { + name = "mingw-gcc-wrapper"; + nativeTools = false; + nativeGlibc = true; + inherit shell; # Note: this is the MSYS shell. + binutils = binpkgs.binutils; + gcc = binpkgs.gccCore // { langC = true; langCC = false; langF77 = false; }; + + /** + * Tricky: gcc-wrapper cannot be constructed using the MSYS shell + * so we use the Cygwin shell. + */ + stdenv = stdenvInit1; + }; + stdenv = stdenvInit2.mkDerivation { name = "stdenv-mingw"; @@ -86,9 +101,7 @@ let { substitute = ../../build-support/substitute/substitute.sh; setup = ./setup.sh; initialPath = [binpkgs.make msys]; - inherit shell; - # todo: wrapper? - gcc = binpkgs.gcc; + inherit shell gcc; }; mkDerivationFun = { diff --git a/pkgs/stdenv/mingw/pkgs/default.nix b/pkgs/stdenv/mingw/pkgs/default.nix index 2c8acf8481c4..45c1ca409551 100755 --- a/pkgs/stdenv/mingw/pkgs/default.nix +++ b/pkgs/stdenv/mingw/pkgs/default.nix @@ -9,7 +9,8 @@ let { */ body = {stdenv, fetchurl} : { make = make { inherit stdenv fetchurl; }; - gcc = gcc { inherit stdenv fetchurl; }; + gccCore = gccCore { inherit stdenv fetchurl; }; + binutils = binutils { inherit stdenv fetchurl; }; }; /** @@ -29,7 +30,7 @@ let { /** * GCC. Binary */ - gcc = {stdenv, fetchurl} : + gccCore = {stdenv, fetchurl} : stdenv.mkDerivation { name = "mingw-gcc-core-3.4.2-20040916-1"; builder = ./bin-builder.sh; @@ -40,6 +41,20 @@ let { }; }; + /** + * binutils. Binary. + */ + binutils = {stdenv, fetchurl} : + stdenv.mkDerivation { + name = "mingw-binutils-2.16.91-20060119-1"; + builder = ./bin-builder.sh; + src = + fetchurl { + url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/binutils-2.16.91-20060119-1.tar.gz; + md5 = "a54f33ca9d6cf56dc99c0c5367f58ea3"; + }; + }; + /* pkgs.coreutils pkgs.findutils