mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 09:43:14 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
45 lines
1.1 KiB
Nix
45 lines
1.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 ];
|
|
mainProgram = "payload_dumper";
|
|
};
|
|
})
|