8 stdenvNoCC.mkDerivation rec {
10 version = "8.0.2-9289358";
15 if stdenvNoCC.isLinux then {
16 url = "https://dl.google.com/android/maven2/com/android/tools/build/aapt2/${version}/aapt2-${version}-linux.jar";
17 hash = "sha256-P8eVIS6zaZGPh4Z7SXUiLtZaX1YIsSmGOdvF6Xb1WHI=";
18 } else if stdenvNoCC.isDarwin then {
19 url = "https://dl.google.com/android/maven2/com/android/tools/build/aapt2/${version}/aapt2-${version}-osx.jar";
20 hash = "sha256-hDfEPk3IJt+8FbRVEiHQbn24vsuOe6m36UcQsT6tGsQ=";
21 } else throw "Unsupport platform: ${stdenvNoCC.system}";
23 fetchzip (urlAndHash // {
28 nativeBuildInputs = lib.optionals stdenvNoCC.isLinux [ autoPatchelfHook ];
29 buildInputs = lib.optionals stdenvNoCC.isLinux [ libcxx ];
34 install -D aapt2 $out/bin/aapt2
40 description = "A build tool that compiles and packages Android app's resources";
41 homepage = "https://developer.android.com/tools/aapt2";
42 license = lib.licenses.asl20;
43 maintainers = with lib.maintainers; [ linsui ];
44 platforms = lib.platforms.unix;
45 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];