2024-07-27 06:49:29 +00:00
{ lib , androidenv , buildPackages , pkgs , targetPackages , androidndkPkgs_23 , config
2020-04-24 23:36:52 +00:00
} :
2024-06-24 18:47:55 +00:00
let
2024-07-27 06:49:29 +00:00
makeNdkPkgs = ndkVersion : llvmPackages :
2020-04-24 23:36:52 +00:00
let
2020-09-25 04:45:31 +00:00
buildAndroidComposition = buildPackages . buildPackages . androidenv . composeAndroidPackages {
includeNDK = true ;
inherit ndkVersion ;
} ;
androidComposition = androidenv . composeAndroidPackages {
includeNDK = true ;
inherit ndkVersion ;
} ;
2024-06-24 18:47:55 +00:00
majorVersion = lib . versions . major ndkVersion ;
2020-09-25 04:45:31 +00:00
in
import ./androidndk-pkgs.nix {
2021-02-05 17:12:51 +00:00
inherit lib ;
2020-09-25 04:45:31 +00:00
inherit ( buildPackages )
2022-07-18 16:21:45 +00:00
makeWrapper autoPatchelfHook ;
2020-09-25 04:45:31 +00:00
inherit ( pkgs )
stdenv
runCommand wrapBintoolsWith wrapCCWith ;
2024-07-27 06:49:29 +00:00
# For hardeningUnsupportedFlagsByTargetPlatform
inherit llvmPackages ;
2020-09-25 04:45:31 +00:00
# buildPackages.foo rather than buildPackages.buildPackages.foo would work,
# 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 = buildAndroidComposition . ndk-bundle ;
androidndk = androidComposition . ndk-bundle ;
2024-06-24 18:47:55 +00:00
targetAndroidndkPkgs = if targetPackages ? " a n d r o i d n d k P k g s _ ${ majorVersion } " then targetPackages . " a n d r o i d n d k P k g s _ ${ majorVersion } " else throw " a n d r o i d n d k P k g s _ ${ majorVersion } : n o t a r g e t P a c k a g e s , u s e ` b u i l d P a c k a g e s . a n d r o i d n d k P k g s _ ${ majorVersion } " ;
2020-09-25 04:45:31 +00:00
} ;
2024-06-24 18:47:55 +00:00
in
2020-09-25 04:45:31 +00:00
2024-06-24 18:47:55 +00:00
{
2024-07-27 06:49:29 +00:00
" 2 1 " = makeNdkPkgs " 2 1 . 0 . 6 1 1 3 6 6 9 " pkgs . llvmPackages_14 ; # "9"
" 2 3 " = makeNdkPkgs " 2 3 . 1 . 7 7 7 9 6 2 0 " pkgs . llvmPackages_14 ; # "12"
# 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.
" 2 4 " = makeNdkPkgs " 2 4 . 0 . 8 2 1 5 8 8 8 " pkgs . llvmPackages_14 ;
" 2 5 " = makeNdkPkgs " 2 5 . 2 . 9 5 1 9 6 5 3 " pkgs . llvmPackages_14 ;
" 2 6 " = makeNdkPkgs " 2 6 . 3 . 1 1 5 7 9 2 6 4 " pkgs . llvmPackages_17 ;
2020-04-24 23:36:52 +00:00
}