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