summary refs log tree commit diff
path: root/pkgs/development/mobile/androidenv
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-09-17 22:34:37 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-09-17 22:34:37 -0400
commit67694371869eaa43933f47f5cbcb87024945a72d (patch)
treeca2fc7678901677e4e3b7849df63a1cfece2ceab /pkgs/development/mobile/androidenv
parent8da28de0e8c62c51def43d224d64f58946fabb05 (diff)
downloadnixpkgs-67694371869eaa43933f47f5cbcb87024945a72d.tar
nixpkgs-67694371869eaa43933f47f5cbcb87024945a72d.tar.gz
nixpkgs-67694371869eaa43933f47f5cbcb87024945a72d.tar.bz2
nixpkgs-67694371869eaa43933f47f5cbcb87024945a72d.tar.lz
nixpkgs-67694371869eaa43933f47f5cbcb87024945a72d.tar.xz
nixpkgs-67694371869eaa43933f47f5cbcb87024945a72d.tar.zst
nixpkgs-67694371869eaa43933f47f5cbcb87024945a72d.zip
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/.
Diffstat (limited to 'pkgs/development/mobile/androidenv')
-rw-r--r--pkgs/development/mobile/androidenv/androidndk-pkgs.nix3
-rw-r--r--pkgs/development/mobile/androidenv/androidndk.nix12
-rw-r--r--pkgs/development/mobile/androidenv/default.nix31
-rw-r--r--pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17c.patch (renamed from pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17.patch)0
4 files changed, 29 insertions, 17 deletions
diff --git a/pkgs/development/mobile/androidenv/androidndk-pkgs.nix b/pkgs/development/mobile/androidenv/androidndk-pkgs.nix
index 9bc252ce6f6..d4189fe8455 100644
--- a/pkgs/development/mobile/androidenv/androidndk-pkgs.nix
+++ b/pkgs/development/mobile/androidenv/androidndk-pkgs.nix
@@ -12,6 +12,9 @@ let
   # than we do. We don't just use theirs because ours are less ambiguous and
   # some builds need that clarity.
   ndkInfoFun = { config, ... }: {
+    "x86_64-apple-darwin" = {
+      double = "darwin-x86_64";
+    };
     "x86_64-unknown-linux-gnu" = {
       double = "linux-x86_64";
     };
diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix
index 3ccdb237f89..78995f3155b 100644
--- a/pkgs/development/mobile/androidenv/androidndk.nix
+++ b/pkgs/development/mobile/androidenv/androidndk.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, zlib, ncurses5, unzip, lib, makeWrapper
 , coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which
-, platformTools, python3, libcxx, version, sha256
+, platformTools, python3, libcxx, version, sha1s
 , fullNDK ? false # set to true if you want other parts of the NDK
                   # that is not used by Nixpkgs like sources,
                   # examples, docs, or LLVM toolchains
@@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
   name = "android-ndk-r${version}";
   inherit version;
 
-  src = if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl {
-      url = "https://dl.google.com/android/repository/${name}-linux-x86_64.zip";
-      inherit sha256;
-    } else throw "platform ${stdenv.hostPlatform.system} not supported!";
+  src = fetchurl {
+    url = "https://dl.google.com/android/repository/${name}-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}.zip";
+    sha1 = sha1s.${stdenv.hostPlatform.system} or (throw "platform ${stdenv.hostPlatform.system} not supported!");
+  };
 
   phases = "buildPhase";
 
@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    platforms = stdenv.lib.platforms.linux;
+    platforms = builtins.attrNames sha1s;
     hydraPlatforms = [];
     license = stdenv.lib.licenses.asl20;
   };
diff --git a/pkgs/development/mobile/androidenv/default.nix b/pkgs/development/mobile/androidenv/default.nix
index 8e108f24088..1f61be9440b 100644
--- a/pkgs/development/mobile/androidenv/default.nix
+++ b/pkgs/development/mobile/androidenv/default.nix
@@ -232,7 +232,10 @@ rec {
       coreutils file findutils gawk gnugrep gnused jdk which;
     inherit platformTools;
     version = "10e";
-    sha256 = "032j3sgk93bjbkny84i17ph61dhjmsax9ddqng1zbi2p7dgl0pzf";
+    sha1s = {
+      x86_64-darwin = "6be8598e4ed3d9dd42998c8cb666f0ee502b1294";
+      x86_64-linux = "f692681b007071103277f6edc6f91cb5c5494a32";
+    };
   };
 
   androidndk_16b = pkgs.callPackage ./androidndk.nix {
@@ -243,20 +246,26 @@ rec {
       coreutils file findutils gawk gnugrep gnused jdk which;
     inherit platformTools;
     version = "16b";
-    sha256 = "00frcnvpcsngv00p6l2vxj4cwi2mwcm9lnjvm3zv4wrp6pss9pmw";
+    sha1s = {
+      x86_64-darwin = "e51e615449b98c716cf912057e2682e75d55e2de";
+      x86_64-linux = "42aa43aae89a50d1c66c3f9fdecd676936da6128";
+    };
   };
 
-  androidndk_17 = pkgs.callPackage ./androidndk.nix {
+  androidndk_17c = pkgs.callPackage ./androidndk.nix {
     inherit (buildPackages)
       unzip makeWrapper;
     inherit (pkgs)
       stdenv fetchurl zlib ncurses5 lib python3 libcxx
       coreutils file findutils gawk gnugrep gnused jdk which;
     inherit platformTools;
-    version = "17";
-    sha256 = "1jj3zy958zsidywqd5nwdyrnr72rf9zhippkl8rbqxfy8wxq2gds";
+    version = "17c";
+    sha1s = {
+      x86_64-darwin = "f97e3d7711497e3b4faf9e7b3fa0f0da90bb649c";
+      x86_64-linux = "12cacc70c3fd2f40574015631c00f41fb8a39048";
+    };
   };
-  androidndk = androidndk_17;
+  androidndk = androidndk_17c;
 
   androidndk_r8e = import ./androidndk_r8e.nix {
     inherit (buildPackages)
@@ -277,7 +286,7 @@ rec {
     inherit androidsdk;
   };
 
-  androidndkPkgs_17 = import ./androidndk-pkgs.nix {
+  androidndkPkgs_17c = import ./androidndk-pkgs.nix {
     inherit (buildPackages)
       makeWrapper;
     inherit (pkgs)
@@ -287,11 +296,11 @@ rec {
     # but for splicing messing up on infinite recursion for the variants we
     # *dont't* use. Using this workaround, but also making a test to ensure
     # these two really are the same.
-    buildAndroidndk = buildPackages.buildPackages.androidenv.androidndk_17;
-    androidndk = androidndk_17;
-    targetAndroidndkPkgs = targetPackages.androidenv.androidndkPkgs_17;
+    buildAndroidndk = buildPackages.buildPackages.androidenv.androidndk_17c;
+    androidndk = androidndk_17c;
+    targetAndroidndkPkgs = targetPackages.androidenv.androidndkPkgs_17c;
   };
-  androidndkPkgs = androidndkPkgs_17;
+  androidndkPkgs = androidndkPkgs_17c;
 
   androidndkPkgs_10e = import ./androidndk-pkgs.nix {
     inherit (buildPackages)
diff --git a/pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17.patch b/pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17c.patch
index 88ce69be3e8..88ce69be3e8 100644
--- a/pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17.patch
+++ b/pkgs/development/mobile/androidenv/make_standalone_toolchain.py_17c.patch