@@ -0,0 +1,46 @@
1+{ lib, stdenv, fetchurl
2+, cmake, perl, go
3+, protobuf, zlib, gtest, brotli, lz4, zstd, libusb1, pcre2
4+}:
5+
6+stdenv.mkDerivation rec {
7+ pname = "android-tools";
8+ version = "31.0.0p1";
9+
10+ src = fetchurl {
11+ url = "https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz";
12+ sha256 = "1dn7v10gdx1pi0pkddznd5sdz941qz0x4jww8h2mk50nbyxc792i";
13+ };
14+
15+ nativeBuildInputs = [ cmake perl go ];
16+ buildInputs = [ protobuf zlib gtest brotli lz4 zstd libusb1 pcre2 ];
17+
18+ # Don't try to fetch any Go modules via the network:
19+ GOFLAGS = [ "-mod=vendor" ];
20+
21+ preConfigure = ''
22+ export GOCACHE=$TMPDIR/go-cache
23+ '';
24+
25+ meta = with lib; {
26+ description = "Android SDK platform tools";
27+ longDescription = ''
28+ Android SDK Platform-Tools is a component for the Android SDK. It
29+ includes tools that interface with the Android platform, such as adb and
30+ fastboot. These tools are required for Android app development. They're
31+ also needed if you want to unlock your device bootloader and flash it
32+ with a new system image.
33+ Currently the following tools are supported:
34+ - adb
35+ - fastboot
36+ - mke2fs.android (required by fastboot)
37+ - simg2img, img2simg, append2simg
38+ '';
39+ # https://developer.android.com/studio/command-line#tools-platform
40+ # https://developer.android.com/studio/releases/platform-tools
41+ homepage = "https://github.com/nmeum/android-tools";
42+ license = with licenses; [ asl20 unicode-dfs-2015 ];
43+ platforms = platforms.linux;
44+ maintainers = with maintainers; [ primeos ];
45+ };
46+}