summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media-gfx/img2pdf/Manifest1
-rw-r--r--media-gfx/img2pdf/files/img2pdf-0.4.3-test-gif-animation.patch13
-rw-r--r--media-gfx/img2pdf/img2pdf-0.4.3.ebuild60
3 files changed, 74 insertions, 0 deletions
diff --git a/media-gfx/img2pdf/Manifest b/media-gfx/img2pdf/Manifest
index bc68121b738..508fb8f29dc 100644
--- a/media-gfx/img2pdf/Manifest
+++ b/media-gfx/img2pdf/Manifest
@@ -1,2 +1,3 @@
DIST img2pdf-0.4.1-imagemagick-7-tests.patch.gz 2586 BLAKE2B 3d905b22c02fadf69e6329001cf7d6562d5809ba27842a5e630d87054979d953b641afb0b461f37bc9e379af808d0dc9e95478bdd5143047ea19d13d38e04593 SHA512 c9c5e88aea344a17bb57ff6b4540d7010537df0987cd3884e36220236753a42a71377468b556c17090ba22497a50c7d9365373aaeb007b75240ad55d21e9032a
DIST img2pdf-0.4.1.tar.gz 96699 BLAKE2B f5a41a3a3d1b1ae7caadab4f37df644ad28a3ef4bd7a56a339253f0aead4d2427f05373dcfd16b10d82a6167243b3b03906e9f95b7ae0dcdbea6a666905c45a2 SHA512 e71833250509d52b8782a8bc9e12a8de6ab7ae06d5e6e235c0b3787bfad1070b5ed90934b21e4decc9b2c7008eeb0424f9df27e44ec66259916d3a2fdb73d1f1
+DIST img2pdf-0.4.3.tar.gz 98656 BLAKE2B ec7be83fa7fc38f94c7770a2566a49a39e5fd0abb715de74fc3f65d59087cecdd009f4284e647facaf6ae019a118b4bedf7ce8d4a09b8479a299c8404a8940d5 SHA512 00755788c7380e44733c5a309428894b6689e93d4d7cca8f84681d12977848971a6b1a7c92c7203258a529894e7a0debb5beaeb6b375de769a0d600ea8d65423
diff --git a/media-gfx/img2pdf/files/img2pdf-0.4.3-test-gif-animation.patch b/media-gfx/img2pdf/files/img2pdf-0.4.3-test-gif-animation.patch
new file mode 100644
index 00000000000..459746455c9
--- /dev/null
+++ b/media-gfx/img2pdf/files/img2pdf-0.4.3-test-gif-animation.patch
@@ -0,0 +1,13 @@
+diff -r -U2 img2pdf-0.4.3.orig/src/img2pdf_test.py img2pdf-0.4.3/src/img2pdf_test.py
+--- img2pdf-0.4.3.orig/src/img2pdf_test.py 2021-10-24 20:46:53.000000000 +0700
++++ img2pdf-0.4.3/src/img2pdf_test.py 2022-02-08 23:20:27.584463297 +0700
+@@ -5613,8 +5613,5 @@
+
+
+-@pytest.mark.skipif(
+- sys.platform in ["win32"],
+- reason="test utilities not available on Windows and MacOS",
+-)
++@pytest.mark.skip(reason="gif animation test fails")
+ def test_gif_animation(tmp_path_factory, gif_animation_img, gif_animation_pdf):
+ tmpdir = tmp_path_factory.mktemp("gif_animation")
diff --git a/media-gfx/img2pdf/img2pdf-0.4.3.ebuild b/media-gfx/img2pdf/img2pdf-0.4.3.ebuild
new file mode 100644
index 00000000000..7900354a977
--- /dev/null
+++ b/media-gfx/img2pdf/img2pdf-0.4.3.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit distutils-r1
+
+DESCRIPTION="Losslessly convert raster images to PDF"
+HOMEPAGE="https://gitlab.mister-muffin.de/josch/img2pdf"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="gui"
+
+# pytest-xdist isn't really required but it helps speed up tests
+BDEPEND="
+ test? (
+ app-text/ghostscript-gpl
+ app-text/mupdf
+ app-text/poppler[cairo,png,tiff]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pdfrw[${PYTHON_USEDEP}]
+ dev-python/pillow[tiff,${PYTHON_USEDEP}]
+ dev-python/pytest-xdist[${PYTHON_USEDEP}]
+ dev-python/scipy[${PYTHON_USEDEP}]
+ media-gfx/imagemagick[jpeg,jpeg2k,lcms,png,-q8,-q32,tiff]
+ media-libs/exiftool
+ media-libs/netpbm[jpeg]
+ )
+"
+RDEPEND="
+ dev-python/pikepdf[${PYTHON_USEDEP}]
+ dev-python/pillow[${PYTHON_USEDEP}]
+ gui? ( $(python_gen_impl_dep tk) )
+"
+
+# gif animation test fails
+PATCHES=( "${FILESDIR}"/${P}-test-gif-animation.patch )
+
+distutils_enable_tests pytest
+
+src_prepare() {
+ distutils-r1_python_prepare_all
+
+ # Remove gui executable if there's no demand/support for it.
+ if ! use gui; then
+ sed -i '/gui_scripts/d' setup.py || die
+ fi
+
+ # gif animation test fails
+ rm src/tests/input/animation.gif src/tests/output/animation.gif.pdf || die "rm animation gif failes"
+}
+
+python_test() {
+ epytest -n auto
+}