]> Pileus Git - ~andy/sunrise/blob - games-action/openclonk/openclonk-5.2.2.ebuild
games-action/openclonk: New Ebuild for bug 348149 thanks to ssuominen and mgorny
[~andy/sunrise] / games-action / openclonk / openclonk-5.2.2.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=3
6
7 inherit autotools eutils flag-o-matic games
8
9 MY_P=${PN}-release-${PV}-src
10
11 DESCRIPTION="A free multiplayer action game where you control clonks"
12 HOMEPAGE="http://openclonk.org/"
13 SRC_URI="http://hg.${PN}.org/${PN}/archive/${MY_P}.tar.gz
14         http://${PN}.org/homepage/icon.png -> ${PN}.png"
15
16 LICENSE="BSD CLONK-source CLONK-trademark LGPL-2.1 POSTGRESQL"
17 SLOT="0"
18 KEYWORDS="~amd64 ~x86"
19 IUSE="+audio doc mp3 openal"
20
21 RDEPEND="
22         media-libs/freetype:2
23         media-libs/glew
24         media-libs/libpng:0
25         media-libs/libsdl[X,audio?,opengl,video]
26         sys-libs/zlib
27         virtual/jpeg
28         virtual/opengl
29         x11-libs/cairo
30         x11-libs/gdk-pixbuf
31         x11-libs/gtk+:3
32         x11-libs/libXpm
33         x11-libs/libXrandr
34         x11-libs/libXxf86vm
35         x11-libs/libX11
36         audio? (
37                 media-libs/sdl-mixer[mp3?]
38                 openal? (
39                         media-libs/libvorbis
40                         media-libs/openal
41                 )
42         )"
43 DEPEND="${RDEPEND}
44         >=dev-libs/boost-1.40
45         dev-util/pkgconfig
46         doc? (
47                 =dev-lang/python-2*
48                 dev-libs/libxml2[python]
49                 sys-devel/gettext
50         )"
51
52 S=${WORKDIR}/${MY_P}
53
54 src_prepare() {
55         # remove license files
56         sed \
57                 -e '/dist_doc_DATA/s#planet/COPYING ##;s:licenses/LGPL.txt ::' \
58                 -i Makefile.am || die
59
60         # force python2 for doc-generation
61         if use doc ; then
62                 sed \
63                         -e 's/python/python2/g' \
64                         -i docs/Makefile || die
65         fi
66
67         eautoreconf
68 }
69
70 src_configure() {
71         # QA
72         append-flags -fno-strict-aliasing
73
74         local myconf
75         if use audio ; then
76                 myconf="$(use_enable audio sound)"
77                 use mp3 && myconf="${myconf} $(use_enable mp3)"
78                 use openal && myconf="${myconf} $(use_with openal)"
79         fi
80
81         egamesconf \
82                 --with-automatic-update=no \
83                 --with-gtk=3.0 \
84                 ${myconf}
85 }
86
87 src_compile() {
88         emake || die
89
90         if use doc ; then
91                 emake -C docs || die
92         fi
93 }
94
95 src_install() {
96         emake DESTDIR="${D}" install || die
97         doicon "${DISTDIR}"/${PN}.png
98         newgamesbin "${FILESDIR}"/${PN}-wrapper-script.sh ${PN} || die
99         make_desktop_entry ${PN} ${PN}
100
101         if use doc ; then
102                 dohtml -r docs/online/*
103         fi
104
105         prepgamesdirs
106 }
107
108 pkg_postinst() {
109         games_pkg_postinst
110         einfo "Run the game via the wrapper \"${GAMES_BINDIR}/${PN}\"."
111 }