gnu: renpy: Use system fribidi and drop generated sources.

* gnu/packages/patches/renpy-use-system-fribidi.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it here.
* gnu/packages/game-development.scm (renpy)[source]<patches> Use it here.
<modules>: Add (guix build utils).
<snippet>: Drop generated sources and fribidi sources.
(arguments)[phases]: Add fix-include-paths.
(inputs): Add fribidi.

Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
This commit is contained in:
Leo Prikler 2020-12-10 20:03:12 +01:00 committed by Nicolas Goaziou
parent 2a951e87c5
commit 1592491c39
No known key found for this signature in database
GPG Key ID: DA00B4F048E92F2D
3 changed files with 73 additions and 1 deletions

@ -1569,6 +1569,7 @@ dist_patch_DATA = \
%D%/packages/patches/rct-add-missing-headers.patch \
%D%/packages/patches/readline-link-ncurses.patch \
%D%/packages/patches/readline-6.2-CVE-2014-2524.patch \
%D%/packages/patches/renpy-use-system-fribidi.patch \
%D%/packages/patches/reposurgeon-add-missing-docbook-files.patch \
%D%/packages/patches/r-httpuv-1.5.4-unvendor-libuv.patch \
%D%/packages/patches/ri-li-modernize_cpp.patch \

@ -1120,7 +1120,18 @@ developed mainly for Ren'py.")
(method url-fetch)
(uri (string-append "https://www.renpy.org/dl/" version
"/renpy-" version "-source.tar.bz2"))
(sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))))
(sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))
(modules '((guix build utils)))
(patches
(search-patches
"renpy-use-system-fribidi.patch"))
(snippet
'(with-directory-excursion "module"
;; drop generated sources
(delete-file-recursively "gen")
;; drop fribidi sources
(delete-file-recursively "fribidi-src")
#t))))
(build-system python-build-system)
(arguments
`(#:tests? #f ; Ren'py doesn't seem to package tests
@ -1133,6 +1144,13 @@ developed mainly for Ren'py.")
(("xdg-open")
(which "xdg-open")))
#t))
(add-after 'unpack 'fix-include-paths
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "module/setup.py"
(("/usr/include/fribidi")
(string-append (assoc-ref inputs "fribidi")
"/include/fribidi")))
#t))
(add-after 'set-paths 'set-build-vars
(lambda* (#:key inputs #:allow-other-keys)
(setenv "RENPY_CYTHON"
@ -1170,6 +1188,7 @@ developed mainly for Ren'py.")
(inputs
`(("ffmpeg" ,ffmpeg)
("freetype" ,freetype)
("fribidi" ,fribidi)
("glew" ,glew)
("libpng" ,libpng)
("python2-pygame" ,python2-pygame-sdl2)

@ -0,0 +1,52 @@
See also [Arch] and [Gentoo] for similar patches in other distros.
[Arch] https://github.com/archlinux/svntogit-community/blob/packages/renpy/trunk/renpy-system-fribidi.patch
[Gentoo] https://gitweb.gentoo.org/repo/gentoo.git/tree/games-engines/renpy/files/renpy-7.3.5-use-system-fribidi.patch
Index: renpy-7.3.5-source/module/renpybidicore.c
===================================================================
--- renpy-7.3.5-source.orig/module/renpybidicore.c
+++ renpy-7.3.5-source/module/renpybidicore.c
@@ -1,5 +1,5 @@
#include <Python.h>
-#include <fribidi-src/lib/fribidi.h>
+#include <fribidi.h>
#include <stdlib.h>
#ifndef alloca
Index: renpy-7.3.5-source/module/setup.py
===================================================================
--- renpy-7.3.5-source.orig/module/setup.py
+++ renpy-7.3.5-source/module/setup.py
@@ -119,30 +119,13 @@ cython(
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/",
- ],
- define_macros=[
- ("FRIBIDI_ENTRY", ""),
- ("HAVE_CONFIG_H", "1"),
- ])
+ includes=["/usr/include/fribidi"],
+ libs=["fribidi"])
cython("_renpysteam", language="c++", compile_if=steam_sdk, libs=["steam_api"])