Browse Source

Replace androidenv by new implementation

nixos-19.03
Sander van der Burg 2 years ago
parent
commit
74750dc67d
61 changed files with 5538 additions and 9439 deletions
  1. 2
    1
      .gitignore
  2. 0
    1614
      pkgs/development/mobile/androidenv/addon.xml
  3. 0
    321
      pkgs/development/mobile/androidenv/addons.nix
  4. 0
    120
      pkgs/development/mobile/androidenv/androidndk.nix
  5. 0
    88
      pkgs/development/mobile/androidenv/androidndk_r8e.nix
  6. 0
    296
      pkgs/development/mobile/androidenv/androidsdk.nix
  7. 22
    25
      pkgs/development/mobile/androidenv/build-app.nix
  8. 0
    108
      pkgs/development/mobile/androidenv/build-gradle-app.nix
  9. 0
    376
      pkgs/development/mobile/androidenv/build-tools-srcs-linux.nix
  10. 0
    376
      pkgs/development/mobile/androidenv/build-tools-srcs-macosx.nix
  11. 19
    53
      pkgs/development/mobile/androidenv/build-tools.nix
  12. 10
    0
      pkgs/development/mobile/androidenv/cmake.nix
  13. 255
    0
      pkgs/development/mobile/androidenv/compose-android-packages.nix
  14. 128
    0
      pkgs/development/mobile/androidenv/convertaddons.xsl
  15. 116
    0
      pkgs/development/mobile/androidenv/convertpackages.xsl
  16. 47
    0
      pkgs/development/mobile/androidenv/convertsystemimages.xsl
  17. 11
    335
      pkgs/development/mobile/androidenv/default.nix
  18. 44
    0
      pkgs/development/mobile/androidenv/deploy-androidpackage.nix
  19. 52
    41
      pkgs/development/mobile/androidenv/emulate-app.nix
  20. 20
    0
      pkgs/development/mobile/androidenv/emulator.nix
  21. 0
    14
      pkgs/development/mobile/androidenv/fetch.sh
  22. 0
    3
      pkgs/development/mobile/androidenv/generate-addons.sh
  23. 0
    82
      pkgs/development/mobile/androidenv/generate-addons.xsl
  24. 0
    4
      pkgs/development/mobile/androidenv/generate-platforms.sh
  25. 0
    54
      pkgs/development/mobile/androidenv/generate-platforms.xsl
  26. 0
    3
      pkgs/development/mobile/androidenv/generate-sources.sh
  27. 0
    52
      pkgs/development/mobile/androidenv/generate-sources.xsl
  28. 0
    26
      pkgs/development/mobile/androidenv/generate-sysimages.sh
  29. 0
    20
      pkgs/development/mobile/androidenv/generate-sysimages.xsl
  30. 0
    4
      pkgs/development/mobile/androidenv/generate-tools.sh
  31. 0
    43
      pkgs/development/mobile/androidenv/generate-tools.xsl
  32. 16
    0
      pkgs/development/mobile/androidenv/generate.sh
  33. 1145
    0
      pkgs/development/mobile/androidenv/generated/addons.nix
  34. 1910
    0
      pkgs/development/mobile/androidenv/generated/packages.nix
  35. 157
    0
      pkgs/development/mobile/androidenv/generated/system-images-android-tv.nix
  36. 67
    0
      pkgs/development/mobile/androidenv/generated/system-images-android-wear-cn.nix
  37. 97
    0
      pkgs/development/mobile/androidenv/generated/system-images-android-wear.nix
  38. 547
    0
      pkgs/development/mobile/androidenv/generated/system-images-android.nix
  39. 502
    0
      pkgs/development/mobile/androidenv/generated/system-images-google_apis.nix
  40. 97
    0
      pkgs/development/mobile/androidenv/generated/system-images-google_apis_playstore.nix
  41. 12
    0
      pkgs/development/mobile/androidenv/lldb.nix
  42. 0
    13
      pkgs/development/mobile/androidenv/make-standalone-toolchain_r10e.patch
  43. 0
    13
      pkgs/development/mobile/androidenv/make-standalone-toolchain_r8e.patch
  44. 0
    119
      pkgs/development/mobile/androidenv/make_standalone_toolchain.py_16b.patch
  45. 0
    119
      pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17c.patch
  46. 50
    0
      pkgs/development/mobile/androidenv/ndk-bundle/default.nix
  47. 44
    0
      pkgs/development/mobile/androidenv/ndk-bundle/make_standalone_toolchain.py_18.patch
  48. 12
    44
      pkgs/development/mobile/androidenv/platform-tools.nix
  49. 0
    343
      pkgs/development/mobile/androidenv/platforms-linux.nix
  50. 0
    343
      pkgs/development/mobile/androidenv/platforms-macosx.nix
  51. 27
    0
      pkgs/development/mobile/androidenv/querypackages.sh
  52. 0
    2834
      pkgs/development/mobile/androidenv/repository-11.xml
  53. 0
    184
      pkgs/development/mobile/androidenv/sources.nix
  54. 0
    18
      pkgs/development/mobile/androidenv/support-repository.nix
  55. 0
    18
      pkgs/development/mobile/androidenv/support.nix
  56. 0
    1026
      pkgs/development/mobile/androidenv/sys-img.xml
  57. 0
    305
      pkgs/development/mobile/androidenv/sysimages.nix
  58. 26
    0
      pkgs/development/mobile/androidenv/tools.nix
  59. 62
    0
      pkgs/development/mobile/androidenv/tools/25.nix
  60. 40
    0
      pkgs/development/mobile/androidenv/tools/26.nix
  61. 1
    1
      pkgs/top-level/all-packages.nix

+ 2
- 1
.gitignore View File

@@ -13,4 +13,5 @@ result-*
13 13
 .DS_Store
14 14
 
15 15
 /pkgs/development/libraries/qt-5/*/tmp/
16
-/pkgs/desktops/kde-5/*/tmp/
16
+/pkgs/desktops/kde-5/*/tmp/
17
+/pkgs/development/mobile/androidenv/xml/*

+ 0
- 1614
pkgs/development/mobile/androidenv/addon.xml
File diff suppressed because it is too large
View File


+ 0
- 321
pkgs/development/mobile/androidenv/addons.nix View File

@@ -1,321 +0,0 @@
1
-
2
-# This file is generated from generate-addons.sh. DO NOT EDIT.
3
-# Execute generate-addons.sh or fetch.sh to update the file.
4
-{stdenv, fetchurl, unzip}:
5
-
6
-let
7
-  buildGoogleApis = args:
8
-    stdenv.mkDerivation (args // {
9
-      buildInputs = [ unzip ];
10
-      buildCommand = ''
11
-        mkdir -p $out
12
-        cd $out
13
-        unzip $src
14
-      '';
15
-    });
16
-in
17
-{
18
-
19
-  google_apis_3 = buildGoogleApis {
20
-    name = "google_apis-3";
21
-      src = fetchurl {
22
-        url = https://dl.google.com/android/repository/google_apis-3-r03.zip;
23
-        sha1 = "1f92abf3a76be66ae8032257fc7620acbd2b2e3a";
24
-      };
25
-      meta = {
26
-        description = "Android + Google APIs";
27
-        url = http://developer.android.com/;
28
-      };
29
-    };
30
-
31
-  google_apis_4 = buildGoogleApis {
32
-    name = "google_apis-4";
33
-      src = fetchurl {
34
-        url = https://dl.google.com/android/repository/google_apis-4_r02.zip;
35
-        sha1 = "9b6e86d8568558de4d606a7debc4f6049608dbd0";
36
-      };
37
-      meta = {
38
-        description = "Android + Google APIs";
39
-        url = http://developer.android.com/;
40
-      };
41
-    };
42
-
43
-  google_apis_5 = buildGoogleApis {
44
-    name = "google_apis-5";
45
-      src = fetchurl {
46
-        url = https://dl.google.com/android/repository/google_apis-5_r01.zip;
47
-        sha1 = "46eaeb56b645ee7ffa24ede8fa17f3df70db0503";
48
-      };
49
-      meta = {
50
-        description = "Android + Google APIs";
51
-        url = http://developer.android.com/;
52
-      };
53
-    };
54
-
55
-  google_apis_6 = buildGoogleApis {
56
-    name = "google_apis-6";
57
-      src = fetchurl {
58
-        url = https://dl.google.com/android/repository/google_apis-6_r01.zip;
59
-        sha1 = "5ff545d96e031e09580a6cf55713015c7d4936b2";
60
-      };
61
-      meta = {
62
-        description = "Android + Google APIs";
63
-        url = http://developer.android.com/;
64
-      };
65
-    };
66
-
67
-  google_apis_7 = buildGoogleApis {
68
-    name = "google_apis-7";
69
-      src = fetchurl {
70
-        url = https://dl.google.com/android/repository/google_apis-7_r01.zip;
71
-        sha1 = "2e7f91e0fe34fef7f58aeced973c6ae52361b5ac";
72
-      };
73
-      meta = {
74
-        description = "Android + Google APIs";
75
-        url = http://developer.android.com/;
76
-      };
77
-    };
78
-
79
-  google_apis_8 = buildGoogleApis {
80
-    name = "google_apis-8";
81
-      src = fetchurl {
82
-        url = https://dl.google.com/android/repository/google_apis-8_r02.zip;
83
-        sha1 = "3079958e7ec87222cac1e6b27bc471b27bf2c352";
84
-      };
85
-      meta = {
86
-        description = "Android + Google APIs";
87
-        url = http://developer.android.com/;
88
-      };
89
-    };
90
-
91
-  google_apis_9 = buildGoogleApis {
92
-    name = "google_apis-9";
93
-      src = fetchurl {
94
-        url = https://dl.google.com/android/repository/google_apis-9_r02.zip;
95
-        sha1 = "78664645a1e9accea4430814f8694291a7f1ea5d";
96
-      };
97
-      meta = {
98
-        description = "Android + Google APIs";
99
-        url = http://developer.android.com/;
100
-      };
101
-    };
102
-
103
-  google_apis_10 = buildGoogleApis {
104
-    name = "google_apis-10";
105
-      src = fetchurl {
106
-        url = https://dl.google.com/android/repository/google_apis-10_r02.zip;
107
-        sha1 = "cc0711857c881fa7534f90cf8cc09b8fe985484d";
108
-      };
109
-      meta = {
110
-        description = "Android + Google APIs";
111
-        url = http://developer.android.com/;
112
-      };
113
-    };
114
-
115
-  google_apis_11 = buildGoogleApis {
116
-    name = "google_apis-11";
117
-      src = fetchurl {
118
-        url = https://dl.google.com/android/repository/google_apis-11_r01.zip;
119
-        sha1 = "5eab5e81addee9f3576d456d205208314b5146a5";
120
-      };
121
-      meta = {
122
-        description = "Android + Google APIs";
123
-        url = http://developer.android.com/;
124
-      };
125
-    };
126
-
127
-  google_apis_12 = buildGoogleApis {
128
-    name = "google_apis-12";
129
-      src = fetchurl {
130
-        url = https://dl.google.com/android/repository/google_apis-12_r01.zip;
131
-        sha1 = "e9999f4fa978812174dfeceec0721c793a636e5d";
132
-      };
133
-      meta = {
134
-        description = "Android + Google APIs";
135
-        url = http://developer.android.com/;
136
-      };
137
-    };
138
-
139
-  google_apis_13 = buildGoogleApis {
140
-    name = "google_apis-13";
141
-      src = fetchurl {
142
-        url = https://dl.google.com/android/repository/google_apis-13_r01.zip;
143
-        sha1 = "3b153edd211c27dc736c893c658418a4f9041417";
144
-      };
145
-      meta = {
146
-        description = "Android + Google APIs";
147
-        url = http://developer.android.com/;
148
-      };
149
-    };
150
-
151
-  google_apis_14 = buildGoogleApis {
152
-    name = "google_apis-14";
153
-      src = fetchurl {
154
-        url = https://dl.google.com/android/repository/google_apis-14_r02.zip;
155
-        sha1 = "f8eb4d96ad0492b4c0db2d7e4f1a1a3836664d39";
156
-      };
157
-      meta = {
158
-        description = "Android + Google APIs";
159
-
160
-      };
161
-    };
162
-
163
-  google_apis_15 = buildGoogleApis {
164
-    name = "google_apis-15";
165
-      src = fetchurl {
166
-        url = https://dl.google.com/android/repository/google_apis-15_r03.zip;
167
-        sha1 = "d0d2bf26805eb271693570a1aaec33e7dc3f45e9";
168
-      };
169
-      meta = {
170
-        description = "Android + Google APIs";
171
-
172
-      };
173
-    };
174
-
175
-  google_apis_16 = buildGoogleApis {
176
-    name = "google_apis-16";
177
-      src = fetchurl {
178
-        url = https://dl.google.com/android/repository/google_apis-16_r04.zip;
179
-        sha1 = "ee6acf1b01020bfa8a8e24725dbc4478bee5e792";
180
-      };
181
-      meta = {
182
-        description = "Android + Google APIs";
183
-
184
-      };
185
-    };
186
-
187
-  google_apis_17 = buildGoogleApis {
188
-    name = "google_apis-17";
189
-      src = fetchurl {
190
-        url = https://dl.google.com/android/repository/google_apis-17_r04.zip;
191
-        sha1 = "a076be0677f38df8ca5536b44dfb411a0c808c4f";
192
-      };
193
-      meta = {
194
-        description = "Android + Google APIs";
195
-
196
-      };
197
-    };
198
-
199
-  google_apis_18 = buildGoogleApis {
200
-    name = "google_apis-18";
201
-      src = fetchurl {
202
-        url = https://dl.google.com/android/repository/google_apis-18_r04.zip;
203
-        sha1 = "6109603409debdd40854d4d4a92eaf8481462c8b";
204
-      };
205
-      meta = {
206
-        description = "Android + Google APIs";
207
-
208
-      };
209
-    };
210
-
211
-  google_apis_19 = buildGoogleApis {
212
-    name = "google_apis-19";
213
-      src = fetchurl {
214
-        url = https://dl.google.com/android/repository/google_apis-19_r20.zip;
215
-        sha1 = "5b933abe830b2f25b4c0f171d45e9e0651e56311";
216
-      };
217
-      meta = {
218
-        description = "Android + Google APIs";
219
-
220
-      };
221
-    };
222
-
223
-  google_apis_21 = buildGoogleApis {
224
-    name = "google_apis-21";
225
-      src = fetchurl {
226
-        url = https://dl.google.com/android/repository/google_apis-21_r01.zip;
227
-        sha1 = "66a754efb24e9bb07cc51648426443c7586c9d4a";
228
-      };
229
-      meta = {
230
-        description = "Android + Google APIs";
231
-
232
-      };
233
-    };
234
-
235
-  google_apis_22 = buildGoogleApis {
236
-    name = "google_apis-22";
237
-      src = fetchurl {
238
-        url = https://dl.google.com/android/repository/google_apis-22_r01.zip;
239
-        sha1 = "5def0f42160cba8acff51b9c0c7e8be313de84f5";
240
-      };
241
-      meta = {
242
-        description = "Android + Google APIs";
243
-
244
-      };
245
-    };
246
-
247
-  google_apis_23 = buildGoogleApis {
248
-    name = "google_apis-23";
249
-      src = fetchurl {
250
-        url = https://dl.google.com/android/repository/google_apis-23_r01.zip;
251
-        sha1 = "04c5cc1a7c88967250ebba9561d81e24104167db";
252
-      };
253
-      meta = {
254
-        description = "Android + Google APIs";
255
-
256
-      };
257
-    };
258
-
259
-  google_apis_24 = buildGoogleApis {
260
-    name = "google_apis-24";
261
-      src = fetchurl {
262
-        url = https://dl.google.com/android/repository/google_apis-24_r1.zip;
263
-        sha1 = "31361c2868f27343ee917fbd259c1463821b6145";
264
-      };
265
-      meta = {
266
-        description = "Android + Google APIs";
267
-
268
-      };
269
-    };
270
-
271
-  google_apis_25 = buildGoogleApis {
272
-    name = "google_apis-25";
273
-      src = fetchurl {
274
-        url = https://dl.google.com/android/repository/google_apis-25_r1.zip;
275
-        sha1 = "550e83eea9513ab11c44919ac6da54b36084a9f3";
276
-      };
277
-      meta = {
278
-        description = "Android + Google APIs";
279
-
280
-      };
281
-    };
282
-
283
-  android_support_extra = buildGoogleApis {
284
-    name = "android_support_extra";
285
-    src = fetchurl {
286
-      url = https://dl.google.com/android/repository/support_r23.2.1.zip;
287
-      sha1 = "41121bbc412c2fce0be170d589d20cfa3e78e857";
288
-    };
289
-    meta = {
290
-      description = "Android Support Library";
291
-      url = http://developer.android.com/;
292
-    };
293
-  };
294
-
295
-
296
-  google_play_services = buildGoogleApis {
297
-    name = "google_play_services";
298
-    src = fetchurl {
299
-      url = https://dl.google.com/android/repository/google_play_services_v16_1_rc09.zip;
300
-      sha1 = "f95bf19634e2ab0430923247fe2c50246432d2e9";
301
-    };
302
-    meta = {
303
-      description = "Google Play services client library and sample code";
304
-      url = http://developer.android.com/;
305
-    };
306
-  };
307
-
308
-  instant_apps = buildGoogleApis {
309
-    name = "instant_apps_sdk";
310
-    src = fetchurl {
311
-      url = https://dl.google.com/android/repository/iasdk-1.5.0-1538000167.zip;
312
-      sha1 = "6c282b9c686e819fe7f5ac8f2249d2479acb63b4";
313
-    };
314
-    meta = {
315
-      description = "Android Instant Apps Development SDK";
316
-      url = "https://developer.android.com/";
317
-    };
318
-  };
319
-
320
-
321
-}

+ 0
- 120
pkgs/development/mobile/androidenv/androidndk.nix View File

@@ -1,120 +0,0 @@
1
-{ stdenv, fetchurl, zlib, ncurses5, unzip, lib, makeWrapper
2
-, coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which
3
-, platformTools, python3, libcxx, version, sha1s, bash, runCommand
4
-, fullNDK ? false # set to true if you want other parts of the NDK
5
-                  # that is not used by Nixpkgs like sources,
6
-                  # examples, docs, or LLVM toolchains
7
-}:
8
-
9
-let
10
-  makeStandaloneToolchain = api: arch: let
11
-      full_ndk = (ndk true);
12
-    in runCommand "makeStandaloneToolchain-${version}" {} ''
13
-      ${full_ndk}/libexec/${full_ndk.name}/build/tools/make_standalone_toolchain.py --api ${toString api} --arch ${arch} --install-dir $out
14
-    '';
15
-  ndk = fullNDK: stdenv.mkDerivation rec {
16
-    name = "android-ndk-r${version}";
17
-    inherit version;
18
-
19
-    src = fetchurl {
20
-      url = "https://dl.google.com/android/repository/${name}-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}.zip";
21
-      sha1 = sha1s.${stdenv.hostPlatform.system} or (throw "platform ${stdenv.hostPlatform.system} not supported!");
22
-    };
23
-
24
-    phases = "buildPhase";
25
-
26
-    nativeBuildInputs = [ unzip makeWrapper file ];
27
-
28
-    buildCommand = let
29
-      bin_path = "$out/bin";
30
-      pkg_path = "$out/libexec/${name}";
31
-      sed_script_1 =
32
-        "'s|^PROGDIR=`dirname $0`" +
33
-        "|PROGDIR=`dirname $(readlink -f $(which $0))`|'";
34
-      runtime_paths = (lib.makeBinPath [
35
-        coreutils file findutils
36
-        gawk gnugrep gnused
37
-        jdk python3 which
38
-      ]) + ":${platformTools}/platform-tools";
39
-    in ''
40
-      mkdir -pv $out/libexec
41
-      cd $out/libexec
42
-      unzip -qq $src
43
-
44
-      # so that it doesn't fail because of read-only permissions set
45
-      cd -
46
-      ${if (version == "10e") then
47
-          ''
48
-            patch -p1 \
49
-              --no-backup-if-mismatch \
50
-              -d $out/libexec/${name} < ${ ./make-standalone-toolchain_r10e.patch }
51
-          ''
52
-        else
53
-          ''
54
-            patch -p1 \
55
-              --no-backup-if-mismatch \
56
-              -d $out/libexec/${name} < ${ ./. + "/make_standalone_toolchain.py_" + "${version}" + ".patch" }
57
-
58
-            sed -i 's,#!/usr/bin/env python,#!${python3}/bin/python,g' ${pkg_path}/build/tools/make_standalone_toolchain.py
59
-            sed -i 's,#!/bin/bash,#!${bash}/bin/bash,g' ${pkg_path}/build/tools/make_standalone_toolchain.py
60
-            wrapProgram ${pkg_path}/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}"
61
-          ''
62
-      }
63
-
64
-      patchShebangs ${pkg_path}
65
-
66
-      cd ${pkg_path}
67
-
68
-    '' + lib.optionalString (!fullNDK) ''
69
-      # Steps to reduce output size
70
-      rm -rf docs sources tests
71
-      # We only support cross compiling with gcc for now
72
-      rm -rf toolchains/*-clang* toolchains/llvm*
73
-    '' +
74
-
75
-    ''
76
-      find ${pkg_path}/toolchains \( \
77
-          \( -type f -a -name "*.so*" \) -o \
78
-          \( -type f -a -perm -0100 \) \
79
-          \) -exec patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-*so.? \
80
-                            --set-rpath ${stdenv.lib.makeLibraryPath [ libcxx zlib ncurses5 ]} {} \;
81
-      # fix ineffective PROGDIR / MYNDKDIR determination
82
-      for i in ndk-build ${lib.optionalString (version == "10e") "ndk-gdb ndk-gdb-py"}
83
-      do
84
-          sed -i -e ${sed_script_1} $i
85
-      done
86
-
87
-      # wrap
88
-      for i in ndk-build ${lib.optionalString (version == "10e") "ndk-gdb ndk-gdb-py ndk-which"}
89
-      do
90
-          wrapProgram "$(pwd)/$i" --prefix PATH : "${runtime_paths}"
91
-      done
92
-
93
-      ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
94
-        for i in ${pkg_path}/prebuilt/linux-x86_64/bin/*
95
-        do
96
-            if ! isELF $i; then continue; fi
97
-            patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 $i
98
-            patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64 $i
99
-        done
100
-      ''}
101
-
102
-      # make some executables available in PATH
103
-      mkdir -pv ${bin_path}
104
-      for i in \
105
-          ndk-build ${lib.optionalString (version == "10e") "ndk-depends ndk-gdb ndk-gdb-py ndk-gdb.py ndk-stack ndk-which"}
106
-      do
107
-          ln -sf ${pkg_path}/$i ${bin_path}/$i
108
-      done
109
-    '';
110
-
111
-    meta = {
112
-      platforms = builtins.attrNames sha1s;
113
-      hydraPlatforms = [];
114
-      license = stdenv.lib.licenses.asl20;
115
-    };
116
-  };
117
-  passthru = {
118
-    inherit makeStandaloneToolchain;
119
-  };
120
-in lib.extendDerivation true passthru (ndk fullNDK)

+ 0
- 88
pkgs/development/mobile/androidenv/androidndk_r8e.nix View File

@@ -1,88 +0,0 @@
1
-{ stdenv, fetchurl, zlib, ncurses, lib, makeWrapper
2
-, coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which
3
-, platformTools
4
-, fullNDK ? false # set to true if you want other parts of the NDK
5
-                  # that is not used by Nixpkgs like sources,
6
-                  # examples, docs, or LLVM toolchains
7
-}:
8
-
9
-stdenv.mkDerivation rec {
10
-  name = "android-ndk-r8e";
11
-
12
-  src = if stdenv.hostPlatform.system == "i686-linux"
13
-    then fetchurl {
14
-      url = "http://dl.google.com/android/ndk/${name}-linux-x86.tar.bz2";
15
-      sha256 = "c2c4e0c8b3037149a0f5dbb08d72f814a52af4da9fff9d80328c675457e95a98";
16
-    }
17
-    else if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl {
18
-      url = "http://dl.google.com/android/ndk/${name}-linux-x86_64.tar.bz2";
19
-      sha256 = "093gf55zbh38p2gk5bdykj1vg9p5l774wjdzw5mhk4144jm1wdq7";
20
-    }
21
-    else throw "platform ${stdenv.hostPlatform.system} not supported!";
22
-
23
-  phases = "buildPhase";
24
-
25
-  nativeBuildInputs = [ makeWrapper ];
26
-
27
-  buildCommand = let
28
-    bin_path = "$out/bin";
29
-    pkg_path = "$out/libexec/${name}";
30
-    sed_script_1 =
31
-      "'s|^PROGDIR=`dirname $0`" +
32
-      "|PROGDIR=`dirname $(readlink -f $(which $0))`|'";
33
-    sed_script_2 =
34
-      "'s|^MYNDKDIR=`dirname $0`" +
35
-      "|MYNDKDIR=`dirname $(readlink -f $(which $0))`|'";
36
-    runtime_paths = (lib.makeBinPath [
37
-      coreutils file findutils
38
-      gawk gnugrep gnused
39
-      jdk
40
-      which
41
-    ]) + ":${platformTools}/platform-tools";
42
-  in ''
43
-    set -x
44
-    mkdir -pv $out/libexec
45
-    cd $out/libexec
46
-    tar -xjf $src
47
-
48
-    # so that it doesn't fail because of read-only permissions set
49
-    cd -
50
-    patch -p1 \
51
-        --no-backup-if-mismatch \
52
-        -d $out/libexec/${name} < ${ ./make-standalone-toolchain_r8e.patch }
53
-    cd ${pkg_path}
54
-
55
-  '' + lib.optionalString (!fullNDK) ''
56
-    # Steps to reduce output size
57
-    rm -rf docs sources tests
58
-    # We only support cross compiling with gcc for now
59
-    rm -rf toolchains/*-clang* toolchains/llvm-*
60
-
61
-  '' + ''
62
-    find ${pkg_path}/toolchains \( \
63
-        \( -type f -a -name "*.so*" \) -o \
64
-        \( -type f -a -perm -0100 \) \
65
-        \) -exec patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-*so.? \
66
-                          --set-rpath ${stdenv.lib.makeLibraryPath [ zlib ncurses ]} {} \;
67
-    # fix ineffective PROGDIR / MYNDKDIR determination
68
-    for i in ndk-build ndk-gdb ndk-gdb-py
69
-    do
70
-        sed -i -e ${sed_script_1} $i
71
-    done
72
-    sed -i -e ${sed_script_2} ndk-which
73
-    # a bash script
74
-    patchShebangs ndk-which
75
-    # wrap
76
-    for i in ndk-build ndk-gdb ndk-gdb-py ndk-which
77
-    do
78
-        wrapProgram "$(pwd)/$i" --prefix PATH : "${runtime_paths}"
79
-    done
80
-    # make some executables available in PATH
81
-    mkdir -pv ${bin_path}
82
-    for i in \
83
-        ndk-build ndk-depends ndk-gdb ndk-gdb-py ndk-gdb.py ndk-stack ndk-which
84
-    do
85
-        ln -sf ${pkg_path}/$i ${bin_path}/$i
86
-    done
87
-  '';
88
-}

+ 0
- 296
pkgs/development/mobile/androidenv/androidsdk.nix View File

@@ -1,296 +0,0 @@
1
-{ stdenv, stdenv_32bit, fetchurl, fetchzip, unzip, makeWrapper
2
-, platformTools, buildTools, support, supportRepository, platforms, sysimages, addons, sources
3
-, libX11, libXext, libXrender, libxcb, libXau, libXdmcp, libXtst, libGLU_combined, alsaLib
4
-, freetype, fontconfig, glib, gtk2, atk, file, jdk, coreutils, libpulseaudio, dbus
5
-, zlib, glxinfo, xkeyboardconfig
6
-, includeSources
7
-, licenseAccepted
8
-}:
9
-{ platformVersions, abiVersions, useGoogleAPIs, buildToolsVersions ? [], useExtraSupportLibs ? false
10
-, useGooglePlayServices ? false, useInstantApps ? false }:
11
-
12
-if !licenseAccepted then throw ''
13
-    You must accept the Android Software Development Kit License Agreement at
14
-    https://developer.android.com/studio/terms
15
-    by setting nixpkgs config option 'android_sdk.accept_license = true;'
16
-  ''
17
-else assert licenseAccepted;
18
-
19
-let inherit (stdenv.lib) makeLibraryPath;
20
-
21
-    googleRepository = let version = "gms_v9_rc41_wear_2_0_rc6";
22
-      in fetchzip rec {
23
-        url = "https://dl-ssl.google.com/android/repository/google_m2repository_${version}.zip";
24
-        sha256 = "0k99xmynv0k62d301zx5jnjkddflr51i5lb02l9incg7m5cn8kzx";
25
-      };
26
-
27
-in
28
-
29
-stdenv.mkDerivation rec {
30
-  name = "android-sdk-${version}";
31
-  version = "26.1.1";
32
-
33
-  src = if (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
34
-    then fetchurl {
35
-      url = "https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip";
36
-      sha256 = "1yfy0qqxz1ixpsci1pizls1nrncmi8p16wcb9rimdn4q3mdfxzwj";
37
-    }
38
-    else if stdenv.hostPlatform.system == "x86_64-darwin" then fetchurl {
39
-      url = "https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip";
40
-      sha256 = "0gl5c30m40kx0vvrpbaa8cw8wq2vb89r14hgzb1df4qgpic97cpc";
41
-    }
42
-    else throw "platform not ${stdenv.hostPlatform.system} supported!";
43
-
44
-  emulator = fetchurl {
45
-     url = "https://dl.google.com/android/repository/emulator-linux-4969155.zip";
46
-     sha256 = "0iw0j6j3w9zpfalsa7xq2czz4vzgq96zk2zddjhanwwx4p8fhrfd";
47
-  };
48
-
49
-  buildCommand = ''
50
-    mkdir -p $out/libexec
51
-    cd $out/libexec
52
-    unpackFile $src
53
-    unpackFile $emulator
54
-    cd tools
55
-
56
-    for f in monitor bin/monkeyrunner bin/uiautomatorviewer
57
-    do
58
-        sed -i -e "s|/bin/ls|${coreutils}/bin/ls|" "$f"
59
-    done
60
-
61
-    ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
62
-    ''
63
-      # There are a number of native binaries. We must patch them to let them find the interpreter and libstdc++
64
-
65
-      for i in mksdcard
66
-      do
67
-          patchelf --set-interpreter ${stdenv_32bit.cc.libc.out}/lib/ld-linux.so.2 $i
68
-          patchelf --set-rpath ${stdenv_32bit.cc.cc.lib}/lib $i
69
-      done
70
-
71
-      # The following scripts used SWT and wants to dynamically load some GTK+ stuff.
72
-      # Creating these wrappers ensure that they can be found:
73
-
74
-      wrapProgram `pwd`/android \
75
-        --prefix PATH : ${jdk}/bin \
76
-        --prefix LD_LIBRARY_PATH : ${makeLibraryPath [ glib gtk2 libXtst ]}
77
-
78
-      wrapProgram `pwd`/bin/uiautomatorviewer \
79
-        --prefix PATH : ${jdk}/bin \
80
-        --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ glib gtk2 libXtst ]}
81
-
82
-      # The emulators need additional libraries, which are dynamically loaded => let's wrap them
83
-
84
-      ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
85
-        cd ..
86
-        for i in emulator/emulator* emulator/qemu/linux-x86_64/qemu-system-*
87
-        do
88
-            patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 $i
89
-            wrapProgram `pwd`/$i \
90
-              --prefix PATH : ${stdenv.lib.makeBinPath [ file glxinfo ]} \
91
-              --suffix LD_LIBRARY_PATH : `pwd`/lib:${makeLibraryPath [ stdenv.cc.cc libX11 libxcb libXau libXdmcp libXext libGLU_combined alsaLib zlib libpulseaudio dbus.lib ]} \
92
-              --suffix QT_XKB_CONFIG_ROOT : ${xkeyboardconfig}/share/X11/xkb
93
-        done
94
-        cd tools
95
-      ''}
96
-    ''}
97
-
98
-    patchShebangs .
99
-
100
-    ${if stdenv.hostPlatform.system == "i686-linux" then
101
-      ''
102
-        # The monitor requires some more patching
103
-
104
-        cd lib/monitor-x86
105
-        patchelf --set-interpreter ${stdenv_32bit.cc.libc.out}/lib/ld-linux.so.2 monitor
106
-        patchelf --set-rpath ${makeLibraryPath [ libX11 libXext libXrender freetype fontconfig ]} libcairo-swt.so
107
-
108
-        wrapProgram `pwd`/monitor \
109
-          --prefix LD_LIBRARY_PATH : ${makeLibraryPath [ gtk2 atk stdenv.cc.cc libXtst ]}
110
-
111
-        cd ../..
112
-      ''
113
-      else if stdenv.hostPlatform.system == "x86_64-linux" then
114
-      ''
115
-        # The monitor requires some more patching
116
-
117
-        cd lib/monitor-x86_64
118
-        patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 monitor
119
-        patchelf --set-rpath ${makeLibraryPath [ libX11 libXext libXrender freetype fontconfig ]} libcairo-swt.so
120
-
121
-        wrapProgram `pwd`/monitor \
122
-          --prefix LD_LIBRARY_PATH : ${makeLibraryPath [ gtk2 atk stdenv.cc.cc libXtst ]}
123
-
124
-        cd ../..
125
-      ''
126
-      else ""}
127
-
128
-    # Symlink the other sub packages
129
-
130
-    cd ..
131
-    ln -s ${platformTools}/platform-tools
132
-    ln -s ${support}/support
133
-
134
-    mkdir -p build-tools
135
-    cd build-tools
136
-
137
-    ${stdenv.lib.concatMapStrings
138
-       (v: "ln -s ${builtins.getAttr "v${builtins.replaceStrings ["."] ["_"] v}" buildTools}/build-tools/*")
139
-       (if (builtins.length buildToolsVersions) == 0 then platformVersions else buildToolsVersions)}
140
-
141
-    cd ..
142
-
143
-    # Symlink required Google API add-ons
144
-
145
-    mkdir -p add-ons
146
-    cd add-ons
147
-
148
-    ${if useGoogleAPIs then
149
-        stdenv.lib.concatMapStrings (platformVersion:
150
-        if (builtins.hasAttr ("google_apis_"+platformVersion) addons) then
151
-          let
152
-            googleApis = builtins.getAttr ("google_apis_"+platformVersion) addons;
153
-          in
154
-          "ln -s ${googleApis}/* addon-google_apis-${platformVersion}\n"
155
-        else "") platformVersions
156
-      else ""}
157
-
158
-    cd ..
159
-
160
-    # Symlink required extras
161
-
162
-    mkdir -p extras/android
163
-    cd extras/android
164
-
165
-    ln -s ${supportRepository}/m2repository
166
-
167
-    ${if useExtraSupportLibs then
168
-       "ln -s ${addons.android_support_extra}/support ."
169
-     else ""}
170
-
171
-    cd ..
172
-    mkdir -p google
173
-    cd google
174
-
175
-    ${if useGooglePlayServices then
176
-       "ln -s ${addons.google_play_services}/google-play-services google_play_services"
177
-     else ""}
178
-
179
-    ${stdenv.lib.optionalString useInstantApps
180
-       "ln -s ${addons.instant_apps}/whsdk instantapps"}
181
-
182
-    ln -s ${googleRepository} m2repository
183
-
184
-    cd ../..
185
-
186
-    # Symlink required sources
187
-    mkdir -p sources
188
-    cd sources
189
-
190
-    ${if includeSources then
191
-        stdenv.lib.concatMapStrings (platformVersion:
192
-        if (builtins.hasAttr ("source_"+platformVersion) sources) then
193
-          let
194
-            source = builtins.getAttr ("source_"+platformVersion) sources;
195
-          in
196
-          "ln -s ${source}/* android-${platformVersion}\n"
197
-        else "") platformVersions
198
-      else ""}
199
-
200
-    cd ..
201
-
202
-    # Symlink required platforms
203
-
204
-    mkdir -p platforms
205
-    cd platforms
206
-
207
-    ${stdenv.lib.concatMapStrings (platformVersion:
208
-      if (builtins.hasAttr ("platform_"+platformVersion) platforms) then
209
-        let
210
-          platform = builtins.getAttr ("platform_"+platformVersion) platforms;
211
-        in
212
-        "ln -s ${platform}/* android-${platformVersion}\n"
213
-      else ""
214
-    ) platformVersions}
215
-
216
-    cd ..
217
-
218
-    # Symlink required system images
219
-
220
-    mkdir -p system-images
221
-    cd system-images
222
-
223
-    ${stdenv.lib.concatMapStrings (abiVersion:
224
-      stdenv.lib.concatMapStrings (platformVersion:
225
-        if (builtins.hasAttr ("sysimg_" + abiVersion + "_" + platformVersion) sysimages) then
226
-          let
227
-            sysimg = builtins.getAttr ("sysimg_" + abiVersion + "_" + platformVersion) sysimages;
228
-          in
229
-          ''
230
-            mkdir -p android-${platformVersion}
231
-            cd android-${platformVersion}
232
-            ln -s ${sysimg}/*
233
-            cd ..
234
-          ''
235
-        else ""
236
-      ) platformVersions
237
-    ) abiVersions}
238
-
239
-    # Create wrappers to the most important tools and platform tools so that we can run them if the SDK is in our PATH
240
-
241
-    mkdir -p $out/bin
242
-
243
-    for i in $out/libexec/tools/*
244
-    do
245
-        if [ ! -d $i ] && [ -x $i ]
246
-        then
247
-            ln -sf $i $out/bin/$(basename $i)
248
-        fi
249
-    done
250
-
251
-    for i in $out/libexec/tools/bin/*
252
-    do
253
-        if [ ! -d $i ] && [ -x $i ]
254
-        then
255
-            ln -sf $i $out/bin/$(basename $i)
256
-        fi
257
-    done
258
-
259
-    for i in $out/libexec/platform-tools/*
260
-    do
261
-        if [ ! -d $i ] && [ -x $i ]
262
-        then
263
-            ln -sf $i $out/bin/$(basename $i)
264
-        fi
265
-    done
266
-
267
-    for i in $out/libexec/build-tools/*/*
268
-    do
269
-        if [ ! -d $i ] && [ -x $i ]
270
-        then
271
-            ln -sf $i $out/bin/$(basename $i)
272
-        fi
273
-    done
274
-
275
-    for i in $out/libexec/emulator/*
276
-    do
277
-        if [ ! -d $i ] && [ -x $i ]
278
-        then
279
-            ln -sf $i $out/bin/$(basename $i)
280
-        fi
281
-    done
282
-
283
-    wrapProgram $out/bin/sdkmanager \
284
-      --set JAVA_HOME ${jdk}
285
-
286
-    yes | ANDROID_SDK_HOME=$(mktemp -d) $out/bin/sdkmanager --licenses || true
287
-  '';
288
-
289
-  buildInputs = [ unzip makeWrapper ];
290
-
291
-  meta = {
292
-    platforms = stdenv.lib.platforms.unix;
293
-    hydraPlatforms = [];
294
-    license = stdenv.lib.licenses.unfree;
295
-  };
296
-}

+ 22
- 25
pkgs/development/mobile/androidenv/build-app.nix View File

@@ -1,28 +1,26 @@
1
-{ stdenv, androidsdk, jdk, ant, androidndk, gnumake, gawk, file, which }:
2
-args@{ name, src, platformVersions ? [ "8" ], useGoogleAPIs ? false, antFlags ? ""
1
+{ composeAndroidPackages, stdenv, ant, jdk, gnumake, gawk }:
2
+
3
+{ name
3 4
 , release ? false, keyStore ? null, keyAlias ? null, keyStorePassword ? null, keyAliasPassword ? null
4
-, useNDK ? false, ...
5
-}:
5
+, antFlags ? ""
6
+, ...
7
+}@args:
6 8
 
7 9
 assert release -> keyStore != null && keyAlias != null && keyStorePassword != null && keyAliasPassword != null;
8 10
 
9 11
 let
10
-  androidsdkComposition = androidsdk {
11
-    inherit platformVersions useGoogleAPIs;
12
-    abiVersions = [];
13
-  };
12
+  androidSdkFormalArgs = builtins.functionArgs composeAndroidPackages;
13
+  androidArgs = builtins.intersectAttrs androidSdkFormalArgs args;
14
+  androidsdk = (composeAndroidPackages androidArgs).androidsdk;
15
+
16
+  extraArgs = removeAttrs args ([ "name" ] ++ builtins.attrNames androidSdkFormalArgs);
14 17
 in
15 18
 stdenv.mkDerivation ({
16
-  name = stdenv.lib.replaceChars [" "] [""] name;
17
-
18
-  ANDROID_HOME = "${androidsdkComposition}/libexec";
19
-
20
-  buildInputs = [ jdk ant ] ++
21
-    stdenv.lib.optional useNDK [ androidndk gnumake gawk file which ];
22
-
19
+  name = stdenv.lib.replaceChars [" "] [""] name; # Android APKs may contain white spaces in their names, but Nix store paths cannot
20
+  ANDROID_HOME = "${androidsdk}/libexec/android-sdk";
21
+  buildInputs = [ jdk ant ];
23 22
   buildPhase = ''
24 23
     ${stdenv.lib.optionalString release ''
25
-    
26 24
       # Provide key singing attributes
27 25
       ( echo "key.store=${keyStore}"
28 26
         echo "key.alias=${keyAlias}"
@@ -32,20 +30,19 @@ stdenv.mkDerivation ({
32 30
     ''}
33 31
 
34 32
     export ANDROID_SDK_HOME=`pwd` # Key files cannot be stored in the user's home directory. This overrides it.
35
-    ${if useNDK then ''
36
-        export GNUMAKE=${gnumake}/bin/make
37
-        export NDK_HOST_AWK=${gawk}/bin/gawk
38
-        ${androidndk}/bin/ndk-build
39
-      '' else ""}
33
+
34
+    ${stdenv.lib.optionalString (args ? includeNDK && args.includeNDK) ''
35
+      export GNUMAKE=${gnumake}/bin/make
36
+      export NDK_HOST_AWK=${gawk}/bin/gawk
37
+      ${androidsdk}/libexec/android-sdk/ndk-bundle/ndk-build
38
+    ''}
40 39
     ant ${antFlags} ${if release then "release" else "debug"}
41 40
   '';
42
-
43 41
   installPhase = ''
44 42
     mkdir -p $out
45 43
     mv bin/*-${if release then "release" else "debug"}.apk $out
46
-    
44
+
47 45
     mkdir -p $out/nix-support
48 46
     echo "file binary-dist \"$(echo $out/*.apk)\"" > $out/nix-support/hydra-build-products
49 47
   '';
50
-} //
51
-builtins.removeAttrs args ["name"])
48
+} // extraArgs)

+ 0
- 108
pkgs/development/mobile/androidenv/build-gradle-app.nix View File

@@ -1,108 +0,0 @@
1
-{ stdenv, androidsdk, jdk, androidndk, gnumake, gawk, file
2
-, which, gradle, fetchurl, buildEnv, runCommand }:
3
-
4
-args@{ name, src, platformVersions ? [ "8" ], useGoogleAPIs ? false
5
-     , useExtraSupportLibs ? false, useGooglePlayServices ? false
6
-     , release ? false, keyStore ? null, keyAlias ? null
7
-     , keyStorePassword ? null, keyAliasPassword ? null
8
-     , useNDK ? false, buildInputs ? [], mavenDeps, gradleTask
9
-     , buildDirectory ? "./.", acceptAndroidSdkLicenses ? false }:
10
-
11
-assert release -> keyStore != null;
12
-assert release -> keyAlias != null;
13
-assert release -> keyStorePassword != null;
14
-assert release -> keyAliasPassword != null;
15
-assert acceptAndroidSdkLicenses;
16
-
17
-let
18
-  inherit (stdenv.lib) optionalString;
19
-
20
-  m2install = { repo, version, artifactId, groupId
21
-              , jarSha256, pomSha256, aarSha256, suffix ? "" }:
22
-    let m2Name = "${artifactId}-${version}";
23
-        m2Path = "${builtins.replaceStrings ["."] ["/"] groupId}/${artifactId}/${version}";
24
-    in runCommand m2Name {} (''
25
-         mkdir -p $out/m2/${m2Path}
26
-       '' + optionalString (jarSha256 != null) ''
27
-         install -D ${fetchurl {
28
-                        url = "${repo}${m2Path}/${m2Name}${suffix}.jar";
29
-                        sha256 = jarSha256;
30
-                      }} $out/m2/${m2Path}/${m2Name}${suffix}.jar
31
-       '' + optionalString (pomSha256 != null) ''
32
-         install -D ${fetchurl {
33
-                        url = "${repo}${m2Path}/${m2Name}${suffix}.pom";
34
-                        sha256 = pomSha256;
35
-                      }} $out/m2/${m2Path}/${m2Name}${suffix}.pom
36
-       '' + optionalString (aarSha256 != null) ''
37
-         install -D ${fetchurl {
38
-                        url = "${repo}${m2Path}/${m2Name}${suffix}.aar";
39
-                        sha256 = aarSha256;
40
-                      }} $out/m2/${m2Path}/${m2Name}${suffix}.aar
41
-       '');
42
-
43
-  androidsdkComposition = androidsdk {
44
-    inherit platformVersions useGoogleAPIs
45
-            useExtraSupportLibs useGooglePlayServices;
46
-    abiVersions = [ "armeabi-v7a" ];
47
-  };
48
-in
49
-stdenv.mkDerivation ({
50
-  name = stdenv.lib.replaceChars [" "] [""] name;
51
-
52
-  ANDROID_HOME = "${androidsdkComposition}/libexec";
53
-  ANDROID_NDK_HOME = "${androidndk}/libexec/${androidndk.name}";
54
-
55
-  buildInputs = [ jdk gradle ] ++
56
-    stdenv.lib.optional useNDK [ androidndk gnumake gawk file which ] ++
57
-      buildInputs;
58
-
59
-  DEPENDENCIES = buildEnv { name = "${name}-maven-deps";
60
-                            paths = map m2install mavenDeps;
61
-                          };
62
-
63
-  buildPhase = ''
64
-    ${optionalString release ''
65
-      # Provide key signing attributes
66
-      ( echo "RELEASE_STORE_FILE=${keyStore}"
67
-        echo "RELEASE_KEY_ALIAS=${keyAlias}"
68
-        echo "RELEASE_STORE_PASSWORD=${keyStorePassword}"
69
-        echo "RELEASE_KEY_PASSWORD=${keyAliasPassword}"
70
-      ) >> gradle.properties
71
-    ''}
72
-    buildDir=`pwd`
73
-    cp -r $ANDROID_HOME $buildDir/local_sdk
74
-    chmod -R 755 local_sdk
75
-    export ANDROID_HOME=$buildDir/local_sdk
76
-    # Key files cannot be stored in the user's home directory. This
77
-    # overrides it.
78
-    export ANDROID_SDK_HOME=`pwd`
79
-
80
-    mkdir -p "$ANDROID_HOME/licenses"
81
-    echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
82
-    echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
83
-
84
-    export APP_HOME=`pwd`
85
-
86
-    mkdir -p .m2/repository
87
-    if [ -d "$DEPENDENCIES/m2" ] ; then
88
-      cp -RL "$DEPENDENCIES"/m2/* .m2/repository/
89
-    fi
90
-    chmod -R 755 .m2
91
-    mkdir -p .m2/repository/com/android/support
92
-    cp -RL local_sdk/extras/android/m2repository/com/android/support/* .m2/repository/com/android/support/
93
-    cp -RL local_sdk/extras/google/m2repository/* .m2/repository/
94
-    gradle ${gradleTask} --offline --no-daemon -g ./tmp -Dmaven.repo.local=`pwd`/.m2/repository
95
-  '';
96
-
97
-  installPhase = ''
98
-    mkdir -p $out
99
-    mv ${buildDirectory}/build/outputs/apk/*.apk $out
100
-
101
-    mkdir -p $out/nix-support
102
-    echo "file binary-dist \"$(echo $out/*.apk)\"" > $out/nix-support/hydra-build-products
103
-  '';
104
-
105
-  meta = {
106
-    license = stdenv.lib.licenses.unfree;
107
-  };
108
-} // builtins.removeAttrs args ["name" "mavenDeps"])

+ 0
- 376
pkgs/development/mobile/androidenv/build-tools-srcs-linux.nix View File

@@ -1,376 +0,0 @@
1
-
2
-# This file is generated from generate-tools.sh. DO NOT EDIT.
3
-# Execute generate-tools.sh or fetch.sh to update the file.
4
-{ fetchurl }:
5
-
6
-{
7
-    
8
-  v17 = {
9
-    version = "17.0.0";
10
-    src = fetchurl {
11
-      url = https://dl.google.com/android/repository/build-tools_r17-linux.zip;
12
-      sha1 = "2c2872bc3806aabf16a12e3959c2183ddc866e6d";
13
-    };
14
-  };
15
-
16
-  v18_0_1 = {
17
-    version = "18.0.1";
18
-    src = fetchurl {
19
-      url = https://dl.google.com/android/repository/build-tools_r18.0.1-linux.zip;
20
-      sha1 = "f11618492b0d2270c332325d45d752d3656a9640";
21
-    };
22
-  };
23
-
24
-  v18_1_0 = {
25
-    version = "18.1.0";
26
-    src = fetchurl {
27
-      url = https://dl.google.com/android/repository/build-tools_r18.1-linux.zip;
28
-      sha1 = "f314a0599e51397f0886fe888b50dd98f2f050d8";
29
-    };
30
-  };
31
-
32
-  v18_1_1 = {
33
-    version = "18.1.1";
34
-    src = fetchurl {
35
-      url = https://dl.google.com/android/repository/build-tools_r18.1.1-linux.zip;
36
-      sha1 = "68c9acbfc0cec2d51b19efaed39831a17055d998";
37
-    };
38
-  };
39
-
40
-  v19 = {
41
-    version = "19.0.0";
42
-    src = fetchurl {
43
-      url = https://dl.google.com/android/repository/build-tools_r19-linux.zip;
44
-      sha1 = "55c1a6cf632e7d346f0002b275ec41fd3137fd83";
45
-    };
46
-  };
47
-
48
-  v19_0_1 = {
49
-    version = "19.0.1";
50
-    src = fetchurl {
51
-      url = https://dl.google.com/android/repository/build-tools_r19.0.1-linux.zip;
52
-      sha1 = "18d2312dc4368858914213087f4e61445aca4517";
53
-    };
54
-  };
55
-
56
-  v19_0_2 = {
57
-    version = "19.0.2";
58
-    src = fetchurl {
59
-      url = https://dl.google.com/android/repository/build-tools_r19.0.2-linux.zip;
60
-      sha1 = "a03a6bdea0091aea32e1b35b90a7294c9f04e3dd";
61
-    };
62
-  };
63
-
64
-  v19_0_3 = {
65
-    version = "19.0.3";
66
-    src = fetchurl {
67
-      url = https://dl.google.com/android/repository/build-tools_r19.0.3-linux.zip;
68
-      sha1 = "c2d6055478e9d2d4fba476ee85f99181ddd1160c";
69
-    };
70
-  };
71
-
72
-  v19_1_0 = {
73
-    version = "19.1.0";
74
-    src = fetchurl {
75
-      url = https://dl.google.com/android/repository/build-tools_r19.1-linux.zip;
76
-      sha1 = "1ff20ac15fa47a75d00346ec12f180d531b3ca89";
77
-    };
78
-  };
79
-
80
-  v20 = {
81
-    version = "20.0.0";
82
-    src = fetchurl {
83
-      url = https://dl.google.com/android/repository/build-tools_r20-linux.zip;
84
-      sha1 = "b688905526a5584d1327a662d871a635ff502758";
85
-    };
86
-  };
87
-
88
-  v21 = {
89
-    version = "21.0.0";
90
-    src = fetchurl {
91
-      url = https://dl.google.com/android/repository/build-tools_r21-linux.zip;
92
-      sha1 = "4933328fdeecbd554a29528f254f4993468e1cf4";
93
-    };
94
-  };
95
-
96
-  v21_0_1 = {
97
-    version = "21.0.1";
98
-    src = fetchurl {
99
-      url = https://dl.google.com/android/repository/build-tools_r21.0.1-linux.zip;
100
-      sha1 = "e573069eea3e5255e7a65bedeb767f4fd0a5f49a";
101
-    };
102
-  };
103
-
104
-  v21_0_2 = {
105
-    version = "21.0.2";
106
-    src = fetchurl {
107
-      url = https://dl.google.com/android/repository/build-tools_r21.0.2-linux.zip;
108
-      sha1 = "e1236ab8897b62b57414adcf04c132567b2612a5";
109
-    };
110
-  };
111
-
112
-  v21_1_0 = {
113
-    version = "21.1.0";
114
-    src = fetchurl {
115
-      url = https://dl.google.com/android/repository/build-tools_r21.1-linux.zip;
116
-      sha1 = "b7455e543784d52a8925f960bc880493ed1478cb";
117
-    };
118
-  };
119
-
120
-  v21_1_1 = {
121
-    version = "21.1.1";
122
-    src = fetchurl {
123
-      url = https://dl.google.com/android/repository/build-tools_r21.1.1-linux.zip;
124
-      sha1 = "1c712ee3a1ba5a8b0548f9c32f17d4a0ddfd727d";
125
-    };
126
-  };
127
-
128
-  v21_1_2 = {
129
-    version = "21.1.2";
130
-    src = fetchurl {
131
-      url = https://dl.google.com/android/repository/build-tools_r21.1.2-linux.zip;
132
-      sha1 = "5e35259843bf2926113a38368b08458735479658";
133
-    };
134
-  };
135
-
136
-  v22 = {
137
-    version = "22.0.0";
138
-    src = fetchurl {
139
-      url = https://dl.google.com/android/repository/build-tools_r22-linux.zip;
140
-      sha1 = "a8a1619dd090e44fac957bce6842e62abf87965b";
141
-    };
142
-  };
143
-
144
-  v22_0_1 = {
145
-    version = "22.0.1";
146
-    src = fetchurl {
147
-      url = https://dl.google.com/android/repository/build-tools_r22.0.1-linux.zip;
148
-      sha1 = "da8b9c5c3ede39298e6cf0283c000c2ee9029646";
149
-    };
150
-  };
151
-
152
-  v23 = {
153
-    version = "23.0.0";
154
-    src = fetchurl {
155
-      url = https://dl.google.com/android/repository/build-tools_r23-linux.zip;
156
-      sha1 = "c1d6209212b01469f80fa804e0c1d39a06bc9060";
157
-    };
158
-  };
159
-
160
-  v23_0_1 = {
161
-    version = "23.0.1";
162
-    src = fetchurl {
163
-      url = https://dl.google.com/android/repository/build-tools_r23.0.1-linux.zip;
164
-      sha1 = "b6ba7c399d5fa487d95289d8832e4ad943aed556";
165
-    };
166
-  };
167
-
168
-  v23_0_2 = {
169
-    version = "23.0.2";
170
-    src = fetchurl {
171
-      url = https://dl.google.com/android/repository/build-tools_r23.0.2-linux.zip;
172
-      sha1 = "8a9f2b37f6fcf7a9fa784dc21aeaeb41bbb9f2c3";
173
-    };
174
-  };
175
-
176
-  v23_0_3 = {
177
-    version = "23.0.3";
178
-    src = fetchurl {
179
-      url = https://dl.google.com/android/repository/build-tools_r23.0.3-linux.zip;
180
-      sha1 = "368f2600feac7e9b511b82f53d1f2240ae4a91a3";
181
-    };
182
-  };
183
-
184
-  v24 = {
185
-    version = "24.0.0";
186
-    src = fetchurl {
187
-      url = https://dl.google.com/android/repository/build-tools_r24-linux.zip;
188
-      sha1 = "c6271c4d78a5612ea6c7150688bcd5b7313de8d1";
189
-    };
190
-  };
191
-
192
-  v24_0_1 = {
193
-    version = "24.0.1";
194
-    src = fetchurl {
195
-      url = https://dl.google.com/android/repository/build-tools_r24.0.1-linux.zip;
196
-      sha1 = "84f18c392919a074fcbb9b1d967984e6b2fef8b4";
197
-    };
198
-  };
199
-
200
-  v24_0_2 = {
201
-    version = "24.0.2";
202
-    src = fetchurl {
203
-      url = https://dl.google.com/android/repository/build-tools_r24.0.2-linux.zip;
204
-      sha1 = "f199a7a788c3fefbed102eea34d6007737b803cf";
205
-    };
206
-  };
207
-
208
-  v24_0_3 = {
209
-    version = "24.0.3";
210
-    src = fetchurl {
211
-      url = https://dl.google.com/android/repository/build-tools_r24.0.3-linux.zip;
212
-      sha1 = "9e8cc49d66e03fa1a8ecc1ac3e58f1324f5da304";
213
-    };
214
-  };
215
-
216
-  v25 = {
217
-    version = "25.0.0";
218
-    src = fetchurl {
219
-      url = https://dl.google.com/android/repository/build-tools_r25-linux.zip;
220
-      sha1 = "f2bbda60403e75cabd0f238598c3b4dfca56ea44";
221
-    };
222
-  };
223
-
224
-  v25_0_1 = {
225
-    version = "25.0.1";
226
-    src = fetchurl {
227
-      url = https://dl.google.com/android/repository/build-tools_r25.0.1-linux.zip;
228
-      sha1 = "ff063d252ab750d339f5947d06ff782836f22bac";
229
-    };
230
-  };
231
-
232
-  v25_0_2 = {
233
-    version = "25.0.2";
234
-    src = fetchurl {
235
-      url = https://dl.google.com/android/repository/build-tools_r25.0.2-linux.zip;
236
-      sha1 = "ff953c0177e317618fda40516f3e9d95fd43c7ae";
237
-    };
238
-  };
239
-
240
-  v25_0_3 = {
241
-    version = "25.0.3";
242
-    src = fetchurl {
243
-      url = https://dl.google.com/android/repository/build-tools_r25.0.3-linux.zip;
244
-      sha1 = "db95f3a0ae376534d4d69f4cdb6fad20649f3509";
245
-    };
246
-  };
247
-
248
-  v26 = {
249
-    version = "26.0.0";
250
-    src = fetchurl {
251
-      url = https://dl.google.com/android/repository/build-tools_r26-linux.zip;
252
-      sha1 = "1cbe72929876f8a872ab1f1b1040a9f720261f59";
253
-    };
254
-  };
255
-
256
-  v26_rc1 = {
257
-    version = "26.0.0-rc1";
258
-    src = fetchurl {
259
-      url = https://dl.google.com/android/repository/build-tools_r26-rc1-linux.zip;
260
-      sha1 = "8cd6388dc96db2d7a49d06159cf990d3bbc78d04";
261
-    };
262
-  };
263
-
264
-  v26_rc2 = {
265
-    version = "26.0.0-rc2";
266
-    src = fetchurl {
267
-      url = https://dl.google.com/android/repository/build-tools_r26-rc2-linux.zip;
268
-      sha1 = "629bbd8d2e415bf64871fb0b4c0540fd6d0347a0";
269
-    };
270
-  };
271
-
272
-  v26_0_1 = {
273
-    version = "26.0.1";
274
-    src = fetchurl {
275
-      url = https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip;
276
-      sha1 = "5378c2c78091b414d0eac40a6bd37f2faa31a365";
277
-    };
278
-  };
279
-
280
-  v26_0_2 = {
281
-    version = "26.0.2";
282
-    src = fetchurl {
283
-      url = https://dl.google.com/android/repository/build-tools_r26.0.2-linux.zip;
284
-      sha1 = "5b2b7b66c7bf2151f2af183b5b50a17808850592";
285
-    };
286
-  };
287
-
288
-  v26_0_3 = {
289
-    version = "26.0.3";
290
-    src = fetchurl {
291
-      url = https://dl.google.com/android/repository/build-tools_r26.0.3-linux.zip;
292
-      sha1 = "8a2e6c1bcd845844523a68aa17e5442f0dce328c";
293
-    };
294
-  };
295
-
296
-  v27 = {
297
-    version = "27.0.0";
298
-    src = fetchurl {
299
-      url = https://dl.google.com/android/repository/build-tools_r27-linux.zip;
300
-      sha1 = "28542332ba97cf4a08c3eddfcf5edd70e3cf1260";
301
-    };
302
-  };
303
-
304
-  v27_0_1 = {
305
-    version = "27.0.1";
306
-    src = fetchurl {
307
-      url = https://dl.google.com/android/repository/build-tools_r27.0.1-linux.zip;
308
-      sha1 = "7f4eedb1077ef948b848040dcd15de9e8a759f4a";
309
-    };
310
-  };
311
-
312
-  v27_0_2 = {
313
-    version = "27.0.2";
314
-    src = fetchurl {
315
-      url = https://dl.google.com/android/repository/build-tools_r27.0.2-linux.zip;
316
-      sha1 = "b687ddf6be84f11607871138aad32cf857d0b837";
317
-    };
318
-  };
319
-
320
-  v27_0_3 = {
321
-    version = "27.0.3";
322
-    src = fetchurl {
323
-      url = https://dl.google.com/android/repository/build-tools_r27.0.3-linux.zip;
324
-      sha1 = "d85e7a6320eddffe7eeace3437605079dac938ca";
325
-    };
326
-  };
327
-
328
-  v28 = {
329
-    version = "28.0.0";
330
-    src = fetchurl {
331
-      url = https://dl.google.com/android/repository/build-tools_r28-linux.zip;
332
-      sha1 = "d9f8a754d833ccd334f56fcc6089c5925cd82abb";
333
-    };
334
-  };
335
-
336
-  v28_rc1 = {
337
-    version = "28.0.0-rc1";
338
-    src = fetchurl {
339
-      url = https://dl.google.com/android/repository/build-tools_r28-rc1-linux.zip;
340
-      sha1 = "1601977fae25fd478bcfaa0481ca5ea3c609d840";
341
-    };
342
-  };
343
-
344
-  v28_rc2 = {
345
-    version = "28.0.0-rc2";
346
-    src = fetchurl {
347
-      url = https://dl.google.com/android/repository/build-tools_r28-rc2-linux.zip;
348
-      sha1 = "efe9c0dde0646a07544c864276390ca6e96b24dc";
349
-    };
350
-  };
351
-
352
-  v28_0_1 = {
353
-    version = "28.0.1";
354
-    src = fetchurl {
355
-      url = https://dl.google.com/android/repository/build-tools_r28.0.1-linux.zip;
356
-      sha1 = "ee70dfa1fccb58b37cebc9544830511f36a137a0";
357
-    };
358
-  };
359
-
360
-  v28_0_2 = {
361
-    version = "28.0.2";
362
-    src = fetchurl {
363
-      url = https://dl.google.com/android/repository/build-tools_r28.0.2-linux.zip;
364
-      sha1 = "b4492209810a3fd48deaa982f9852fef12433d55";
365
-    };
366
-  };
367
-
368
-  v28_0_3 = {
369
-    version = "28.0.3";
370
-    src = fetchurl {
371
-      url = https://dl.google.com/android/repository/build-tools_r28.0.3-linux.zip;
372
-      sha1 = "ea6f2f7103cd9da9ff0bdf6e37fbbba548fa4165";
373
-    };
374
-  };
375
-
376
-}

+ 0
- 376
pkgs/development/mobile/androidenv/build-tools-srcs-macosx.nix View File

@@ -1,376 +0,0 @@
1
-
2
-# This file is generated from generate-tools.sh. DO NOT EDIT.
3
-# Execute generate-tools.sh or fetch.sh to update the file.
4
-{ fetchurl }:
5
-
6
-{
7
-    
8
-  v17 = {
9
-    version = "17.0.0";
10
-    src = fetchurl {
11
-      url = https://dl.google.com/android/repository/build-tools_r17-macosx.zip;
12
-      sha1 = "602ee709be9dbb8f179b1e4075148a57f9419930";
13
-    };
14
-  };
15
-
16
-  v18_0_1 = {
17
-    version = "18.0.1";
18
-    src = fetchurl {
19
-      url = https://dl.google.com/android/repository/build-tools_r18.0.1-macosx.zip;
20
-      sha1 = "d84f5692fb44d60fc53e5b2507cebf9f24626902";
21
-    };
22
-  };
23
-
24
-  v18_1_0 = {
25
-    version = "18.1.0";
26
-    src = fetchurl {
27
-      url = https://dl.google.com/android/repository/build-tools_r18.1-macosx.zip;
28
-      sha1 = "16ddb299b8b43063e5bb3387ec17147c5053dfd8";
29
-    };
30
-  };
31
-
32
-  v18_1_1 = {
33
-    version = "18.1.1";
34
-    src = fetchurl {
35
-      url = https://dl.google.com/android/repository/build-tools_r18.1.1-macosx.zip;
36
-      sha1 = "a9d9d37f6ddf859e57abc78802a77aaa166e48d4";
37
-    };
38
-  };
39
-
40
-  v19 = {
41
-    version = "19.0.0";
42
-    src = fetchurl {
43
-      url = https://dl.google.com/android/repository/build-tools_r19-macosx.zip;
44
-      sha1 = "86ec1c12db1bc446b7bcaefc5cc14eb361044e90";
45
-    };
46
-  };
47
-
48
-  v19_0_1 = {
49
-    version = "19.0.1";
50
-    src = fetchurl {
51
-      url = https://dl.google.com/android/repository/build-tools_r19.0.1-macosx.zip;
52
-      sha1 = "efaf50fb19a3edb8d03efbff76f89a249ad2920b";
53
-    };
54
-  };
55
-
56
-  v19_0_2 = {
57
-    version = "19.0.2";
58
-    src = fetchurl {
59
-      url = https://dl.google.com/android/repository/build-tools_r19.0.2-macosx.zip;
60
-      sha1 = "145bc43065d45f756d99d87329d899052b9a9288";
61
-    };
62
-  };
63
-
64
-  v19_0_3 = {
65
-    version = "19.0.3";
66
-    src = fetchurl {
67
-      url = https://dl.google.com/android/repository/build-tools_r19.0.3-macosx.zip;
68
-      sha1 = "651cf8754373b2d52e7f6aab2c52eabffe4e9ea4";
69
-    };
70
-  };
71
-
72
-  v19_1_0 = {
73
-    version = "19.1.0";
74
-    src = fetchurl {
75
-      url = https://dl.google.com/android/repository/build-tools_r19.1-macosx.zip;
76
-      sha1 = "0d11aae3417de1efb4b9a0e0a7855904a61bcec1";
77
-    };
78
-  };
79
-
80
-  v20 = {
81
-    version = "20.0.0";
82
-    src = fetchurl {
83
-      url = https://dl.google.com/android/repository/build-tools_r20-macosx.zip;
84
-      sha1 = "1240f629411c108a714c4ddd756937c7fab93f83";
85
-    };
86
-  };
87
-
88
-  v21 = {
89
-    version = "21.0.0";
90
-    src = fetchurl {
91
-      url = https://dl.google.com/android/repository/build-tools_r21-macosx.zip;
92
-      sha1 = "9bef7989b51436bd4e5114d8a0330359f077cbfa";
93
-    };
94
-  };
95
-
96
-  v21_0_1 = {
97
-    version = "21.0.1";
98
-    src = fetchurl {
99
-      url = https://dl.google.com/android/repository/build-tools_r21.0.1-macosx.zip;
100
-      sha1 = "b60c8f9b810c980abafa04896706f3911be1ade7";
101
-    };
102
-  };
103
-
104
-  v21_0_2 = {
105
-    version = "21.0.2";
106
-    src = fetchurl {
107
-      url = https://dl.google.com/android/repository/build-tools_r21.0.2-macosx.zip;
108
-      sha1 = "f17471c154058f3734729ef3cc363399b1cd3de1";
109
-    };
110
-  };
111
-
112
-  v21_1_0 = {
113
-    version = "21.1.0";
114
-    src = fetchurl {
115
-      url = https://dl.google.com/android/repository/build-tools_r21.1-macosx.zip;
116
-      sha1 = "df619356c2359aa5eacdd48699d15b335d9bd246";
117
-    };
118
-  };
119
-
120
-  v21_1_1 = {
121
-    version = "21.1.1";
122
-    src = fetchurl {
123
-      url = https://dl.google.com/android/repository/build-tools_r21.1.1-macosx.zip;
124
-      sha1 = "836a146eab0504aa9387a5132e986fe7c7381571";
125
-    };
126
-  };
127
-
128
-  v21_1_2 = {
129
-    version = "21.1.2";
130
-    src = fetchurl {
131
-      url = https://dl.google.com/android/repository/build-tools_r21.1.2-macosx.zip;
132
-      sha1 = "e7c906b4ba0eea93b32ba36c610dbd6b204bff48";
133
-    };
134
-  };
135
-
136
-  v22 = {
137
-    version = "22.0.0";
138
-    src = fetchurl {
139
-      url = https://dl.google.com/android/repository/build-tools_r22-macosx.zip;
140
-      sha1 = "af95429b24088d704bc5db9bd606e34ac1b82c0d";
141
-    };
142
-  };
143
-
144
-  v22_0_1 = {
145
-    version = "22.0.1";
146
-    src = fetchurl {
147
-      url = https://dl.google.com/android/repository/build-tools_r22.0.1-macosx.zip;
148
-      sha1 = "53dad7f608e01d53b17176ba11165acbfccc5bbf";
149
-    };
150
-  };
151
-
152
-  v23 = {
153
-    version = "23.0.0";
154
-    src = fetchurl {
155
-      url = https://dl.google.com/android/repository/build-tools_r23-macosx.zip;
156
-      sha1 = "90ba6e716f7703a236cd44b2e71c5ff430855a03";
157
-    };
158
-  };
159
-
160
-  v23_0_1 = {
161
-    version = "23.0.1";
162
-    src = fetchurl {
163
-      url = https://dl.google.com/android/repository/build-tools_r23.0.1-macosx.zip;
164
-      sha1 = "d96ec1522721e9a179ae2c591c99f75d31d39718";
165
-    };
166
-  };
167
-
168
-  v23_0_2 = {
169
-    version = "23.0.2";
170
-    src = fetchurl {
171
-      url = https://dl.google.com/android/repository/build-tools_r23.0.2-macosx.zip;
172
-      sha1 = "482c4cbceef8ff58aefd92d8155a38610158fdaf";
173
-    };
174
-  };
175
-
176
-  v23_0_3 = {
177
-    version = "23.0.3";
178
-    src = fetchurl {
179
-      url = https://dl.google.com/android/repository/build-tools_r23.0.3-macosx.zip;
180
-      sha1 = "fbc98cd303fd15a31d472de6c03bd707829f00b0";
181
-    };
182
-  };
183
-
184
-  v24 = {
185
-    version = "24.0.0";
186
-    src = fetchurl {
187
-      url = https://dl.google.com/android/repository/build-tools_r24-macosx.zip;
188
-      sha1 = "97fc4ed442f23989cc488d02c1d1de9bdde241de";
189
-    };
190
-  };
191
-
192
-  v24_0_1 = {
193
-    version = "24.0.1";
194
-    src = fetchurl {
195
-      url = https://dl.google.com/android/repository/build-tools_r24.0.1-macosx.zip;
196
-      sha1 = "5c6457fcdfa07724fb086d8ff4e8316fc0742848";
197
-    };
198
-  };
199
-
200
-  v24_0_2 = {
201
-    version = "24.0.2";
202
-    src = fetchurl {
203
-      url = https://dl.google.com/android/repository/build-tools_r24.0.2-macosx.zip;
204
-      sha1 = "8bb8fc575477491d5957de743089df412de55cda";
205
-    };
206
-  };
207
-
208
-  v24_0_3 = {
209
-    version = "24.0.3";
210
-    src = fetchurl {
211
-      url = https://dl.google.com/android/repository/build-tools_r24.0.3-macosx.zip;
212
-      sha1 = "a01c15f1b105c34595681075e1895d58b3fff48c";
213
-    };
214
-  };
215
-
216
-  v25 = {
217
-    version = "25.0.0";
218
-    src = fetchurl {
219
-      url = https://dl.google.com/android/repository/build-tools_r25-macosx.zip;
220
-      sha1 = "273c5c29a65cbed00e44f3aa470bbd7dce556606";
221
-    };
222
-  };
223
-
224
-  v25_0_1 = {
225
-    version = "25.0.1";
226
-    src = fetchurl {
227
-      url = https://dl.google.com/android/repository/build-tools_r25.0.1-macosx.zip;
228
-      sha1 = "7bf7f22d7d48ef20b6ab0e3d7a2912e5c088340f";
229
-    };
230
-  };
231
-
232
-  v25_0_2 = {
233
-    version = "25.0.2";
234
-    src = fetchurl {
235
-      url = https://dl.google.com/android/repository/build-tools_r25.0.2-macosx.zip;
236
-      sha1 = "12a5204bb3b6e39437535469fde7ddf42da46b16";
237
-    };
238
-  };
239
-
240
-  v25_0_3 = {
241
-    version = "25.0.3";
242
-    src = fetchurl {
243
-      url = https://dl.google.com/android/repository/build-tools_r25.0.3-macosx.zip;
244
-      sha1 = "160d2fefb5ce68e443427fc30a793a703b63e26e";
245
-    };
246
-  };
247
-
248
-  v26 = {
249
-    version = "26.0.0";
250
-    src = fetchurl {
251
-      url = https://dl.google.com/android/repository/build-tools_r26-macosx.zip;
252
-      sha1 = "d01a1aeca03747245f1f5936b3cb01759c66d086";
253
-    };
254
-  };
255
-
256
-  v26_rc1 = {
257
-    version = "26.0.0-rc1";
258
-    src = fetchurl {
259
-      url = https://dl.google.com/android/repository/build-tools_r26-rc1-macosx.zip;
260
-      sha1 = "5c5a1de7d5f4f000d36ae349229fe0be846d6137";
261
-    };
262
-  };
263
-
264
-  v26_rc2 = {
265
-    version = "26.0.0-rc2";
266
-    src = fetchurl {
267
-      url = https://dl.google.com/android/repository/build-tools_r26-rc2-macosx.zip;
268
-      sha1 = "cb1eb738a1f7003025af267a9b8cc2d259533c70";
269
-    };
270
-  };
271
-
272
-  v26_0_1 = {
273
-    version = "26.0.1";
274
-    src = fetchurl {
275
-      url = https://dl.google.com/android/repository/build-tools_r26.0.1-macosx.zip;
276
-      sha1 = "cbde59de198916b390777dd0227921bfa2120832";
277
-    };
278
-  };
279
-
280
-  v26_0_2 = {
281
-    version = "26.0.2";
282
-    src = fetchurl {
283
-      url = https://dl.google.com/android/repository/build-tools_r26.0.2-macosx.zip;
284
-      sha1 = "d9ed7c7f149ce38be5dc08979aea8acec1459ca0";
285
-    };
286
-  };
287
-
288
-  v26_0_3 = {
289
-    version = "26.0.3";
290
-    src = fetchurl {
291
-      url = https://dl.google.com/android/repository/build-tools_r26.0.3-macosx.zip;
292
-      sha1 = "5bb90ed935d99e5bc90686f43b852e68c5ad40df";
293
-    };
294
-  };
295
-
296
-  v27 = {
297
-    version = "27.0.0";
298
-    src = fetchurl {
299
-      url = https://dl.google.com/android/repository/build-tools_r27-macosx.zip;
300
-      sha1 = "fb4e8d7e6b8d29a77090e34024077a80458d5ae1";
301
-    };
302
-  };
303
-
304
-  v27_0_1 = {
305
-    version = "27.0.1";
306
-    src = fetchurl {
307
-      url = https://dl.google.com/android/repository/build-tools_r27.0.1-macosx.zip;
308
-      sha1 = "1edd07bfdbadd95652d093040e16d858f7489594";
309
-    };
310
-  };
311
-
312
-  v27_0_2 = {
313
-    version = "27.0.2";
314
-    src = fetchurl {
315
-      url = https://dl.google.com/android/repository/build-tools_r27.0.2-macosx.zip;
316
-      sha1 = "6d5d9cf2a47877f273f4b742b19e712a051a31be";
317
-    };
318
-  };
319
-
320
-  v27_0_3 = {
321
-    version = "27.0.3";
322
-    src = fetchurl {
323
-      url = https://dl.google.com/android/repository/build-tools_r27.0.3-macosx.zip;
324
-      sha1 = "61d9fb18790c68d66ff73bf1e7ad56bc1f1eef2d";
325
-    };
326
-  };
327
-
328
-  v28 = {
329
-    version = "28.0.0";
330
-    src = fetchurl {
331
-      url = https://dl.google.com/android/repository/build-tools_r28-macosx.zip;
332
-      sha1 = "72088d32d1d82cc3c2cf7cf6618b6130c0c84ade";
333
-    };
334
-  };
335
-
336
-  v28_rc1 = {
337
-    version = "28.0.0-rc1";
338
-    src = fetchurl {
339
-      url = https://dl.google.com/android/repository/build-tools_r28-rc1-macosx.zip;
340
-      sha1 = "2c77821967a2330b7b227072d0b1c02ef19fe2fc";
341
-    };
342
-  };
343
-
344
-  v28_rc2 = {
345
-    version = "28.0.0-rc2";
346
-    src = fetchurl {
347
-      url = https://dl.google.com/android/repository/build-tools_r28-rc2-macosx.zip;
348
-      sha1 = "0d0314b353589feb10e528b44c5a685b6658d797";
349
-    };
350
-  };
351
-
352
-  v28_0_1 = {
353
-    version = "28.0.1";
354
-    src = fetchurl {
355
-      url = https://dl.google.com/android/repository/build-tools_r28.0.1-macosx.zip;
356
-      sha1 = "aeef42ad953f1630dd6f5d71eefdc0b825211462";
357
-    };
358
-  };
359
-
360
-  v28_0_2 = {
361
-    version = "28.0.2";
362
-    src = fetchurl {
363
-      url = https://dl.google.com/android/repository/build-tools_r28.0.2-macosx.zip;
364
-      sha1 = "c10dd5a7825578622fb362a8a34f76eb3ba0c0a9";
365
-    };
366
-  };
367
-
368
-  v28_0_3 = {
369
-    version = "28.0.3";
370
-    src = fetchurl {
371
-      url = https://dl.google.com/android/repository/build-tools_r28.0.3-macosx.zip;
372
-      sha1 = "f8c333a2991b1ab05a671bc6248b78e00edcd83a";
373
-    };
374
-  };
375
-
376
-}

+ 19
- 53
pkgs/development/mobile/androidenv/build-tools.nix View File

@@ -1,53 +1,19 @@
1
-{stdenv, lib, stdenv_32bit, fetchurl, unzip, zlib_32bit, ncurses_32bit, file, zlib, ncurses, coreutils, buildToolsSources}:
2
-
3
-let buildBuildTools = name: { version, src }:
4
-  stdenv.mkDerivation rec {
5
-    inherit version src;
6
-    name = "android-build-tools-r${version}";
7
-    buildCommand = ''
8
-      mkdir -p $out/build-tools
9
-      cd $out/build-tools
10
-      unzip $src
11
-      mv android-* ${version}
12
-
13
-      cd ${version}
14
-
15
-      for f in $(grep -Rl /bin/ls .); do
16
-        sed -i -e "s|/bin/ls|${coreutils}/bin/ls|" "$f"
17
-      done
18
-
19
-      ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
20
-        ''
21
-
22
-          ln -s ${ncurses.out}/lib/libncurses.so.5 `pwd`/lib64/libtinfo.so.5
23
-
24
-          find . -type f -print0 | while IFS= read -r -d "" file
25
-          do
26
-            type=$(file "$file")
27
-            ## Patch 64-bit binaries
28
-            if grep -q "ELF 64-bit" <<< "$type"
29
-            then
30
-              if grep -q "interpreter" <<< "$type"
31
-              then
32
-                patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 "$file"
33
-              fi
34
-              patchelf --set-rpath `pwd`/lib64:${stdenv.cc.cc.lib.out}/lib:${zlib.out}/lib:${ncurses.out}/lib "$file"
35
-            ## Patch 32-bit binaries
36
-            elif grep -q "ELF 32-bit" <<< "$type"
37
-            then
38
-              if grep -q "interpreter" <<< "$type"
39
-              then
40
-                patchelf --set-interpreter ${stdenv_32bit.cc.libc.out}/lib/ld-linux.so.2 "$file"
41
-              fi
42
-              patchelf --set-rpath ${stdenv_32bit.cc.cc.lib.out}/lib:${zlib_32bit.out}/lib:${ncurses_32bit.out}/lib "$file"
43
-            fi
44
-          done
45
-        ''}
46
-
47
-        patchShebangs .
48
-    '';
49
-
50
-    buildInputs = [ unzip file ];
51
-  };
52
-in
53
-  lib.mapAttrs buildBuildTools buildToolsSources
1
+{deployAndroidPackage, lib, package, os, autoPatchelfHook, makeWrapper, pkgs, pkgs_i686}:
2
+
3
+deployAndroidPackage {
4
+  inherit package os;
5
+  buildInputs = [ autoPatchelfHook makeWrapper ] ++
6
+    lib.optional (os == "linux") [ pkgs.glibc pkgs.zlib pkgs.ncurses5 pkgs_i686.glibc pkgs_i686.zlib pkgs_i686.ncurses5 ];
7
+  patchInstructions = ''
8
+    ${lib.optionalString (os == "linux") ''
9
+      addAutoPatchelfSearchPath $packageBaseDir/lib
10
+      addAutoPatchelfSearchPath $packageBaseDir/lib64
11
+      autoPatchelf --no-recurse $packageBaseDir/lib64
12
+      autoPatchelf --no-recurse $packageBaseDir
13
+    ''}
14
+
15
+    wrapProgram $PWD/mainDexClasses \
16
+      --prefix PATH : ${pkgs.jdk8}/bin
17
+  '';
18
+  noAuditTmpdir = true; # The checker script gets confused by the build-tools path that is incorrectly identified as a reference to /build
19
+}

+ 10
- 0
pkgs/development/mobile/androidenv/cmake.nix View File

@@ -0,0 +1,10 @@
1
+{deployAndroidPackage, lib, package, os, autoPatchelfHook, pkgs}:
2
+
3
+deployAndroidPackage {
4
+  inherit package os;
5
+  buildInputs = [ autoPatchelfHook ]
6
+    ++ lib.optional (os == "linux") [ pkgs.stdenv.glibc pkgs.stdenv.cc.cc ];
7
+  patchInstructions = lib.optionalString (os == "linux") ''
8
+    autoPatchelf $packageBaseDir/bin
9
+  '';
10
+}

+ 255
- 0
pkgs/development/mobile/androidenv/compose-android-packages.nix View File

@@ -0,0 +1,255 @@
1
+{stdenv, fetchurl, requireFile, makeWrapper, unzip, autoPatchelfHook, pkgs, pkgs_i686}:
2
+
3
+{ toolsVersion ? "25.2.5"
4
+, platformToolsVersion ? "28.0.1"
5
+, buildToolsVersions ? [ "28.0.3" ]
6
+, includeEmulator ? false
7
+, emulatorVersion ? "28.0.14"
8
+, platformVersions ? []
9
+, includeSources ? false
10
+, includeDocs ? false
11
+, includeSystemImages ? false
12
+, systemImageTypes ? [ "default" ]
13
+, abiVersions ? [ "armeabi-v7a" ]
14
+, lldbVersions ? [ ]
15
+, cmakeVersions ? [ ]
16
+, includeNDK ? false
17
+, ndkVersion ? "18.1.5063045"
18
+, useGoogleAPIs ? false
19
+, useGoogleTVAddOns ? false
20
+, includeExtras ? []
21
+}:
22
+
23
+let
24
+  inherit (pkgs) stdenv fetchurl makeWrapper unzip;
25
+
26
+  # Determine the Android os identifier from Nix's system identifier
27
+  os = if stdenv.system == "x86_64-linux" then "linux"
28
+    else if stdenv.system == "x86_64-darwin" then "macosx"
29
+    else "No tarballs found for system architecture: ${stdenv.system}";
30
+
31
+  # Generated Nix packages
32
+  packages = import ./generated/packages.nix {
33
+    inherit fetchurl;
34
+  };
35
+
36
+  # Generated system images
37
+  system-images-packages-android = import ./generated/system-images-android.nix {
38
+    inherit fetchurl;
39
+  };
40
+
41
+  system-images-packages-android-tv = import ./generated/system-images-android-tv.nix {
42
+    inherit fetchurl;
43
+  };
44
+
45
+  system-images-packages-android-wear = import ./generated/system-images-android-wear.nix {
46
+    inherit fetchurl;
47
+  };
48
+
49
+  system-images-packages-android-wear-cn = import ./generated/system-images-android-wear-cn.nix {
50
+    inherit fetchurl;
51
+  };
52
+
53
+  system-images-packages-google_apis = import ./generated/system-images-google_apis.nix {
54
+    inherit fetchurl;
55
+  };
56
+
57
+  system-images-packages-google_apis_playstore = import ./generated/system-images-google_apis_playstore.nix {
58
+    inherit fetchurl;
59
+  };
60
+
61
+  system-images-packages =
62
+    stdenv.lib.recursiveUpdate
63
+      system-images-packages-android
64
+      (stdenv.lib.recursiveUpdate system-images-packages-android-tv
65
+        (stdenv.lib.recursiveUpdate system-images-packages-android-wear
66
+          (stdenv.lib.recursiveUpdate system-images-packages-android-wear-cn
67
+            (stdenv.lib.recursiveUpdate system-images-packages-google_apis system-images-packages-google_apis_playstore))));
68
+
69
+  # Generated addons
70
+  addons = import ./generated/addons.nix {
71
+    inherit fetchurl;
72
+  };
73
+in
74
+rec {
75
+  deployAndroidPackage = import ./deploy-androidpackage.nix {
76
+    inherit stdenv unzip;
77
+  };
78
+
79
+  platform-tools = import ./platform-tools.nix {
80
+    inherit deployAndroidPackage os autoPatchelfHook pkgs;
81
+    inherit (stdenv) lib;
82
+    package = packages.platform-tools."${platformToolsVersion}";
83
+  };
84
+
85
+  build-tools = map (version:
86
+    import ./build-tools.nix {
87
+      inherit deployAndroidPackage os autoPatchelfHook makeWrapper pkgs pkgs_i686;
88
+      inherit (stdenv) lib;
89
+      package = packages.build-tools."${version}";
90
+    }
91
+  ) buildToolsVersions;
92
+
93
+  docs = deployAndroidPackage {
94
+    inherit os;
95
+    package = packages.docs."1";
96
+  };
97
+
98
+  emulator = import ./emulator.nix {
99
+    inherit deployAndroidPackage os autoPatchelfHook makeWrapper pkgs pkgs_i686;
100
+    inherit (stdenv) lib;
101
+    package = packages.emulator."${emulatorVersion}"."${os}";
102
+  };
103
+
104
+  platforms = map (version:
105
+    deployAndroidPackage {
106
+      inherit os;
107
+      package = packages.platforms."${version}";
108
+    }
109
+  ) platformVersions;
110
+
111
+  sources = stdenv.lib.optional includeSources (map (version:
112
+    deployAndroidPackage {
113
+      inherit os;
114
+      package = packages.sources."${version}";
115
+    }
116
+  ) platformVersions);
117
+
118
+  system-images = stdenv.lib.flatten (map (apiVersion:
119
+    map (type:
120
+      map (abiVersion:
121
+        deployAndroidPackage {
122
+          inherit os;
123
+          package = system-images-packages.${apiVersion}.${type}.${abiVersion};
124
+        }
125
+      ) abiVersions
126
+    ) systemImageTypes
127
+  ) platformVersions);
128
+
129
+  lldb = map (version:
130
+    import ./lldb.nix {
131
+      inherit deployAndroidPackage os autoPatchelfHook pkgs;
132
+      inherit (stdenv) lib;
133
+      package = packages.lldb."${version}";
134
+    }
135
+  ) lldbVersions;
136
+
137
+  cmake = map (version:
138
+    import ./cmake.nix {
139
+      inherit deployAndroidPackage os autoPatchelfHook pkgs;
140
+      inherit (stdenv) lib;
141
+      package = packages.cmake."${version}";
142
+    }
143
+  ) cmakeVersions;
144
+
145
+  ndk-bundle = import ./ndk-bundle {
146
+    inherit deployAndroidPackage os autoPatchelfHook makeWrapper pkgs platform-tools;
147
+    inherit (stdenv) lib;
148
+    package = packages.ndk-bundle."${ndkVersion}";
149
+  };
150
+
151
+  google-apis = map (version:
152
+    deployAndroidPackage {
153
+      inherit os;
154
+      package = addons.addons."${version}".google_apis;
155
+    }
156
+  ) (builtins.filter (platformVersion: platformVersion < "26") platformVersions); # API level 26 and higher include Google APIs by default
157
+
158
+  google-tv-addons = map (version:
159
+    deployAndroidPackage {
160
+      inherit os;
161
+      package = addons.addons."${version}".google_tv_addon;
162
+    }
163
+  ) platformVersions;
164
+
165
+  # Function that automatically links all plugins for which multiple versions can coexist
166
+  linkPlugins = {name, plugins}:
167
+    stdenv.lib.optionalString (plugins != []) ''
168
+      mkdir -p ${name}
169
+      ${stdenv.lib.concatMapStrings (plugin: ''
170
+        ln -s ${plugin}/libexec/android-sdk/${name}/* ${name}
171
+      '') plugins}
172
+    '';
173
+
174
+  # Function that automatically links a plugin for which only one version exists
175
+  linkPlugin = {name, plugin, check ? true}:
176
+    stdenv.lib.optionalString check ''
177
+      ln -s ${plugin}/libexec/android-sdk/* ${name}
178
+    '';
179
+
180
+  # Links all plugins related to a requested platform
181
+  linkPlatformPlugins = {name, plugins, check}:
182
+    stdenv.lib.optionalString check ''
183
+      mkdir -p ${name}
184
+      ${stdenv.lib.concatMapStrings (plugin: ''
185
+        ln -s ${plugin}/libexec/android-sdk/${name}/* ${name}
186
+      '') plugins}
187
+    ''; # */
188
+
189
+  # This derivation deploys the tools package and symlinks all the desired
190
+  # plugins that we want to use.
191
+
192
+  androidsdk = import ./tools.nix {
193
+    inherit deployAndroidPackage requireFile packages toolsVersion autoPatchelfHook makeWrapper os pkgs pkgs_i686;
194
+    inherit (stdenv) lib;
195
+
196
+    postInstall = ''
197
+      # Symlink all requested plugins
198
+
199
+      ${linkPlugin { name = "platform-tools"; plugin = platform-tools; }}
200
+      ${linkPlugins { name = "build-tools"; plugins = build-tools; }}
201
+      ${linkPlugin { name = "emulator"; plugin = emulator; check = includeEmulator; }}
202
+      ${linkPlugin { name = "docs"; plugin = docs; check = includeDocs; }}
203
+      ${linkPlugins { name = "platforms"; plugins = platforms; }}
204
+      ${linkPlatformPlugins { name = "sources"; plugins = sources; check = includeSources; }}
205
+      ${linkPlugins { name = "lldb"; plugins = lldb; }}
206
+      ${linkPlugins { name = "cmake"; plugins = cmake; }}
207
+      ${linkPlugin { name = "ndk-bundle"; plugin = ndk-bundle; check = includeNDK; }}
208
+
209
+      ${stdenv.lib.optionalString includeSystemImages ''
210
+        mkdir -p system-images
211
+        ${stdenv.lib.concatMapStrings (system-image: ''
212
+          apiVersion=$(basename $(echo ${system-image}/libexec/android-sdk/system-images/*))
213
+          type=$(basename $(echo ${system-image}/libexec/android-sdk/system-images/*/*))
214
+          mkdir -p system-images/$apiVersion/$type
215
+          ln -s ${system-image}/libexec/android-sdk/system-images/$apiVersion/$type/* system-images/$apiVersion/$type
216
+        '') system-images}
217
+      ''}
218
+
219
+      ${linkPlatformPlugins { name = "add-ons"; plugins = google-apis; check = useGoogleAPIs; }}
220
+      ${linkPlatformPlugins { name = "add-ons"; plugins = google-apis; check = useGoogleTVAddOns; }}
221
+
222
+      # Link extras
223
+      ${stdenv.lib.concatMapStrings (identifier:
224
+        let
225
+          path = addons.extras."${identifier}".path;
226
+          addon = deployAndroidPackage {
227
+            inherit os;
228
+            package = addons.extras."${identifier}";
229
+          };
230
+        in
231
+        ''
232
+          targetDir=$(dirname ${path})
233
+          mkdir -p $targetDir
234
+          ln -s ${addon}/libexec/android-sdk/${path} $targetDir
235
+        '') includeExtras}
236
+
237
+      # Expose common executables in bin/
238
+      mkdir -p $out/bin
239
+      find $PWD/tools -not -path '*/\.*' -type f -executable -mindepth 1 -maxdepth 1 | while read i
240
+      do
241
+          ln -s $i $out/bin
242
+      done
243
+
244
+      find $PWD/tools/bin -not -path '*/\.*' -type f -executable -mindepth 1 -maxdepth 1 | while read i
245
+      do
246
+          ln -s $i $out/bin
247
+      done
248
+
249
+      for i in ${platform-tools}/bin/*
250
+      do
251
+          ln -s $i $out/bin
252
+      done
253
+    '';
254
+  };
255
+}

+ 128
- 0
pkgs/development/mobile/androidenv/convertaddons.xsl View File

@@ -0,0 +1,128 @@
1
+<?xml version="1.0"?>
2
+
3
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
+  xmlns:addon="http://schemas.android.com/sdk/android/repo/addon2/01"
5
+  xmlns:sdk="http://schemas.android.com/repository/android/common/01"
6
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
7
+
8
+  <xsl:output omit-xml-declaration="yes" indent="no" />
9
+
10
+  <!-- Template that puts a google HTTP prefix in front of relative URLs -->
11
+  <xsl:template name="repository-url">
12
+    <xsl:variable name="raw-url" select="complete/url"/>
13
+    <xsl:choose>
14
+      <xsl:when test="starts-with($raw-url, 'http')">
15
+        <xsl:value-of select="$raw-url"/>
16
+      </xsl:when>
17
+      <xsl:otherwise>
18
+        <xsl:text>https://dl.google.com/android/repository/</xsl:text>
19
+        <xsl:value-of select="$raw-url"/>
20
+      </xsl:otherwise>
21
+    </xsl:choose>
22
+  </xsl:template>
23
+
24
+  <xsl:template match="/addon:sdk-addon">
25
+{fetchurl}:
26
+
27
+{
28
+  addons = {
29
+    <!-- Convert all addons, but skip the entry for google APIs version 25 because it is inconsistent with the spec -->
30
+    <xsl:for-each select="remotePackage[type-details/@xsi:type='addon:addonDetailsType' and archives/archive/complete/url != 'google_apis-25_r1.zip' ]"><xsl:sort select="@path" />
31
+    "<xsl:value-of select="type-details/api-level" />"."<xsl:value-of select="type-details/tag/id" />" = {
32
+      name = "<xsl:value-of select="type-details/tag/id" />";
33
+      path = "<xsl:value-of select="translate(@path, ';', '/')" />";
34
+      revision = "<xsl:value-of select="type-details/api-level" />";
35
+      displayName = "<xsl:value-of select="display-name" />";
36
+      archives = {
37
+      <xsl:for-each select="archives/archive[not(host-os)]">
38
+        all = fetchurl {
39
+          url = <xsl:call-template name="repository-url"/>;
40
+          sha1 = "<xsl:value-of select="complete/checksum" />";
41
+        };
42
+      </xsl:for-each>
43
+      <xsl:for-each select="archives/archive[host-os and not(host-os = 'windows')]">
44
+        <xsl:value-of select="host-os" /> = fetchurl {
45
+          url = <xsl:call-template name="repository-url"/>;
46
+          sha1 = "<xsl:value-of select="complete/checksum" />";
47
+        };
48
+      </xsl:for-each>
49
+      };
50
+    };
51
+    </xsl:for-each>
52
+
53
+    <!-- Workaround to make google APIs version 25 work. Hopefully, we can get rid of this at some point -->
54
+    <xsl:for-each select="remotePackage[type-details/@xsi:type='addon:addonDetailsType' and archives/archive/complete/url = 'google_apis-25_r1.zip' ]">
55
+    "<xsl:value-of select="25" />"."<xsl:value-of select="type-details/tag/id" />" = {
56
+      name = "<xsl:value-of select="type-details/tag/id" />";
57
+      path = "add-ons/addon-google_apis-google-25";
58
+      revision = "<xsl:value-of select="25" />";
59
+      displayName = "<xsl:value-of select="display-name" />";
60
+      archives = {
61
+      <xsl:for-each select="archives/archive[not(host-os)]">
62
+        all = fetchurl {
63
+          url = <xsl:call-template name="repository-url"/>;
64
+          sha1 = "<xsl:value-of select="complete/checksum" />";
65
+        };
66
+      </xsl:for-each>
67
+      <xsl:for-each select="archives/archive[host-os and not(host-os = 'windows')]">
68
+        <xsl:value-of select="host-os" /> = fetchurl {
69
+          url = <xsl:call-template name="repository-url"/>;
70
+          sha1 = "<xsl:value-of select="complete/checksum" />";
71
+        };
72
+      </xsl:for-each>
73
+      };
74
+    };
75
+    </xsl:for-each>
76
+  };
77
+
78
+  extras = {
79
+    <!-- Convert all extras and maven artefacts -->
80
+    <xsl:for-each select="remotePackage[type-details/@xsi:type='addon:extraDetailsType' or type-details/@xsi:type='addon:mavenType']"><xsl:sort select="@path" />
81
+    
82
+    <!-- Compose revision string from revision attributes -->
83
+    <xsl:variable name="revision">
84
+      <xsl:choose>
85
+        <xsl:when test="revision/major">
86
+          <xsl:value-of select="revision/major" />
87
+        </xsl:when>
88
+      </xsl:choose>
89
+      <xsl:choose>
90
+        <xsl:when test="revision/minor">.<xsl:value-of select="revision/minor" />
91
+        </xsl:when>
92
+      </xsl:choose>
93
+      <xsl:choose>
94
+        <xsl:when test="revision/micro">.<xsl:value-of select="revision/micro" />
95
+        </xsl:when>
96
+      </xsl:choose>
97
+      <xsl:choose>
98
+        <xsl:when test="revision/preview">-rc<xsl:value-of select="revision/preview" />
99
+        </xsl:when>
100
+      </xsl:choose>
101
+    </xsl:variable>
102
+
103
+    "<xsl:value-of select="@path" />" = {
104
+      name = "<xsl:value-of select="translate(@path, ';', '-')" />";
105
+      path = "<xsl:value-of select="translate(@path, ';', '/')" />";
106
+      revision = "<xsl:value-of select="$revision" />";
107
+      displayName = "<xsl:value-of select="display-name" />";
108
+      archives = {
109
+      <xsl:for-each select="archives/archive[not(host-os)]">
110
+        all = fetchurl {
111
+          url = <xsl:call-template name="repository-url"/>;
112
+          sha1 = "<xsl:value-of select="complete/checksum" />";
113
+        };
114
+      </xsl:for-each>
115
+      <xsl:for-each select="archives/archive[host-os and not(host-os = 'windows')]">
116
+        <xsl:value-of select="host-os" /> = fetchurl {
117
+          url = <xsl:call-template name="repository-url"/>;
118
+          sha1 = "<xsl:value-of select="complete/checksum" />";
119
+        };
120
+      </xsl:for-each>
121
+      };
122
+    };
123
+    </xsl:for-each>
124
+  };
125
+}
126
+  </xsl:template>
127
+
128
+</xsl:stylesheet>

+ 116
- 0
pkgs/development/mobile/androidenv/convertpackages.xsl View File

@@ -0,0 +1,116 @@
1
+<?xml version="1.0"?>
2
+
3
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
+  xmlns:common="http://schemas.android.com/repository/android/common/01"
5
+  xmlns:generic="http://schemas.android.com/repository/android/generic/01"
6
+  xmlns:sdk="http://schemas.android.com/sdk/android/repo/repository2/01"
7
+  xmlns:sdk-common="http://schemas.android.com/sdk/android/repo/common/01"
8
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
9
+
10
+  <xsl:output omit-xml-declaration="yes" indent="no" />
11
+
12
+  <!-- Template that puts a google HTTP prefix in front of relative URLs -->
13
+  <xsl:template name="repository-url">
14
+    <xsl:variable name="raw-url" select="complete/url"/>
15
+    <xsl:choose>
16
+      <xsl:when test="starts-with($raw-url, 'http')">
17
+        <xsl:value-of select="$raw-url"/>
18
+      </xsl:when>
19
+      <xsl:otherwise>
20
+        <xsl:text>https://dl.google.com/android/repository/</xsl:text>
21
+        <xsl:value-of select="$raw-url"/>
22
+      </xsl:otherwise>
23
+    </xsl:choose>
24
+  </xsl:template>
25
+
26
+  <xsl:template match="/sdk:sdk-repository">
27
+{fetchurl}:
28
+
29
+{
30
+  <!-- Convert all remote packages -->
31
+  <xsl:for-each select="remotePackage"><xsl:sort select="@path" />
32
+
33
+  <!-- Extract the package name from the path -->
34
+  <xsl:variable name="name">
35
+    <xsl:choose>
36
+      <xsl:when test="contains(@path, ';')">
37
+        <xsl:value-of select="substring-before(@path, ';')" />
38
+      </xsl:when>
39
+      <xsl:otherwise>
40
+        <xsl:value-of select="@path" />
41
+      </xsl:otherwise>
42
+    </xsl:choose>
43
+  </xsl:variable>
44
+
45
+  <!-- Compose version string from version attributes -->
46
+  <xsl:variable name="revision">
47
+    <xsl:choose>
48
+      <!-- Compose revision for a generic package from the revision attributes -->
49
+      <xsl:when test="type-details/@xsi:type='generic:genericDetailsType'">
50
+        <xsl:choose>
51
+          <xsl:when test="revision/major">
52
+            <xsl:value-of select="revision/major" />
53
+          </xsl:when>
54
+        </xsl:choose>
55
+        <xsl:choose>
56
+          <xsl:when test="revision/minor">.<xsl:value-of select="revision/minor" />
57
+          </xsl:when>
58
+        </xsl:choose>
59
+        <xsl:choose>
60
+          <xsl:when test="revision/micro">.<xsl:value-of select="revision/micro" />
61
+          </xsl:when>
62
+        </xsl:choose>
63
+        <xsl:choose>
64
+          <xsl:when test="revision/preview">-rc<xsl:value-of select="revision/preview" />
65
+          </xsl:when>
66
+        </xsl:choose>
67
+      </xsl:when>
68
+      <!-- Compose revision of a platform SDK from the API-level or codename if the latter exists -->
69
+      <xsl:when test="type-details/@xsi:type='sdk:platformDetailsType'">
70
+        <xsl:choose>
71
+          <xsl:when test="not(type-details/codename='')">
72
+            <xsl:value-of select="type-details/codename" />
73
+          </xsl:when>
74
+          <xsl:otherwise>
75
+            <xsl:value-of select="type-details/api-level" />
76
+          </xsl:otherwise>
77
+        </xsl:choose>
78
+      </xsl:when>
79
+      <!-- Compose revision of a source SDK from the API-level -->
80
+      <xsl:when test="type-details/@xsi:type='sdk:sourceDetailsType'">
81
+        <xsl:value-of select="type-details/api-level" />
82
+      </xsl:when>
83
+    </xsl:choose>
84
+  </xsl:variable>
85
+
86
+  <xsl:choose>
87
+    <xsl:when test="@path='emulator'"> <!-- An emulator package provides one archive per operating system but the same versions -->
88
+  "<xsl:value-of select="$name" />"."<xsl:value-of select="$revision" />".<xsl:value-of select="archives/archive/host-os" /> = {
89
+    </xsl:when>
90
+    <xsl:otherwise>
91
+  "<xsl:value-of select="$name" />"."<xsl:value-of select="$revision" />" = {
92
+    </xsl:otherwise>
93
+  </xsl:choose>
94
+    name = "<xsl:value-of select="$name" />";
95
+    path = "<xsl:value-of select="translate(@path, ';', '/')" />";
96
+    revision = "<xsl:value-of select="$revision" />";
97
+    displayName = "<xsl:value-of select="display-name" />";
98
+    archives = {
99
+      <xsl:for-each select="archives/archive[not(host-os)]">
100
+        all = fetchurl {
101
+          url = <xsl:call-template name="repository-url"/>;
102
+          sha1 = "<xsl:value-of select="complete/checksum" />";
103
+        };
104
+      </xsl:for-each>
105
+      <xsl:for-each select="archives/archive[host-os and not(host-os = 'windows')]">
106
+        <xsl:value-of select="host-os" /> = fetchurl {
107
+        url = <xsl:call-template name="repository-url"/>;
108
+        sha1 = "<xsl:value-of select="complete/checksum" />";
109
+      };
110
+      </xsl:for-each>
111
+    };
112
+  };
113
+  </xsl:for-each>
114
+}
115
+  </xsl:template>
116
+</xsl:stylesheet>

+ 47
- 0
pkgs/development/mobile/androidenv/convertsystemimages.xsl View File

@@ -0,0 +1,47 @@
1
+<?xml version="1.0"?>
2
+
3
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
+  xmlns:sys-img="http://schemas.android.com/sdk/android/repo/sys-img2/01"
5
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6
+
7
+  <xsl:param name="imageType" />
8
+
9
+  <xsl:output omit-xml-declaration="yes" indent="no" />
10
+
11
+  <xsl:template name="repository-url">
12
+    <xsl:variable name="raw-url" select="complete/url"/>
13
+    <xsl:choose>
14
+      <xsl:when test="starts-with($raw-url, 'http')">
15
+        <xsl:value-of select="$raw-url"/>
16
+      </xsl:when>
17
+      <xsl:otherwise>
18
+        https://dl.google.com/android/repository/sys-img/<xsl:value-of select="$imageType" />/<xsl:value-of select="$raw-url"/>
19
+      </xsl:otherwise>
20
+    </xsl:choose>
21
+  </xsl:template>
22
+
23
+  <xsl:template match="/sys-img:sdk-sys-img">
24
+{fetchurl}:
25
+
26
+{
27
+  <xsl:for-each select="remotePackage[starts-with(@path, 'system-images;')]">
28
+    <xsl:variable name="revision">
29
+      <xsl:value-of select="type-details/api-level" />-<xsl:value-of select="type-details/tag/id" />-<xsl:value-of select="type-details/abi" />
30
+    </xsl:variable>
31
+
32
+    "<xsl:value-of select="type-details/api-level" />".<xsl:value-of select="type-details/tag/id" />."<xsl:value-of select="type-details/abi" />" = {
33
+      name = "system-image-<xsl:value-of select="$revision" />";
34
+      path = "<xsl:value-of select="translate(@path, ';', '/')" />";
35
+      revision = "<xsl:value-of select="$revision" />";
36
+      displayName = "<xsl:value-of select="display-name" />";
37
+      archives.all = fetchurl {
38
+      <xsl:for-each select="archives/archive">
39
+        url = <xsl:call-template name="repository-url"/>;
40
+        sha1 = "<xsl:value-of select="complete/checksum" />";
41
+      </xsl:for-each>
42
+      };
43
+  };
44
+  </xsl:for-each>
45
+}
46
+  </xsl:template>
47
+</xsl:stylesheet>

+ 11
- 335
pkgs/development/mobile/androidenv/default.nix View File

@@ -1,349 +1,25 @@
1
-{ pkgs, pkgs_i686, buildPackages
2
-, includeSources ? true, licenseAccepted ? false
1
+{ pkgs ? import <nixpkgs> {}
2
+, pkgs_i686 ? import <nixpkgs> { system = "i686-linux"; }
3 3
 }:
4 4
 
5
-# TODO: use callPackage instead of import to avoid so many inherits
6
-
7 5
 rec {
8
-  platformTools = import ./platform-tools.nix {
9
-    inherit buildPackages pkgs;
10
-  };
11
-
12
-  buildToolsSources = let
13
-    system = pkgs.stdenv.hostPlatform.system;
14
-    path = if (system == "i686-linux" || system == "x86_64-linux")
15
-      then ./build-tools-srcs-linux.nix
16
-      else if system == "x86_64-darwin"
17
-      then ./build-tools-srcs-macosx.nix
18
-      else throw "System: ${system} not supported!";
19
-  in
20
-    import path { inherit (pkgs) fetchurl; };
21
-
22
-  buildTools = import ./build-tools.nix {
23
-    inherit (pkgs) stdenv lib fetchurl unzip zlib file coreutils;
24
-    inherit buildToolsSources;
25
-    stdenv_32bit = pkgs_i686.stdenv;
26
-    zlib_32bit = pkgs_i686.zlib;
27
-    ncurses_32bit = pkgs_i686.ncurses5;
28
-    ncurses = pkgs.ncurses5;
29
-  };
30
-
31
-  support = import ./support.nix {
32
-    inherit (pkgs) stdenv fetchurl unzip;
33
-  };
34
-
35
-  supportRepository = import ./support-repository.nix {
36
-    inherit (pkgs) stdenv fetchurl unzip;
37
-  };
38
-
39
-  platforms = if (pkgs.stdenv.hostPlatform.system == "i686-linux" || pkgs.stdenv.hostPlatform.system == "x86_64-linux")
40
-    then import ./platforms-linux.nix {
41
-      inherit (pkgs) stdenv fetchurl unzip;
42
-    }
43
-    else if pkgs.stdenv.hostPlatform.system == "x86_64-darwin"
44
-    then import ./platforms-macosx.nix {
45
-      inherit (pkgs) stdenv fetchurl unzip;
46
-    }
47
-    else throw "Platform: ${pkgs.stdenv.hostPlatform.system} not supported!";
48
-
49
-  sysimages = import ./sysimages.nix {
50
-    inherit (pkgs) stdenv fetchurl unzip;
51
-  };
52
-
53
-  addons = import ./addons.nix {
54
-    inherit (pkgs) stdenv fetchurl unzip;
55
-  };
56
-
57
-  sources = import ./sources.nix {
58
-    inherit (pkgs) stdenv fetchurl unzip;
59
-  };
60
-
61
-  androidsdk = import ./androidsdk.nix {
62
-    inherit (pkgs) stdenv fetchurl unzip makeWrapper zlib
63
-                   glxinfo freetype fontconfig glib gtk2 atk
64
-                   libGLU_combined file alsaLib jdk coreutils
65
-                   libpulseaudio dbus fetchzip;
66
-    inherit (pkgs.xorg) libX11 libXext libXrender
67
-                        libxcb libXau libXdmcp libXtst xkeyboardconfig;
68
-
69
-    inherit platformTools buildTools support
70
-            supportRepository platforms sysimages
71
-            addons sources includeSources licenseAccepted;
72
-
73
-    stdenv_32bit = pkgs_i686.stdenv;
74
-  };
75
-
76
-  androidsdk_2_1 = androidsdk {
77
-    platformVersions = [ "7" ];
78<