[PATCH 0/2] QC Ren'py package

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Prikler
  • Nicolas Goaziou
Owner
unassigned
Submitted by
Leo Prikler
Severity
normal

Debbugs page

Leo Prikler wrote 4 years ago
(address . guix-patches@gnu.org)
02e03c983db083b554991ee295b366adedd95bc5.camel@student.tugraz.at
Hello Guix,

perhaps a bit overdue, the 10th of October marks the anniversary of my
first contribution to Guix. A bit later and with a broken git setup,
I've added a package for Ren'py, which was finally upstreamed towards
the end of October.

Today, I am again revisiting that package, as back then there were
several steps skipped in packaging, that should not have been skipped.
The following patch set drops generated sources from both Ren'py and
its fork of pygame, and also has Ren'py use the already existing
fribidi package.

Regards,
Leo
Leo Prikler wrote 4 years ago
[PATCH 1/2] gnu: pygame-sdl2-for-renpy: Drop generated sources in snippet.
(address . 45132@debbugs.gnu.org)
20201209145650.25624-1-leo.prikler@student.tugraz.at
* gnu/packages/game-development.scm (pygame-sdl2-for-renpy)[source]<modules>:
Add (guix build utils).
[#:phases]<drop-generated-files>: Move from here...
[source]<snippet>: ... to here.
---
gnu/packages/game-development.scm | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

Toggle diff (33 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index c57ea5a908..7b0b1cb83d 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1071,7 +1071,13 @@ to create fully featured games and multimedia programs in the python language.")
(method url-fetch)
(uri (string-append "https://www.renpy.org/dl/" renpy-version
"/pygame_sdl2-" version ".tar.gz"))
- (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))))
+ (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; drop generated sources
+ (delete-file-recursively "gen")
+ (delete-file-recursively "gen3")))))
(build-system python-build-system)
(arguments
`(#:tests? #f ; tests require pygame to be installed first
@@ -1090,11 +1096,6 @@ to create fully featured games and multimedia programs in the python language.")
"/lib -Wl,-rpath,"
(assoc-ref inputs "sdl-union")
"/lib -Wl,--enable-new-dtags -lSDL2"))
- #t))
- (add-before 'build 'drop-generated-files
- (lambda args
- (delete-file-recursively "gen")
- (delete-file-recursively "gen3")
#t)))))
(inputs
`(("sdl-union"
--
2.29.2
Leo Prikler wrote 4 years ago
[PATCH 2/2] gnu: renpy: Use system fribidi and drop generated sources.
(address . 45132@debbugs.gnu.org)
20201209145650.25624-2-leo.prikler@student.tugraz.at
* 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.
---
gnu/local.mk | 1 +
gnu/packages/game-development.scm | 20 +++++++-
.../patches/renpy-use-system-fribidi.patch | 48 +++++++++++++++++++
3 files changed, 68 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/renpy-use-system-fribidi.patch

Toggle diff (113 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 90df6f3966..b0af8f29b5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1568,6 +1568,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 \
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 7b0b1cb83d..832b782f3c 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1119,7 +1119,17 @@ 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")))))
(build-system python-build-system)
(arguments
`(#:tests? #f ; Ren'py doesn't seem to package tests
@@ -1132,6 +1142,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"
@@ -1169,6 +1186,7 @@ developed mainly for Ren'py.")
(inputs
`(("ffmpeg" ,ffmpeg)
("freetype" ,freetype)
+ ("fribidi" ,fribidi)
("glew" ,glew)
("libpng" ,libpng)
("python2-pygame" ,python2-pygame-sdl2)
diff --git a/gnu/packages/patches/renpy-use-system-fribidi.patch b/gnu/packages/patches/renpy-use-system-fribidi.patch
new file mode 100644
index 0000000000..a6d22eb7e5
--- /dev/null
+++ b/gnu/packages/patches/renpy-use-system-fribidi.patch
@@ -0,0 +1,48 @@
+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"])
--
2.29.2
Nicolas Goaziou wrote 4 years ago
Re: [bug#45132] [PATCH 0/2] QC Ren'py package
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 45132@debbugs.gnu.org)
87v9d9hq8f.fsf@nicolasgoaziou.fr
Hello,

Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (5 lines)
> perhaps a bit overdue, the 10th of October marks the anniversary of my
> first contribution to Guix. A bit later and with a broken git setup,
> I've added a package for Ren'py, which was finally upstreamed towards
> the end of October.

Time flies!

Toggle quote (6 lines)
> Today, I am again revisiting that package, as back then there were
> several steps skipped in packaging, that should not have been skipped.
> The following patch set drops generated sources from both Ren'py and
> its fork of pygame, and also has Ren'py use the already existing
> fribidi package.

It looks good. I suggest adding #t at the end of the snippet as long as
next core-updates merge has not happened.

Could you also mention the origin of the patch (unless it is yours, of
course, in which case you can mention your name)?

Otherwise, LGTM.

Regards,
--
Nicolas Goaziou
Leo Prikler wrote 4 years ago
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 45132@debbugs.gnu.org)
f2cc0b10776f3f0c4e4c43a3065d36dec40d893f.camel@student.tugraz.at
Hello,

Am Donnerstag, den 10.12.2020, 12:09 +0100 schrieb Nicolas Goaziou:
Toggle quote (25 lines)
> Hello,
>
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>
> > perhaps a bit overdue, the 10th of October marks the anniversary of
> > my
> > first contribution to Guix. A bit later and with a broken git
> > setup,
> > I've added a package for Ren'py, which was finally upstreamed
> > towards
> > the end of October.
>
> Time flies!
>
> > Today, I am again revisiting that package, as back then there were
> > several steps skipped in packaging, that should not have been
> > skipped.
> > The following patch set drops generated sources from both Ren'py
> > and
> > its fork of pygame, and also has Ren'py use the already existing
> > fribidi package.
>
> It looks good. I suggest adding #t at the end of the snippet as long
> as
> next core-updates merge has not happened.
Will do.

Toggle quote (3 lines)
> Could you also mention the origin of the patch (unless it is yours,
> of
> course, in which case you can mention your name)?
It's a bit of a mixed bag. The patch is inspired by [1] and [2], but
I've recreated it on Guix.

I'm sadly a little pressed for time currently and I won't be able to
reroll before evening, but I still wanted to reply as soon as I
received the mail.

Regards,
Leo

[1]
[2]
Leo Prikler wrote 4 years ago
[PATCH v2 1/2] gnu: pygame-sdl2-for-renpy: Drop generated sources in snippet.
(address . 45132@debbugs.gnu.org)(address . mail@nicolasgoaziou.fr)
20201210190312.19632-1-leo.prikler@student.tugraz.at
* gnu/packages/game-development.scm (pygame-sdl2-for-renpy)[source]<modules>:
Add (guix build utils).
[#:phases]<drop-generated-files>: Move from here...
[source]<snippet>: ... to here.
---
gnu/packages/game-development.scm | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index c57ea5a908..557f02f564 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1071,7 +1071,14 @@ to create fully featured games and multimedia programs in the python language.")
(method url-fetch)
(uri (string-append "https://www.renpy.org/dl/" renpy-version
"/pygame_sdl2-" version ".tar.gz"))
- (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))))
+ (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; drop generated sources
+ (delete-file-recursively "gen")
+ (delete-file-recursively "gen3")
+ #t))))
(build-system python-build-system)
(arguments
`(#:tests? #f ; tests require pygame to be installed first
@@ -1090,11 +1097,6 @@ to create fully featured games and multimedia programs in the python language.")
"/lib -Wl,-rpath,"
(assoc-ref inputs "sdl-union")
"/lib -Wl,--enable-new-dtags -lSDL2"))
- #t))
- (add-before 'build 'drop-generated-files
- (lambda args
- (delete-file-recursively "gen")
- (delete-file-recursively "gen3")
#t)))))
(inputs
`(("sdl-union"
--
2.29.2
Leo Prikler wrote 4 years ago
[PATCH v2 2/2] gnu: renpy: Use system fribidi and drop generated sources.
(address . 45132@debbugs.gnu.org)(address . mail@nicolasgoaziou.fr)
20201210190312.19632-2-leo.prikler@student.tugraz.at
* 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.
---
gnu/local.mk | 1 +
gnu/packages/game-development.scm | 21 +++++++-
.../patches/renpy-use-system-fribidi.patch | 52 +++++++++++++++++++
3 files changed, 73 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/renpy-use-system-fribidi.patch

Toggle diff (118 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 90df6f3966..b0af8f29b5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1568,6 +1568,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 \
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 557f02f564..21f7f7e880 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -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)
diff --git a/gnu/packages/patches/renpy-use-system-fribidi.patch b/gnu/packages/patches/renpy-use-system-fribidi.patch
new file mode 100644
index 0000000000..1437274bcc
--- /dev/null
+++ b/gnu/packages/patches/renpy-use-system-fribidi.patch
@@ -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"])
--
2.29.2
Nicolas Goaziou wrote 4 years ago
Re: [PATCH v2 1/2] gnu: pygame-sdl2-for-renpy: Drop generated sources in snippet.
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 45132-done@debbugs.gnu.org)
87360a231e.fsf@nicolasgoaziou.fr
Hello,

Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (3 lines)
> * gnu/packages/game-development.scm
> (pygame-sdl2-for-renpy)[source]<modules>:

Both patches applied. Thank you.

Regards,
--
Nicolas Goaziou
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 45132@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 45132
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help