13 ndkVersion: llvmPackages:
15 buildAndroidComposition = buildPackages.buildPackages.androidenv.composeAndroidPackages {
20 androidComposition = androidenv.composeAndroidPackages {
24 majorVersion = lib.versions.major ndkVersion;
26 import ./androidndk-pkgs.nix {
28 inherit (buildPackages)
39 # For hardeningUnsupportedFlagsByTargetPlatform
42 # buildPackages.foo rather than buildPackages.buildPackages.foo would work,
43 # but for splicing messing up on infinite recursion for the variants we
44 # *dont't* use. Using this workaround, but also making a test to ensure
45 # these two really are the same.
46 buildAndroidndk = buildAndroidComposition.ndk-bundle;
47 androidndk = androidComposition.ndk-bundle;
48 targetAndroidndkPkgs =
49 if targetPackages ? "androidndkPkgs_${majorVersion}" then
50 targetPackages."androidndkPkgs_${majorVersion}"
52 throw "androidndkPkgs_${majorVersion}: no targetPackages, use `buildPackages.androidndkPkgs_${majorVersion}";
57 "21" = makeNdkPkgs "21.0.6113669" pkgs.llvmPackages_14; # "9"
58 "23" = makeNdkPkgs "23.1.7779620" pkgs.llvmPackages_14; # "12"
59 # Versions below 24 use a version not available in nixpkgs/old version which could be removed in the near future so use 14 for them as this is only used to get the hardening flags.
60 "24" = makeNdkPkgs "24.0.8215888" pkgs.llvmPackages_14;
61 "25" = makeNdkPkgs "25.2.9519653" pkgs.llvmPackages_14;
62 "26" = makeNdkPkgs "26.3.11579264" pkgs.llvmPackages_17;