about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qpdf
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qpdf')
-rw-r--r--nixpkgs/pkgs/development/libraries/qpdf/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qpdf/default.nix b/nixpkgs/pkgs/development/libraries/qpdf/default.nix
new file mode 100644
index 000000000000..d80309f2b16b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qpdf/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, libjpeg, zlib, cmake, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "qpdf";
+  version = "11.6.1";
+
+  src = fetchFromGitHub {
+    owner = "qpdf";
+    repo = "qpdf";
+    rev = "v${version}";
+    hash = "sha256-QXRzvSMi6gKISJo44KIjTYENNqxh1yDhUUhEZa8uz6Q=";
+  };
+
+  nativeBuildInputs = [ cmake perl ];
+
+  buildInputs = [ zlib libjpeg ];
+
+  preConfigure = ''
+    patchShebangs qtest/bin/qtest-driver
+    patchShebangs run-qtest
+    # qtest needs to know where the source code is
+    substituteInPlace CMakeLists.txt --replace "run-qtest" "run-qtest --top $src --code $src --bin $out"
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://qpdf.sourceforge.io/";
+    description = "A C++ library and set of programs that inspect and manipulate the structure of PDF files";
+    license = licenses.asl20; # as of 7.0.0, people may stay at artistic2
+    maintainers = with maintainers; [ abbradar ];
+    platforms = platforms.all;
+    changelog = "https://github.com/qpdf/qpdf/blob/v${version}/ChangeLog";
+  };
+}