Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/freeimage/files/, media-libs/freeimage/
Date: Mon, 30 May 2022 20:27:41
Message-Id: 1653942345.01647baea4dca5b7c53519672abae1160e596d3f.ionen@gentoo
1 commit: 01647baea4dca5b7c53519672abae1160e596d3f
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 30 20:13:20 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Mon May 30 20:25:45 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01647bae
7
8 media-libs/freeimage: fix revdeps when using >=tiff-4.4.0
9
10 Closes: https://bugs.gentoo.org/848531
11 Closes: https://bugs.gentoo.org/848534
12 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
13
14 .../files/freeimage-3.18.0-tiff-4.4.0.patch | 12 ++
15 media-libs/freeimage/freeimage-3.18.0-r8.ebuild | 125 +++++++++++++++++++++
16 2 files changed, 137 insertions(+)
17
18 diff --git a/media-libs/freeimage/files/freeimage-3.18.0-tiff-4.4.0.patch b/media-libs/freeimage/files/freeimage-3.18.0-tiff-4.4.0.patch
19 new file mode 100644
20 index 000000000000..a0c39064aa34
21 --- /dev/null
22 +++ b/media-libs/freeimage/files/freeimage-3.18.0-tiff-4.4.0.patch
23 @@ -0,0 +1,12 @@
24 +https://bugs.gentoo.org/848531
25 +https://bugs.gentoo.org/848534
26 +https://www.asmail.be/msg0055228425.html
27 +--- a/Source/Metadata/XTIFF.cpp
28 ++++ b/Source/Metadata/XTIFF.cpp
29 +@@ -750,5 +750,5 @@
30 + }
31 + // type of storage may differ (e.g. rationnal array vs float array type)
32 +- if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) {
33 ++ if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) {
34 + // skip tag or _TIFFmemcpy will fail
35 + continue;
36
37 diff --git a/media-libs/freeimage/freeimage-3.18.0-r8.ebuild b/media-libs/freeimage/freeimage-3.18.0-r8.ebuild
38 new file mode 100644
39 index 000000000000..aef7915a1072
40 --- /dev/null
41 +++ b/media-libs/freeimage/freeimage-3.18.0-r8.ebuild
42 @@ -0,0 +1,125 @@
43 +# Copyright 1999-2022 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI=8
47 +
48 +inherit edos2unix toolchain-funcs
49 +
50 +MY_PN=FreeImage
51 +MY_PV=${PV//.}
52 +MY_P=${MY_PN}${MY_PV}
53 +
54 +DESCRIPTION="Image library supporting many formats"
55 +HOMEPAGE="https://freeimage.sourceforge.io/"
56 +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip
57 + mirror://sourceforge/${PN}/${MY_P}.pdf
58 + https://dev.gentoo.org/~juippis/distfiles/tmp/freeimage-3.18.0-unbundling.patch"
59 +
60 +LICENSE="|| ( GPL-2 FIPL-1.0 )"
61 +SLOT="0"
62 +KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86 ~amd64-linux ~x86-linux"
63 +IUSE="jpeg jpeg2k mng openexr png raw static-libs tiff webp"
64 +
65 +# The tiff/imath+openexr isn't a typo. The TIFF plugin cheats and
66 +# uses code from it to handle 16bit<->float conversions.
67 +RDEPEND="
68 + sys-libs/zlib
69 + jpeg? ( media-libs/libjpeg-turbo:= )
70 + jpeg2k? ( media-libs/openjpeg:2= )
71 + mng? ( media-libs/libmng:= )
72 + openexr? ( media-libs/openexr:= )
73 + png? ( media-libs/libpng:0= )
74 + raw? ( media-libs/libraw:= )
75 + tiff? (
76 + >=dev-libs/imath-3.1.4-r2:=
77 + >=media-libs/openexr-3:0=
78 + >=media-libs/tiff-4.4.0
79 + )
80 + webp? ( media-libs/libwebp:= )"
81 +DEPEND="${RDEPEND}"
82 +BDEPEND="
83 + app-arch/unzip
84 + virtual/pkgconfig"
85 +
86 +S=${WORKDIR}/${MY_PN}
87 +
88 +DOCS=( "${DISTDIR}"/${MY_P}.pdf README.linux Whatsnew.txt )
89 +
90 +PATCHES=(
91 + "${DISTDIR}"/${PN}-3.18.0-unbundling.patch
92 + "${FILESDIR}"/${PN}-3.18.0-remove-jpeg-transform.patch
93 + "${FILESDIR}"/${PN}-3.18.0-rename-jpeg_read_icc_profile.patch
94 + "${FILESDIR}"/${PN}-3.18.0-disable-plugin-G3.patch
95 + "${FILESDIR}"/${PN}-3.18.0-raw.patch
96 + "${FILESDIR}"/${PN}-3.18.0-libjpeg9.patch
97 + "${FILESDIR}"/${PN}-3.18.0-CVE-2019-12211-CVE-2019-12213.patch
98 + "${FILESDIR}"/${PN}-3.18.0-openexr-3-imath.patch
99 + "${FILESDIR}"/${PN}-3.18.0-libraw-0.20.0.patch
100 + "${FILESDIR}"/${PN}-3.18.0-tiff-4.4.0.patch
101 +)
102 +
103 +src_prepare() {
104 + pushd Source >/dev/null || die
105 + cp LibJPEG/{transupp.c,transupp.h,jinclude.h} . || die
106 + cp LibTIFF4/{tiffiop,tif_dir}.h . || die
107 + rm -rf LibPNG LibMNG LibOpenJPEG ZLib OpenEXR LibRawLite LibTIFF4 LibJPEG LibWebP LibJXR || die
108 + popd >/dev/null || die
109 +
110 + edos2unix Makefile.{gnu,fip,srcs} fipMakefile.srcs */*.h */*/*.cpp
111 + sed -i \
112 + -e "s:/./:/:g" \
113 + -e "s: ./: :g" \
114 + -e 's: Source: \\\n\tSource:g' \
115 + -e 's: Wrapper: \\\n\tWrapper:g' \
116 + -e 's: Examples: \\\n\tExamples:g' \
117 + -e 's: TestAPI: \\\n\tTestAPI:g' \
118 + -e 's: -ISource: \\\n\t-ISource:g' \
119 + -e 's: -IWrapper: \\\n\t-IWrapper:g' \
120 + -e 's:INCLS:\nINCLS:g' \
121 + Makefile.srcs fipMakefile.srcs || die
122 + sed -i \
123 + -e "/LibJPEG/d" \
124 + -e "/LibJXR/d" \
125 + -e "/LibPNG/d" \
126 + -e "/LibTIFF/d" \
127 + -e "/Source\/ZLib/d" \
128 + -e "/LibOpenJPEG/d" \
129 + -e "/OpenEXR/d" \
130 + -e "/LibRawLite/d" \
131 + -e "/LibMNG/d" \
132 + -e "/LibWebP/d" \
133 + -e "/LibJXR/d" \
134 + Makefile.srcs fipMakefile.srcs || die
135 +
136 + default
137 +}
138 +
139 +foreach_make() {
140 + local m
141 + for m in Makefile.{gnu,fip} ; do
142 + emake -f ${m} \
143 + USE_EXR=$(usex openexr) \
144 + USE_JPEG=$(usex jpeg) \
145 + USE_JPEG2K=$(usex jpeg2k) \
146 + USE_MNG=$(usex mng) \
147 + USE_PNG=$(usex png) \
148 + USE_TIFF=$(usex tiff) \
149 + USE_RAW=$(usex raw) \
150 + USE_WEBP=$(usex webp) \
151 + $(usex static-libs '' STATICLIB=) \
152 + "$@"
153 + done
154 +}
155 +
156 +src_compile() {
157 + tc-export AR PKG_CONFIG
158 + foreach_make \
159 + CXX="$(tc-getCXX) -fPIC" \
160 + CC="$(tc-getCC) -fPIC" \
161 + ${MY_PN}
162 +}
163 +
164 +src_install() {
165 + foreach_make install DESTDIR="${ED}" INSTALLDIR="${ED}"/usr/$(get_libdir)
166 + einstalldocs
167 +}