summary refs log tree commit diff
path: root/pkgs/stdenv/mingw/default.nix
blob: 54970acce4ca4413a01cbf11c52765db82b12f57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/**
 * Initial stdenv should have:
 * - shell
 * - mkdir
 * - gnu tar
 * - curl
 */
{system} :

let {
  /**
   * Initial standard environment based on native cygwin tools.
   */
  stdenvInit1 =
    import ./simple-stdenv {
      inherit system;
      name = "stdenv-initial-cygwin";
      shell = "/bin/bash";
      path = ["/usr/bin" "/bin"];
    };

  /**
   * Initial standard environment based on MSYS tools.
   * From this point, cygwin should no longer by involved.
   */
  stdenvInit2 =
    import ./simple-stdenv {
      name = "stdenv-initial-msys";
      inherit system;
      shell = msys + /bin/sh + ".exe";
      path = [msys];

      /**
       * Instruct MSYS to change the uname
       * The PATH manipulation in /etc/profile is not relevant for now:
       * This will be overridden anyway.
       */
      extraEnv = {
        MSYSTEM = "MSYS";
      };
    };

  /**
   * Fetchurl, based on native 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
   */
  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 = "7e76eec10a205ea63ada6a4e834cc468";
      };
    };

  /**
   * Complete standard environment
   */
  body =
    import ../generic {
      name = "stdenv-mingw";
      # preHook = ./prehook.sh;
      initialPath = [msys];
      stdenv = stdenvInit2;
      shell = msys + /bin/sh + ".exe";
      gcc = msys;
    };
}


     /* 

  mingw = {
    langC = true;
    langCC = true;
    langF77 = true;
  };

    gcc =
      import ../../build-support/gcc-wrapper {
        nativeTools = false;
        nativeGlibc = false;
        stdenv = stdenvInitial;
        binutils = msys;
        gcc = mingw;
        shell = msys + /bin/sh;
      }; */