Here is the revised patch which update to 2.12.2.

It build well and pass the test on amd64-current system.

Two ports depends on it:
 graphics/img2pdf:  9 failed, 196 passed, 12 skipped, 4 warnings, 131 error in 
112.79 seconds
      fails and errors not caused by this patch.
print/pdfarranger: With my patch submitted just now, it build and run well.

wen

________________________________________
发件人: wen heping <[email protected]>
发送时间: 2021年5月19日 16:45
收件人: [email protected]
主题: print/py-pikepdf: Update to 2.12.0

Hi, ports@:

    Here is a patch for print/py-pikepdf:
   i) Update to 2.12.0
   ii) Add do-test
   iii) Remove patches/patch-src_qpdf_page_cpp, it is included
into upstream now
   iv) Add patches/patch-tests_test_io_py, which avoid some
tests fail

   It build well and run well, all tests passed.
   2 ports depend on it, I did not test them since both should be update.

wen
Index: Makefile
===================================================================
RCS file: /cvs/ports/print/py-pikepdf/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile    10 Jan 2021 08:35:13 -0000      1.5
+++ Makefile    17 Jun 2021 07:22:39 -0000
@@ -2,10 +2,9 @@
 
 COMMENT =              Python library for reading and writing PDF files
 
-MODPY_EGG_VERSION =    1.19.3
+MODPY_EGG_VERSION =    2.12.2
 DISTNAME =             pikepdf-${MODPY_EGG_VERSION}
 PKGNAME =              py-${DISTNAME}
-REVISION =             1
 
 CATEGORIES =           print
 
@@ -36,6 +35,8 @@ LIB_DEPENDS =         print/qpdf
 TEST_DEPENDS =         devel/py-hypothesis${MODPY_FLAVOR} \
                        sysutils/py-psutil${MODPY_FLAVOR}
 
-TEST_ENV =             PYTHONPATH=${WRKSRC}/src/pikepdf:
+do-test:
+       cd ${WRKSRC} && \
+               ${MAKE_ENV} ${MODPY_BIN} -m pytest -rs -v -o addopts=
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/print/py-pikepdf/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo    2 Nov 2020 19:49:40 -0000       1.1.1.1
+++ distinfo    17 Jun 2021 07:22:39 -0000
@@ -1,2 +1,2 @@
-SHA256 (pikepdf-1.19.3.tar.gz) = eN15kLBJ2oQRNLV4U38ZDwC0KoBXWQP4yfWb1o3Y6rs=
-SIZE (pikepdf-1.19.3.tar.gz) = 2360826
+SHA256 (pikepdf-2.12.2.tar.gz) = X/NUmbGuexgSd/eM5bG8yNMAkYK7OJkXeRxdyBH8yOQ=
+SIZE (pikepdf-2.12.2.tar.gz) = 2310586
Index: patches/patch-src_qpdf_page_cpp
===================================================================
RCS file: patches/patch-src_qpdf_page_cpp
diff -N patches/patch-src_qpdf_page_cpp
--- patches/patch-src_qpdf_page_cpp     10 Jan 2021 08:35:13 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-src_qpdf_page_cpp,v 1.1 2021/01/10 08:35:13 ajacoutot Exp $
-
-From 7ac9b058104219b26747f3fc9761ac6b3c037402 Mon Sep 17 00:00:00 2001
-From: "James R. Barlow" <[email protected]>
-Date: Mon, 4 Jan 2021 20:21:51 -0800
-Subject: [PATCH] Fix externalize_inline_images for qpdf 10.1.0
-
-Index: src/qpdf/page.cpp
---- src/qpdf/page.cpp.orig
-+++ 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.
Index: patches/patch-tests_test_io_py
===================================================================
RCS file: patches/patch-tests_test_io_py
diff -N patches/patch-tests_test_io_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_test_io_py      17 Jun 2021 07:22:39 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: tests/test_io.py
+--- tests/test_io.py.orig
++++ tests/test_io.py
+@@ -96,7 +96,7 @@ def test_invalid_output_stream(sandwich, bio_class, ex
+ 
+ @pytest.fixture
+ def file_descriptor_is_open_for():
+-    if sys.platform == 'win32' or sys.platform.startswith('freebsd'):
++    if sys.platform == 'win32' or sys.platform.startswith('freebsd') or 
sys.platform.startswith('openbsd'):
+         pytest.skip(
+             "psutil documentation warns that .open_files() has problems on 
these"
+         )
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/print/py-pikepdf/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST   4 Jan 2021 14:06:37 -0000       1.2
+++ pkg/PLIST   17 Jun 2021 07:22:39 -0000
@@ -13,6 +13,7 @@ lib/python${MODPY_VERSION}/site-packages
 
lib/python${MODPY_VERSION}/site-packages/pikepdf/${MODPY_PYCACHE}_cpphelpers.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/pikepdf/${MODPY_PYCACHE}_methods.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/pikepdf/${MODPY_PYCACHE}_version.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/pikepdf/${MODPY_PYCACHE}_xml.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/pikepdf/${MODPY_PYCACHE}codec.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/pikepdf/${MODPY_PYCACHE}jbig2.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/pikepdf/${MODPY_PYCACHE}objects.${MODPY_PYC_MAGIC_TAG}pyc
@@ -20,6 +21,7 @@ lib/python${MODPY_VERSION}/site-packages
 lib/python${MODPY_VERSION}/site-packages/pikepdf/_methods.py
 @so 
lib/python${MODPY_VERSION}/site-packages/pikepdf/_qpdf.${MODPY_PYC_MAGIC_TAG}so
 lib/python${MODPY_VERSION}/site-packages/pikepdf/_version.py
+lib/python${MODPY_VERSION}/site-packages/pikepdf/_xml.py
 lib/python${MODPY_VERSION}/site-packages/pikepdf/codec.py
 lib/python${MODPY_VERSION}/site-packages/pikepdf/jbig2.py
 lib/python${MODPY_VERSION}/site-packages/pikepdf/models/
@@ -37,3 +39,4 @@ lib/python${MODPY_VERSION}/site-packages
 lib/python${MODPY_VERSION}/site-packages/pikepdf/models/metadata.py
 lib/python${MODPY_VERSION}/site-packages/pikepdf/models/outlines.py
 lib/python${MODPY_VERSION}/site-packages/pikepdf/objects.py
+lib/python${MODPY_VERSION}/site-packages/pikepdf/py.typed

Reply via email to