Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 fetchzip,
4 python3,
5 python3Packages,
6 makeBinaryWrapper,
7}:
8
9python3Packages.buildPythonApplication rec {
10 pname = "pdfid";
11 version = "0.2.10";
12 format = "other";
13
14 src = fetchzip {
15 url = "https://didierstevens.com/files/software/pdfid_v${
16 builtins.replaceStrings [ "." ] [ "_" ] version
17 }.zip";
18 hash = "sha256-GxQOwIwCVaKEruFO+kxXciOiFcXtBO0vvCwb6683lGU=";
19 stripRoot = false;
20 };
21
22 nativeBuildInputs = [
23 makeBinaryWrapper
24 ];
25
26 installPhase = ''
27 runHook preInstall
28 mkdir -p $out/{bin,share/pdfid}
29 cp -a * $out/share/pdfid/
30 makeWrapper ${lib.getExe python3} $out/bin/pdfid \
31 --prefix PYTHONPATH : "$PYTHONPATH" \
32 --add-flags "$out/share/pdfid/pdfid.py"
33 runHook postInstall
34 '';
35
36 meta = with lib; {
37 description = "Scan a file to look for certain PDF keywords";
38 homepage = "https://blog.didierstevens.com/programs/pdf-tools/";
39 license = with licenses; [ free ];
40 mainProgram = "pdfid";
41 maintainers = with maintainers; [ d3vil0p3r ];
42 platforms = platforms.unix;
43 };
44}