summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2025-11-29 17:06:49 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2025-12-07 07:57:23 +0100
commit944d5bc08a908955c560c44ce999f64aaab37ac6 (patch)
tree1af6c7c3c64202019c66e04567cb916c986dbbf0 /gnu/packages
parent8f00517eee4fb6d0376b2fafb51a16d19a497c0c (diff)
gnu: python-renpy: Update to 8.5.0.
* gnu/packages/patches/renpy-fix-integer-slots.patch: New file. * gnu/packages/patches/renpy-python-3.11-compat.patch: New file. * gnu/packages/patches/renpy-use-system-fribidi: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/game-development.scm (python-renpy): Update to 8.5.0. [patches]: Use the new patches. [snippet]: Adjust accordingly. [build-system]: Switch to pyproject-build-system. [#:phases]: Remove ‘relax-gcc-14-strictness’. No longer replace ‘build’ and ‘install’. Add ‘build-renpy’ and ‘install-renpy’. [native-inputs]: Replace python-cython-0 with python-cython. [inputs]: Add assimp. Replace ffmpeg-6 with ffmpeg. [propagated-inputs]: Remove python-pygame-sdl2.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/game-development.scm76
-rw-r--r--gnu/packages/patches/renpy-fix-integer-slots.patch40
-rw-r--r--gnu/packages/patches/renpy-python-3.11-compat.patch189
-rw-r--r--gnu/packages/patches/renpy-use-system-fribidi.patch57
4 files changed, 269 insertions, 93 deletions
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 58bb59b7f43..9100a59f914 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1740,7 +1740,7 @@ bugfixes and enhancements, and a new governance model.")
1740(define-public python-renpy 1740(define-public python-renpy
1741 (package 1741 (package
1742 (name "python-renpy") 1742 (name "python-renpy")
1743 (version "8.3.0") 1743 (version "8.5.0")
1744 (source 1744 (source
1745 (origin 1745 (origin
1746 (method url-fetch) 1746 (method url-fetch)
@@ -1748,8 +1748,11 @@ bugfixes and enhancements, and a new governance model.")
1748 "/renpy-" version "-source.tar.bz2")) 1748 "/renpy-" version "-source.tar.bz2"))
1749 (sha256 1749 (sha256
1750 (base32 1750 (base32
1751 "1xb9ixb73nm271frkchrqpf64bcrdvrk3n4281dxzm4k4wj60rwb")) 1751 "1dv856sb8mak21kkj0ys0k6zc6ly2k8102ahnfdrc04cwdrryw6b"))
1752 (modules '((guix build utils))) 1752 (modules '((guix build utils)))
1753 ;; TODO: Remove when updating Python to 3.12 or higher.
1754 (patches (search-patches "renpy-python-3.11-compat.patch"
1755 "renpy-fix-integer-slots.patch"))
1753 (snippet 1756 (snippet
1754 #~(begin 1757 #~(begin
1755 ;; Build without sync service. 1758 ;; Build without sync service.
@@ -1759,15 +1762,29 @@ bugfixes and enhancements, and a new governance model.")
1759 (for-each delete-file 1762 (for-each delete-file
1760 '("renpy/encryption.pyx" 1763 '("renpy/encryption.pyx"
1761 "renpy/common/00sync.rpy")) 1764 "renpy/common/00sync.rpy"))
1762 (substitute* "module/setup.py" 1765 (delete-file-recursively "src/libhydrogen")
1763 (("cython\\(\"renpy\\.encryption\"\\)") "")) 1766 (substitute* "setup.py"
1767 (("cython\\(\"renpy\\.encryption\"\\)") "")
1768 (("version = .*") (string-append "version = \"" #$version "\"")))
1764 (substitute* "renpy/__init__.py" 1769 (substitute* "renpy/__init__.py"
1765 (("import renpy\\.encryption") "")) 1770 (("import renpy\\.encryption") ""))
1766 ;; Trust vc_version.py when it comes to detecting whether a 1771 ;; Trust vc_version.py when it comes to detecting whether a
1767 ;; version is official. 1772 ;; version is official.
1768 (substitute* "renpy/__init__.py" 1773 (substitute* "renpy/__init__.py"
1769 (("official = official and .*") "")))))) 1774 (("official = official and .*") ""))
1770 (build-system python-build-system) 1775
1776 ;; Make source compatible with Python 3.11.
1777 ;; Drop this part once a newer Python is used.
1778 (substitute* (find-files "renpy" "\\.py$")
1779 (("type ([A-Za-z0-9]+) =" all id)
1780 (string-append id " =")))
1781 (substitute* "renpy/minstore.py"
1782 ((", override") ""))
1783
1784 ;; Use SDL2/ prefix.
1785 (substitute* "src/pygame/sdl_image_compat.h"
1786 (("\"SDL_image.h\"") "<SDL2/SDL_image.h>"))))))
1787 (build-system pyproject-build-system)
1771 (arguments 1788 (arguments
1772 (list 1789 (list
1773 #:tests? #f ; Ren'py doesn't seem to package tests 1790 #:tests? #f ; Ren'py doesn't seem to package tests
@@ -1785,49 +1802,36 @@ bugfixes and enhancements, and a new governance model.")
1785 (search-input-file (or native-inputs inputs) 1802 (search-input-file (or native-inputs inputs)
1786 "/bin/cython")) 1803 "/bin/cython"))
1787 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":")))) 1804 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))))
1788 (add-before 'build 'relax-gcc-14-strictness 1805 (add-after 'build 'build-renpy
1789 (lambda _ 1806 (lambda _
1790 (setenv "CFLAGS" (string-join
1791 (list "-g" "-O2"
1792 "-Wno-error=incompatible-pointer-types"
1793 "-Wno-error=implicit-function-declaration")
1794 " "))))
1795 (replace 'build
1796 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1797 ;; The "module" subdirectory contains a python (really cython)
1798 ;; project, which is built using a script, that is thankfully
1799 ;; named "setup.py".
1800 (with-directory-excursion "module"
1801 (apply (assoc-ref %standard-phases 'build) args))
1802 ;; The above only builds the cython modules, but nothing else,
1803 ;; so we do that here.
1804 (invoke "python" "-m" "compileall" "renpy"))) 1807 (invoke "python" "-m" "compileall" "renpy")))
1805 (replace 'install 1808 (add-after 'install 'install-renpy
1806 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args) 1809 (lambda* (#:key inputs outputs #:allow-other-keys)
1807 ;; Again, we have to wrap the module installation. 1810 (let ((site (string-append (assoc-ref outputs "out")
1808 ;; Additionally, we want to install the python code 1811 "/lib/python"
1809 ;; (both source and compiled) in the same directory.
1810 (let* ((out (assoc-ref outputs "out"))
1811 (site (string-append "/lib/python"
1812 (python-version 1812 (python-version
1813 (assoc-ref inputs "python")) 1813 (assoc-ref inputs "python"))
1814 "/site-packages"))) 1814 "/site-packages")))
1815 (with-directory-excursion "module"
1816 (apply (assoc-ref %standard-phases 'install) args))
1817 (copy-recursively "renpy" 1815 (copy-recursively "renpy"
1818 (string-append out site "/renpy")) 1816 (string-append site "/renpy"))
1819 (delete-file-recursively (string-append out site 1817 (delete-file-recursively
1820 "/renpy/common")))))))) 1818 (string-append site "/renpy/common"))
1821 (native-inputs (list python-cython-0)) 1819 (for-each delete-file
1820 (find-files site "\\.py[ix]"))))))))
1821 (native-inputs (list pkg-config
1822 python-cython
1823 python-setuptools
1824 python-wheel))
1822 (inputs 1825 (inputs
1823 (list ffmpeg-6 1826 (list assimp
1827 ffmpeg
1824 freetype 1828 freetype
1825 fribidi 1829 fribidi
1826 glew 1830 glew
1827 libpng 1831 libpng
1828 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)) 1832 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))
1829 xdg-utils)) 1833 xdg-utils))
1830 (propagated-inputs (list python-ecdsa python-future python-pygame-sdl2)) 1834 (propagated-inputs (list python-ecdsa python-future))
1831 (home-page "https://www.renpy.org/") 1835 (home-page "https://www.renpy.org/")
1832 (synopsis "Ren'py python module") 1836 (synopsis "Ren'py python module")
1833 (description "This package contains the shared libraries and Python modules 1837 (description "This package contains the shared libraries and Python modules
diff --git a/gnu/packages/patches/renpy-fix-integer-slots.patch b/gnu/packages/patches/renpy-fix-integer-slots.patch
new file mode 100644
index 00000000000..2f7ac9168fa
--- /dev/null
+++ b/gnu/packages/patches/renpy-fix-integer-slots.patch
@@ -0,0 +1,40 @@
1Index: renpy-8.5.0-source/renpy/cslots.pyx
2===================================================================
3--- renpy-8.5.0-source.orig/renpy/cslots.pyx
4+++ renpy-8.5.0-source/renpy/cslots.pyx
5@@ -32,6 +32,9 @@ Value unions, followed by a series of by
6 from cpython.mem cimport PyMem_Calloc, PyMem_Free
7 from cpython.object cimport PyObject, PyTypeObject, Py_TPFLAGS_HAVE_GC, PyObject_Free
8 from cpython.ref cimport Py_XINCREF, Py_XDECREF, Py_CLEAR
9+cdef extern from "<limits.h>":
10+ const long long LLONG_MIN
11+ const long long LLONG_MAX
12
13 from copyreg import __newobj__
14
15@@ -51,7 +54,7 @@ cdef unsigned char DEFAULT_VALUE = 0xff
16
17 cdef union Value:
18 PyObject *object
19- unsigned long long integer
20+ long long integer
21
22 cdef class CMetaclass(type):
23
24@@ -369,10 +372,15 @@ cdef class IntegerSlot(Slot):
25 super(IntegerSlot, self).__init__(default_value)
26 self.default_int_value = default_value
27
28- def __set__(self, CObject instance, unsigned int value):
29+ def __set__(self, CObject instance, long long value):
30
31 cdef Value v
32
33+ if value >= (LLONG_MAX >> 1):
34+ raise OverflowError("Value is too large for an IntegerSlot")
35+ if value <= (LLONG_MIN >> 1):
36+ raise OverflowError("Value is too small for an IntegerSlot")
37+
38 if value == self.default_int_value:
39 v.object = NULL
40 else:
diff --git a/gnu/packages/patches/renpy-python-3.11-compat.patch b/gnu/packages/patches/renpy-python-3.11-compat.patch
new file mode 100644
index 00000000000..80758173eb7
--- /dev/null
+++ b/gnu/packages/patches/renpy-python-3.11-compat.patch
@@ -0,0 +1,189 @@
1Index: renpy-8.5.0-source/renpy/color.py
2===================================================================
3--- renpy-8.5.0-source.orig/renpy/color.py
4+++ renpy-8.5.0-source/renpy/color.py
5@@ -19,7 +19,7 @@
6 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
7 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
9-from typing import final, overload
10+from typing import final, overload, ForwardRef
11
12 import re
13 import colorsys
14@@ -32,7 +32,7 @@ _LONG_COLOR_STRING_RE = re.compile(
15 r"#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?",
16 )
17
18-type ColorLike = "Color" | tuple[int, int, int, int] | tuple[int, int, int] | str
19+type ColorLike = ForwardRef("Color") | tuple[int, int, int, int] | tuple[int, int, int] | str
20 """
21 The color, in one of the standard formats Ren'Py understands. These are:
22 - A Color object.
23@@ -409,11 +409,11 @@ class Color(tuple[int, int, int, int]):
24
25 __rmul__ = __mul__ # type: ignore
26
27- def _interpolate_tuple[T: tuple](self, a: T, b: T, fraction: float) -> T:
28+ def _interpolate_tuple(self, a: tuple, b: tuple, fraction: float) -> tuple:
29 i = self._interpolate_num
30 return type(a)(tuple(i(ac, bc, fraction) for ac, bc in zip(a, b)))
31
32- def _interpolate_num[T: (float, int)](self, a: T, b: T, fraction: float) -> T:
33+ def _interpolate_num(self, a: int | float, b: int | float, fraction: float) -> int | float:
34 return type(a)(a + (b - a) * fraction)
35
36 def interpolate(self, other: ColorLike, fraction: float) -> "Color":
37Index: renpy-8.5.0-source/renpy/cslots.pyi
38===================================================================
39--- renpy-8.5.0-source.orig/renpy/cslots.pyi
40+++ renpy-8.5.0-source/renpy/cslots.pyi
41@@ -19,6 +19,8 @@
42 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
43 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
45+from typing import TypeVar, Generic
46+
47 class Object:
48 linenumber: int
49 "If known, the line number of the object in the source file."
50@@ -45,7 +47,9 @@ class Object:
51 and setting all slots to the default, breaking reference cycles.
52 """
53
54-class Slot[T]:
55+T = TypeVar('T')
56+
57+class Slot(Generic(T)):
58 number: int
59 "A number assigned to this slot."
60
61Index: renpy-8.5.0-source/renpy/easy.py
62===================================================================
63--- renpy-8.5.0-source.orig/renpy/easy.py
64+++ renpy-8.5.0-source/renpy/easy.py
65@@ -21,7 +21,7 @@
66
67 """Functions that make the user's life easier."""
68
69-from typing import Any, Callable
70+from typing import Any, Callable, ParamSpec, TypeVar
71 from collections.abc import Iterable
72
73 import contextlib
74@@ -262,7 +262,10 @@ def split_properties(properties: dict[st
75 return rv
76
77
78-def to_list[T](value: T | Iterable[T], copy: bool = False) -> list[T]:
79+T = TypeVar('T')
80+
81+
82+def to_list(value: T | Iterable[T], copy: bool = False) -> list[T]:
83 """
84 If the value is an iterable, turns it into a list, otherwise wraps it into one.
85 If a list is provided and `copy` is True, a new list will be returned.
86@@ -281,7 +284,7 @@ def to_list[T](value: T | Iterable[T], c
87 return [value]
88
89
90-def to_tuple[T](value: T | Iterable[T]) -> tuple[T, ...]:
91+def to_tuple(value: T | Iterable[T]) -> tuple[T, ...]:
92 """
93 Same as to_list, but with tuples.
94 """
95@@ -299,7 +302,11 @@ def to_tuple[T](value: T | Iterable[T])
96 return (value,)
97
98
99-def run_callbacks[**P, R](
100+P = ParamSpec('P')
101+R = TypeVar('R')
102+
103+
104+def run_callbacks(
105 cb: Callable[P, R] | list[Callable[P, R]] | None,
106 *args: P.args,
107 **kwargs: P.kwargs,
108Index: renpy-8.5.0-source/renpy/display/position.py
109===================================================================
110--- renpy-8.5.0-source.orig/renpy/display/position.py
111+++ renpy-8.5.0-source/renpy/display/position.py
112@@ -19,11 +19,14 @@
113 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
114 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
115
116-from typing import final, overload, SupportsIndex, Any
117+from typing import final, overload, SupportsIndex, Any, TypeVar
118
119 from renpy.types import Position
120
121
122+T = TypeVar('T', int, float, "absolute")
123+
124+
125 @final
126 class absolute(float):
127 """
128@@ -176,7 +179,7 @@ class absolute(float):
129
130 @overload
131 @staticmethod
132- def compute_raw[T: ("int | float | absolute")](value: T, room: float) -> T: ...
133+ def compute_raw(value: T, room: float) -> T: ...
134
135 @staticmethod
136 def compute_raw(value: Position, room: float) -> "int | float | absolute":
137Index: renpy-8.5.0-source/renpy/types.py
138===================================================================
139--- renpy-8.5.0-source.orig/renpy/types.py
140+++ renpy-8.5.0-source/renpy/types.py
141@@ -29,10 +29,11 @@
142 # be inconvenient.
143
144 import renpy
145+from typing import ForwardRef
146
147-type Displayable = renpy.display.displayable.Displayable
148+type Displayable = ForwardRef('renpy.display.displayable.Displayable')
149
150-type DisplayableLike = Displayable | str | list[str] | renpy.color.Color
151+type DisplayableLike = Displayable | str | list[str] | ForwardRef('renpy.color.Color')
152 """
153 This describes anything that Ren'Py considers to be a displayable.
154
155@@ -45,7 +46,7 @@ Apart from Displayable itself, this coul
156 - renpy.color.Color object.
157 """
158
159-type Position = int | float | renpy.display.position.absolute | renpy.display.position.position
160+type Position = int | float | ForwardRef('renpy.display.position.absolute') | ForwardRef('renpy.display.position.position')
161 """
162 This describes a position, which can be one of:
163 - An integer - treated as pixels from the top left corner of the area.
164Index: renpy-8.5.0-source/renpy/__init__.py
165===================================================================
166--- renpy-8.5.0-source.orig/renpy/__init__.py
167+++ renpy-8.5.0-source/renpy/__init__.py
168@@ -227,6 +227,7 @@ backup_blacklist = {
169 "renpy.test.testreporter",
170 "renpy.test.testsettings",
171 "renpy.tfd",
172+ "renpy.types",
173 "renpy.gl2",
174 "renpycoverage",
175 }
176@@ -245,9 +246,13 @@ name_blacklist = {
177 "renpy.savelocation.disk_lock",
178 "renpy.character.TAG_RE",
179+ "renpy.color.ColorLike",
180 "renpy.display.im.cache",
181+ "renpy.display.position.Position",
182 "renpy.display.render.main_thread",
183 "renpy.display.render.blit_lock",
184 "renpy.display.render.IDENTITY",
185+ "renpy.easy.Displayable",
186+ "renpy.easy.DisplayableLike",
187 "renpy.loader.auto_lock",
188 "renpy.display.screen.cprof",
189 "renpy.audio.audio.lock",
diff --git a/gnu/packages/patches/renpy-use-system-fribidi.patch b/gnu/packages/patches/renpy-use-system-fribidi.patch
deleted file mode 100644
index 913415e317e..00000000000
--- a/gnu/packages/patches/renpy-use-system-fribidi.patch
+++ /dev/null
@@ -1,57 +0,0 @@
1See also [Arch] and [Gentoo] for similar patches in other distros.
2[Arch] https://github.com/archlinux/svntogit-community/blob/packages/renpy/trunk/renpy-system-fribidi.patch
3[Gentoo] https://gitweb.gentoo.org/repo/gentoo.git/tree/games-engines/renpy/files/renpy-7.3.5-use-system-fribidi.patch
4
5Index: renpy-7.4.0-source/module/renpybidicore.c
6===================================================================
7--- renpy-7.4.0-source.orig/module/renpybidicore.c
8+++ renpy-7.4.0-source/module/renpybidicore.c
9@@ -1,9 +1,3 @@
10 #include <Python.h>
11-
12-#ifdef RENPY_BUILD
13 #include <fribidi.h>
14-#else
15-#include <fribidi-src/lib/fribidi.h>
16-#endif
17-
18 #include <stdlib.h>
19
20 #ifndef alloca
21Index: renpy-7.4.0-source/module/setup.py
22===================================================================
23--- renpy-7.4.0-source.orig/module/setup.py
24+++ renpy-7.4.0-source/module/setup.py
25@@ -125,30 +125,13 @@ cython(
26 sdl + [ png, 'z', 'm' ])
27
28 FRIBIDI_SOURCES = """
29-fribidi-src/lib/fribidi.c
30-fribidi-src/lib/fribidi-arabic.c
31-fribidi-src/lib/fribidi-bidi.c
32-fribidi-src/lib/fribidi-bidi-types.c
33-fribidi-src/lib/fribidi-deprecated.c
34-fribidi-src/lib/fribidi-joining.c
35-fribidi-src/lib/fribidi-joining-types.c
36-fribidi-src/lib/fribidi-mem.c
37-fribidi-src/lib/fribidi-mirroring.c
38-fribidi-src/lib/fribidi-run.c
39-fribidi-src/lib/fribidi-shape.c
40 renpybidicore.c
41 """.split()
42 cython(
43 "_renpybidi",
44 FRIBIDI_SOURCES,
45- includes=[
46- BASE + "/fribidi-src/",
47- BASE + "/fribidi-src/lib/",
48- ],
49- define_macros=[
50- ("FRIBIDI_ENTRY", ""),
51- ("HAVE_CONFIG_H", "1"),
52- ])
53+ includes=["/usr/include/fribidi"],
54+ libs=["fribidi"])
55
56
57 cython("_renpysteam", language="c++", compile_if=steam_sdk, libs=["steam_api"])