Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-libs/fltk/files/, x11-libs/fltk/
Date: Fri, 02 Sep 2016 04:28:04
Message-Id: 1472790476.90be2edd265129a81dfccbc30288095d93f3d61e.jer@gentoo
1 commit: 90be2edd265129a81dfccbc30288095d93f3d61e
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 2 04:22:25 2016 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 2 04:27:56 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90be2edd
7
8 x11-libs/fltk: Add multilib support by James Le Cuirot (bug #592434).
9
10 Package-Manager: portage-2.3.0
11
12 x11-libs/fltk/files/fltk-1.3.3-makefile-dirs.patch | 11 ++
13 x11-libs/fltk/fltk-1.3.3-r4.ebuild | 188 +++++++++++++++++++++
14 x11-libs/fltk/fltk-1.3.9999.ebuild | 137 +++++++++------
15 3 files changed, 282 insertions(+), 54 deletions(-)
16
17 diff --git a/x11-libs/fltk/files/fltk-1.3.3-makefile-dirs.patch b/x11-libs/fltk/files/fltk-1.3.3-makefile-dirs.patch
18 new file mode 100644
19 index 00000000..089855c
20 --- /dev/null
21 +++ b/x11-libs/fltk/files/fltk-1.3.3-makefile-dirs.patch
22 @@ -0,0 +1,11 @@
23 +--- a/Makefile
24 ++++ b/Makefile
25 +@@ -18,7 +18,7 @@
26 +
27 + include makeinclude
28 +
29 +-DIRS = $(IMAGEDIRS) src $(CAIRODIR) fluid test documentation
30 ++DIRS = $(IMAGEDIRS) src $(CAIRODIR)
31 +
32 + all: makeinclude fltk-config
33 + for dir in $(DIRS); do\
34
35 diff --git a/x11-libs/fltk/fltk-1.3.3-r4.ebuild b/x11-libs/fltk/fltk-1.3.3-r4.ebuild
36 new file mode 100644
37 index 00000000..de7dc98
38 --- /dev/null
39 +++ b/x11-libs/fltk/fltk-1.3.3-r4.ebuild
40 @@ -0,0 +1,188 @@
41 +# Copyright 1999-2016 Gentoo Foundation
42 +# Distributed under the terms of the GNU General Public License v2
43 +# $Id$
44 +
45 +EAPI=6
46 +inherit autotools fdo-mime flag-o-matic multilib-minimal
47 +
48 +DESCRIPTION="C++ user interface toolkit for X and OpenGL"
49 +HOMEPAGE="http://www.fltk.org/"
50 +SRC_URI="http://fltk.org/pub/${PN}/${PV}/${P}-source.tar.gz"
51 +
52 +SLOT="1"
53 +LICENSE="FLTK LGPL-2"
54 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
55 +IUSE="cairo debug doc examples games +opengl static-libs +threads +xft +xinerama"
56 +
57 +RDEPEND="
58 + >=media-libs/libpng-1.2:0=[${MULTILIB_USEDEP}]
59 + sys-libs/zlib[${MULTILIB_USEDEP}]
60 + virtual/jpeg:0=[${MULTILIB_USEDEP}]
61 + x11-libs/libICE[${MULTILIB_USEDEP}]
62 + x11-libs/libSM[${MULTILIB_USEDEP}]
63 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
64 + x11-libs/libXext[${MULTILIB_USEDEP}]
65 + x11-libs/libXfixes[${MULTILIB_USEDEP}]
66 + x11-libs/libXt[${MULTILIB_USEDEP}]
67 + cairo? ( x11-libs/cairo[${MULTILIB_USEDEP},X] )
68 + opengl? (
69 + virtual/glu[${MULTILIB_USEDEP}]
70 + virtual/opengl[${MULTILIB_USEDEP}]
71 + )
72 + xft? ( x11-libs/libXft[${MULTILIB_USEDEP}] )
73 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
74 +"
75 +DEPEND="
76 + ${RDEPEND}
77 + x11-proto/xextproto
78 + doc? ( app-doc/doxygen )
79 + xinerama? ( x11-proto/xineramaproto )
80 +"
81 +
82 +DOCS=(
83 + ANNOUNCEMENT
84 + CHANGES
85 + CREDITS
86 + README
87 +)
88 +FLTK_GAMES="
89 + blocks
90 + checkers
91 + sudoku
92 +"
93 +
94 +PATCHES=(
95 + "${FILESDIR}"/${PN}-1.3.0-share.patch
96 + "${FILESDIR}"/${PN}-1.3.2-conf-tests.patch
97 + "${FILESDIR}"/${PN}-1.3.2-desktop.patch
98 + "${FILESDIR}"/${PN}-1.3.2-jpeg-9a.patch
99 + "${FILESDIR}"/${PN}-1.3.3-fl_open_display.patch
100 + "${FILESDIR}"/${PN}-1.3.3-fltk-config.patch
101 + "${FILESDIR}"/${PN}-1.3.3-makefile-dirs.patch
102 + "${FILESDIR}"/${PN}-1.3.3-visibility.patch
103 + "${FILESDIR}"/${PN}-1.3.3-xutf8-visibility.patch
104 +)
105 +
106 +pkg_setup() {
107 + unset FLTK_LIBDIRS
108 +}
109 +
110 +src_prepare() {
111 + default
112 +
113 + rm -rf zlib jpeg png || die
114 +
115 + sed -i \
116 + -e 's:@HLINKS@::g' FL/Makefile.in || die
117 + # docs in proper docdir
118 + sed -i \
119 + -e "/^docdir/s:fltk:${PF}/html:" \
120 + -e "/SILENT:/d" \
121 + makeinclude.in || die
122 + sed -e "s/7/${PV}/" \
123 + < "${FILESDIR}"/FLTKConfig.cmake \
124 + > CMake/FLTKConfig.cmake || die
125 + sed -e 's:-Os::g' -i configure.in || die
126 +
127 + # also in Makefile:config.guess config.sub:
128 + cp misc/config.{guess,sub} . || die
129 +
130 + eautoconf
131 + multilib_copy_sources
132 +}
133 +
134 +multilib_src_configure() {
135 + local FLTK_INCDIR=${EPREFIX}/usr/include/fltk
136 + local FLTK_LIBDIR=${EPREFIX}/usr/$(get_libdir)/fltk
137 + FLTK_LIBDIRS+=${FLTK_LIBDIRS+:}${FLTK_LIBDIR}
138 +
139 + multilib_is_native_abi && use prefix &&
140 + append-ldflags -Wl,-rpath -Wl,"${FLTK_LIBDIR}"
141 +
142 + econf \
143 + $(use_enable cairo) \
144 + $(use_enable debug) \
145 + $(use_enable opengl gl) \
146 + $(use_enable threads) \
147 + $(use_enable xft) \
148 + $(use_enable xinerama) \
149 + --disable-localjpeg \
150 + --disable-localpng \
151 + --disable-localzlib \
152 + --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
153 + --enable-largefile \
154 + --enable-shared \
155 + --enable-xcursor \
156 + --enable-xdbe \
157 + --enable-xfixes \
158 + --includedir=${FLTK_INCDIR} \
159 + --libdir=${FLTK_LIBDIR}
160 +}
161 +
162 +multilib_src_compile() {
163 + # Prevent reconfigure on non-native ABIs.
164 + touch -r makeinclude config.{guess,sub} || die
165 +
166 + default
167 +
168 + if multilib_is_native_abi; then
169 + emake -C fluid
170 + use doc && emake -C documentation html
171 + use games && emake -C test ${FLTK_GAMES}
172 + fi
173 +}
174 +
175 +multilib_src_test() {
176 + emake -C fluid
177 + emake -C test
178 +}
179 +
180 +multilib_src_install() {
181 + default
182 +
183 + if multilib_is_native_abi; then
184 + emake -C fluid DESTDIR="${D}" install-linux
185 +
186 + use doc && \
187 + emake -C documentation DESTDIR="${D}" install
188 +
189 + use games && \
190 + emake -C test DESTDIR="${D}" install-linux
191 + fi
192 +}
193 +
194 +multilib_src_install_all() {
195 + for app in fluid $(usex games "${FLTK_GAMES}" ''); do
196 + dosym \
197 + /usr/share/icons/hicolor/32x32/apps/${app}.png \
198 + /usr/share/pixmaps/${app}.png
199 + done
200 +
201 + if use examples; then
202 + insinto /usr/share/doc/${PF}/examples
203 + doins test/*.{h,cxx,fl} test/demo.menu
204 + fi
205 +
206 + insinto /usr/share/cmake/Modules
207 + doins CMake/FLTK*.cmake
208 +
209 + echo "LDPATH=${FLTK_LIBDIRS}" > 99fltk || die
210 + echo "FLTK_DOCDIR=${EPREFIX}/usr/share/doc/${PF}/html" >> 99fltk || die
211 + doenvd 99fltk
212 +
213 + # FIXME: This is bad, but building only shared libraries is hardly supported
214 + # FIXME: The executables in test/ are linking statically against libfltk
215 + if ! use static-libs; then
216 + rm "${ED}"/usr/lib*/fltk/*.a || die
217 + fi
218 +
219 + prune_libtool_files
220 +}
221 +
222 +pkg_postinst() {
223 + fdo-mime_desktop_database_update
224 +}
225 +
226 +pkg_postrm() {
227 + fdo-mime_desktop_database_update
228 +}
229
230 diff --git a/x11-libs/fltk/fltk-1.3.9999.ebuild b/x11-libs/fltk/fltk-1.3.9999.ebuild
231 index 7e769f7..4646fdd 100644
232 --- a/x11-libs/fltk/fltk-1.3.9999.ebuild
233 +++ b/x11-libs/fltk/fltk-1.3.9999.ebuild
234 @@ -2,8 +2,8 @@
235 # Distributed under the terms of the GNU General Public License v2
236 # $Id$
237
238 -EAPI=5
239 -inherit autotools eutils fdo-mime flag-o-matic subversion
240 +EAPI=6
241 +inherit autotools fdo-mime flag-o-matic multilib-minimal subversion
242
243 DESCRIPTION="C++ user interface toolkit for X and OpenGL"
244 HOMEPAGE="http://www.fltk.org/"
245 @@ -17,17 +17,22 @@ KEYWORDS=""
246 IUSE="cairo debug doc examples games +opengl static-libs +threads +xft +xinerama"
247
248 RDEPEND="
249 - >=media-libs/libpng-1.2:0
250 - virtual/jpeg:0
251 - sys-libs/zlib
252 - x11-libs/libICE
253 - x11-libs/libSM
254 - x11-libs/libXext
255 - x11-libs/libXt
256 - cairo? ( x11-libs/cairo[X] )
257 - opengl? ( virtual/glu virtual/opengl )
258 - xinerama? ( x11-libs/libXinerama )
259 - xft? ( x11-libs/libXft )
260 + >=media-libs/libpng-1.2:0=[${MULTILIB_USEDEP}]
261 + sys-libs/zlib[${MULTILIB_USEDEP}]
262 + virtual/jpeg:0=[${MULTILIB_USEDEP}]
263 + x11-libs/libICE[${MULTILIB_USEDEP}]
264 + x11-libs/libSM[${MULTILIB_USEDEP}]
265 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
266 + x11-libs/libXext[${MULTILIB_USEDEP}]
267 + x11-libs/libXfixes[${MULTILIB_USEDEP}]
268 + x11-libs/libXt[${MULTILIB_USEDEP}]
269 + cairo? ( x11-libs/cairo[${MULTILIB_USEDEP},X] )
270 + opengl? (
271 + virtual/glu[${MULTILIB_USEDEP}]
272 + virtual/opengl[${MULTILIB_USEDEP}]
273 + )
274 + xft? ( x11-libs/libXft[${MULTILIB_USEDEP}] )
275 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
276 "
277 DEPEND="
278 ${RDEPEND}
279 @@ -36,23 +41,43 @@ DEPEND="
280 xinerama? ( x11-proto/xineramaproto )
281 "
282
283 +DOCS=(
284 + ANNOUNCEMENT
285 + CHANGES
286 + CREDITS
287 + README
288 +)
289 +
290 +FLTK_GAMES="
291 + blocks
292 + checkers
293 + sudoku
294 +"
295 +
296 +PATCHES=(
297 + "${FILESDIR}"/${PN}-1.3.0-share.patch
298 + "${FILESDIR}"/${PN}-1.3.2-conf-tests.patch
299 + "${FILESDIR}"/${PN}-1.3.3-makefile-dirs.patch
300 + "${FILESDIR}"/${PN}-1.3.3-visibility.patch
301 +)
302 +
303 +pkg_setup() {
304 + unset FLTK_LIBDIRS
305 +}
306 +
307 src_prepare() {
308 + default
309 +
310 rm -rf zlib jpeg png || die
311 - epatch \
312 - "${FILESDIR}"/${PN}-1.3.0-share.patch \
313 - "${FILESDIR}"/${PN}-1.3.2-conf-tests.patch \
314 - "${FILESDIR}"/${PN}-1.3.3-visibility.patch
315
316 sed -i \
317 -e 's:@HLINKS@::g' FL/Makefile.in || die
318 sed -i \
319 + -e '/x-fluid/d' fluid/Makefile || die
320 + sed -i \
321 -e '/C\(XX\)\?FLAGS=/s:@C\(XX\)\?FLAGS@::' \
322 -e '/^LDFLAGS=/d' \
323 "${S}/fltk-config.in" || die
324 - # some fixes introduced because slotting
325 - sed -i \
326 - -e '/RANLIB/s:$(libdir)/\(.*LIBNAME)\):$(libdir)/`basename \1`:g' \
327 - src/Makefile || die
328 # docs in proper docdir
329 sed -i \
330 -e "/^docdir/s:fltk:${PF}/html:" \
331 @@ -63,17 +88,20 @@ src_prepare() {
332 > CMake/FLTKConfig.cmake || die
333 sed -e 's:-Os::g' -i configure.in || die
334
335 - use prefix && append-ldflags -Wl,-rpath -Wl,"${FLTK_LIBDIR}"
336 -
337 # also in Makefile:config.guess config.sub:
338 cp misc/config.{guess,sub} . || die
339
340 eautoconf
341 + multilib_copy_sources
342 }
343
344 -src_configure() {
345 - FLTK_INCDIR=${EPREFIX}/usr/include/fltk
346 - FLTK_LIBDIR=${EPREFIX}/usr/$(get_libdir)/fltk
347 +multilib_src_configure() {
348 + local FLTK_INCDIR=${EPREFIX}/usr/include/fltk
349 + local FLTK_LIBDIR=${EPREFIX}/usr/$(get_libdir)/fltk
350 + FLTK_LIBDIRS+=${FLTK_LIBDIRS+:}${FLTK_LIBDIR}
351 +
352 + multilib_is_native_abi && use prefix &&
353 + append-ldflags -Wl,-rpath -Wl,"${FLTK_LIBDIR}"
354
355 econf \
356 $(use_enable cairo) \
357 @@ -88,53 +116,54 @@ src_configure() {
358 --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
359 --enable-largefile \
360 --enable-shared \
361 + --enable-xcursor \
362 --enable-xdbe \
363 + --enable-xfixes \
364 --includedir=${FLTK_INCDIR} \
365 --libdir=${FLTK_LIBDIR}
366 }
367
368 -src_compile() {
369 - default
370 +multilib_src_compile() {
371 + # Prevent reconfigure on non-native ABIs.
372 + touch -r makeinclude config.{guess,sub} || die
373
374 - if use doc; then
375 - emake -C documentation html
376 - fi
377 + default
378
379 - if use games; then
380 - emake -C test blocks checkers sudoku
381 + if multilib_is_native_abi; then
382 + emake -C fluid
383 + use doc && emake -C documentation html
384 + use games && emake -C test ${FLTK_GAMES}
385 fi
386 }
387
388 -src_test() {
389 +multilib_src_test() {
390 + emake -C fluid
391 emake -C test
392 }
393
394 -src_install() {
395 +multilib_src_install() {
396 default
397
398 - emake -C fluid \
399 - DESTDIR="${D}" install-linux
400 - if use doc; then
401 - emake -C documentation \
402 - DESTDIR="${D}" install
403 - fi
404 + if multilib_is_native_abi; then
405 + emake -C fluid \
406 + DESTDIR="${D}" install-linux
407 +
408 + use doc &&
409 + emake -C documentation \
410 + DESTDIR="${D}" install
411
412 - local apps="fluid"
413 - if use games; then
414 - emake -C test \
415 - DESTDIR="${D}" install-linux
416 - emake -C documentation \
417 - DESTDIR="${D}" install-linux
418 - apps+=" sudoku blocks checkers"
419 + use games &&
420 + emake -C test \
421 + DESTDIR="${D}" install-linux
422 fi
423 +}
424
425 - for app in ${apps}; do
426 +multilib_src_install_all() {
427 + for app in fluid $(usex games "${FLTK_GAMES}" ''); do
428 dosym /usr/share/icons/hicolor/32x32/apps/${app}.png \
429 - /usr/share/pixmaps/${app}.png
430 + /usr/share/pixmaps/${app}.png
431 done
432
433 - dodoc CHANGES README CREDITS ANNOUNCEMENT
434 -
435 if use examples; then
436 insinto /usr/share/doc/${PF}/examples
437 doins test/*.{h,cxx,fl} test/demo.menu
438 @@ -143,8 +172,8 @@ src_install() {
439 insinto /usr/share/cmake/Modules
440 doins CMake/FLTK*.cmake
441
442 - echo "LDPATH=${FLTK_LIBDIR}" > 99fltk
443 - echo "FLTK_DOCDIR=${EPREFIX}/usr/share/doc/${PF}/html" >> 99fltk
444 + echo "LDPATH=${FLTK_LIBDIRS}" > 99fltk || die
445 + echo "FLTK_DOCDIR=${EPREFIX}/usr/share/doc/${PF}/html" >> 99fltk || die
446 doenvd 99fltk
447
448 # FIXME: This is bad, but building only shared libraries is hardly supported