depot/third_party/nixpkgs/pkgs/tools/archivers/payload_dumper/default.nix
Default email 92b3d6365d Project import generated by Copybara.
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
2022-10-30 16:09:59 +01:00

43 lines
1 KiB
Nix

{ lib
, stdenv
, makeWrapper
, python3
, fetchFromGitHub
}:
stdenv.mkDerivation (finalAttrs: {
pname = "payload_dumper";
version = "unstable-2022-04-11";
src = fetchFromGitHub {
owner = "vm03";
repo = "payload_dumper";
rev = "c1eb5dbbc7bd88ac94635ae90ec22ccf92f89881";
sha256 = "1j1hbh5vqq33wq2b9gqvm1qs9nl0bmqklbnyyyhwkcha7zxn0aki";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = with python3.pkgs; [ bsdiff4 protobuf ];
installPhase = ''
runHook preInstall
sitePackages=$out/${python3.sitePackages}/${finalAttrs.pname}
install -D ./payload_dumper.py $out/bin/payload_dumper
install -D ./update_metadata_pb2.py $sitePackages/update_metadata_pb2.py
wrapProgram $out/bin/payload_dumper \
--set PYTHONPATH "$sitePackages:$PYTHONPATH"
runHook postInstall
'';
meta = with lib; {
homepage = finalAttrs.src.meta.homepage;
description = "Android OTA payload dumper";
license = licenses.gpl3;
maintainers = with maintainers; [ DamienCassou ];
};
})