aboutsummaryrefslogtreecommitdiff
path: root/textproc/py-pikepdf
diff options
context:
space:
mode:
authorKai Knoblich <kai@FreeBSD.org>2021-01-09 13:18:00 +0000
committerKai Knoblich <kai@FreeBSD.org>2021-01-09 13:18:00 +0000
commitf0c6ab8cf49cb5172c69b8ca3c3e007f02d6f8b5 (patch)
treeef6b9977f05316d8f6c4df4faf024cdc8a70b11d /textproc/py-pikepdf
parent5803da33ccf310bb6a5275dc69515bb08d4ab2d2 (diff)
downloadports-f0c6ab8cf49cb5172c69b8ca3c3e007f02d6f8b5.tar.gz
ports-f0c6ab8cf49cb5172c69b8ca3c3e007f02d6f8b5.zip
textproc/py-pikepdf: Unbreak build with qpdf 10.1.0 after r560703
* Bump PORTREVISION due package change. src/qpdf/page.cpp:82:10: error: no matching member function for call to 'def' .def("externalize_inline_images", &QPDFPageObjectHelper::externalizeInlineImages, ~^~~ Reported by: pkg-fallout
Notes
Notes: svn path=/head/; revision=560860
Diffstat (limited to 'textproc/py-pikepdf')
-rw-r--r--textproc/py-pikepdf/Makefile1
-rw-r--r--textproc/py-pikepdf/files/patch-src_qpdf_page.cpp22
-rw-r--r--textproc/py-pikepdf/files/patch-tests_test__filters.py43
3 files changed, 66 insertions, 0 deletions
diff --git a/textproc/py-pikepdf/Makefile b/textproc/py-pikepdf/Makefile
index bbb6544a0f18..67550c7fd297 100644
--- a/textproc/py-pikepdf/Makefile
+++ b/textproc/py-pikepdf/Makefile
@@ -2,6 +2,7 @@
PORTNAME= pikepdf
DISTVERSION= 1.19.3
+PORTREVISION= 1
CATEGORIES= textproc python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
diff --git a/textproc/py-pikepdf/files/patch-src_qpdf_page.cpp b/textproc/py-pikepdf/files/patch-src_qpdf_page.cpp
new file mode 100644
index 000000000000..79aa79b98024
--- /dev/null
+++ b/textproc/py-pikepdf/files/patch-src_qpdf_page.cpp
@@ -0,0 +1,22 @@
+From: "James R. Barlow" <james@purplerock.ca>
+Date: Mon, 4 Jan 2021 20:21:51 -0800
+Subject: [PATCH] Fix externalize_inline_images for qpdf 10.1.0
+
+Obtained from:
+
+https://github.com/pikepdf/pikepdf/commit/7ac9b058104219b26747f3fc9761ac6b3c037402.patch
+
+--- src/qpdf/page.cpp.orig 2020-09-09 22:57:09 UTC
++++ src/qpdf/page.cpp
+@@ -79,7 +79,10 @@ void init_page(py::module& m)
+ .def("_get_mediabox", &QPDFPageObjectHelper::getMediaBox)
+ .def("_get_cropbox", &QPDFPageObjectHelper::getCropBox)
+ .def("_get_trimbox", &QPDFPageObjectHelper::getTrimBox)
+- .def("externalize_inline_images", &QPDFPageObjectHelper::externalizeInlineImages,
++ .def("externalize_inline_images",
++ [](QPDFPageObjectHelper &poh, size_t min_size = 0) {
++ return poh.externalizeInlineImages(min_size);
++ },
+ py::arg("min_size") = 0,
+ R"~~~(
+ Convert inlines image to normal (external) images.
diff --git a/textproc/py-pikepdf/files/patch-tests_test__filters.py b/textproc/py-pikepdf/files/patch-tests_test__filters.py
new file mode 100644
index 000000000000..36f8cc2a24ca
--- /dev/null
+++ b/textproc/py-pikepdf/files/patch-tests_test__filters.py
@@ -0,0 +1,43 @@
+From: "James R. Barlow" <james@purplerock.ca>
+Date: Wed, 6 Jan 2021 00:22:16 -0800
+Subject: [PATCH] libqpdf 10.1.0 raises different exception [1]
+
+The different errors are acceptable to us; actually they are more
+correct than the original behavior.
+
+From: "James R. Barlow" <james@purplerock.ca>
+Date: Wed, 6 Jan 2021 03:39:50 -0800
+Subject: [PATCH] Fix test_tokenfilter_is_abstract [2]
+
+Obtained from:
+
+[1] https://github.com/pikepdf/pikepdf/commit/fe4b568ac88ba551458578613b013ac17edf5c4e.patch
+[2] https://github.com/pikepdf/pikepdf/commit/7ca375cb6ff82011d716da1614ef5721a97f91b0.patch
+
+--- tests/test_filters.py.orig 2020-09-09 22:57:09 UTC
++++ tests/test_filters.py
+@@ -74,19 +74,17 @@ class FilterInvalid(pikepdf.TokenFilter):
+
+ def test_invalid_handle_token(pal):
+ page = pikepdf.Page(pal.pages[0])
+- with pytest.raises(pikepdf.PdfError):
+- result = page.get_filtered_contents(FilterInvalid())
++ with pytest.raises((TypeError, pikepdf.PdfError)):
++ page.get_filtered_contents(FilterInvalid())
+
+
+ def test_invalid_tokenfilter(pal):
+ page = pikepdf.Page(pal.pages[0])
+ with pytest.raises(TypeError):
+- result = page.get_filtered_contents(list())
++ page.get_filtered_contents(list())
+
+
+ def test_tokenfilter_is_abstract(pal):
+ page = pikepdf.Page(pal.pages[0])
+- try:
+- result = page.get_filtered_contents(pikepdf.TokenFilter())
+- except pikepdf.PdfError:
+- assert 'Tried to call pure virtual' in pal.get_warnings()[0]
++ with pytest.raises((RuntimeError, pikepdf.PdfError)):
++ page.get_filtered_contents(pikepdf.TokenFilter())