1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit autotools eutils fdo-mime flag-o-matic versionator
11 DESCRIPTION="C++ user interface toolkit for X and OpenGL"
12 HOMEPAGE="http://www.fltk.org/"
13 SRC_URI="http://fltk.org/pub/${PN}/${PV/_}/${P/_}-source.tar.gz"
17 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
18 IUSE="cairo debug doc examples games +opengl pdf static-libs +threads +xft +xinerama"
21 >=media-libs/libpng-1.2:0
28 cairo? ( x11-libs/cairo )
29 opengl? ( virtual/opengl )
30 xinerama? ( x11-libs/libXinerama )
31 xft? ( x11-libs/libXft )"
36 pdf? ( dev-texlive/texlive-latex )
38 xinerama? ( x11-proto/xineramaproto )"
40 INCDIR=${EPREFIX}/usr/include/fltk-${SLOT}
41 LIBDIR=${EPREFIX}/usr/$(get_libdir)/fltk-${SLOT}
46 rm -rf zlib jpeg png || die
48 "${FILESDIR}"/${PN}-1.3.1-as-needed.patch \
49 "${FILESDIR}"/${PN}-1.3.2-desktop.patch \
50 "${FILESDIR}"/${PN}-1.3.0-share.patch \
51 "${FILESDIR}"/${PN}-1.3.0-conf-tests.patch
53 -e 's:@HLINKS@::g' -i FL/Makefile.in || die
55 -e '/C\(XX\)\?FLAGS=/s:@C\(XX\)\?FLAGS@::' \
57 "${S}/fltk-config.in" || die
58 # some fixes introduced because slotting
60 -e '/RANLIB/s:$(libdir)/\(.*LIBNAME)\):$(libdir)/`basename \1`:g' \
62 # docs in proper docdir
64 -e "/^docdir/s:fltk:${PF}/html:" \
67 sed -e "s/7/$(get_version_component_range 3)/" \
68 "${FILESDIR}"/FLTKConfig.cmake > CMake/FLTKConfig.cmake
69 sed -e 's:-Os::g' -i configure.in || die
70 use prefix && append-ldflags -Wl,-rpath -Wl,"${LIBDIR}"
76 --includedir=${INCDIR}\
78 --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
87 $(use_enable opengl gl) \
88 $(use_enable threads) \
90 $(use_enable xinerama)
96 cd "${S}"/documentation
104 emake blocks checkers sudoku
111 DESTDIR="${D}" install-linux
113 emake -C documentation \
114 DESTDIR="${D}" install
119 DESTDIR="${D}" install-linux
120 emake -C documentation \
121 DESTDIR="${D}" install-linux
122 apps="${apps} sudoku blocks checkers"
124 for app in ${apps}; do
125 dosym /usr/share/icons/hicolor/32x32/apps/${app}.png \
126 /usr/share/pixmaps/${app}.png
128 dodoc CHANGES README CREDITS ANNOUNCEMENT
130 if use examples; then
131 insinto /usr/share/doc/${PF}/examples
132 doins test/*.{h,cxx,fl} test/demo.menu
135 insinto /usr/share/cmake/Modules
136 doins CMake/FLTK*.cmake
138 echo "LDPATH=${LIBDIR}" > 99fltk-${SLOT}
139 echo "FLTK_DOCDIR=${EPREFIX}/usr/share/doc/${PF}/html" >> 99fltk-${SLOT}
140 doenvd 99fltk-${SLOT}
142 if ! use static-libs; then
143 rm "${ED}"/usr/lib*/fltk-1/*.a || die
148 fdo-mime_desktop_database_update
152 fdo-mime_desktop_database_update