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 gnome2-utils toolchain-funcs versionator 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.7
23 ~dev-python/pygame_sdl2-${PV}[${PYTHON_USEDEP}]
24 >=dev-lang/python-exec-0.3[${PYTHON_USEDEP}]
27 media-libs/libsdl2[video]
32 dev-python/cython[${PYTHON_USEDEP}]
35 S=${WORKDIR}/${P}-source
38 "${FILESDIR}"/${P}-multiple-abi.patch
39 "${FILESDIR}"/${P}-compat-window.patch #601200
40 "${FILESDIR}"/${P}-compat-style.patch
41 "${FILESDIR}"/${P}-compat-infinite-loop.patch
44 python_prepare_all() {
45 export CFLAGS="${CFLAGS} $($(tc-getPKG_CONFIG) --cflags fribidi)"
46 distutils-r1_python_prepare_all
48 einfo "Deleting precompiled python files"
49 find . -name '*.py[co]' -print -delete || die
52 -e "s/@SLOT@/${MYSLOT}/" \
53 renpy.py renpy/common.py || die "setting slot failed!"
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_newscript renpy.py ${PN}-${SLOT}
68 python_moduleinto renpy${MYSLOT}
70 if use development ; then
71 python_domodule launcher templates
73 if use examples ; then
74 python_domodule the_question tutorial
78 python_install_all() {
79 distutils-r1_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}
86 insinto "/usr/share/doc/${PF}/html"
89 newman "${FILESDIR}/${PN}.1" "${P}.1"
93 use development && gnome2_icon_savelist
97 use development && gnome2_icon_cache_update
99 einfo "running: eselect renpy update --if-unset"
100 eselect renpy update --if-unset
104 use development && gnome2_icon_cache_update
106 einfo "running: eselect renpy update --if-unset"
107 eselect renpy update --if-unset