From 0e5f82b847632cfd01122915ad9c57b2c65a2026 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 23 Apr 2018 20:37:27 +0200 Subject: [PATCH] pdf-quench: init at 1.0.5 --- pkgs/applications/misc/pdf-quench/default.nix | 36 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/applications/misc/pdf-quench/default.nix diff --git a/pkgs/applications/misc/pdf-quench/default.nix b/pkgs/applications/misc/pdf-quench/default.nix new file mode 100644 index 000000000000..5b80fb161224 --- /dev/null +++ b/pkgs/applications/misc/pdf-quench/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub, pkgs, pythonPackages, wrapGAppsHook}: + +pythonPackages.buildPythonApplication rec { + name = "pdf-quench-${version}"; + version = "1.0.5"; + + src = fetchFromGitHub { + owner = "linuxerwang"; + repo = "pdf-quench"; + rev = "b72b3970b371026f9a7ebe6003581e8a63af98f6"; + sha256 = "1rp9rlwr6rarcsxygv5x2c5psgwl6r69k0lsgribgyyla9cf2m7n"; + }; + + nativeBuildInputs = [ wrapGAppsHook ]; + buildInputs = with pkgs; [ gtk3 gobjectIntrospection goocanvas2 (poppler.override { introspectionSupport = true; }) ]; + propagatedBuildInputs = with pythonPackages; [ pygobject3 pypdf2 ]; + + dontBuild = true; + doCheck = false; + + postPatch = '' + substituteInPlace src/pdf_quench.py \ + --replace /usr/bin/python "${pythonPackages.python}/bin/python" + ''; + + installPhase = '' + install -D -T -m 755 src/pdf_quench.py $out/bin/pdf-quench + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/linuxerwang/pdf-quench; + description = "A visual tool for cropping pdf files"; + platforms = platforms.linux; + maintainers = with maintainers; [ flokli ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 35e320dc31fc..a45a6f2d04a2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4276,6 +4276,8 @@ with pkgs; pdfmod = callPackage ../applications/misc/pdfmod { }; + pdf-quench = callPackage ../applications/misc/pdf-quench { }; + jbig2enc = callPackage ../tools/graphics/jbig2enc { }; pdfread = callPackage ../tools/graphics/pdfread {