c7932c3eb325378f3e78a2872060cb82f86f0056
[gentoo.git] / games-strategy / naev / naev-0.6.1-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit flag-o-matic gnome2-utils
6
7 DESCRIPTION="A 2D space trading and combat game, in a similar vein to Escape Velocity"
8 HOMEPAGE="http://blog.naev.org/"
9 SRC_URI="mirror://sourceforge/naev/${P}.tar.bz2
10         mirror://sourceforge/naev/ndata-${PV}.zip"
11
12 LICENSE="GPL-2 GPL-3 public-domain CC-BY-3.0 CC-BY-SA-3.0"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="debug +mixer +openal"
16
17 RDEPEND="
18         media-libs/libsdl2[X,sound,video]
19         dev-libs/libzip
20         dev-libs/libxml2
21         >=media-libs/freetype-2:2
22         >=media-libs/libvorbis-1.2.1
23         >=media-libs/libpng-1.2:0=
24         virtual/glu
25         virtual/opengl
26         dev-lang/lua:0
27         mixer? ( media-libs/sdl2-mixer )
28         openal? ( media-libs/openal )
29 "
30 DEPEND="${RDEPEND}
31         virtual/pkgconfig
32 "
33
34 src_unpack() {
35         unpack ${P}.tar.bz2
36 }
37
38 src_configure() {
39         econf \
40                 --docdir=/usr/share/doc/${PF} \
41                 --enable-lua=shared \
42                 $(use_enable debug) \
43                 $(use_with openal) \
44                 $(use_with mixer sdlmixer)
45 }
46
47 src_compile() {
48         emake V=1
49 }
50
51 src_install() {
52         emake \
53                 DESTDIR="${D}" \
54                 appicondir=/usr/share/pixmaps \
55                 appdatadir=/usr/share/appdata \
56                 Graphicsdir=/usr/share/applications \
57                 install
58         insinto /usr/share/${PN}
59         newins "${DISTDIR}"/ndata-${PV}.zip ndata
60
61         local res
62         for res in 16 32 64 128; do
63                 newicon -s ${res} extras/logos/logo${res}.png naev.png
64         done
65
66         rm -f "${D}"/usr/share/doc/${PF}/LICENSE
67 }
68
69 pkg_preinst() {
70         gnome2_icon_savelist
71 }
72
73 pkg_postinst() {
74         gnome2_icon_cache_update
75 }
76
77 pkg_postrm() {
78         gnome2_icon_cache_update
79 }