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