From: oynqr <oynqr@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] img2pdf: update to 0.5.0.
Date: Fri, 01 Dec 2023 07:53:10 +0100 [thread overview]
Message-ID: <20231201065310.AV41hXdWzwnBvwdNYHyRaB5AdtM5rsrsuskH_tdXm-8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-47296@inbox.vuxu.org>
[-- 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
next prev parent reply other threads:[~2023-12-01 6:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-18 9:13 [PR PATCH] " 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 ` oynqr [this message]
2024-03-01 1:46 ` img2pdf: update to 0.5.1 github-actions
2024-03-16 1:44 ` [PR PATCH] [Closed]: " github-actions
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231201065310.AV41hXdWzwnBvwdNYHyRaB5AdtM5rsrsuskH_tdXm-8@z \
--to=oynqr@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).