1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
6 DISTUTILS_IN_SOURCE_BUILD=1
7 inherit eutils toolchain-funcs python-r1 versionator gnome2-utils games distutils-r1
9 DESCRIPTION="Visual novel engine written in python"
10 HOMEPAGE="http://www.renpy.org"
11 SRC_URI="http://www.renpy.org/dl/${PV}/${P}-source.tar.bz2"
14 SLOT="$(get_version_component_range 1-2)"
15 MYSLOT=$(delete_all_version_separators ${SLOT})
17 IUSE="development doc examples"
18 REQUIRED_USE="examples? ( development )"
21 >=app-eselect/eselect-renpy-0.4
23 dev-python/pygame[X,${PYTHON_USEDEP}]
24 >=dev-lang/python-exec-0.3[${PYTHON_USEDEP}]
27 media-libs/libsdl[X,video]
32 dev-python/cython[${PYTHON_USEDEP}]
35 S=${WORKDIR}/${P}-source
39 export CFLAGS="${CFLAGS} $($(tc-getPKG_CONFIG) --cflags fribidi)"
42 python_prepare_all() {
43 # wooosh! this should fix multiple abi
44 epatch "${FILESDIR}"/${P}-multiple-abi.patch
46 einfo "Deleting precompiled python files"
47 find . -name '*.py[co]' -print -delete || die
50 -e "s/@SLOT@/${MYSLOT}/" \
51 renpy.py renpy/common.py || die "setting slot failed!"
53 distutils-r1_python_prepare_all
57 cd "${S}"/module || die
58 distutils-r1_python_compile
62 cd "${S}"/module || die
63 distutils-r1_python_install --install-lib="$(python_get_sitedir)/renpy${MYSLOT}"
66 python_scriptinto "${GAMES_BINDIR}"
67 python_newscript renpy.py ${PN}-${SLOT}
69 python_moduleinto renpy${MYSLOT}
71 if use development ; then
72 python_domodule launcher templates
74 if use examples ; then
75 python_domodule the_question tutorial
79 python_install_all() {
80 if use development; then
81 newicon -s 32 launcher/game/images/logo32.png ${P}.png
82 make_desktop_entry ${PN}-${SLOT} "Ren'Py ${PV}" ${P}
94 use development && gnome2_icon_savelist
99 use development && gnome2_icon_cache_update
101 einfo "running: eselect renpy update --if-unset"
102 eselect renpy update --if-unset
106 use development && gnome2_icon_cache_update
108 einfo "running: eselect renpy update --if-unset"
109 eselect renpy update --if-unset