depot/third_party/nixpkgs/pkgs/by-name/pk/pkcrack/package.nix
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

53 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchurl
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pkcrack";
version = "1.2.2";
src = fetchurl {
url = "https://www.unix-ag.uni-kl.de/~conrad/krypto/pkcrack/pkcrack-${finalAttrs.version}.tar.gz";
hash = "sha256-TS3Bk/+kNCrC7TpjEf33cK5qB3Eiaz70U9yo0D5DiVo=";
};
sourceRoot = "pkcrack-${finalAttrs.version}/src";
postPatch = ''
# malloc.h is not needed because stdlib.h is already included.
# On macOS, malloc.h does not even exist, resulting in an error.
substituteInPlace exfunc.c extract.c main.c readhead.c zipdecrypt.c \
--replace '#include <malloc.h>' ""
'';
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
install -D extract $out/bin/extract
install -D findkey $out/bin/findkey
install -D makekey $out/bin/makekey
install -D pkcrack $out/bin/pkcrack
install -D zipdecrypt $out/bin/zipdecrypt
mkdir -p $out/share/doc
cp -R ../doc/ $out/share/doc/pkcrack
runHook postInstall
'';
meta = with lib; {
description = "Breaking PkZip-encryption";
homepage = "https://www.unix-ag.uni-kl.de/~conrad/krypto/pkcrack.html";
license = {
fullName = "PkCrack Non Commercial License";
url = "https://www.unix-ag.uni-kl.de/~conrad/krypto/pkcrack/pkcrack-readme.html";
free = false;
};
maintainers = with maintainers; [ emilytrau ];
platforms = platforms.all;
mainProgram = "pkcrack";
};
})