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 mainProgram = "aapt2";
42 homepage = "https://developer.android.com/tools/aapt2";
43 license = lib.licenses.asl20;
44 maintainers = with lib.maintainers; [ linsui ];
45 platforms = lib.platforms.unix;
46 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];