summary refs log tree commit diff
path: root/pkgs/top-level/release-cross.nix
blob: cef3d2dffbdb75486177447d67fe262283471527 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
with import ./release-lib.nix { supportedSystems = []; };
let
  nativePlatforms = linux;

  /* Basic list of packages to cross-build */
  basicCrossDrv = {
    gccCrossStageFinal = nativePlatforms;
    bison.crossDrv = nativePlatforms;
    busybox.crossDrv = nativePlatforms;
    coreutils.crossDrv = nativePlatforms;
    dropbear.crossDrv = nativePlatforms;
    tigervnc.crossDrv = nativePlatforms;
    wxGTK.crossDrv = nativePlatforms;
    #firefox = nativePlatforms;
    xorg = {
      #xorgserver.crossDrv = nativePlatforms;
    };
    nixUnstable.crossDrv = nativePlatforms;
    linuxPackages_3_4.kernel.crossDrv = linux;
  };

  /* Basic list of packages to be natively built,
     but need a crossSystem defined to get meaning */
  basicNativeDrv = {
    gdbCross = nativePlatforms;
  };

  basic = basicCrossDrv // basicNativeDrv;

in
(

/* Test some cross builds to the Sheevaplug */
let
  crossSystem = {
    config = "armv5tel-unknown-linux-gnueabi";
    bigEndian = false;
    arch = "arm";
    float = "soft";
    withTLS = true;
    platform = pkgs.platforms.sheevaplug;
    libc = "glibc";
    openssl.system = "linux-generic32";
  };

in {
  crossSheevaplugLinux = mapTestOnCross crossSystem (
    basic //
    {
      ubootSheevaplug.crossDrv = nativePlatforms;
    });
}) // (

/* Test some cross builds to the Sheevaplug - uclibc*/
let
  crossSystem = {
    config = "armv5tel-unknown-linux-gnueabi";
    bigEndian = false;
    arch = "arm";
    float = "soft";
    withTLS = true;
    platform = pkgs.platforms.sheevaplug;
    libc = "uclibc";
    openssl.system = "linux-generic32";
    uclibc.extraConfig = ''
      CONFIG_ARM_OABI n
      CONFIG_ARM_EABI y
      ARCH_BIG_ENDIAN n
      ARCH_WANTS_BIG_ENDIAN n
      ARCH_WANTS_LITTLE_ENDIAN y
      LINUXTHREADS_OLD y
    '';
  };

in {
  crossSheevaplugLinuxUclibc = mapTestOnCross crossSystem (
    basic //
    {
      ubootSheevaplug.crossDrv = nativePlatforms;
    });
}) // (

/* Test some cross builds to the mipsel */
let
  crossSystem = {
    config = "mipsel-unknown-linux";
    bigEndian = false;
    arch = "mips";
    float = "soft";
    withTLS = true;
    libc = "uclibc";
    platform = {
      name = "malta";
      kernelMajor = "2.4";
      kernelBaseConfig = "defconfig-malta";
      kernelHeadersBaseConfig = "defconfig-malta";
      uboot = null;
      kernelArch = "mips";
      kernelAutoModules = false;
      kernelTarget = "vmlinux";
    };
    openssl.system = "linux-generic32";
    uclibc.extraConfig = ''
      ARCH_BIG_ENDIAN n
      ARCH_WANTS_BIG_ENDIAN n
      ARCH_WANTS_LITTLE_ENDIAN y
      LINUXTHREADS_OLD y

      # Without this, it does not build for linux 2.4
      UCLIBC_SUSV4_LEGACY y
    '';
  };
in {
  crossMipselLinux24 = mapTestOnCross crossSystem basic;
}) // (

/* Test some cross builds to the ultrasparc */
let
  crossSystem = {
    config = "sparc64-unknown-linux";
    bigEndian = true;
    arch = "sparc64";
    float = "hard";
    withTLS = true;
    libc = "glibc";
    platform = {
        name = "ultrasparc";
        kernelMajor = "2.6";
        kernelHeadersBaseConfig = "sparc64_defconfig";
        kernelBaseConfig = "sparc64_defconfig";
        kernelArch = "sparc";
        kernelAutoModules = false;
        kernelTarget = "zImage";
        uboot = null;
    };
    openssl.system = "linux64-sparcv9";
    gcc.cpu = "ultrasparc";
  };
in {
  crossUltraSparcLinux = mapTestOnCross crossSystem basic;
}) // (

/* Test some cross builds on 32 bit mingw-w64 */
let
  crossSystem = {
      config = "i686-w64-mingw32";
      arch = "x86"; # Irrelevant
      libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
      platform = {};
  };
in {
  crossMingw32 = mapTestOnCross crossSystem {
    coreutils.crossDrv = nativePlatforms;
    boehmgc.crossDrv = nativePlatforms;
    gmp.crossDrv = nativePlatforms;
    guile_1_8.crossDrv = nativePlatforms;
    libffi.crossDrv = nativePlatforms;
    libtool.crossDrv = nativePlatforms;
    libunistring.crossDrv = nativePlatforms;
    windows.wxMSW.crossDrv = nativePlatforms;
  };
}) // (

/* Test some cross builds on 64 bit mingw-w64 */
let
  crossSystem = {
      # That's the triplet they use in the mingw-w64 docs.
      config = "x86_64-w64-mingw32";
      arch = "x86_64"; # Irrelevant
      libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
      platform = {};
  };
in {
  crossMingwW64 = mapTestOnCross crossSystem {
    coreutils.crossDrv = nativePlatforms;
    boehmgc.crossDrv = nativePlatforms;
    gmp.crossDrv = nativePlatforms;
    guile_1_8.crossDrv = nativePlatforms;
    libffi.crossDrv = nativePlatforms;
    libtool.crossDrv = nativePlatforms;
    libunistring.crossDrv = nativePlatforms;
    windows.wxMSW.crossDrv = nativePlatforms;
  };
}) // (

/* GNU aka. GNU/Hurd.  */
let
  crossSystem = {
    config = "i586-pc-gnu";
    bigEndian = false;
    arch = "i586";
    float = "hard";
    withTLS = true;
    platform = pkgs.platforms.pc32;
    libc = "glibc";
    openssl.system = "hurd-x86";  # Nix depends on OpenSSL.
  };
in {
  crossGNU = mapTestOnCross crossSystem {
    gnu.hurdCross = nativePlatforms;
    gnu.mach.crossDrv = nativePlatforms;
    gnu.mig = nativePlatforms;
    gnu.smbfs.crossDrv = nativePlatforms;

    coreutils.crossDrv = nativePlatforms;
    ed.crossDrv = nativePlatforms;
    grub2.crossDrv = nativePlatforms;
    inetutils.crossDrv = nativePlatforms;
    boehmgc.crossDrv = nativePlatforms;
    findutils.crossDrv = nativePlatforms;
    gcc.crossDrv = nativePlatforms;
    gcc46.crossDrv = nativePlatforms;
    gdb.crossDrv = nativePlatforms;
    gmp.crossDrv = nativePlatforms;
    gnugrep.crossDrv = nativePlatforms;
    gnumake.crossDrv = nativePlatforms;
    gnused.crossDrv = nativePlatforms;
    guile_1_8.crossDrv = nativePlatforms;
    guile.crossDrv = nativePlatforms;
    libffi.crossDrv = nativePlatforms;
    libtool.crossDrv = nativePlatforms;
    libunistring.crossDrv = nativePlatforms;
    lsh.crossDrv = nativePlatforms;
    nixUnstable.crossDrv = nativePlatforms;
    openssl.crossDrv = nativePlatforms;            # dependency of Nix
    patch.crossDrv = nativePlatforms;
    samba_light.crossDrv = nativePlatforms;      # needed for `runInGenericVM'
    zile.crossDrv = nativePlatforms;
  };
}) // (

/* Linux on the fuloong */
let
  crossSystem = {
    config = "mips64el-unknown-linux";
    bigEndian = false;
    arch = "mips";
    float = "hard";
    withTLS = true;
    libc = "glibc";
    platform = {
      name = "fuloong-minipc";
      kernelMajor = "2.6";
      kernelBaseConfig = "lemote2f_defconfig";
      kernelHeadersBaseConfig = "fuloong2e_defconfig";
      uboot = null;
      kernelArch = "mips";
      kernelAutoModules = false;
      kernelTarget = "vmlinux";
    };
    openssl.system = "linux-generic32";
    gcc = {
      arch = "loongson2f";
      abi = "n32";
    };
  };
in {
  fuloongminipc = mapTestOnCross crossSystem {

    coreutils.crossDrv = nativePlatforms;
    ed.crossDrv = nativePlatforms;
    grub2.crossDrv = nativePlatforms;
    inetutils.crossDrv = nativePlatforms;
    nixUnstable.crossDrv = nativePlatforms;
    patch.crossDrv = nativePlatforms;
    zile.crossDrv = nativePlatforms;
  };
}) // (

/* Linux on the Ben Nanonote */
let
  crossSystem = {
    config = "mipsel-unknown-linux";
    bigEndian = false;
    arch = "mips";
    float = "soft";
    withTLS = true;
    libc = "glibc";
    platform = {
      name = "ben_nanonote";
      kernelMajor = "2.6";
      kernelBaseConfig = "qi_lb60_defconfig";
      kernelHeadersBaseConfig = "malta_defconfig";
      uboot = "nanonote";
      kernelArch = "mips";
      kernelAutoModules = false;
      kernelTarget = "vmlinux.bin";
      kernelExtraConfig = ''
        SOUND y
        SND y
        SND_MIPS y
        SND_SOC y
        SND_JZ4740_SOC y
        SND_JZ4740_SOC_QI_LB60 y
        FUSE_FS m
        MIPS_FPU_EMU y
      '';
    };
    openssl.system = "linux-generic32";
    perl.arch = "mipsel-unknown";
    uclibc.extraConfig = ''
      CONFIG_MIPS_ISA_1 n
      CONFIG_MIPS_ISA_MIPS32 y
      CONFIG_MIPS_N32_ABI n
      CONFIG_MIPS_O32_ABI y
      ARCH_BIG_ENDIAN n
      ARCH_WANTS_BIG_ENDIAN n
      ARCH_WANTS_LITTLE_ENDIAN y
      LINUXTHREADS_OLD y
    '';
    gcc = {
      abi = "32";
      arch = "mips32";
    };
    mpg123.cpu = "generic_nofpu";
  };
in {
  nanonote = mapTestOnCross crossSystem {

    coreutils.crossDrv = nativePlatforms;
    ed.crossDrv = nativePlatforms;
    inetutils.crossDrv = nativePlatforms;
    nixUnstable.crossDrv = nativePlatforms;
    patch.crossDrv = nativePlatforms;
    zile.crossDrv = nativePlatforms;
    prboom.crossDrv = nativePlatforms;
    vim.crossDrv = nativePlatforms;
    lynx.crossDrv = nativePlatforms;
    patchelf.crossDrv = nativePlatforms;
    nix.crossDrv = nativePlatforms;
    fossil.crossDrv = nativePlatforms;
    binutils.crossDrv = nativePlatforms;
    mpg123.crossDrv = nativePlatforms;
    yacas.crossDrv = nativePlatforms;
  };
}) // (


/* Linux on Raspberrypi */
let
  crossSystem = {
    config = "armv6l-unknown-linux-gnueabi";
    bigEndian = false;
    arch = "arm";
    float = "hard";
    fpu = "vfp";
    withTLS = true;
    libc = "glibc";
    platform = pkgs.platforms.raspberrypi;
    openssl.system = "linux-generic32";
    gcc = {
      arch = "armv6";
      fpu = "vfp";
      float = "softfp";
      abi = "aapcs-linux";
    };
  };
in {
  rpi = mapTestOnCross crossSystem {
    coreutils.crossDrv = nativePlatforms;
    ed.crossDrv = nativePlatforms;
    inetutils.crossDrv = nativePlatforms;
    nixUnstable.crossDrv = nativePlatforms;
    patch.crossDrv = nativePlatforms;
    vim.crossDrv = nativePlatforms;
    tmux.crossDrv = nativePlatforms;
    screen.crossDrv = nativePlatforms;
    unrar.crossDrv = nativePlatforms;
    unzip.crossDrv = nativePlatforms;
    hdparm.crossDrv = nativePlatforms;
    ddrescue.crossDrv = nativePlatforms;
    git.crossDrv = nativePlatforms;
    lynx.crossDrv = nativePlatforms;
    patchelf.crossDrv = nativePlatforms;
    nix.crossDrv = nativePlatforms;
    fossil.crossDrv = nativePlatforms;
    binutils.crossDrv = nativePlatforms;
    mpg123.crossDrv = nativePlatforms;
    yacas.crossDrv = nativePlatforms;
  };
})