1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
9 inherit eutils python games
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"
19 KEYWORDS="~amd64 ~ppc ~x86"
23 # pyopengl-2.0.0.44 (stable) makes the game crash with some configs
25 RDEPEND="dev-python/pygame
26 >=dev-python/pyopengl-2.0.1.09-r1
29 media-libs/sdl-mixer[vorbis]
30 doc? ( >=dev-python/epydoc-3.0.1 )
31 guitarhero? ( media-sound/vorbis-tools )"
33 S=${WORKDIR}/${MY_PN}-${PV}
35 DOCS="readme.txt todo.txt PKG-INFO MANIFEST"
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"
44 "s:os.path.join(\"..\", \"\(data\)\"):\"${GAMES_DATADIR}/${PN}/\1\":" \
45 src/Version.py || die "patching src/Version.py failed"
49 # NOTE : there is a Makefile but it has not te be run
52 epydoc --html -o "doc/html" -n "Frets on Fire" src/*.py src/midi/*.py \
53 || die "documentation generation failed"
58 insinto "$(games_get_libdir)/${PN}"
59 # we have to ignore .pyc files
60 doins src/*.py src/*.pot || die "installation failed"
62 insinto "$(games_get_libdir)/${PN}/midi"
63 # we have to ignore .pyc files
64 doins src/midi/*.py || die "installation failed"
66 insinto "${GAMES_DATADIR}/${PN}"
67 # removes useless files
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"
74 ${PN} "python FretsOnFire.py" "$(games_get_libdir)/${PN}" \
75 || die "games wrapper installation failed"
78 dohtml -r doc/html/* || die "documentation installation failed"
81 dodoc ${DOCS} || die "documentation installation failed"
83 newicon data/icon.png ${PN}.png
84 make_desktop_entry ${PN} "Frets on Fire"
91 python_mod_optimize "${ROOT}$(games_get_libdir)/${PN}"
95 python_mod_cleanup "${ROOT}$(games_get_libdir)/${PN}"