Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/tiff/, media-libs/tiff/files/
Date: Thu, 01 Dec 2022 07:17:05
Message-Id: 1669879016.33944343462c9aa5a0a23b4a296074d0bc62c5c2.sam@gentoo
1 commit: 33944343462c9aa5a0a23b4a296074d0bc62c5c2
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 1 07:15:54 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 1 07:16:56 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33944343
7
8 media-libs/tiff: backport fix for hylafaxplus regression
9
10 Closes: https://bugs.gentoo.org/883641
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 .../files/tiff-4.4.0-hylafaxplus-regression.patch | 34 +++++++
14 media-libs/tiff/tiff-4.4.0-r2.ebuild | 102 +++++++++++++++++++++
15 2 files changed, 136 insertions(+)
16
17 diff --git a/media-libs/tiff/files/tiff-4.4.0-hylafaxplus-regression.patch b/media-libs/tiff/files/tiff-4.4.0-hylafaxplus-regression.patch
18 new file mode 100644
19 index 000000000000..c640f6e1b1a7
20 --- /dev/null
21 +++ b/media-libs/tiff/files/tiff-4.4.0-hylafaxplus-regression.patch
22 @@ -0,0 +1,34 @@
23 +https://bugs.gentoo.org/883641
24 +https://gitlab.com/libtiff/libtiff/-/issues/489
25 +https://gitlab.com/libtiff/libtiff/-/commit/72de8fd00be8a583a6b16cc0b700105020d249ba
26 +
27 +From 72de8fd00be8a583a6b16cc0b700105020d249ba Mon Sep 17 00:00:00 2001
28 +From: Even Rouault <even.rouault@×××××××××.com>
29 +Date: Tue, 29 Nov 2022 14:57:27 +0100
30 +Subject: [PATCH] TIFFWriteRawStrip(): restore capabilities to append data in
31 + the current strip (fixes #489)
32 +
33 +This fixes a regression of libtiff 4.4.0
34 +--- a/libtiff/tif_write.c
35 ++++ b/libtiff/tif_write.c
36 +@@ -341,10 +341,13 @@ TIFFWriteRawStrip(TIFF* tif, uint32_t strip, void* data, tmsize_t cc)
37 + return ((tmsize_t) -1);
38 + }
39 +
40 +- tif->tif_curstrip = strip;
41 ++ if (tif->tif_curstrip != strip)
42 ++ {
43 ++ tif->tif_curstrip = strip;
44 +
45 +- /* this informs TIFFAppendToStrip() we have changed or reset strip */
46 +- tif->tif_curoff = 0;
47 ++ /* this informs TIFFAppendToStrip() we have changed or reset strip */
48 ++ tif->tif_curoff = 0;
49 ++ }
50 +
51 + if (td->td_stripsperimage == 0) {
52 + TIFFErrorExtR(tif, module,"Zero strips per image");
53 +--
54 +GitLab
55 +
56 +
57
58 diff --git a/media-libs/tiff/tiff-4.4.0-r2.ebuild b/media-libs/tiff/tiff-4.4.0-r2.ebuild
59 new file mode 100644
60 index 000000000000..f485be1f583a
61 --- /dev/null
62 +++ b/media-libs/tiff/tiff-4.4.0-r2.ebuild
63 @@ -0,0 +1,102 @@
64 +# Copyright 1999-2022 Gentoo Authors
65 +# Distributed under the terms of the GNU General Public License v2
66 +
67 +EAPI=8
68 +
69 +QA_PKGCONFIG_VERSION="$(ver_cut 1-3)"
70 +
71 +# Release signer can vary per version but not clear if others will be doing
72 +# them in future, so gone with Even Rouault for now as he does other geosci
73 +# stuff too like PROJ, GDAL. Previous release manager of TIFF was
74 +# GraphicsMagick maintainer Bob Friesenhahn. Please be careful when verifying
75 +# who made releases.
76 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/rouault.asc
77 +inherit multilib-minimal verify-sig libtool flag-o-matic
78 +
79 +MY_P="${P/_rc/rc}"
80 +DESCRIPTION="Tag Image File Format (TIFF) library"
81 +HOMEPAGE="http://libtiff.maptools.org"
82 +SRC_URI="https://download.osgeo.org/libtiff/${MY_P}.tar.xz"
83 +SRC_URI+=" verify-sig? ( https://download.osgeo.org/libtiff/${MY_P}.tar.xz.sig )"
84 +S="${WORKDIR}/${PN}-$(ver_cut 1-3)"
85 +
86 +LICENSE="libtiff"
87 +SLOT="0"
88 +if [[ ${PV} != *_rc* ]] ; then
89 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
90 +fi
91 +IUSE="+cxx jbig jpeg lzma static-libs test webp zlib zstd"
92 +RESTRICT="!test? ( test )"
93 +
94 +# bug #483132
95 +REQUIRED_USE="test? ( jpeg )"
96 +
97 +RDEPEND="jbig? ( >=media-libs/jbigkit-2.1:=[${MULTILIB_USEDEP}] )
98 + jpeg? ( media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}] )
99 + lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
100 + webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
101 + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
102 + zstd? ( >=app-arch/zstd-1.3.7-r1:=[${MULTILIB_USEDEP}] )"
103 +DEPEND="${RDEPEND}"
104 +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-evenrouault )"
105 +
106 +MULTILIB_WRAPPED_HEADERS=(
107 + /usr/include/tiffconf.h
108 +)
109 +
110 +PATCHES=(
111 + "${FILESDIR}"/${PN}-4.4.0_rc1-skip-thumbnail-test.patch
112 + "${FILESDIR}"/${P}-hylafaxplus-regression.patch
113 +)
114 +
115 +src_prepare() {
116 + default
117 +
118 + # Added to fix cross-compilation
119 + elibtoolize
120 +}
121 +
122 +multilib_src_configure() {
123 + append-lfs-flags
124 +
125 + local myeconfargs=(
126 + --without-x
127 + --with-docdir="${EPREFIX}"/usr/share/doc/${PF}
128 + $(use_enable cxx)
129 + $(use_enable jbig)
130 + $(use_enable jpeg)
131 + $(use_enable lzma)
132 + $(use_enable static-libs static)
133 + $(use_enable webp)
134 + $(use_enable zlib)
135 + $(use_enable zstd)
136 + )
137 +
138 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
139 +
140 + # Remove components (like tools) that are irrelevant for the multilib
141 + # build which we only want libraries for.
142 + # TODO: upstream options to disable these properly
143 + # https://gitlab.com/libtiff/libtiff/-/merge_requests/334
144 + if ! multilib_is_native_abi ; then
145 + sed -i \
146 + -e 's/ tools//' \
147 + -e 's/ contrib//' \
148 + -e 's/ man//' \
149 + -e 's/ html//' \
150 + Makefile || die
151 + fi
152 +}
153 +
154 +multilib_src_test() {
155 + if ! multilib_is_native_abi ; then
156 + emake -C tools
157 + fi
158 +
159 + emake check
160 +}
161 +
162 +multilib_src_install_all() {
163 + find "${ED}" -type f -name '*.la' -delete || die
164 + rm "${ED}"/usr/share/doc/${PF}/{COPYRIGHT,README*,RELEASE-DATE,TODO,VERSION} || die
165 +}