android: add ndkVer to resolve ndk ambiguity

It wasn’t exactly clear which NDK you were using previously. This adds
an attribute to system that handles what version of the NDK we should
use when building things.

/cc @Ericson2314
This commit is contained in:
Matthew Bauer 2018-06-22 10:21:43 -04:00
parent cf09ffe9aa
commit c8fd285c8d
5 changed files with 14 additions and 9 deletions

View File

@ -31,7 +31,8 @@ rec {
armv5te-android-prebuilt = rec {
config = "armv5tel-unknown-linux-androideabi";
sdkVer = "24";
sdkVer = "21";
ndkVer = "10e";
platform = platforms.armv5te-android;
useAndroidPrebuilt = true;
};
@ -39,6 +40,7 @@ rec {
armv7a-android-prebuilt = rec {
config = "armv7a-unknown-linux-androideabi";
sdkVer = "24";
ndkVer = "17";
platform = platforms.armv7a-android;
useAndroidPrebuilt = true;
};
@ -46,6 +48,7 @@ rec {
aarch64-android-prebuilt = rec {
config = "aarch64-unknown-linux-android";
sdkVer = "24";
ndkVer = "17";
platform = platforms.aarch64-multiplatform;
useAndroidPrebuilt = true;
};

View File

@ -18,7 +18,7 @@ let
"armv5tel-unknown-linux-androideabi" = {
arch = "arm";
triple = "arm-linux-androideabi";
gccVer = "4.9";
gccVer = "4.8";
};
"armv7a-unknown-linux-androideabi" = {
arch = "arm";

View File

@ -246,7 +246,7 @@ rec {
sha256 = "00frcnvpcsngv00p6l2vxj4cwi2mwcm9lnjvm3zv4wrp6pss9pmw";
};
androidndk = import ./androidndk.nix {
androidndk_17 = import ./androidndk.nix {
inherit (buildPackages)
p7zip makeWrapper;
inherit (pkgs)
@ -256,6 +256,7 @@ rec {
version = "17";
sha256 = "1jj3zy958zsidywqd5nwdyrnr72rf9zhippkl8rbqxfy8wxq2gds";
};
androidndk = androidndk_17;
androidndk_r8e = import ./androidndk_r8e.nix {
inherit (buildPackages)
@ -276,7 +277,7 @@ rec {
inherit androidsdk;
};
androidndkPkgs = import ./androidndk-pkgs.nix {
androidndkPkgs_17 = import ./androidndk-pkgs.nix {
inherit (buildPackages)
makeWrapper;
inherit (pkgs)
@ -286,10 +287,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;
inherit androidndk;
targetAndroidndkPkgs = targetPackages.androidenv.androidndkPkgs;
buildAndroidndk = buildPackages.buildPackages.androidenv.androidndk_17;
androidndk = androidndk_17;
targetAndroidndkPkgs = targetPackages.androidenv.androidndkPkgs_17;
};
androidndkPkgs = androidndkPkgs_17;
androidndkPkgs_10e = import ./androidndk-pkgs.nix {
inherit (buildPackages)

View File

@ -42,7 +42,7 @@ in lib.init bootStages ++ [
cc = if crossSystem.useiOSPrebuilt or false
then buildPackages.darwin.iosSdkPkgs.clang
else if crossSystem.useAndroidPrebuilt
then buildPackages.androidenv.androidndkPkgs.gcc
then buildPackages.androidenv."androidndkPkgs_${crossSystem.ndkVer}".gcc
else buildPackages.gcc;
};
})

View File

@ -8695,7 +8695,7 @@ with pkgs;
# TODO(@Ericson2314): Build bionic libc from source
bionic = assert hostPlatform.useAndroidPrebuilt;
androidenv.androidndkPkgs.libraries;
androidenv."androidndkPkgs_${hostPlatform.ndkVer}".libraries;
bobcat = callPackage ../development/libraries/bobcat { };