git.iko.soy/typeable/nixpkgs
on master help sign in
androidndk: Add Darwin support

Also switch Linux to using the official sha1 hashes for consistency. They are gotten from https://developer.android.com/ndk/downloads/.

commit67694371869eaa43933f47f5cbcb87024945a72d authorJohn Ericson <John.Ericson@Obsidian.Systems> dateMon 17 Sep 2018, 22:34 (8 years ago) parent8da28de
5 files changed+31−19
lib/systems/examples.nix+2−2 pkgs/development/mobile/androidenv/androidndk-pkgs.nix+3 pkgs/development/mobile/androidenv/androidndk.nix+6−6 pkgs/development/mobile/androidenv/default.nix+20−11 pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17.patch → pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17c.patch
lib/systems/examples.nix+2−2
@@ -48,7 +48,7 @@ rec {
4848 armv7a-android-prebuilt = rec {
4949 config = "armv7a-unknown-linux-androideabi";
5050 sdkVer = "24";
51− ndkVer = "17";
51+ ndkVer = "17c";
5252 platform = platforms.armv7a-android;
5353 useAndroidPrebuilt = true;
5454 };
@@ -56,7 +56,7 @@ rec {
5656 aarch64-android-prebuilt = rec {
5757 config = "aarch64-unknown-linux-android";
5858 sdkVer = "24";
59− ndkVer = "17";
59+ ndkVer = "17c";
6060 platform = platforms.aarch64-multiplatform;
6161 useAndroidPrebuilt = true;
6262 };
pkgs/development/mobile/androidenv/androidndk-pkgs.nix+3
@@ -12,6 +12,9 @@ let
1212 # than we do. We don't just use theirs because ours are less ambiguous and
1313 # some builds need that clarity.
1414 ndkInfoFun = { config, ... }: {
15+ "x86_64-apple-darwin" = {
16+ double = "darwin-x86_64";
17+ };
1518 "x86_64-unknown-linux-gnu" = {
1619 double = "linux-x86_64";
1720 };
pkgs/development/mobile/androidenv/androidndk.nix+6−6
@@ -1,6 +1,6 @@
11{ stdenv, fetchurl, zlib, ncurses5, unzip, lib, makeWrapper
22, coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which
3−, platformTools, python3, libcxx, version, sha256
3+, platformTools, python3, libcxx, version, sha1s
44, fullNDK ? false # set to true if you want other parts of the NDK
55 # that is not used by Nixpkgs like sources,
66 # examples, docs, or LLVM toolchains
@@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
1010 name = "android-ndk-r${version}";
1111 inherit version;
1212
13− src = if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl {
14− url = "https://dl.google.com/android/repository/${name}-linux-x86_64.zip";
15− inherit sha256;
16− } else throw "platform ${stdenv.hostPlatform.system} not supported!";
13+ src = fetchurl {
14+ url = "https://dl.google.com/android/repository/${name}-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}.zip";
15+ sha1 = sha1s.${stdenv.hostPlatform.system} or (throw "platform ${stdenv.hostPlatform.system} not supported!");
16+ };
1717
1818 phases = "buildPhase";
1919
@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
8989 '';
9090
9191 meta = {
92− platforms = stdenv.lib.platforms.linux;
92+ platforms = builtins.attrNames sha1s;
9393 hydraPlatforms = [];
9494 license = stdenv.lib.licenses.asl20;
9595 };
pkgs/development/mobile/androidenv/default.nix+20−11
@@ -232,7 +232,10 @@ rec {
232232 coreutils file findutils gawk gnugrep gnused jdk which;
233233 inherit platformTools;
234234 version = "10e";
235− sha256 = "032j3sgk93bjbkny84i17ph61dhjmsax9ddqng1zbi2p7dgl0pzf";
235+ sha1s = {
236+ x86_64-darwin = "6be8598e4ed3d9dd42998c8cb666f0ee502b1294";
237+ x86_64-linux = "f692681b007071103277f6edc6f91cb5c5494a32";
238+ };
236239 };
237240
238241 androidndk_16b = pkgs.callPackage ./androidndk.nix {
@@ -243,20 +246,26 @@ rec {
243246 coreutils file findutils gawk gnugrep gnused jdk which;
244247 inherit platformTools;
245248 version = "16b";
246− sha256 = "00frcnvpcsngv00p6l2vxj4cwi2mwcm9lnjvm3zv4wrp6pss9pmw";
249+ sha1s = {
250+ x86_64-darwin = "e51e615449b98c716cf912057e2682e75d55e2de";
251+ x86_64-linux = "42aa43aae89a50d1c66c3f9fdecd676936da6128";
252+ };
247253 };
248254
249− androidndk_17 = pkgs.callPackage ./androidndk.nix {
255+ androidndk_17c = pkgs.callPackage ./androidndk.nix {
250256 inherit (buildPackages)
251257 unzip makeWrapper;
252258 inherit (pkgs)
253259 stdenv fetchurl zlib ncurses5 lib python3 libcxx
254260 coreutils file findutils gawk gnugrep gnused jdk which;
255261 inherit platformTools;
256− version = "17";
257− sha256 = "1jj3zy958zsidywqd5nwdyrnr72rf9zhippkl8rbqxfy8wxq2gds";
262+ version = "17c";
263+ sha1s = {
264+ x86_64-darwin = "f97e3d7711497e3b4faf9e7b3fa0f0da90bb649c";
265+ x86_64-linux = "12cacc70c3fd2f40574015631c00f41fb8a39048";
266+ };
258267 };
259− androidndk = androidndk_17;
268+ androidndk = androidndk_17c;
260269
261270 androidndk_r8e = import ./androidndk_r8e.nix {
262271 inherit (buildPackages)
@@ -277,7 +286,7 @@ rec {
277286 inherit androidsdk;
278287 };
279288
280− androidndkPkgs_17 = import ./androidndk-pkgs.nix {
289+ androidndkPkgs_17c = import ./androidndk-pkgs.nix {
281290 inherit (buildPackages)
282291 makeWrapper;
283292 inherit (pkgs)
@@ -287,11 +296,11 @@ rec {
287296 # but for splicing messing up on infinite recursion for the variants we
288297 # *dont't* use. Using this workaround, but also making a test to ensure
289298 # these two really are the same.
290− buildAndroidndk = buildPackages.buildPackages.androidenv.androidndk_17;
291− androidndk = androidndk_17;
292− targetAndroidndkPkgs = targetPackages.androidenv.androidndkPkgs_17;
299+ buildAndroidndk = buildPackages.buildPackages.androidenv.androidndk_17c;
300+ androidndk = androidndk_17c;
301+ targetAndroidndkPkgs = targetPackages.androidenv.androidndkPkgs_17c;
293302 };
294− androidndkPkgs = androidndkPkgs_17;
303+ androidndkPkgs = androidndkPkgs_17c;
295304
296305 androidndkPkgs_10e = import ./androidndk-pkgs.nix {
297306 inherit (buildPackages)
pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17.patch → pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17c.patchrenamed

The content is the same.