Merge pull request #136174 from musfay/android-tools-avb

android-tools: install missing tools

authored by Michael Weiss and committed by GitHub dc47a7be 912565a7

+16 -1
+16 -1
pkgs/tools/misc/android-tools/default.nix
··· 1 { lib, stdenv, fetchurl, fetchpatch 2 - , cmake, perl, go 3 , protobuf, zlib, gtest, brotli, lz4, zstd, libusb1, pcre2, fmt_7 4 }: 5 6 stdenv.mkDerivation rec { 7 pname = "android-tools"; ··· 23 }) 24 ]; 25 26 nativeBuildInputs = [ cmake perl go ]; 27 buildInputs = [ protobuf zlib gtest brotli lz4 zstd libusb1 pcre2 fmt_7 ]; 28 29 # Don't try to fetch any Go modules via the network: 30 GOFLAGS = [ "-mod=vendor" ]; 31 32 preConfigure = '' 33 export GOCACHE=$TMPDIR/go-cache 34 ''; 35 36 meta = with lib; {
··· 1 { lib, stdenv, fetchurl, fetchpatch 2 + , cmake, perl, go, python3 3 , protobuf, zlib, gtest, brotli, lz4, zstd, libusb1, pcre2, fmt_7 4 }: 5 + 6 + let 7 + pythonEnv = python3.withPackages(ps: [ ps.protobuf ]); 8 + in 9 10 stdenv.mkDerivation rec { 11 pname = "android-tools"; ··· 27 }) 28 ]; 29 30 + postPatch = '' 31 + sed -i -E "0,/import api_pb2/ s//from google.protobuf import api_pb2/" vendor/avb/aftltool.py 32 + ''; 33 + 34 nativeBuildInputs = [ cmake perl go ]; 35 buildInputs = [ protobuf zlib gtest brotli lz4 zstd libusb1 pcre2 fmt_7 ]; 36 + propagatedBuildInputs = [ pythonEnv ]; 37 38 # Don't try to fetch any Go modules via the network: 39 GOFLAGS = [ "-mod=vendor" ]; 40 41 preConfigure = '' 42 export GOCACHE=$TMPDIR/go-cache 43 + ''; 44 + 45 + postInstall = '' 46 + install -Dm755 ../vendor/avb/aftltool.py -t $out/bin 47 + install -Dm755 ../vendor/avb/avbtool.py -t $out/bin 48 + install -Dm755 ../vendor/mkbootimg/mkbootimg.py $out/bin/mkbootimg 49 ''; 50 51 meta = with lib; {