2023-08-11 08:51:08 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
|
|
|
, python3
|
|
|
|
, ghostscript
|
|
|
|
, pdftk
|
|
|
|
, poppler_utils
|
2023-08-20 18:09:25 +02:00
|
|
|
, makeBinaryWrapper
|
2023-08-11 08:51:08 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
python-env = python3.withPackages (ps: with ps; [ tkinter ]);
|
2023-08-20 18:09:25 +02:00
|
|
|
binPath = lib.makeBinPath [ ghostscript pdftk poppler_utils ];
|
2023-08-11 08:51:08 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "pdf-sign";
|
|
|
|
version = "unstable-2023-08-08";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "svenssonaxel";
|
|
|
|
repo = "pdf-sign";
|
|
|
|
rev = "98742c6b12ebe2ca3ba375c695f43b52fe38b362";
|
|
|
|
hash = "sha256-5GRk0T1iLqmvWI8zvZE3OWEHPS0/zN/Ie9brjZiFpqc=";
|
|
|
|
};
|
|
|
|
|
2023-08-20 18:09:25 +02:00
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
2023-08-11 08:51:08 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2023-08-20 18:09:25 +02:00
|
|
|
mkdir -p $out
|
|
|
|
cp pdf-sign pdf-create-empty $out
|
|
|
|
|
|
|
|
makeWrapper ${python-env}/bin/python $out/bin/pdf-sign \
|
|
|
|
--add-flags $out/pdf-sign \
|
|
|
|
--prefix PATH : ${binPath}
|
|
|
|
makeWrapper ${python-env}/bin/python $out/bin/pdf-create-empty \
|
|
|
|
--add-flags $out/pdf-create-empty \
|
|
|
|
--prefix PATH : ${binPath}
|
2023-08-11 08:51:08 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A tool to visually sign PDF files";
|
|
|
|
homepage = "https://github.com/svenssonaxel/pdf-sign";
|
|
|
|
license = lib.licenses.mit;
|
2023-08-20 18:09:25 +02:00
|
|
|
mainProgram = "pdf-sign";
|
2023-08-11 08:51:08 +02:00
|
|
|
maintainers = with lib.maintainers; [ tomasajt ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|