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.
77 lines
1.8 KiB
Nix
77 lines
1.8 KiB
Nix
{ lib
|
|
, apksigner
|
|
, bash
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, pandoc
|
|
, python3
|
|
}:
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
pname = "apksigcopier";
|
|
version = "1.1.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "obfusk";
|
|
repo = "apksigcopier";
|
|
rev = "refs/tags/v${version}";
|
|
sha256 = "sha256-VuwSaoTv5qq1jKwgBTKd1y9RKUzz89n86Z4UBv7Q51o=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
pandoc
|
|
];
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
click
|
|
];
|
|
|
|
makeWrapperArgs = [
|
|
"--prefix"
|
|
"PATH"
|
|
":"
|
|
"${lib.makeBinPath [ apksigner ]}"
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace Makefile \
|
|
--replace /bin/bash ${bash}/bin/bash
|
|
'';
|
|
|
|
postBuild = ''
|
|
make ${pname}.1
|
|
'';
|
|
|
|
postInstall = ''
|
|
installManPage ${pname}.1
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
runHook preInstallCheck
|
|
$out/bin/apksigcopier --version | grep "${version}"
|
|
runHook postInstallCheck
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Copy/extract/patch android apk signatures & compare APKs";
|
|
mainProgram = "apksigcopier";
|
|
longDescription = ''
|
|
apksigcopier is a tool for copying android APK signatures from a signed
|
|
APK to an unsigned one (in order to verify reproducible builds).
|
|
It can also be used to compare two APKs with different signatures.
|
|
Its command-line tool offers four operations:
|
|
|
|
* copy signatures directly from a signed to an unsigned APK
|
|
* extract signatures from a signed APK to a directory
|
|
* patch previously extracted signatures onto an unsigned APK
|
|
* compare two APKs with different signatures (requires apksigner)
|
|
'';
|
|
homepage = "https://github.com/obfusk/apksigcopier";
|
|
license = with licenses; [ gpl3Plus ];
|
|
maintainers = with maintainers; [ obfusk ];
|
|
};
|
|
}
|