commit: c653532fb3f5a9f50f7bb8adb270bd068691c746 parent b8c185218e7461e73e8226cb8175ae4edc7e6dab Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Date: Mon, 5 Sep 2022 20:50:14 +0200 games-engines/renpy: New packageDiffstat:
A | games-engines/renpy/Manifest | 1 | + |
A | games-engines/renpy/files/renpy-6.99.12.4-compat-infinite-loop.patch | 42 | ++++++++++++++++++++++++++++++++++++++++++ |
A | games-engines/renpy/files/renpy-6.99.12.4-compat-style.patch | 43 | +++++++++++++++++++++++++++++++++++++++++++ |
A | games-engines/renpy/files/renpy-8.0.3-system-path.patch | 13 | +++++++++++++ |
A | games-engines/renpy/files/renpy-8.0.3-use-system-fribidi.patch | 33 | +++++++++++++++++++++++++++++++++ |
A | games-engines/renpy/files/renpy.1 | 163 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | games-engines/renpy/metadata.xml | 25 | +++++++++++++++++++++++++ |
A | games-engines/renpy/renpy-8.0.3.ebuild | 98 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
8 files changed, 418 insertions(+), 0 deletions(-)diff --git a/games-engines/renpy/Manifest b/games-engines/renpy/Manifest
@@ -0,0 +1 @@ +DIST renpy-8.0.3-source.tar.bz2 66077960 BLAKE2B 053bd3e8ef175d7f4d3437a53086cb7c47064526c50cdcad00f9a8196cfb82789794d4bee573514a40215b2cc70b9eed8adaebefb45d01a6b61a7fddc1a18560 SHA512 99b5ad8f20a69ae4a3d06f550be6d56ef2313928a0bc026f5638e3c043eb634f67599b89dd441b3d923d75551bd93c2d0de0523e0ed9adfa100231742e7b5751diff --git a/games-engines/renpy/files/renpy-6.99.12.4-compat-infinite-loop.patch b/games-engines/renpy/files/renpy-6.99.12.4-compat-infinite-loop.patch
@@ -0,0 +1,42 @@ +Adapted from git HEAD: +commit ff308191a190bf7c5c2118a31f3d8569a0904c04 +Author: Andrew Savchenko <bircoph@gmail.com> +Date: Mon Jul 17 08:00:07 2017 +0300 + + Increase infinite loop hardcoded values + + On many old hardware, e.g on my Atom netbook games hit this limit, + but otherwise work fine. Increasing the limit helps. People are + also reporting this issue in many cases (old laptops, stow tablets, + etc where games fail due to this issue and work otherwise): + + https://translationprojectvisualnovels.blogspot.ru/2016/09/monster-girl-quest-android-15092016.html + https://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=30521&start=90 + https://steamcommunity.com/app/356530/discussions/0/365163686036650662/ + (and many more, just google) + +index 00c7562..a7e361c 100644 +--- a/renpy/display/core.py ++++ b/renpy/display/core.py +@@ -2845,7 +2845,7 @@ class Interface(object): + + while rv is None: + +- renpy.execution.not_infinite_loop(10) ++ renpy.execution.not_infinite_loop(50) + + # Check for a change in fullscreen preference. + if ((self.fullscreen != renpy.game.preferences.fullscreen) or +diff --git a/renpy/main.py b/renpy/main.py +index 6f14d77..960d2fd 100644 +--- a/renpy/main.py ++++ b/renpy/main.py +@@ -318,7 +318,7 @@ def main(): + game.contexts = [ renpy.execution.Context(False) ] + game.contexts[0].init_phase = True + +- renpy.execution.not_infinite_loop(60) ++ renpy.execution.not_infinite_loop(300) + + # Load the script. + renpy.game.exception_info = 'While loading the script.'diff --git a/games-engines/renpy/files/renpy-6.99.12.4-compat-style.patch b/games-engines/renpy/files/renpy-6.99.12.4-compat-style.patch
@@ -0,0 +1,43 @@ +commit 1d350d993d2b51df7880e92b48ed103e059ec385 +Author: Andrew Savchenko <bircoph@gmail.com> +Date: Sun Jul 16 17:07:27 2017 +0300 + + Fix compatibility problem With ElvenRelations-1.2: + + When starting game: + + Full traceback: + File "/home/andrew/src/_compat/styles.rpymc", line 22, in script + File "/usr/lib64/python2.7/site-packages/renpy699/renpy/ast.py", line 814, in execute + renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store) + File "/usr/lib64/python2.7/site-packages/renpy699/renpy/python.py", line 1719, in py_exec_bytecode + exec bytecode in globals, locals + File "renpy/common/_compat/styles.rpym", line 374, in <module> + style.selected_button = _SelectedCompat('button') + File "renpy/common/_compat/styles.rpym", line 347, in __init__ + self.target = target + File "renpy/style.pyx", line 378, in renpy.style.StyleCore.__setattr__ (gen/renpy.style.c:6236) + raise Exception("Style property {} is not known.".format(name)) + Exception: Style property target is not known. + + "button*" properties are no longer present in RenPy, so relevant + code is removed. + +diff --git a/renpy/common/_compat/styles.rpym b/renpy/common/_compat/styles.rpym +index d83eeb0..174f0b6 100644 +--- a/renpy/common/_compat/styles.rpym ++++ b/renpy/common/_compat/styles.rpym +@@ -371,13 +371,6 @@ init python: + self.property_updates = [ ] + + +- style.selected_button = _SelectedCompat('button') +- style.selected_button_text = _SelectedCompat('button_text') +- style.gm_nav_selected_button = _SelectedCompat('gm_nav_button') +- style.gm_nav_selected_button_text = _SelectedCompat('gm_nav_button_text') +- style.prefs_selected_button = _SelectedCompat('prefs_button') +- style.prefs_selected_button_text = _SelectedCompat('prefs_button_text') +- + def _apply_selected_compat(): + for scs in _selected_compat: + scs.apply()diff --git a/games-engines/renpy/files/renpy-8.0.3-system-path.patch b/games-engines/renpy/files/renpy-8.0.3-system-path.patch
@@ -0,0 +1,13 @@ +diff --git a/renpy.py.old b/renpy.py +index c00d46456f..29046c5335 100755 +--- a/renpy.py.old ++++ b/renpy.py +@@ -209,7 +209,7 @@ def path_to_renpy_base(): + Returns the absolute path to thew Ren'Py base directory. + """ + +- renpy_base = os.path.dirname(os.path.realpath(sys.argv[0])) ++ renpy_base = get_python_lib() + renpy_base = os.path.abspath(renpy_base) + + return renpy_basediff --git a/games-engines/renpy/files/renpy-8.0.3-use-system-fribidi.patch b/games-engines/renpy/files/renpy-8.0.3-use-system-fribidi.patch
@@ -0,0 +1,33 @@ +--- renpy-7.3.5-source.orig/module/setup.py 2019-08-09 05:11:58.000000000 +0300 ++++ renpy-7.3.5-source/module/setup.py 2020-05-09 12:46:46.463942266 +0300 +@@ -119,28 +119,14 @@ + sdl + [ png, 'z', 'm' ]) + + FRIBIDI_SOURCES = """ +-fribidi-src/lib/fribidi.c +-fribidi-src/lib/fribidi-arabic.c +-fribidi-src/lib/fribidi-bidi.c +-fribidi-src/lib/fribidi-bidi-types.c +-fribidi-src/lib/fribidi-deprecated.c +-fribidi-src/lib/fribidi-joining.c +-fribidi-src/lib/fribidi-joining-types.c +-fribidi-src/lib/fribidi-mem.c +-fribidi-src/lib/fribidi-mirroring.c +-fribidi-src/lib/fribidi-run.c +-fribidi-src/lib/fribidi-shape.c + renpybidicore.c + """.split() + cython( + "_renpybidi", + FRIBIDI_SOURCES, +- includes=[ +- BASE + "/fribidi-src/", +- BASE + "/fribidi-src/lib/", +- ], ++ libs=["fribidi"], + define_macros=[ +- ("FRIBIDI_ENTRY", ""), ++ ("RENPY_BUILD", ""), + ("HAVE_CONFIG_H", "1"), + ]) +diff --git a/games-engines/renpy/files/renpy.1 b/games-engines/renpy/files/renpy.1
@@ -0,0 +1,163 @@ +.\" Copyright © 2015 Andrew Savchenko +.\" Distributed under the terms of GNU FDL-1.3+ license, +.\" based on original Ren'Py documentation licensed under MIT. +.TH renpy 1 "31 May 2015" "Ren'Py" "Ren'Py Gentoo's manual" +.SH NAME +renpy \- a visual novel engine + +.SH SYNOPSIS +.BI renpy " game_directory" +.\" **************************************************************** +.SH DESCRIPTION + +.B renpy +(Ren'Py) is a visual novel engine \- used by hundreds of creators +from around the world \- that helps you use words, images, and +sounds to tell interactive stories that run on computers and mobile +devices. These can be both visual novels and life simulation games. +The easy to learn script language allows anyone to efficiently +write large visual novels, while its +.BR python (1) +scripting is enough for complex simulation games. +.\" **************************************************************** +.SH RUNNING A GAME + +In order to run a game, provide +.I game_directory +as an argument to +.BR renpy . +Exact directory name may vary depending or a game, but usually +this path corresponds to +.I */game +wildcard and contains +.I script_version.rpy* +file within. Game directory usually contains other +.IR *.rpy* " and " *.rpa " files." + +One may use +.BR find (1) +tool to locate required directory within unpacked game top +directory: +.RS + +find -O3 +.I top_directory +-type f -iname "script_version.rpy*" + +.RE +A directory one level above may be provided as an argument as well. +.\" **************************************************************** +.SH PORTABILITY + +All +.B renpy +games are written in +.BR python (1), +so one can run then on any platform and architecture. + +As you may have noticed, Ren'Py games are often distributed in +different archives for different architectures. This happens due to +bundling of +.BR python (1) +interpreter and required libraries in a game's tarball. Since you +are using OS native +.B renpy +setup, you should be able to run any of these games. +.\" **************************************************************** +.SH GAMES CATALOGUE + +A large catalogue of Ren'Py powered games is available at +.IR http://games.renpy.org/ . +.\" **************************************************************** +.SH TROUBLESHOOTING + +In some cases game may fail to run with current +.B renpy +version due to various errors. + +In such case please try to use the closest +.B renpy +version to one used by game developer. Most games contain +.IR script_version.rpy " file in the " game " directory." +This file actually contains +.B renpy +version used during a game build. +You may install multiple slots of +.B renpy +in Gentoo and use +.BI eselect " renpy" +module to switch between various versions. + +If +.I game +directory contains both +.IR *.rpyc " (or " *.rpyo ") and " *.rpy " files, delete" +.IR *.rpyc " (or " *.rpyo ") files, they will be regenerated by" +the interpreter. +Another solution will be to switch between version of +.BR python (1) +using +.IR eselect (1) +tool in order to find one suitable to interpret game's +.IR *.rpyc " files." + +Some games may lack general media files, e.g. +.I click.ogg +sound, so you should create or download one and place in the +.I game +directory. + +Also please pay attention to +.I problems.html +page from +.B renpy +html documentation, see +.B FURTHER READING +section. +.\" **************************************************************** +.SH ENVIRONMENT VARIABLES + +.B renpy +supports a number of environment variables to control its +behaviour. Please refer to html docs for further details +(see +.B FURTHER READING +section). +.\" **************************************************************** +.SH FURTHER READING + +.B renpy +comes with extensive html documentation. To use it install +.B renpy +with +.I USE="doc" +and go to +.I /usr/share/doc/renpy-*/html/doc/index.html + +Alternatively one may refer to online documentation: +.IR http://www.renpy.org/doc/html/ . +Be warned that online docs maybe different from your current active +version, so it recommended to use shipped documentation instead. +.\" **************************************************************** +.SH BUGS + +Any bugs related to Gentoo packaging (e.g. omitted dependencies) +please report on bugzilla: +.IR https://bugs.gentoo.org . + +For bugs in the Ren'Py engine itself, please contact upstream: +.I https://github.com/renpy/renpy/issues +and add a Gentoo bug if you feel it necessary. + +For issues with games themselves please contact corresponding +authors. +.\" **************************************************************** +.SH SEE ALSO + +.BR python (1) +\- an interpreter used by Ren'Py engine. + +.BR unrpa (1) +\- a tool to unpack +.I *.rpa +data files (Ren'Py Archives).diff --git a/games-engines/renpy/metadata.xml b/games-engines/renpy/metadata.xml
@@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <longdescription> + Ren'Py is a free and cross-platform visual novel engine that + helps you use words, + pictures, and sounds to tell stories with the computer. + It`s easy and efficient script language makes it possible for + non-programmers to make visual novels, + while its Python support allows for complex simulation games. + </longdescription> + <use> + <flag name="development">Install IDE for game developers and an empty game template</flag> + </use> + <upstream> + <maintainer status="active"> + <email>pytom@bishoujo.us</email> + <name>Tom Rothamel</name> + </maintainer> + <changelog>http://www.renpy.org/latest.html</changelog> + <bugs-to>https://github.com/renpy/renpy/issues</bugs-to> + <doc>http://renpy.org/wiki/renpy/doc</doc> + <remote-id type="github">renpy/renpy</remote-id> + </upstream> +</pkgmetadata>diff --git a/games-engines/renpy/renpy-8.0.3.ebuild b/games-engines/renpy/renpy-8.0.3.ebuild
@@ -0,0 +1,98 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{8,9,10} ) +DISTUTILS_IN_SOURCE_BUILD=1 +DISTUTILS_USE_SETUPTOOLS=no +inherit gnome2-utils distutils-r1 + +DESCRIPTION="Visual novel engine written in python" +HOMEPAGE="https://www.renpy.org" +SRC_URI="https://www.renpy.org/dl/${PV}/${P}-source.tar.bz2" +S="${WORKDIR}/${P}-source" + +LICENSE="MIT" +SLOT=0 +KEYWORDS="" +IUSE="development doc examples" +REQUIRED_USE="examples? ( development )" + +BDEPEND=" + dev-python/cython[${PYTHON_USEDEP}] + virtual/pkgconfig" +DEPEND=" + dev-libs/fribidi + ~dev-python/pygame_sdl2-${PV}[${PYTHON_USEDEP}] + >=dev-lang/python-exec-0.3[${PYTHON_USEDEP}] + media-libs/glew:0 + media-libs/libpng:0 + media-libs/libsdl2[video] + media-libs/freetype:2 + sys-libs/zlib + media-video/ffmpeg" +RDEPEND="${DEPEND} + !app-eselect/eselect-renpy" + +PATCHES=( + "${FILESDIR}"/${P}-system-path.patch + "${FILESDIR}"/${PN}-6.99.12.4-compat-style.patch + "${FILESDIR}"/${PN}-6.99.12.4-compat-infinite-loop.patch + "${FILESDIR}"/${P}-use-system-fribidi.patch +) + +python_prepare_all() { + einfo "Deleting precompiled python files" + find . -name '*.py[co]' -print -delete || die + rm -r module/fribidi-src || die + + export CFLAGS="${CFLAGS} $($(tc-getPKG_CONFIG) --cflags fribidi)" + distutils-r1_python_prepare_all +} + +python_compile() { + cd "${S}"/module || die + distutils-r1_python_compile +} + +python_install() { + cd "${S}"/module || die + distutils-r1_python_install + + cd "${S}" || die + python_newscript renpy.py ${PN} + + python_domodule renpy + if use development ; then + python_domodule launcher + fi + if use examples ; then + python_domodule the_question tutorial + fi +} + +python_install_all() { + distutils-r1_python_install_all + if use development; then + newicon -s 32 launcher/game/images/logo32.png ${P}.png + make_desktop_entry ${PN} "Ren'Py ${PV}" ${P} + fi + + if use doc; then + insinto "/usr/share/doc/${PF}/html" + doins -r doc/* + fi + newman "${FILESDIR}/${PN}.1" "${P}.1" +} + +pkg_preinst() { + use development && gnome2_icon_savelist +} + +pkg_postinst() { + use development && gnome2_icon_cache_update +} + +pkg_postrm() { + use development && gnome2_icon_cache_update +}