1{ lib, stdenv, fetchurl
2, cmake, ninja, pkg-config, perl, go, python3
3, protobuf, zlib, gtest, brotli, lz4, zstd, libusb1, pcre2
4}:
5
6let
7 pythonEnv = python3.withPackages(ps: [ ps.protobuf ]);
8in
9
10stdenv.mkDerivation rec {
11 pname = "android-tools";
12 version = "34.0.4";
13
14 src = fetchurl {
15 url = "https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz";
16 hash = "sha256-eiL/nOqB/0849WBoeFjo+PtzNiRBJZfjzBqwJi+No6E=";
17 };
18
19 nativeBuildInputs = [ cmake ninja pkg-config perl go ];
20 buildInputs = [ protobuf zlib gtest brotli lz4 zstd libusb1 pcre2 ];
21 propagatedBuildInputs = [ pythonEnv ];
22
23 preConfigure = ''
24 export GOCACHE=$TMPDIR/go-cache
25 '';
26
27 meta = with lib; {
28 description = "Android SDK platform tools";
29 longDescription = ''
30 Android SDK Platform-Tools is a component for the Android SDK. It
31 includes tools that interface with the Android platform, such as adb and
32 fastboot. These tools are required for Android app development. They're
33 also needed if you want to unlock your device bootloader and flash it
34 with a new system image.
35 Currently the following tools are supported:
36 - adb
37 - fastboot
38 - mke2fs.android (required by fastboot)
39 - simg2img, img2simg, append2simg
40 - lpdump, lpmake, lpadd, lpflash, lpunpack
41 - mkbootimg, unpack_bootimg, repack_bootimg, avbtool
42 - mkdtboimg
43 '';
44 # https://developer.android.com/studio/command-line#tools-platform
45 # https://developer.android.com/studio/releases/platform-tools
46 homepage = "https://github.com/nmeum/android-tools";
47 license = with licenses; [ asl20 unicode-dfs-2015 ];
48 platforms = platforms.unix;
49 maintainers = with maintainers; [ primeos ];
50 };
51}