2024-06-24 18:47:55 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, libjpeg
|
|
|
|
, perl
|
|
|
|
, zlib
|
|
|
|
|
|
|
|
# for passthru.tests
|
|
|
|
, cups-filters
|
|
|
|
, pdfmixtool
|
|
|
|
, pdfslicer
|
|
|
|
, python3
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "qpdf";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "11.9.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qpdf";
|
|
|
|
repo = "qpdf";
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-HD7+2TBDLBIt+VaPO5WgnDjNZOj8naltFmYdYzOIn+4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [ cmake perl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ zlib libjpeg ];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
preConfigure = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
patchShebangs qtest/bin/qtest-driver
|
2022-09-30 11:47:45 +00:00
|
|
|
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"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2024-06-24 18:47:55 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (python3.pkgs) pikepdf;
|
|
|
|
inherit
|
|
|
|
cups-filters
|
|
|
|
pdfmixtool
|
|
|
|
pdfslicer
|
|
|
|
;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2022-11-21 17:40:18 +00:00
|
|
|
homepage = "https://qpdf.sourceforge.io/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "C++ library and set of programs that inspect and manipulate the structure of PDF files";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20; # as of 7.0.0, people may stay at artistic2
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
platforms = platforms.all;
|
2022-11-21 17:40:18 +00:00
|
|
|
changelog = "https://github.com/qpdf/qpdf/blob/v${version}/ChangeLog";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|