media-gfx/splash-themes-livecd: Merge gentoo-functions use fix
[gentoo.git] / games-kids / tuxmath / tuxmath-2.0.1.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit eutils gnome2-utils games
7
8 MY_PN="${PN}_w_fonts"
9 DESCRIPTION="Educational arcade game where you have to solve maths problems"
10 HOMEPAGE="http://tux4kids.alioth.debian.org/tuxmath/"
11 SRC_URI="mirror://sourceforge/tuxmath/${MY_PN}-${PV}.tar.gz"
12
13 LICENSE="GPL-2 OFL-1.1"
14 SLOT="0"
15 KEYWORDS="amd64 x86"
16 IUSE="nls svg"
17
18 RDEPEND="dev-games/t4k-common[svg?]
19         dev-libs/libxml2:2
20         media-libs/libsdl:0
21         media-libs/sdl-pango
22         media-libs/sdl-image[jpeg,png]
23         media-libs/sdl-mixer[mod]
24         media-libs/sdl-net
25         nls? ( virtual/libintl )
26         svg? (
27                 gnome-base/librsvg:2
28                 x11-libs/cairo
29         )"
30 DEPEND="${RDEPEND}
31         virtual/pkgconfig
32         nls? ( sys-devel/gettext )"
33
34 S=${WORKDIR}/${MY_PN}-${PV}
35
36 src_prepare() {
37         sed -i \
38                 -e '/\bdoc\b/d' \
39                 Makefile.in || die
40         sed -i \
41                 -e '/strncat/s/)/ - 1)/' \
42                 src/server.c || die
43 }
44
45 src_configure() {
46         egamesconf \
47                 --disable-dependency-tracking \
48                 --localedir=/usr/share/locale \
49                 $(use_enable nls) \
50                 $(usex svg "" "--without-rsvg")
51 }
52
53 src_install() {
54         emake DESTDIR="${D}" install || die "install failed"
55         doicon -s scalable data/images/icons/${PN}.svg
56         make_desktop_entry ${PN} "TuxMath"
57         dodoc doc/{README,TODO,changelog}
58         prepgamesdirs
59 }
60
61 pkg_preinst() {
62         games_pkg_preinst
63         gnome2_icon_savelist
64 }
65
66 pkg_postinst() {
67         games_pkg_postinst
68         gnome2_icon_cache_update
69 }
70
71 pkg_postrm() {
72         gnome2_icon_cache_update
73 }