Line 0
Link Here
|
|
|
1 |
diff -Naur a/Makefile b/Makefile |
2 |
--- a/Makefile 2014-08-01 21:56:09.000000000 +0100 |
Line 0
Link Here
|
|
|
1 |
# Copyright 1999-2016 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Id$ |
4 |
|
5 |
EAPI=6 |
6 |
|
7 |
inherit autotools flag-o-matic multilib-minimal xdg |
8 |
|
9 |
DESCRIPTION="C++ user interface toolkit for X and OpenGL" |
10 |
HOMEPAGE="http://www.fltk.org/" |
11 |
SRC_URI="http://fltk.org/pub/${PN}/${PV}/${P}-source.tar.gz" |
12 |
|
13 |
SLOT="1" |
14 |
LICENSE="FLTK LGPL-2" |
15 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos" |
16 |
IUSE="cairo debug doc examples games +opengl static-libs +threads +xft +xinerama" |
17 |
|
18 |
RDEPEND=" |
19 |
>=media-libs/libpng-1.2:0=[${MULTILIB_USEDEP}] |
20 |
sys-libs/zlib[${MULTILIB_USEDEP}] |
21 |
virtual/jpeg:0=[${MULTILIB_USEDEP}] |
22 |
x11-libs/libICE[${MULTILIB_USEDEP}] |
23 |
x11-libs/libSM[${MULTILIB_USEDEP}] |
24 |
x11-libs/libXcursor[${MULTILIB_USEDEP}] |
25 |
x11-libs/libXext[${MULTILIB_USEDEP}] |
26 |
x11-libs/libXfixes[${MULTILIB_USEDEP}] |
27 |
x11-libs/libXt[${MULTILIB_USEDEP}] |
28 |
cairo? ( x11-libs/cairo[${MULTILIB_USEDEP},X] ) |
29 |
opengl? ( |
30 |
virtual/glu[${MULTILIB_USEDEP}] |
31 |
virtual/opengl[${MULTILIB_USEDEP}] ) |
32 |
xft? ( x11-libs/libXft[${MULTILIB_USEDEP}] ) |
33 |
xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] ) |
34 |
" |
35 |
DEPEND=" |
36 |
${RDEPEND} |
37 |
x11-proto/xextproto |
38 |
doc? ( app-doc/doxygen ) |
39 |
xinerama? ( x11-proto/xineramaproto ) |
40 |
" |
41 |
|
42 |
PATCHES=( |
43 |
"${FILESDIR}"/${PN}-1.3.2-desktop.patch |
44 |
"${FILESDIR}"/${PN}-1.3.0-share.patch |
45 |
"${FILESDIR}"/${PN}-1.3.2-conf-tests.patch |
46 |
"${FILESDIR}"/${PN}-1.3.2-jpeg-9a.patch |
47 |
"${FILESDIR}"/${PN}-1.3.3-visibility.patch |
48 |
"${FILESDIR}"/${PN}-1.3.3-fl_open_display.patch |
49 |
"${FILESDIR}"/${PN}-1.3.3-fltk-config.patch |
50 |
"${FILESDIR}"/${PN}-1.3.3-xutf8-visibility.patch |
51 |
"${FILESDIR}"/${PN}-1.3.3-makefile-dirs.patch |
52 |
) |
53 |
|
54 |
DOCS=( |
55 |
ANNOUNCEMENT |
56 |
CHANGES |
57 |
CREDITS |
58 |
README |
59 |
) |
60 |
|
61 |
pkg_setup() { |
62 |
unset FLTK_LIBDIRS |
63 |
} |
64 |
|
65 |
src_prepare() { |
66 |
xdg_src_prepare |
67 |
|
68 |
rm -rf zlib jpeg png || die |
69 |
|
70 |
sed -i \ |
71 |
-e 's:@HLINKS@::g' FL/Makefile.in || die |
72 |
# some fixes introduced because slotting |
73 |
sed -i \ |
74 |
-e '/RANLIB/s:$(libdir)/\(.*LIBNAME)\):$(libdir)/`basename \1`:g' \ |
75 |
src/Makefile || die |
76 |
# docs in proper docdir |
77 |
sed -i \ |
78 |
-e "/^docdir/s:fltk:${PF}/html:" \ |
79 |
-e "/SILENT:/d" \ |
80 |
makeinclude.in || die |
81 |
sed -e "s/7/${PV}/" \ |
82 |
< "${FILESDIR}"/FLTKConfig.cmake \ |
83 |
> CMake/FLTKConfig.cmake || die |
84 |
sed -e 's:-Os::g' -i configure.in || die |
85 |
|
86 |
# also in Makefile:config.guess config.sub: |
87 |
cp misc/config.{guess,sub} . || die |
88 |
|
89 |
eautoconf |
90 |
multilib_copy_sources |
91 |
} |
92 |
|
93 |
multilib_src_configure() { |
94 |
local FLTK_INCDIR=${EPREFIX}/usr/include/fltk |
95 |
local FLTK_LIBDIR=${EPREFIX}/usr/$(get_libdir)/fltk |
96 |
FLTK_LIBDIRS+=${FLTK_LIBDIRS+:}${FLTK_LIBDIR} |
97 |
|
98 |
multilib_is_native_abi && use prefix && |
99 |
append-ldflags -Wl,-rpath -Wl,"${FLTK_LIBDIR}" |
100 |
|
101 |
econf \ |
102 |
$(use_enable cairo) \ |
103 |
$(use_enable debug) \ |
104 |
$(use_enable opengl gl) \ |
105 |
$(use_enable threads) \ |
106 |
$(use_enable xft) \ |
107 |
$(use_enable xinerama) \ |
108 |
--disable-localjpeg \ |
109 |
--disable-localpng \ |
110 |
--disable-localzlib \ |
111 |
--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \ |
112 |
--enable-largefile \ |
113 |
--enable-shared \ |
114 |
--enable-xcursor \ |
115 |
--enable-xdbe \ |
116 |
--enable-xfixes \ |
117 |
--includedir=${FLTK_INCDIR} \ |
118 |
--libdir=${FLTK_LIBDIR} |
119 |
} |
120 |
|
121 |
multilib_src_compile() { |
122 |
# Prevent reconfigure on non-native ABIs. |
123 |
# This is econf's fault as it replaces under WORKDIR. |
124 |
touch -r makeinclude config.{guess,sub} || die |
125 |
|
126 |
default |
127 |
|
128 |
if multilib_is_native_abi; then |
129 |
emake -C fluid |
130 |
use doc && emake -C documentation html |
131 |
use games && emake -C test blocks checkers sudoku |
132 |
fi |
133 |
} |
134 |
|
135 |
multilib_src_test() { |
136 |
emake -C fluid |
137 |
emake -C test |
138 |
} |
139 |
|
140 |
multilib_src_install() { |
141 |
default |
142 |
|
143 |
if multilib_is_native_abi; then |
144 |
emake -C fluid \ |
145 |
DESTDIR="${D}" install-linux |
146 |
|
147 |
use doc && |
148 |
emake -C documentation \ |
149 |
DESTDIR="${D}" install |
150 |
|
151 |
use games && |
152 |
emake -C test \ |
153 |
DESTDIR="${D}" install-linux |
154 |
fi |
155 |
} |
156 |
|
157 |
multilib_src_install_all() { |
158 |
for app in fluid $(use games && echo blocks checkers sudoku); do |
159 |
dosym /usr/share/icons/hicolor/32x32/apps/${app}.png \ |
160 |
/usr/share/pixmaps/${app}.png |
161 |
done |
162 |
|
163 |
if use examples; then |
164 |
insinto /usr/share/doc/${PF}/examples |
165 |
doins test/*.{h,cxx,fl} test/demo.menu |
166 |
fi |
167 |
|
168 |
insinto /usr/share/cmake/Modules |
169 |
doins CMake/FLTK*.cmake |
170 |
|
171 |
echo "LDPATH=${FLTK_LIBDIRS}" > 99fltk || die |
172 |
echo "FLTK_DOCDIR=${EPREFIX}/usr/share/doc/${PF}/html" >> 99fltk || die |
173 |
doenvd 99fltk |
174 |
|
175 |
# FIXME: This is bad, but building only shared libraries is hardly supported |
176 |
# FIXME: The executables in test/ are linking statically against libfltk |
177 |
if ! use static-libs; then |
178 |
rm "${ED}"/usr/lib*/fltk/*.a || die |
179 |
fi |
180 |
|
181 |
prune_libtool_files |
182 |
} |