1{ lib, stdenv, fetchFromGitHub, libjpeg, zlib, cmake, perl }:
2
3stdenv.mkDerivation rec {
4 pname = "qpdf";
5 version = "11.6.1";
6
7 src = fetchFromGitHub {
8 owner = "qpdf";
9 repo = "qpdf";
10 rev = "v${version}";
11 hash = "sha256-QXRzvSMi6gKISJo44KIjTYENNqxh1yDhUUhEZa8uz6Q=";
12 };
13
14 nativeBuildInputs = [ cmake perl ];
15
16 buildInputs = [ zlib libjpeg ];
17
18 preConfigure = ''
19 patchShebangs qtest/bin/qtest-driver
20 patchShebangs run-qtest
21 # qtest needs to know where the source code is
22 substituteInPlace CMakeLists.txt --replace "run-qtest" "run-qtest --top $src --code $src --bin $out"
23 '';
24
25 doCheck = true;
26
27 meta = with lib; {
28 homepage = "https://qpdf.sourceforge.io/";
29 description = "A C++ library and set of programs that inspect and manipulate the structure of PDF files";
30 license = licenses.asl20; # as of 7.0.0, people may stay at artistic2
31 maintainers = with maintainers; [ abbradar ];
32 platforms = platforms.all;
33 changelog = "https://github.com/qpdf/qpdf/blob/v${version}/ChangeLog";
34 };
35}