diff options
author | Damien Cassou <damien@cassou.me> | 2023-11-18 08:20:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-18 08:20:38 +0100 |
commit | ef355dde3c80e7ee30aa65aa5bf76e0b1b00bcc2 (patch) | |
tree | e69ba48b7d2ffd8c586eb6e538a515b15192dada /pkgs/by-name | |
parent | 457610539b37d4e529fe675f6c8261184cf7eb4d (diff) | |
parent | ccf16904afa1595729cfdd50c4027585a0bf994b (diff) |
Merge pull request #266336 from DamienCassou/signaturepdf
Diffstat (limited to 'pkgs/by-name')
-rw-r--r-- | pkgs/by-name/si/signaturepdf/package.nix | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/by-name/si/signaturepdf/package.nix b/pkgs/by-name/si/signaturepdf/package.nix new file mode 100644 index 0000000000000..be7c2fdd308be --- /dev/null +++ b/pkgs/by-name/si/signaturepdf/package.nix @@ -0,0 +1,58 @@ +{ lib +, stdenv +, fetchFromGitHub +, php +, makeWrapper +, imagemagick +, librsvg +, potrace +, pdftk +, ghostscript +}: + +stdenv.mkDerivation rec { + pname = "signaturepdf"; + version = "1.5.0"; + + src = fetchFromGitHub { + owner = "24eme"; + repo = "${pname}"; + rev = "v${version}"; + hash = "sha256-7yhvTxpjxHcmRxTE7avM+dN+yz9iVr8Ea/e2yfkBURA="; + }; + + nativeBuildInputs = [ makeWrapper ]; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/signaturepdf $out/bin + + cp --target-directory=$out/share/signaturepdf --recursive \ + app.php config locale public templates vendor + + makeWrapper ${lib.getExe php} $out/bin/signaturepdf \ + --inherit-argv0 \ + --chdir $out/share/signaturepdf \ + --prefix PATH : ${lib.makeBinPath [ imagemagick librsvg potrace pdftk ghostscript ]} \ + --run 'port=$1' \ + --run '[ $# -ge 1 ] || ( echo "Usage $0 <port> -d upload_max_filesize=24M -d post_max_size=24M -d max_file_uploads=201" >&2 && exit 1 )' \ + --run 'shift' \ + --run 'echo "You may now open a web browser on http://localhost:$port"' \ + --add-flags '-S "localhost:$port" -t public' + + runHook preInstall + ''; + + meta = with lib; { + description = "Web software for signing PDFs and also organize pages, edit metadata and compress pdf"; + homepage = "https://pdf.24eme.fr/"; + changelog = + "https://github.com/24eme/signaturepdf/releases/tag/v${version}"; + license = licenses.agpl3; + platforms = platforms.all; + maintainers = with maintainers; [ DamienCassou ]; + }; +} |