2022-01-09 01:46:50 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, isPy27
|
|
|
|
, fetchPypi
|
2022-02-04 11:48:06 +00:00
|
|
|
, fetchpatch
|
2022-01-09 01:46:50 +00:00
|
|
|
, pikepdf
|
|
|
|
, pillow
|
2022-01-10 05:22:26 +00:00
|
|
|
, stdenv
|
2022-01-09 01:46:50 +00:00
|
|
|
, exiftool
|
|
|
|
, ghostscript
|
|
|
|
, imagemagick
|
|
|
|
, mupdf
|
|
|
|
, netpbm
|
|
|
|
, numpy
|
|
|
|
, poppler_utils
|
|
|
|
, pytestCheckHook
|
|
|
|
, scipy
|
|
|
|
}:
|
2018-08-09 21:13:39 +00:00
|
|
|
|
2020-07-16 12:00:00 +00:00
|
|
|
buildPythonPackage rec {
|
2018-08-09 21:13:39 +00:00
|
|
|
pname = "img2pdf";
|
2021-10-27 18:18:37 +00:00
|
|
|
version = "0.4.3";
|
2020-07-16 12:00:00 +00:00
|
|
|
disabled = isPy27;
|
2018-08-09 21:13:39 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-10-27 18:18:37 +00:00
|
|
|
sha256 = "sha256-jlHFBD76lddRSBtRYHGgBvh8KkBZlhqaxD7COJFd4J8=";
|
2018-08-09 21:13:39 +00:00
|
|
|
};
|
|
|
|
|
2022-02-04 11:48:06 +00:00
|
|
|
patches = [
|
|
|
|
# Disable tests broken by Pillow 9.0.0
|
|
|
|
# https://gitlab.mister-muffin.de/josch/img2pdf/issues/130#issuecomment-586
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://salsa.debian.org/debian/img2pdf/-/raw/f77fefc81e7c4b235c47ae6777d222d391c59536/debian/patches/pillow9";
|
|
|
|
sha256 = "sha256-8giZCuv5PzSbrBQqslNqiLOhgxbg3LsdBVwt+DWnvh4=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-08-09 21:13:39 +00:00
|
|
|
propagatedBuildInputs = [
|
2020-08-17 04:39:53 +00:00
|
|
|
pikepdf
|
2018-08-09 21:13:39 +00:00
|
|
|
pillow
|
|
|
|
];
|
|
|
|
|
2022-01-10 05:22:26 +00:00
|
|
|
# https://gitlab.mister-muffin.de/josch/img2pdf/issues/128
|
|
|
|
doCheck = !stdenv.isAarch64;
|
|
|
|
|
2022-01-09 01:46:50 +00:00
|
|
|
checkInputs = [
|
|
|
|
exiftool
|
|
|
|
ghostscript
|
|
|
|
imagemagick
|
|
|
|
mupdf
|
|
|
|
netpbm
|
|
|
|
numpy
|
|
|
|
poppler_utils
|
|
|
|
pytestCheckHook
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export img2pdfprog="$out/bin/img2pdf"
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_tiff_rgb"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "img2pdf" ];
|
2021-02-12 19:02:02 +00:00
|
|
|
|
2020-07-16 12:00:00 +00:00
|
|
|
meta = with lib; {
|
2018-08-09 21:13:39 +00:00
|
|
|
description = "Convert images to PDF via direct JPEG inclusion";
|
2020-04-09 20:25:11 +00:00
|
|
|
homepage = "https://gitlab.mister-muffin.de/josch/img2pdf";
|
2018-08-09 21:13:39 +00:00
|
|
|
license = licenses.lgpl2;
|
2022-01-09 01:46:50 +00:00
|
|
|
maintainers = with maintainers; [ veprbl dotlambda ];
|
2018-08-09 21:13:39 +00:00
|
|
|
};
|
|
|
|
}
|