nixpkgs/pkgs/tools/misc/android-tools/default.nix
Samuel Tardieu 48ed94664e android-tools: 34.0.1 -> 34.0.4
The patch for linking with private `abseil-cpp` has been removed because
it is present in the upstream version already.

`ninja` has been added to the dependencies as building with `cmake`+`ninja`
is faster than with `cmake`+`make`.

The `-mod=vendor` go flag has been removed as the vendored version of
`boringssl` cannot be built as-is:

```
go: inconsistent vendoring in /build/android-tools-34.0.4/vendor/boringssl:
        golang.org/x/crypto@v0.6.0: is explicitly required in go.mod,
          but not marked as explicit in vendor/modules.txt
        golang.org/x/net@v0.7.0: is explicitly required in go.mod,
          but not marked as explicit in vendor/modules.txt
        golang.org/x/sys@v0.5.0: is explicitly required in go.mod,
          but not marked as explicit in vendor/modules.txt
        golang.org/x/term@v0.5.0: is explicitly required in go.mod,
          but not marked as explicit in vendor/modules.txt
```
2023-10-06 21:38:31 +02:00

52 lines
1.7 KiB
Nix

{ lib, stdenv, fetchurl
, cmake, ninja, pkg-config, perl, go, python3
, protobuf, zlib, gtest, brotli, lz4, zstd, libusb1, pcre2
}:
let
pythonEnv = python3.withPackages(ps: [ ps.protobuf ]);
in
stdenv.mkDerivation rec {
pname = "android-tools";
version = "34.0.4";
src = fetchurl {
url = "https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz";
hash = "sha256-eiL/nOqB/0849WBoeFjo+PtzNiRBJZfjzBqwJi+No6E=";
};
nativeBuildInputs = [ cmake ninja pkg-config perl go ];
buildInputs = [ protobuf zlib gtest brotli lz4 zstd libusb1 pcre2 ];
propagatedBuildInputs = [ pythonEnv ];
preConfigure = ''
export GOCACHE=$TMPDIR/go-cache
'';
meta = with lib; {
description = "Android SDK platform tools";
longDescription = ''
Android SDK Platform-Tools is a component for the Android SDK. It
includes tools that interface with the Android platform, such as adb and
fastboot. These tools are required for Android app development. They're
also needed if you want to unlock your device bootloader and flash it
with a new system image.
Currently the following tools are supported:
- adb
- fastboot
- mke2fs.android (required by fastboot)
- simg2img, img2simg, append2simg
- lpdump, lpmake, lpadd, lpflash, lpunpack
- mkbootimg, unpack_bootimg, repack_bootimg, avbtool
- mkdtboimg
'';
# https://developer.android.com/studio/command-line#tools-platform
# https://developer.android.com/studio/releases/platform-tools
homepage = "https://github.com/nmeum/android-tools";
license = with licenses; [ asl20 unicode-dfs-2015 ];
platforms = platforms.unix;
maintainers = with maintainers; [ primeos ];
};
}