Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] img2pdf: update to 0.5.0.
@ 2023-11-18  9:13 oynqr
  2023-11-18 10:24 ` [PR PATCH] [Updated] " oynqr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: oynqr @ 2023-11-18  9:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]

There is a new pull request by oynqr against master on the void-packages repository

https://github.com/oynqr/void-packages img2pdf
https://github.com/void-linux/void-packages/pull/47296

img2pdf: update to 0.5.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/47296.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-img2pdf-47296.patch --]
[-- Type: text/x-diff, Size: 8174 bytes --]

From 2962eb6cba4ce75e1d0ac781f12b1648518aab30 Mon Sep 17 00:00:00 2001
From: Philipp David <pd@3b.pm>
Date: Sat, 18 Nov 2023 09:53:27 +0100
Subject: [PATCH] img2pdf: update to 0.5.0.

---
 srcpkgs/img2pdf/patches/00_fix_tests.patch    | 84 +++++++++++++++++++
 .../patches/01_disable_broken_tests.patch     | 35 ++++++++
 .../patches/0_fix_color_profile_path.patch    | 15 ----
 srcpkgs/img2pdf/template                      |  9 +-
 4 files changed, 124 insertions(+), 19 deletions(-)
 create mode 100644 srcpkgs/img2pdf/patches/00_fix_tests.patch
 create mode 100644 srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
 delete mode 100644 srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch

diff --git a/srcpkgs/img2pdf/patches/00_fix_tests.patch b/srcpkgs/img2pdf/patches/00_fix_tests.patch
new file mode 100644
index 0000000000000..13f8c4b19f31f
--- /dev/null
+++ b/srcpkgs/img2pdf/patches/00_fix_tests.patch
@@ -0,0 +1,84 @@
+# source:
+# https://salsa.debian.org/debian/img2pdf/-/blob/4a7dbda0f473f7c5ffcaaf68ea4ad3f435e0920d/debian/patches/fix_tests.patch
+--- a/src/img2pdf_test.py
++++ b/src/img2pdf_test.py
+@@ -85,7 +85,6 @@ for prog in ["convert", "compare", "iden
+         globals()[prog.upper()] = ["magick", prog]
+ 
+ HAVE_IMAGEMAGICK_MODERN = True
+-HAVE_EXACT_CMYK8 = True
+ try:
+     ver = subprocess.check_output(CONVERT + ["-version"], stderr=subprocess.STDOUT)
+     m = re.fullmatch(
+@@ -93,18 +92,13 @@ try:
+     )
+     if m is None:
+         HAVE_IMAGEMAGICK_MODERN = False
+-        HAVE_EXACT_CMYK8 = False
+     else:
+         if parse_version(m.group(1)) < parse_version("6.9.10-12"):
+             HAVE_IMAGEMAGICK_MODERN = False
+-        if parse_version(m.group(1)) < parse_version("7.1.0-48"):
+-            HAVE_EXACT_CMYK8 = False
+ except FileNotFoundError:
+     HAVE_IMAGEMAGICK_MODERN = False
+-    HAVE_EXACT_CMYK8 = False
+ except subprocess.CalledProcessError:
+     HAVE_IMAGEMAGICK_MODERN = False
+-    HAVE_EXACT_CMYK8 = False
+ 
+ if not HAVE_IMAGEMAGICK_MODERN:
+     warnings.warn("imagemagick >= 6.9.10-12 not available, skipping certain checks...")
+@@ -351,9 +345,7 @@ def write_png(data, path, bitdepth, colo
+ 
+ def compare(im1, im2, exact, icc, cmyk):
+     if exact:
+-        if cmyk and not HAVE_EXACT_CMYK8:
+-            raise Exception("cmyk cannot be exact before ImageMagick 7.1.0-48")
+-        elif icc:
++        if icc:
+             raise Exception("icc cannot be exact")
+         else:
+             subprocess.check_call(
+@@ -5562,11 +5554,9 @@ def test_jpg_rot(tmp_path_factory, jpg_r
+ )
+ def test_jpg_cmyk(tmp_path_factory, jpg_cmyk_img, jpg_cmyk_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_cmyk")
+-    compare_ghostscript(
+-        tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, gsdevice="tiff32nc", exact=HAVE_EXACT_CMYK8
+-    )
++    compare_ghostscript(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, gsdevice="tiff32nc")
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, exact=HAVE_EXACT_CMYK8, cmyk=True)
++    compare_mupdf(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, cmyk=True)
+     compare_pdfimages_cmyk(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf)
+ 
+ 
+@@ -5957,12 +5947,9 @@ def test_tiff_cmyk8(tmp_path_factory, ti
+         tiff_cmyk8_img,
+         tiff_cmyk8_pdf,
+         gsdevice="tiff32nc",
+-        exact=HAVE_EXACT_CMYK8,
+     )
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(
+-        tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf, exact=HAVE_EXACT_CMYK8, cmyk=True
+-    )
++    compare_mupdf(tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf, cmyk=True)
+     compare_pdfimages_tiff(tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf)
+ 
+ 
+@@ -6403,11 +6390,9 @@ def test_tiff_ccitt_nometa2(
+ )
+ def test_miff_cmyk8(tmp_path_factory, miff_cmyk8_img, tiff_cmyk8_img, miff_cmyk8_pdf):
+     tmpdir = tmp_path_factory.mktemp("miff_cmyk8")
+-    compare_ghostscript(
+-        tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, gsdevice="tiff32nc", exact=False
+-    )
++    compare_ghostscript(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, gsdevice="tiff32nc")
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, exact=False, cmyk=True)
++    compare_mupdf(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, cmyk=True)
+     compare_pdfimages_tiff(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf)
+ 
+ 
diff --git a/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch b/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
new file mode 100644
index 0000000000000..ba93066e58b7c
--- /dev/null
+++ b/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
@@ -0,0 +1,35 @@
+# disable tests apparently affected by ImageMagick regressions. see
+# https://gitlab.mister-muffin.de/josch/img2pdf/issues/178 and
+# https://github.com/ImageMagick/ImageMagick6/issues/285 for related bug
+# reports.
+--- a/src/img2pdf_test.py
++++ b/src/img2pdf_test.py
+@@ -5590,7 +5590,7 @@ def test_jpg_2000(tmp_path_factory, jpg_2000_img, jpg_2000_pdf):
+     reason="test utilities not available on Windows and MacOS",
+ )
+ @pytest.mark.skipif(
+-    not HAVE_JP2, reason="requires imagemagick with support for jpeg2000"
++    True, reason="affected by ImageMagick regressions"
+ )
+ def test_jpg_2000_rgba8(tmp_path_factory, jpg_2000_rgba8_img, jpg_2000_rgba8_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_2000_rgba8")
+@@ -5605,7 +5605,7 @@ def test_jpg_2000_rgba8(tmp_path_factory, jpg_2000_rgba8_img, jpg_2000_rgba8_pdf
+     reason="test utilities not available on Windows and MacOS",
+ )
+ @pytest.mark.skipif(
+-    not HAVE_JP2, reason="requires imagemagick with support for jpeg2000"
++    True, reason="affected by ImageMagick regressions"
+ )
+ def test_jpg_2000_rgba16(tmp_path_factory, jpg_2000_rgba16_img, jpg_2000_rgba16_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_2000_rgba16")
+@@ -6412,8 +6412,8 @@ def test_miff_cmyk8(tmp_path_factory, miff_cmyk8_img, tiff_cmyk8_img, miff_cmyk8
+ 
+ 
+ @pytest.mark.skipif(
+-    sys.platform in ["win32"],
+-    reason="test utilities not available on Windows and MacOS",
++    True,
++    reason="affected by ImageMagick regressions",
+ )
+ def test_miff_cmyk16(
+     tmp_path_factory, miff_cmyk16_img, tiff_cmyk16_img, miff_cmyk16_pdf
diff --git a/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch b/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch
deleted file mode 100644
index 009eee3c29816..0000000000000
--- a/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/src/img2pdf.py
-+++ b/src/img2pdf.py
-@@ -3439,10 +3439,10 @@ RGB.""",
-     outargs.add_argument(
-         "--pdfa",
-         nargs="?",
--        const="/usr/share/color/icc/sRGB.icc",
-+        const="/usr/share/color/icc/colord/sRGB.icc",
-         default=None,
-         help="Output a PDF/A-1b compliant document. By default, this will "
--        "embed /usr/share/color/icc/sRGB.icc as the color profile.",
-+        "embed /usr/share/color/icc/colord/sRGB.icc as the color profile.",
-     )
- 
-     sizeargs = parser.add_argument_group(
diff --git a/srcpkgs/img2pdf/template b/srcpkgs/img2pdf/template
index ec1d99f8bf90a..54d1ccf267b55 100644
--- a/srcpkgs/img2pdf/template
+++ b/srcpkgs/img2pdf/template
@@ -1,14 +1,15 @@
 # Template file for 'img2pdf'
 pkgname=img2pdf
-version=0.4.4
-revision=3
+version=0.5.0
+revision=1
 build_style=python3-module
 hostmakedepends="python3-pikepdf python3-setuptools"
 depends="colord python3-pdfrw python3-pikepdf python3-Pillow python3-tkinter"
+checkdepends="$depends exiftool ghostscript ImageMagick mupdf-tools netpbm
+ poppler python3-numpy python3-pytest python3-pytest-xdist python3-scipy"
 short_desc="Lossless conversion of raster images to PDF"
 maintainer="Philipp David <pd@3b.pm>"
 license="GPL-3.0-or-later"
 homepage="https://gitlab.mister-muffin.de/josch/img2pdf"
 distfiles="${PYPI_SITE}/i/img2pdf/img2pdf-${version}.tar.gz"
-checksum=8ec898a9646523fd3862b154f3f47cd52609c24cc3e2dc1fb5f0168f0cbe793c
-make_check=no # need to patch out some bitdepth checks
+checksum=ae6c19731bde2551356c178bf356ca118ac32a232c737a14b423f8039df3c24b

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] img2pdf: update to 0.5.0.
  2023-11-18  9:13 [PR PATCH] img2pdf: update to 0.5.0 oynqr
@ 2023-11-18 10:24 ` oynqr
  2023-11-20  5:41 ` [PR REVIEW] " classabbyamp
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: oynqr @ 2023-11-18 10:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by oynqr against master on the void-packages repository

https://github.com/oynqr/void-packages img2pdf
https://github.com/void-linux/void-packages/pull/47296

img2pdf: update to 0.5.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/47296.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-img2pdf-47296.patch --]
[-- Type: text/x-diff, Size: 8290 bytes --]

From dd1382c83b053d84707f8a9e8c75c0a6da8f000c Mon Sep 17 00:00:00 2001
From: Philipp David <pd@3b.pm>
Date: Sat, 18 Nov 2023 09:53:27 +0100
Subject: [PATCH] img2pdf: update to 0.5.0.

---
 srcpkgs/img2pdf/patches/00_fix_tests.patch    | 84 +++++++++++++++++++
 .../patches/01_disable_broken_tests.patch     | 35 ++++++++
 .../patches/0_fix_color_profile_path.patch    | 15 ----
 srcpkgs/img2pdf/template                      | 14 +++-
 4 files changed, 129 insertions(+), 19 deletions(-)
 create mode 100644 srcpkgs/img2pdf/patches/00_fix_tests.patch
 create mode 100644 srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
 delete mode 100644 srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch

diff --git a/srcpkgs/img2pdf/patches/00_fix_tests.patch b/srcpkgs/img2pdf/patches/00_fix_tests.patch
new file mode 100644
index 0000000000000..13f8c4b19f31f
--- /dev/null
+++ b/srcpkgs/img2pdf/patches/00_fix_tests.patch
@@ -0,0 +1,84 @@
+# source:
+# https://salsa.debian.org/debian/img2pdf/-/blob/4a7dbda0f473f7c5ffcaaf68ea4ad3f435e0920d/debian/patches/fix_tests.patch
+--- a/src/img2pdf_test.py
++++ b/src/img2pdf_test.py
+@@ -85,7 +85,6 @@ for prog in ["convert", "compare", "iden
+         globals()[prog.upper()] = ["magick", prog]
+ 
+ HAVE_IMAGEMAGICK_MODERN = True
+-HAVE_EXACT_CMYK8 = True
+ try:
+     ver = subprocess.check_output(CONVERT + ["-version"], stderr=subprocess.STDOUT)
+     m = re.fullmatch(
+@@ -93,18 +92,13 @@ try:
+     )
+     if m is None:
+         HAVE_IMAGEMAGICK_MODERN = False
+-        HAVE_EXACT_CMYK8 = False
+     else:
+         if parse_version(m.group(1)) < parse_version("6.9.10-12"):
+             HAVE_IMAGEMAGICK_MODERN = False
+-        if parse_version(m.group(1)) < parse_version("7.1.0-48"):
+-            HAVE_EXACT_CMYK8 = False
+ except FileNotFoundError:
+     HAVE_IMAGEMAGICK_MODERN = False
+-    HAVE_EXACT_CMYK8 = False
+ except subprocess.CalledProcessError:
+     HAVE_IMAGEMAGICK_MODERN = False
+-    HAVE_EXACT_CMYK8 = False
+ 
+ if not HAVE_IMAGEMAGICK_MODERN:
+     warnings.warn("imagemagick >= 6.9.10-12 not available, skipping certain checks...")
+@@ -351,9 +345,7 @@ def write_png(data, path, bitdepth, colo
+ 
+ def compare(im1, im2, exact, icc, cmyk):
+     if exact:
+-        if cmyk and not HAVE_EXACT_CMYK8:
+-            raise Exception("cmyk cannot be exact before ImageMagick 7.1.0-48")
+-        elif icc:
++        if icc:
+             raise Exception("icc cannot be exact")
+         else:
+             subprocess.check_call(
+@@ -5562,11 +5554,9 @@ def test_jpg_rot(tmp_path_factory, jpg_r
+ )
+ def test_jpg_cmyk(tmp_path_factory, jpg_cmyk_img, jpg_cmyk_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_cmyk")
+-    compare_ghostscript(
+-        tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, gsdevice="tiff32nc", exact=HAVE_EXACT_CMYK8
+-    )
++    compare_ghostscript(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, gsdevice="tiff32nc")
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, exact=HAVE_EXACT_CMYK8, cmyk=True)
++    compare_mupdf(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, cmyk=True)
+     compare_pdfimages_cmyk(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf)
+ 
+ 
+@@ -5957,12 +5947,9 @@ def test_tiff_cmyk8(tmp_path_factory, ti
+         tiff_cmyk8_img,
+         tiff_cmyk8_pdf,
+         gsdevice="tiff32nc",
+-        exact=HAVE_EXACT_CMYK8,
+     )
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(
+-        tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf, exact=HAVE_EXACT_CMYK8, cmyk=True
+-    )
++    compare_mupdf(tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf, cmyk=True)
+     compare_pdfimages_tiff(tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf)
+ 
+ 
+@@ -6403,11 +6390,9 @@ def test_tiff_ccitt_nometa2(
+ )
+ def test_miff_cmyk8(tmp_path_factory, miff_cmyk8_img, tiff_cmyk8_img, miff_cmyk8_pdf):
+     tmpdir = tmp_path_factory.mktemp("miff_cmyk8")
+-    compare_ghostscript(
+-        tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, gsdevice="tiff32nc", exact=False
+-    )
++    compare_ghostscript(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, gsdevice="tiff32nc")
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, exact=False, cmyk=True)
++    compare_mupdf(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, cmyk=True)
+     compare_pdfimages_tiff(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf)
+ 
+ 
diff --git a/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch b/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
new file mode 100644
index 0000000000000..ba93066e58b7c
--- /dev/null
+++ b/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
@@ -0,0 +1,35 @@
+# disable tests apparently affected by ImageMagick regressions. see
+# https://gitlab.mister-muffin.de/josch/img2pdf/issues/178 and
+# https://github.com/ImageMagick/ImageMagick6/issues/285 for related bug
+# reports.
+--- a/src/img2pdf_test.py
++++ b/src/img2pdf_test.py
+@@ -5590,7 +5590,7 @@ def test_jpg_2000(tmp_path_factory, jpg_2000_img, jpg_2000_pdf):
+     reason="test utilities not available on Windows and MacOS",
+ )
+ @pytest.mark.skipif(
+-    not HAVE_JP2, reason="requires imagemagick with support for jpeg2000"
++    True, reason="affected by ImageMagick regressions"
+ )
+ def test_jpg_2000_rgba8(tmp_path_factory, jpg_2000_rgba8_img, jpg_2000_rgba8_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_2000_rgba8")
+@@ -5605,7 +5605,7 @@ def test_jpg_2000_rgba8(tmp_path_factory, jpg_2000_rgba8_img, jpg_2000_rgba8_pdf
+     reason="test utilities not available on Windows and MacOS",
+ )
+ @pytest.mark.skipif(
+-    not HAVE_JP2, reason="requires imagemagick with support for jpeg2000"
++    True, reason="affected by ImageMagick regressions"
+ )
+ def test_jpg_2000_rgba16(tmp_path_factory, jpg_2000_rgba16_img, jpg_2000_rgba16_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_2000_rgba16")
+@@ -6412,8 +6412,8 @@ def test_miff_cmyk8(tmp_path_factory, miff_cmyk8_img, tiff_cmyk8_img, miff_cmyk8
+ 
+ 
+ @pytest.mark.skipif(
+-    sys.platform in ["win32"],
+-    reason="test utilities not available on Windows and MacOS",
++    True,
++    reason="affected by ImageMagick regressions",
+ )
+ def test_miff_cmyk16(
+     tmp_path_factory, miff_cmyk16_img, tiff_cmyk16_img, miff_cmyk16_pdf
diff --git a/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch b/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch
deleted file mode 100644
index 009eee3c29816..0000000000000
--- a/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/src/img2pdf.py
-+++ b/src/img2pdf.py
-@@ -3439,10 +3439,10 @@ RGB.""",
-     outargs.add_argument(
-         "--pdfa",
-         nargs="?",
--        const="/usr/share/color/icc/sRGB.icc",
-+        const="/usr/share/color/icc/colord/sRGB.icc",
-         default=None,
-         help="Output a PDF/A-1b compliant document. By default, this will "
--        "embed /usr/share/color/icc/sRGB.icc as the color profile.",
-+        "embed /usr/share/color/icc/colord/sRGB.icc as the color profile.",
-     )
- 
-     sizeargs = parser.add_argument_group(
diff --git a/srcpkgs/img2pdf/template b/srcpkgs/img2pdf/template
index ec1d99f8bf90a..2e7e9e62e0e14 100644
--- a/srcpkgs/img2pdf/template
+++ b/srcpkgs/img2pdf/template
@@ -1,14 +1,20 @@
 # Template file for 'img2pdf'
 pkgname=img2pdf
-version=0.4.4
-revision=3
+version=0.5.0
+revision=1
 build_style=python3-module
 hostmakedepends="python3-pikepdf python3-setuptools"
 depends="colord python3-pdfrw python3-pikepdf python3-Pillow python3-tkinter"
+checkdepends="$depends exiftool ghostscript ImageMagick mupdf-tools netpbm
+ poppler python3-numpy python3-pytest python3-pytest-xdist python3-scipy"
 short_desc="Lossless conversion of raster images to PDF"
 maintainer="Philipp David <pd@3b.pm>"
 license="GPL-3.0-or-later"
 homepage="https://gitlab.mister-muffin.de/josch/img2pdf"
 distfiles="${PYPI_SITE}/i/img2pdf/img2pdf-${version}.tar.gz"
-checksum=8ec898a9646523fd3862b154f3f47cd52609c24cc3e2dc1fb5f0168f0cbe793c
-make_check=no # need to patch out some bitdepth checks
+checksum=ae6c19731bde2551356c178bf356ca118ac32a232c737a14b423f8039df3c24b
+
+if [ "$XBPS_TARGET_WORDSIZE" != "64" ]; then
+	# bit depth checks fail on non-64bit arches
+	make_check=no
+fi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR REVIEW] img2pdf: update to 0.5.0.
  2023-11-18  9:13 [PR PATCH] img2pdf: update to 0.5.0 oynqr
  2023-11-18 10:24 ` [PR PATCH] [Updated] " oynqr
@ 2023-11-20  5:41 ` classabbyamp
  2023-11-20 10:21 ` oynqr
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2023-11-20  5:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/47296#discussion_r1398684135

Comment:
this probably indicates an actual issue with assuming e.g. 64-bit types, it would be better to find this and fix it

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR REVIEW] img2pdf: update to 0.5.0.
  2023-11-18  9:13 [PR PATCH] img2pdf: update to 0.5.0 oynqr
  2023-11-18 10:24 ` [PR PATCH] [Updated] " oynqr
  2023-11-20  5:41 ` [PR REVIEW] " classabbyamp
@ 2023-11-20 10:21 ` oynqr
  2023-12-01  6:53 ` [PR PATCH] [Updated] " oynqr
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: oynqr @ 2023-11-20 10:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

New review comment by oynqr on void-packages repository

https://github.com/void-linux/void-packages/pull/47296#discussion_r1398973156

Comment:
Not an expert on this, but it's probably how ImageMagick calculates bit depth and is intended. I'll open an issue with img2pdf about tests failing on i686 (and probably other 32-bit arches).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] img2pdf: update to 0.5.0.
  2023-11-18  9:13 [PR PATCH] img2pdf: update to 0.5.0 oynqr
                   ` (2 preceding siblings ...)
  2023-11-20 10:21 ` oynqr
@ 2023-12-01  6:53 ` oynqr
  2024-03-01  1:46 ` img2pdf: update to 0.5.1 github-actions
  2024-03-16  1:44 ` [PR PATCH] [Closed]: " github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: oynqr @ 2023-12-01  6:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

There is an updated pull request by oynqr against master on the void-packages repository

https://github.com/oynqr/void-packages img2pdf
https://github.com/void-linux/void-packages/pull/47296

img2pdf: update to 0.5.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/47296.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-img2pdf-47296.patch --]
[-- Type: text/x-diff, Size: 8290 bytes --]

From bb6fb8c0a198288cd8f0ef22ad436d3a06cf7559 Mon Sep 17 00:00:00 2001
From: Philipp David <pd@3b.pm>
Date: Sat, 18 Nov 2023 09:53:27 +0100
Subject: [PATCH] img2pdf: update to 0.5.1.

---
 srcpkgs/img2pdf/patches/00_fix_tests.patch    | 84 +++++++++++++++++++
 .../patches/01_disable_broken_tests.patch     | 35 ++++++++
 .../patches/0_fix_color_profile_path.patch    | 15 ----
 srcpkgs/img2pdf/template                      | 14 +++-
 4 files changed, 129 insertions(+), 19 deletions(-)
 create mode 100644 srcpkgs/img2pdf/patches/00_fix_tests.patch
 create mode 100644 srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
 delete mode 100644 srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch

diff --git a/srcpkgs/img2pdf/patches/00_fix_tests.patch b/srcpkgs/img2pdf/patches/00_fix_tests.patch
new file mode 100644
index 0000000000000..13f8c4b19f31f
--- /dev/null
+++ b/srcpkgs/img2pdf/patches/00_fix_tests.patch
@@ -0,0 +1,84 @@
+# source:
+# https://salsa.debian.org/debian/img2pdf/-/blob/4a7dbda0f473f7c5ffcaaf68ea4ad3f435e0920d/debian/patches/fix_tests.patch
+--- a/src/img2pdf_test.py
++++ b/src/img2pdf_test.py
+@@ -85,7 +85,6 @@ for prog in ["convert", "compare", "iden
+         globals()[prog.upper()] = ["magick", prog]
+ 
+ HAVE_IMAGEMAGICK_MODERN = True
+-HAVE_EXACT_CMYK8 = True
+ try:
+     ver = subprocess.check_output(CONVERT + ["-version"], stderr=subprocess.STDOUT)
+     m = re.fullmatch(
+@@ -93,18 +92,13 @@ try:
+     )
+     if m is None:
+         HAVE_IMAGEMAGICK_MODERN = False
+-        HAVE_EXACT_CMYK8 = False
+     else:
+         if parse_version(m.group(1)) < parse_version("6.9.10-12"):
+             HAVE_IMAGEMAGICK_MODERN = False
+-        if parse_version(m.group(1)) < parse_version("7.1.0-48"):
+-            HAVE_EXACT_CMYK8 = False
+ except FileNotFoundError:
+     HAVE_IMAGEMAGICK_MODERN = False
+-    HAVE_EXACT_CMYK8 = False
+ except subprocess.CalledProcessError:
+     HAVE_IMAGEMAGICK_MODERN = False
+-    HAVE_EXACT_CMYK8 = False
+ 
+ if not HAVE_IMAGEMAGICK_MODERN:
+     warnings.warn("imagemagick >= 6.9.10-12 not available, skipping certain checks...")
+@@ -351,9 +345,7 @@ def write_png(data, path, bitdepth, colo
+ 
+ def compare(im1, im2, exact, icc, cmyk):
+     if exact:
+-        if cmyk and not HAVE_EXACT_CMYK8:
+-            raise Exception("cmyk cannot be exact before ImageMagick 7.1.0-48")
+-        elif icc:
++        if icc:
+             raise Exception("icc cannot be exact")
+         else:
+             subprocess.check_call(
+@@ -5562,11 +5554,9 @@ def test_jpg_rot(tmp_path_factory, jpg_r
+ )
+ def test_jpg_cmyk(tmp_path_factory, jpg_cmyk_img, jpg_cmyk_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_cmyk")
+-    compare_ghostscript(
+-        tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, gsdevice="tiff32nc", exact=HAVE_EXACT_CMYK8
+-    )
++    compare_ghostscript(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, gsdevice="tiff32nc")
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, exact=HAVE_EXACT_CMYK8, cmyk=True)
++    compare_mupdf(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf, cmyk=True)
+     compare_pdfimages_cmyk(tmpdir, jpg_cmyk_img, jpg_cmyk_pdf)
+ 
+ 
+@@ -5957,12 +5947,9 @@ def test_tiff_cmyk8(tmp_path_factory, ti
+         tiff_cmyk8_img,
+         tiff_cmyk8_pdf,
+         gsdevice="tiff32nc",
+-        exact=HAVE_EXACT_CMYK8,
+     )
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(
+-        tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf, exact=HAVE_EXACT_CMYK8, cmyk=True
+-    )
++    compare_mupdf(tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf, cmyk=True)
+     compare_pdfimages_tiff(tmpdir, tiff_cmyk8_img, tiff_cmyk8_pdf)
+ 
+ 
+@@ -6403,11 +6390,9 @@ def test_tiff_ccitt_nometa2(
+ )
+ def test_miff_cmyk8(tmp_path_factory, miff_cmyk8_img, tiff_cmyk8_img, miff_cmyk8_pdf):
+     tmpdir = tmp_path_factory.mktemp("miff_cmyk8")
+-    compare_ghostscript(
+-        tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, gsdevice="tiff32nc", exact=False
+-    )
++    compare_ghostscript(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, gsdevice="tiff32nc")
+     # not testing with poppler as it cannot write CMYK images
+-    compare_mupdf(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, exact=False, cmyk=True)
++    compare_mupdf(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf, cmyk=True)
+     compare_pdfimages_tiff(tmpdir, tiff_cmyk8_img, miff_cmyk8_pdf)
+ 
+ 
diff --git a/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch b/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
new file mode 100644
index 0000000000000..ba93066e58b7c
--- /dev/null
+++ b/srcpkgs/img2pdf/patches/01_disable_broken_tests.patch
@@ -0,0 +1,35 @@
+# disable tests apparently affected by ImageMagick regressions. see
+# https://gitlab.mister-muffin.de/josch/img2pdf/issues/178 and
+# https://github.com/ImageMagick/ImageMagick6/issues/285 for related bug
+# reports.
+--- a/src/img2pdf_test.py
++++ b/src/img2pdf_test.py
+@@ -5590,7 +5590,7 @@ def test_jpg_2000(tmp_path_factory, jpg_2000_img, jpg_2000_pdf):
+     reason="test utilities not available on Windows and MacOS",
+ )
+ @pytest.mark.skipif(
+-    not HAVE_JP2, reason="requires imagemagick with support for jpeg2000"
++    True, reason="affected by ImageMagick regressions"
+ )
+ def test_jpg_2000_rgba8(tmp_path_factory, jpg_2000_rgba8_img, jpg_2000_rgba8_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_2000_rgba8")
+@@ -5605,7 +5605,7 @@ def test_jpg_2000_rgba8(tmp_path_factory, jpg_2000_rgba8_img, jpg_2000_rgba8_pdf
+     reason="test utilities not available on Windows and MacOS",
+ )
+ @pytest.mark.skipif(
+-    not HAVE_JP2, reason="requires imagemagick with support for jpeg2000"
++    True, reason="affected by ImageMagick regressions"
+ )
+ def test_jpg_2000_rgba16(tmp_path_factory, jpg_2000_rgba16_img, jpg_2000_rgba16_pdf):
+     tmpdir = tmp_path_factory.mktemp("jpg_2000_rgba16")
+@@ -6412,8 +6412,8 @@ def test_miff_cmyk8(tmp_path_factory, miff_cmyk8_img, tiff_cmyk8_img, miff_cmyk8
+ 
+ 
+ @pytest.mark.skipif(
+-    sys.platform in ["win32"],
+-    reason="test utilities not available on Windows and MacOS",
++    True,
++    reason="affected by ImageMagick regressions",
+ )
+ def test_miff_cmyk16(
+     tmp_path_factory, miff_cmyk16_img, tiff_cmyk16_img, miff_cmyk16_pdf
diff --git a/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch b/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch
deleted file mode 100644
index 009eee3c29816..0000000000000
--- a/srcpkgs/img2pdf/patches/0_fix_color_profile_path.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/src/img2pdf.py
-+++ b/src/img2pdf.py
-@@ -3439,10 +3439,10 @@ RGB.""",
-     outargs.add_argument(
-         "--pdfa",
-         nargs="?",
--        const="/usr/share/color/icc/sRGB.icc",
-+        const="/usr/share/color/icc/colord/sRGB.icc",
-         default=None,
-         help="Output a PDF/A-1b compliant document. By default, this will "
--        "embed /usr/share/color/icc/sRGB.icc as the color profile.",
-+        "embed /usr/share/color/icc/colord/sRGB.icc as the color profile.",
-     )
- 
-     sizeargs = parser.add_argument_group(
diff --git a/srcpkgs/img2pdf/template b/srcpkgs/img2pdf/template
index ec1d99f8bf90a..e0f03b0dfa52d 100644
--- a/srcpkgs/img2pdf/template
+++ b/srcpkgs/img2pdf/template
@@ -1,14 +1,20 @@
 # Template file for 'img2pdf'
 pkgname=img2pdf
-version=0.4.4
-revision=3
+version=0.5.1
+revision=1
 build_style=python3-module
 hostmakedepends="python3-pikepdf python3-setuptools"
 depends="colord python3-pdfrw python3-pikepdf python3-Pillow python3-tkinter"
+checkdepends="$depends exiftool ghostscript ImageMagick mupdf-tools netpbm
+ poppler python3-numpy python3-pytest python3-pytest-xdist python3-scipy"
 short_desc="Lossless conversion of raster images to PDF"
 maintainer="Philipp David <pd@3b.pm>"
 license="GPL-3.0-or-later"
 homepage="https://gitlab.mister-muffin.de/josch/img2pdf"
 distfiles="${PYPI_SITE}/i/img2pdf/img2pdf-${version}.tar.gz"
-checksum=8ec898a9646523fd3862b154f3f47cd52609c24cc3e2dc1fb5f0168f0cbe793c
-make_check=no # need to patch out some bitdepth checks
+checksum=73847e47242f4b5bd113c70049e03e03212936c2727cd2a8bf564229a67d0b95
+
+if [ "$XBPS_TARGET_WORDSIZE" != "64" ]; then
+	# bit depth checks fail on non-64bit arches
+	make_check=no
+fi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: img2pdf: update to 0.5.1.
  2023-11-18  9:13 [PR PATCH] img2pdf: update to 0.5.0 oynqr
                   ` (3 preceding siblings ...)
  2023-12-01  6:53 ` [PR PATCH] [Updated] " oynqr
@ 2024-03-01  1:46 ` github-actions
  2024-03-16  1:44 ` [PR PATCH] [Closed]: " github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: github-actions @ 2024-03-01  1:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/47296#issuecomment-1972298644

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Closed]: img2pdf: update to 0.5.1.
  2023-11-18  9:13 [PR PATCH] img2pdf: update to 0.5.0 oynqr
                   ` (4 preceding siblings ...)
  2024-03-01  1:46 ` img2pdf: update to 0.5.1 github-actions
@ 2024-03-16  1:44 ` github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: github-actions @ 2024-03-16  1:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]

There's a closed pull request on the void-packages repository

img2pdf: update to 0.5.1.
https://github.com/void-linux/void-packages/pull/47296

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-16  1:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-18  9:13 [PR PATCH] img2pdf: update to 0.5.0 oynqr
2023-11-18 10:24 ` [PR PATCH] [Updated] " oynqr
2023-11-20  5:41 ` [PR REVIEW] " classabbyamp
2023-11-20 10:21 ` oynqr
2023-12-01  6:53 ` [PR PATCH] [Updated] " oynqr
2024-03-01  1:46 ` img2pdf: update to 0.5.1 github-actions
2024-03-16  1:44 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).