Index: head/textproc/py-pikepdf/Makefile =================================================================== --- head/textproc/py-pikepdf/Makefile (revision 560859) +++ head/textproc/py-pikepdf/Makefile (revision 560860) @@ -1,47 +1,48 @@ # $FreeBSD$ PORTNAME= pikepdf DISTVERSION= 1.19.3 +PORTREVISION= 1 CATEGORIES= textproc python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= kai@FreeBSD.org COMMENT= Read and write PDFs with Python, powered by qpdf LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/LICENSE.txt BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pybind11>=2.4.3<3:devel/py-pybind11@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}setuptools_scm>0:devel/py-setuptools_scm@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}setuptools_scm_git_archive>0:devel/py-setuptools_scm_git_archive@${PY_FLAVOR} LIB_DEPENDS= libqpdf.so:print/qpdf RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}lxml>=4.0:devel/py-lxml@${PY_FLAVOR} \ ${PY_PILLOW} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}attrs>=19.1.0:devel/py-attrs@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}hypothesis>=4.24<6:devel/py-hypothesis@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}psutil>=5:sysutils/py-psutil@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest>=4.4.0<5.3.5:devel/py-pytest@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest-helpers-namespace>=2019.1.8:devel/py-pytest-helpers-namespace@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest-timeout>=1.3.3:devel/py-pytest-timeout@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest-xdist>=1.28,<2:devel/py-pytest-xdist@${PY_FLAVOR} \ ${PY_PILLOW} \ ${PYTHON_PKGNAMEPREFIX}python-xmp-toolkit>=2.0.1:textproc/py-python-xmp-toolkit@${PY_FLAVOR} USES= compiler:c++14-lang python:3.5+ USE_PYTHON= distutils autoplist OPTIONS_DEFINE= JBIG2 OPTIONS_DEFAULT= JBIG2 JBIG2_DESC= Support for extracting JBIG2 images JBIG2_RUN_DEPENDS= jbig2dec:graphics/jbig2dec post-install: ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/pikepdf/_qpdf*.so do-test: @(cd ${WRKSRC} && ${SETENV} LC_ALL=en_US.UTF-8 ${PYTHON_CMD} -m pytest -rs -v ) .include Index: head/textproc/py-pikepdf/files/patch-src_qpdf_page.cpp =================================================================== --- head/textproc/py-pikepdf/files/patch-src_qpdf_page.cpp (nonexistent) +++ head/textproc/py-pikepdf/files/patch-src_qpdf_page.cpp (revision 560860) @@ -0,0 +1,22 @@ +From: "James R. Barlow" +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. Property changes on: head/textproc/py-pikepdf/files/patch-src_qpdf_page.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/textproc/py-pikepdf/files/patch-tests_test__filters.py =================================================================== --- head/textproc/py-pikepdf/files/patch-tests_test__filters.py (nonexistent) +++ head/textproc/py-pikepdf/files/patch-tests_test__filters.py (revision 560860) @@ -0,0 +1,43 @@ +From: "James R. Barlow" +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" +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()) Property changes on: head/textproc/py-pikepdf/files/patch-tests_test__filters.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property