Gentoo Archives: gentoo-commits

From: Viorel Munteanu <ceamac@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/netpbm/
Date: Tue, 01 Nov 2022 13:03:42
Message-Id: 1667307762.e78c4a4c24edc321ad101b408b7de0a01981f59e.ceamac@gentoo
1 commit: e78c4a4c24edc321ad101b408b7de0a01981f59e
2 Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com>
3 AuthorDate: Tue Oct 4 17:42:33 2022 +0000
4 Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 1 13:02:42 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e78c4a4c
7
8 media-libs/netpbm: add 10.86.35
9
10 Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/27620
12 Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
13
14 media-libs/netpbm/Manifest | 1 +
15 media-libs/netpbm/netpbm-10.86.35.ebuild | 249 +++++++++++++++++++++++++++++++
16 2 files changed, 250 insertions(+)
17
18 diff --git a/media-libs/netpbm/Manifest b/media-libs/netpbm/Manifest
19 index e3db9a3cba28..0ed08d4bfe11 100644
20 --- a/media-libs/netpbm/Manifest
21 +++ b/media-libs/netpbm/Manifest
22 @@ -1,2 +1,3 @@
23 DIST netpbm-10.86.34.tar.xz 3698852 BLAKE2B 7ea0e93450fb0bdf50b1b498468dd32350f20c8e993cda3e0ffa942dcdeab775a532a4771b10c55c862340964a4520f51ea4916c20051d5140dbb0a9ce373860 SHA512 bbb4dc685a44c0d7733808edd938b1205891ae5cf312218ef717bf63053513058251a659e3cf9acc762b0aeec8da3fc8e8a05e1442591c87f5a1dce7f63ee870
24 +DIST netpbm-10.86.35.tar.xz 3699944 BLAKE2B 754b695ab25ba2c3ff0cdc8d3810a3df7af9a30476dfd6afa70591df0931334806ad41da41797e3f6121b77b7e3fb77a3c01ebc533812e9a8cb3ccb3eb6c19ea SHA512 a4a0107f04ccdef066d340f97a7d3487a2b349dd5994b294fd815813bb04db10063ba933442ef77e27a96fb3b31a5769f3a19532a651b802f14667dbf43c06f5
25 DIST netpbm-11.0.1.tar.xz 3767852 BLAKE2B 4bea578c9dc7da252817ab6dcb80d7dae462d271cc02d7d58a7608e02dbae57d2996908ab35bf341c5a4378a93bfb33f39e7cb90732b0b028a1bf616bcbd6b2e SHA512 18c9d2f91641b878e7c623f768f2740f0d7d29aae23a87ecc17ceaedd00b9a2d32863c7da6f05ccbeffea1ceadac897d9bfab86489bbb23ebf11a104d6b1991e
26
27 diff --git a/media-libs/netpbm/netpbm-10.86.35.ebuild b/media-libs/netpbm/netpbm-10.86.35.ebuild
28 new file mode 100644
29 index 000000000000..17517a63fb8a
30 --- /dev/null
31 +++ b/media-libs/netpbm/netpbm-10.86.35.ebuild
32 @@ -0,0 +1,249 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +inherit flag-o-matic multilib toolchain-funcs
39 +
40 +# Upstream has 3 flavors of netpbm: super stable, stable and advanced.
41 +# They only provide a tarball for super stable, but super stable is a bit lagging.
42 +# So we package the stable branch of their svn (currently versions 10.86.xx) on SLOT "0/stable"
43 +# and the advanced branch of their svn (currently versions 11.aa.bb) on SLOT "0/advanced".
44 +# The stable branch is stabilized according to usual Gentoo rules, while the
45 +# advanced branch will not be stabilized.
46 +# A detailed explanation is here https://netpbm.sourceforge.net/release.html
47 +
48 +# libnetpbm.so is not 100% ABI compatible between stable and advanced, so
49 +# packages that depend on it should use "media-libs/netpbm:="
50 +
51 +DESCRIPTION="A set of utilities for converting to/from the netpbm (and related) formats"
52 +HOMEPAGE="https://netpbm.sourceforge.net/"
53 +SRC_URI="https://github.com/ceamac/netpbm-make-dist/releases/download/v${PV}/${P}.tar.xz"
54 +
55 +LICENSE="Artistic BSD GPL-2 IJG LGPL-2.1 MIT public-domain"
56 +SLOT="0/stable"
57 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
58 +IUSE="jbig jpeg png postscript rle cpu_flags_x86_sse2 static-libs svga tiff X xml"
59 +
60 +# app-text/ghostscript-gpl is really needed for postscript
61 +# some utilities execute /usr/bin/gs
62 +# also some installed programs are perl scripts
63 +RDEPEND="
64 + dev-lang/perl
65 + jbig? ( media-libs/jbigkit:= )
66 + jpeg? ( media-libs/libjpeg-turbo:=[static-libs?] )
67 + png? (
68 + >=media-libs/libpng-1.4:0=
69 + sys-libs/zlib
70 + )
71 + postscript? (
72 + app-text/ghostscript-gpl
73 + sys-libs/zlib
74 + )
75 + rle? ( media-libs/urt:= )
76 + svga? ( media-libs/svgalib )
77 + tiff? ( >=media-libs/tiff-3.5.5:0 )
78 + xml? ( dev-libs/libxml2 )
79 + X? ( x11-libs/libX11 )
80 +"
81 +
82 +DEPEND="
83 + ${RDEPEND}
84 + x11-base/xorg-proto
85 +"
86 +
87 +BDEPEND="
88 + app-arch/xz-utils
89 + sys-devel/flex
90 + virtual/pkgconfig
91 +"
92 +
93 +PATCHES=(
94 + "${FILESDIR}"/netpbm-10.86.21-build.patch
95 + "${FILESDIR}"/netpbm-10.86.21-test.patch #450530
96 + "${FILESDIR}"/netpbm-10.86.21-misc-deps.patch
97 + "${FILESDIR}"/netpbm-10.86.22-fix-ps-test.patch #670362
98 +)
99 +
100 +netpbm_libtype() {
101 + case ${CHOST} in
102 + *-darwin*) echo dylib;;
103 + *) echo unixshared;;
104 + esac
105 +}
106 +
107 +netpbm_libsuffix() {
108 + local suffix=$(get_libname)
109 + echo ${suffix//\.}
110 +}
111 +
112 +netpbm_ldshlib() {
113 + case ${CHOST} in
114 + *-darwin*) echo '$(LDFLAGS) -dynamiclib -install_name $(SONAME)';;
115 + *) echo '$(LDFLAGS) -shared -Wl,-soname,$(SONAME)';;
116 + esac
117 +}
118 +netpbm_config() {
119 + if use ${1} ; then
120 + [[ ${2} != "!" ]] && echo -l${2:-$1}
121 + else
122 + echo NONE
123 + fi
124 +}
125 +
126 +# for bug #828127
127 +netpbm_cflags_for_build() {
128 + if is-flagq -fPIC; then
129 + echo -fPIC
130 + fi
131 +}
132 +
133 +src_prepare() {
134 + default
135 +
136 + # make sure we use system libs
137 + sed -i '/SUPPORT_SUBDIRS/s:urt::' GNUmakefile || die
138 + rm -r urt converter/other/jbig/libjbig converter/other/jpeg2000/libjasper || die
139 +
140 + # take care of the importinc stuff ourselves by only doing it once
141 + # at the top level and having all subdirs use that one set #149843
142 + sed -i \
143 + -e '/^importinc:/s|^|importinc:\nmanual_|' \
144 + -e '/-Iimportinc/s|-Iimp|-I"$(BUILDDIR)"/imp|g'\
145 + common.mk || die
146 + sed -i \
147 + -e '/%.c/s: importinc$::' \
148 + common.mk lib/Makefile lib/util/Makefile || die
149 + sed -i \
150 + -e 's:pkg-config:$(PKG_CONFIG):' \
151 + GNUmakefile converter/other/Makefile other/pamx/Makefile || die
152 +
153 + # The postscript knob is currently bound up with a fork test.
154 + if ! use postscript ; then
155 + sed -i \
156 + -e 's:$(DONT_HAVE_PROCESS_MGMT):Y:' \
157 + converter/other/Makefile generator/Makefile || die
158 + sed -i -r \
159 + -e 's:(pbmtextps|pnmtops|pstopnm).*::' \
160 + test/all-in-place.{ok,test} || die
161 + sed -i -e 's:lps-roundtrip.*::' test/Test-Order || die
162 + sed -i -e '/^$/d' test/all-in-place.ok || die
163 + sed -i '2iexit 80' test/ps-{alt-,flate-,}roundtrip.test || die
164 + fi
165 +
166 + # the new postscript test needs +x
167 + chmod +x test/lps-roundtrip.test
168 +
169 + # Do not test png if not built
170 + if ! use png ; then
171 + sed -i -r \
172 + -e 's:(pamtopng|pngtopam|pnmtopng).*::' \
173 + test/all-in-place.{ok,test} || die
174 + sed -i -e '/^$/d' test/all-in-place.ok || die
175 +
176 + sed -i -r \
177 + -e 's:(pamrgbatopng|pngtopnm).*::' \
178 + test/legacy-names.{ok,test} || die
179 + sed -i -e '/^$/d' test/legacy-names.ok || die
180 + sed -i -e 's:png-roundtrip.*::' test/Test-Order || die
181 + fi
182 +
183 + # this test requires LC_ALL=en_US.iso88591, not available on musl
184 + if use elibc_musl; then
185 + sed -i -e 's:pbmtext-iso88591.*::' test/Test-Order || die
186 + fi
187 +}
188 +
189 +src_configure() {
190 + # cannot chain the die with the heredoc
191 + # repoman tries to parse the heredoc and fails
192 + cat config.mk.in - >> config.mk <<-EOF
193 + # Misc stuff
194 + BUILD_FIASCO = N
195 + SYMLINK = ln -sf
196 +
197 + # These vars let src_test work by default
198 + PKGDIR_DEFAULT = ${T}/netpbm
199 + RESULTDIR_DEFAULT = ${T}/netpbm-test
200 +
201 + # Toolchain options
202 + CC = $(tc-getCC) -Wall
203 + LD = \$(CC)
204 + CC_FOR_BUILD = $(tc-getBUILD_CC)
205 + LD_FOR_BUILD = \$(CC_FOR_BUILD)
206 + AR = $(tc-getAR)
207 + RANLIB = $(tc-getRANLIB)
208 + PKG_CONFIG = $(tc-getPKG_CONFIG)
209 +
210 + STRIPFLAG =
211 + CFLAGS_SHLIB = -fPIC
212 + CFLAGS_FOR_BUILD += $(netpbm_cflags_for_build)
213 +
214 + LDRELOC = \$(LD) -r
215 + LDSHLIB = $(netpbm_ldshlib)
216 + LINKER_CAN_DO_EXPLICIT_LIBRARY = N # we can, but dont want to
217 + LINKERISCOMPILER = Y
218 + NETPBMLIBSUFFIX = $(netpbm_libsuffix)
219 + NETPBMLIBTYPE = $(netpbm_libtype)
220 + STATICLIB_TOO = $(usex static-libs Y N)
221 +
222 + # The var is called SSE, but the code is actually SSE2.
223 + WANT_SSE = $(usex cpu_flags_x86_sse2 Y N)
224 +
225 + # Gentoo build options
226 + TIFFLIB = $(netpbm_config tiff)
227 + # Let tiff worry about its own dependencies #395753
228 + TIFFLIB_NEEDS_JPEG = N
229 + TIFFLIB_NEEDS_Z = N
230 + JPEGLIB = $(netpbm_config jpeg)
231 + PNGLIB = $(netpbm_config png)
232 + ZLIB = $($(tc-getPKG_CONFIG) --libs zlib)
233 + LINUXSVGALIB = $(netpbm_config svga vga)
234 + XML2_LIBS = $(netpbm_config xml xml2)
235 + JBIGLIB = $(netpbm_config jbig)
236 + JBIGHDR_DIR =
237 + JASPERLIB = NONE
238 + JASPERHDR_DIR =
239 + URTLIB = $(netpbm_config rle)
240 + URTHDR_DIR =
241 + X11LIB = $(netpbm_config X X11)
242 + X11HDR_DIR =
243 + EOF
244 + [[ $? -eq 0 ]] || die "writing config.mk failed"
245 +}
246 +
247 +src_compile() {
248 + emake -j1 pm_config.h version.h manual_importinc #149843
249 + emake
250 +}
251 +
252 +src_test() {
253 + # The code wants to install everything first and then test the result.
254 + emake install.{bin,lib,data}
255 + emake check
256 +}
257 +
258 +src_install() {
259 + # Subdir make targets like to use `mkdir` all over the place
260 + # without any actual dependencies, thus the -j1.
261 + emake -j1 package pkgdir="${ED}"/usr
262 +
263 + if [[ $(get_libdir) != "lib" ]] ; then
264 + mv "${ED}"/usr/lib "${ED}"/usr/$(get_libdir) || die
265 + fi
266 +
267 + # Remove cruft that we don't need, and move around stuff we want
268 + rm "${ED}"/usr/{README,VERSION,{pkgconfig,config}_template,pkginfo} || die
269 +
270 + dodir /usr/share
271 + mv "${ED}"/usr/misc "${ED}"/usr/share/netpbm || die
272 +
273 + doman userguide/*.[0-9]
274 + dodoc README
275 +
276 + cd doc || die
277 + dodoc HISTORY Netpbm.programming USERDOC
278 + docinto html
279 + dodoc -r *.html
280 + dodoc -r ../userguide/*.html
281 +}