about summary refs log tree commit diff
path: root/pkgs/stdenv/mingw
diff options
context:
space:
mode:
authorMartin Bravenboer <martin.bravenboer@logicblox.com>2006-08-16 15:43:34 +0000
committerMartin Bravenboer <martin.bravenboer@logicblox.com>2006-08-16 15:43:34 +0000
commit38de63873c8148bf3afb1292bb9f6389074411d6 (patch)
tree73c57d3dd3b91d48c9032b0b3de28522504507bb /pkgs/stdenv/mingw
parent4957325c314ae45502e52483bda4e45e435ccdda (diff)
downloadnixlib-38de63873c8148bf3afb1292bb9f6389074411d6.tar
nixlib-38de63873c8148bf3afb1292bb9f6389074411d6.tar.gz
nixlib-38de63873c8148bf3afb1292bb9f6389074411d6.tar.bz2
nixlib-38de63873c8148bf3afb1292bb9f6389074411d6.tar.lz
nixlib-38de63873c8148bf3afb1292bb9f6389074411d6.tar.xz
nixlib-38de63873c8148bf3afb1292bb9f6389074411d6.tar.zst
nixlib-38de63873c8148bf3afb1292bb9f6389074411d6.zip
Another initial MinGW environment, having some more basic tools. This will allow us to compile some packages for the stdenv from source.
svn path=/nixpkgs/trunk/; revision=6134
Diffstat (limited to 'pkgs/stdenv/mingw')
-rw-r--r--pkgs/stdenv/mingw/default.nix123
-rwxr-xr-xpkgs/stdenv/mingw/pkgs/default.nix25
-rwxr-xr-xpkgs/stdenv/mingw/setup.sh10
3 files changed, 101 insertions, 57 deletions
diff --git a/pkgs/stdenv/mingw/default.nix b/pkgs/stdenv/mingw/default.nix
index 515e56eb12a4..77f3cbc11b47 100644
--- a/pkgs/stdenv/mingw/default.nix
+++ b/pkgs/stdenv/mingw/default.nix
@@ -8,84 +8,62 @@
 {system} :
 
 let {
+  body =
+    stdenvFinal;
+
   /**
-   * Initial standard environment based on native cygwin tools.
+   * Initial standard environment based on native Cygwin tools.
    */
   stdenvInit1 =
     import ./simple-stdenv {
       inherit system;
-      name = "stdenv-initial-cygwin";
+      name = "stdenv-init1-mingw";
       shell = "/bin/bash.exe";
       path = ["/usr/bin" "/bin"];
     };
 
   /**
    * Initial standard environment based on MSYS tools.
-   * From this point, Cygwin should no longer by involved.
    */
   stdenvInit2 =
     import ./simple-stdenv {
       inherit system;
-      name = "stdenv-initial-msys";
-      shell = msys + /bin/sh.exe;
+      name = "stdenv-init2-mingw";
+      shell = msysShell;
       path = [(msys + /bin)];
     };
 
   /**
-   * Fetchurl, based on Cygwin curl in stdenvInit1
+   * Initial standard environment with the most basic MinGW packages.
    */
-  fetchurl =
-    import ../../build-support/fetchurl {
-      stdenv = stdenvInit1;
-
-      /**
-       * use native curl in Cygwin. We could consider to use curl.exe,
-       * which is widely available (or we could bootstrap it ourselves)
-       */
-      curl = null;
-    };
-
-  /**
-   * MSYS, installed using stdenvInit1
-   *
-   * @todo Maybe remove the make of msys?
-   */
-  msys =
-    stdenvInit1.mkDerivation {
-      name = "msys-1.0.11";
-      builder = ./msys-builder.sh;
-      src =
-        fetchurl {
-          url = http://www.cs.uu.nl/people/martin/msys-1.0.11.tar.gz;
-          md5 = "85ce547934797019d2d642ec3b53934b";
-        };
+  stdenvInit3 =
+    (import ./simple-stdenv) {
+      inherit system;
+      name = "stdenv-init3-mingw";
+      shell = msysShell;
+      path = [ (make + /bin) (msys + /bin) (binutils /bin) (gccCore + /bin) ];
     };
 
   /**
-   * Complete standard environment, based on generic stdenv.
+   * Final standard environment, based on generic stdenv.
    * It would be better to make the generic stdenv usable on
    * MINGW (i.e. make all environment variables CAPS).
    */
-  body =
+  stdenvFinal =
     let {
       body =
         stdenv // mkDerivationFun;
 
-      shell = msys + /bin/sh + ".exe";
-
-      binpkgs =
-        (import ./pkgs) {
-          stdenv = stdenvInit2;
-          inherit fetchurl;   
-        };
+      shell =
+        msys + /bin/sh + ".exe";
 
-      gcc = (import ../../build-support/gcc-wrapper) {
+      gccWrapper = (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; };
+        shell = msysShell;
+        binutils = binutils;
+        gcc = gccCore // { langC = true; langCC = false; langF77 = false; };
 
         /**
          * Tricky: gcc-wrapper cannot be constructed using the MSYS shell
@@ -100,8 +78,9 @@ let {
           builder = ./builder.sh;
           substitute = ../../build-support/substitute/substitute.sh;
           setup = ./setup.sh;
-          initialPath = [binpkgs.make msys];
-          inherit shell gcc;
+          initialPath = [make msys];
+          gcc = gccWrapper;
+          shell = msysShell;
         };
 
       mkDerivationFun = {
@@ -119,6 +98,58 @@ let {
           // { meta = if attrs ? meta then attrs.meta else {}; };
        };
      };
+
+
+  /**
+   * Fetchurl, based on Cygwin curl in stdenvInit1
+   */
+  fetchurl =
+    import ../../build-support/fetchurl {
+      stdenv = stdenvInit1;
+
+      /**
+       * use native curl in Cygwin. We could consider to use curl.exe,
+       * which is widely available (or we could bootstrap it ourselves)
+       */
+      curl = null;
+    };
+
+  /**
+   * MSYS, installed using stdenvInit1
+   *
+   * @todo Maybe remove the make of msys?
+   */
+  msys =
+    stdenvInit1.mkDerivation {
+      name = "msys-1.0.11";
+      builder = ./msys-builder.sh;
+      src =
+        fetchurl {
+          url = http://www.cs.uu.nl/people/martin/msys-1.0.11.tar.gz;
+          md5 = "85ce547934797019d2d642ec3b53934b";
+        };
+    };
+
+  msysShell = 
+    msys + /bin/sh + ".exe";
+
+  gccCore =
+    (import ./pkgs).gccCore {
+      stdenv = stdenvInit2;
+      inherit fetchurl;
+    };
+
+  make =
+   (import ./pkgs).make {
+     stdenv = stdenvInit2;
+     inherit fetchurl;
+   };
+
+  binutils =
+   (import ./pkgs).binutils {
+     stdenv = stdenvInit2;
+     inherit fetchurl;
+    };
 }
 
      /* 
diff --git a/pkgs/stdenv/mingw/pkgs/default.nix b/pkgs/stdenv/mingw/pkgs/default.nix
index 45c1ca409551..59794fc3224e 100755
--- a/pkgs/stdenv/mingw/pkgs/default.nix
+++ b/pkgs/stdenv/mingw/pkgs/default.nix
@@ -1,17 +1,7 @@
 /**
  * MinGW packages.
  */
-let {
-
-  /**
-   * stdenv and fetchurl are parameters of every function to make this more flexible:
-   * after some packages, we might be able to use a better stdenv/fetchurl.
-   */
-  body = {stdenv, fetchurl} : {
-    make = make { inherit stdenv fetchurl; };
-    gccCore  = gccCore { inherit stdenv fetchurl; };
-    binutils = binutils { inherit stdenv fetchurl; };
-  };
+rec {
 
   /**
    * Make. Binary.
@@ -55,6 +45,19 @@ let {
         };
     };
 
+  /**
+   * MinGW Runtime. Source.
+   */
+  mingwRuntime = {stdenv, fetchurl} :
+    stdenv.mkDerivation {
+      name = "mingw-runtime-3.10";
+      src =
+        fetchurl {
+          url = http://surfnet.dl.sourceforge.net/sourceforge/mingw/mingw-runtime-3.10-src.tar.gz;
+          md5 = "9225684e663eafa900b4075731c25f4c";
+        };
+    };
+
   /*
   pkgs.coreutils
   pkgs.findutils
diff --git a/pkgs/stdenv/mingw/setup.sh b/pkgs/stdenv/mingw/setup.sh
index c8882212cda3..dd8b4605de08 100755
--- a/pkgs/stdenv/mingw/setup.sh
+++ b/pkgs/stdenv/mingw/setup.sh
@@ -2,6 +2,16 @@ set -e
 
 test -z $NIX_GCC && NIX_GCC=@GCC@
 
+# Workaround MSYS shell problem
+if test -z "$out"; then
+  out="$OUT"
+  src="$SRC"
+  srcs="$SRCS"
+  buildInputs="$BUILDINPUTS"
+  propagatedBuildInputs="$PROPAGATEDBUILDINPUTS"
+  succeedOnFailure="$SUCCEEDONFAILURE"
+fi
+
 # Set up the initial path.
 PATH=
 for i in $NIX_GCC @INITIALPATH@; do