]> Pileus Git - ~andy/sunrise/blob - games-misc/fretsonfire/fretsonfire-1.3.110.ebuild
sci-geosciences/aweather: Version bump for aweather-0.8.1
[~andy/sunrise] / games-misc / fretsonfire / fretsonfire-1.3.110.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="2"
6
7 PYTHON_DPEEND="2:2.4"
8
9 inherit eutils python games
10
11 MY_PN="Frets on Fire"
12 MY_PN_URI="FretsOnFire"
13 DESCRIPTION="A game of musical skill and fast fingers"
14 HOMEPAGE="http://fretsonfire.sourceforge.net/"
15 SRC_URI="mirror://sourceforge/${PN}/${MY_PN_URI}-${PV}.tar.gz"
16
17 LICENSE="GPL-2"
18 SLOT="0"
19 KEYWORDS="~amd64 ~ppc ~x86"
20 IUSE="doc guitarhero"
21
22 # NOTES :
23 # pyopengl-2.0.0.44 (stable) makes the game crash with some configs
24 DEPEND=""
25 RDEPEND="dev-python/pygame
26         >=dev-python/pyopengl-2.0.1.09-r1
27         dev-python/imaging
28         dev-python/numpy
29         media-libs/sdl-mixer[vorbis]
30         doc? ( >=dev-python/epydoc-3.0.1 )
31         guitarhero? ( media-sound/vorbis-tools )"
32
33 S=${WORKDIR}/${MY_PN}-${PV}
34
35 DOCS="readme.txt todo.txt PKG-INFO MANIFEST"
36
37 src_prepare() {
38         # change main game executable path
39         sed -i -e "s:\(FretsOnFire.py\):$(games_get_libdir)/${PN}/\1:" \
40                 src/FretsOnFire.py || die "patching src/FretsOnFire.py failed"
41
42         # change data path
43         sed -i -e \
44                 "s:os.path.join(\"..\", \"\(data\)\"):\"${GAMES_DATADIR}/${PN}/\1\":" \
45                 src/Version.py || die "patching src/Version.py failed"
46 }
47
48 src_compile() {
49         # NOTE : there is a Makefile but it has not te be run
50
51         if use doc; then
52                 epydoc --html -o "doc/html" -n "Frets on Fire" src/*.py src/midi/*.py \
53                         || die "documentation generation failed"
54         fi
55 }
56
57 src_install() {
58         insinto "$(games_get_libdir)/${PN}"
59         # we have to ignore .pyc files
60         doins src/*.py src/*.pot || die "installation failed"
61
62         insinto "$(games_get_libdir)/${PN}/midi"
63         # we have to ignore .pyc files
64         doins src/midi/*.py || die "installation failed"
65
66         insinto "${GAMES_DATADIR}/${PN}"
67         # removes useless files
68         rm -fr data/win32
69         # removes useless file that is throwing a QA notice
70         rm -f data/PyOpenGL__init__.pyc
71         doins -r data || die "data installation failed"
72
73         games_make_wrapper \
74                 ${PN} "python FretsOnFire.py" "$(games_get_libdir)/${PN}" \
75                 || die "games wrapper installation failed"
76
77         if use doc; then
78                 dohtml -r doc/html/* || die "documentation installation failed"
79         fi
80
81         dodoc ${DOCS} || die "documentation installation failed"
82
83         newicon data/icon.png ${PN}.png
84         make_desktop_entry ${PN} "Frets on Fire"
85
86         prepgamesdirs
87 }
88
89 pkg_postinst() {
90         games_pkg_postinst
91         python_mod_optimize "${ROOT}$(games_get_libdir)/${PN}"
92 }
93
94 pkg_postrm() {
95         python_mod_cleanup "${ROOT}$(games_get_libdir)/${PN}"
96 }