1{
2 lib,
3 stdenv,
4 fetchurl,
5 cmake,
6 ninja,
7 pkg-config,
8 perl,
9 go,
10 python3,
11 protobuf_29, # does not build with 30+
12 zlib,
13 gtest,
14 brotli,
15 lz4,
16 zstd,
17 libusb1,
18 pcre2,
19}:
20
21let
22 pythonEnv = python3.withPackages (ps: [ ps.protobuf ]);
23in
24
25stdenv.mkDerivation rec {
26 pname = "android-tools";
27 version = "35.0.1";
28
29 src = fetchurl {
30 url = "https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz";
31 hash = "sha256-ZUAwx/ltJdciTNaGH6wUoEPPHTmA9AKIzfviGflP+vk=";
32 };
33
34 nativeBuildInputs = [
35 cmake
36 ninja
37 pkg-config
38 perl
39 go
40 ];
41 buildInputs = [
42 protobuf_29
43 zlib
44 gtest
45 brotli
46 lz4
47 zstd
48 libusb1
49 pcre2
50 ];
51 propagatedBuildInputs = [ pythonEnv ];
52
53 preConfigure = ''
54 export GOCACHE=$TMPDIR/go-cache
55 '';
56
57 meta = with lib; {
58 description = "Android SDK platform tools";
59 longDescription = ''
60 Android SDK Platform-Tools is a component for the Android SDK. It
61 includes tools that interface with the Android platform, such as adb and
62 fastboot. These tools are required for Android app development. They're
63 also needed if you want to unlock your device bootloader and flash it
64 with a new system image.
65 Currently the following tools are supported:
66 - adb
67 - fastboot
68 - mke2fs.android (required by fastboot)
69 - simg2img, img2simg, append2simg
70 - lpdump, lpmake, lpadd, lpflash, lpunpack
71 - mkbootimg, unpack_bootimg, repack_bootimg, avbtool
72 - mkdtboimg
73 '';
74 # https://developer.android.com/studio/command-line#tools-platform
75 # https://developer.android.com/studio/releases/platform-tools
76 homepage = "https://github.com/nmeum/android-tools";
77 license = with licenses; [
78 asl20
79 unicode-dfs-2015
80 ];
81 platforms = platforms.unix;
82 maintainers = with maintainers; [ ];
83 teams = [ teams.android ];
84 };
85}