Add renpy package

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Prikler
  • Nicolas Goaziou
Owner
unassigned
Submitted by
Leo Prikler
Severity
normal
L
L
Leo Prikler wrote on 12 Oct 2019 09:20
(address . guix-patches@gnu.org)
d1b5749c53db9fd174a64b1d26272b3517f769d5.camel@student.tugraz.at
This patch adds the Ren'py Visual Novel engine split into four outputs:
- "out": contains the engine itself. Since Guix differs strongly from
the platforms Ren'py usually runs on, we ship our own Ren'py main file.
- "launcher": The Ren'py launcher, that people would normally expect
when invoking renpy -- it does not seem very usable in Guix, though.
- "the-question": An example game, that ships with Ren'py.
- "tutorial": The tutorial that ships with Ren'py.

Ren'py also ships its own version of pygame. They call it pygame_sdl2
since it's a reimplementation of pygame using SDL2, but the tags make
it very clear, that it is developed alongside Ren'py.
L
L
Leo Prikler wrote on 14 Oct 2019 11:00
(address . guix-patches@gnu.org)
220f1702169cb3221272303992ec873ecb1fbcd1.camel@student.tugraz.at
A small fixup to correct the synopsis of python2-renpy. It should now
follow the guidelines.
From fec000e3ca6f8e91504954995389c495590949ed Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Mon, 14 Oct 2019 10:55:59 +0200
Subject: [PATCH 2/2] gnu: python2-renpy: fix synopsis

* /gnu/packages/game-development: (python2-renpy): Follow synopsis guidelines.
---
gnu/packages/game-development.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 134664e773..98330c07a9 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1202,7 +1202,7 @@ if __name__ == \"__main__\":
(native-inputs
`(("python2-cython" ,python2-cython)))
(home-page "http://www.renpy.org/")
- (synopsis "The Ren'Py Visual Novel Engine -- libary files")
+ (synopsis "Visual novel engine")
(description "Ren'Py is a visual novel engine -- used by thousands 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
--
2.23.0
N
N
Nicolas Goaziou wrote on 18 Oct 2019 21:49
Re: [bug#37714] Add renpy package
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 37714@debbugs.gnu.org)
87d0et96lm.fsf@nicolasgoaziou.fr
Hello,

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

Toggle quote (3 lines)
> This patch adds the Ren'py Visual Novel engine split into four
> outputs:

Great! It was on my TODO list, too.

Toggle quote (5 lines)
> - "out": contains the engine itself. Since Guix differs strongly from
> the platforms Ren'py usually runs on, we ship our own Ren'py main file.
> - "launcher": The Ren'py launcher, that people would normally expect
> when invoking renpy -- it does not seem very usable in Guix, though.

What do you mean?

Toggle quote (3 lines)
> * gnu/packages/game-development: (python2-pygame-for-renpy): New procedure.
> (python2-renpy): New variable.

New variable for both in enough, I think.

Toggle quote (12 lines)
> +(define (python2-pygame-for-renpy version hash)
> + (package
> + (inherit python2-pygame)
> + (name "python2-pygame-for-renpy")
> + (version version)
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/renpy/pygame_sdl2.git")
> + (commit (string-append "renpy-" version))))

Upstream provides a tarball for that:


I think it is preferable using it than pointing to Github.

Toggle quote (4 lines)
> + (sha256
> + (base32
> + hash))

Nitpick: At least bash32 and hash could go on the same line.

Toggle quote (3 lines)
> + (home-page "http://www.renpy.org/")
> + (synopsis "Reimplementation of the Pygame API using SDL2")

The description field is missing. Could you add one?

Toggle quote (2 lines)
> +(define-public python2-renpy

"python2" prefix is for libraries. I think this one can be called
"renpy".

Toggle quote (4 lines)
> + (package
> + (name "python2-renpy")
> + (version "7.3.4.596")

I noticed 7.3.5 is out. Could you update it?

Toggle quote (7 lines)
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/renpy/renpy.git")
> + (commit version)))

As above, I suggest to use tarball from main site:


Toggle quote (12 lines)
> + (replace 'build
> + (lambda args
> + (apply
> + (lambda* (build-root #:key inputs outputs #:allow-other-keys)
> + (chdir "module")
> + (apply (assoc-ref %standard-phases 'build) args)
> + (chdir build-root)
> + (delete-file "renpy/__init__.pyc")
> + (invoke "python" "-m" "compileall" "renpy"))
> + (getcwd) args)
> + #t))

This is a bit confusing because you're not really replacing `build'
phase, but wrapping stuff around it. I think it may be better to add
a `before-build' and an `after-build' phases, adding comments, if
possible, to explain why they are needed.

Toggle quote (18 lines)
> + (replace 'install
> + (lambda args
> + (apply
> + (lambda* (build-root #:key inputs outputs #:allow-other-keys)
> + (let* ((pygame (assoc-ref inputs "python2-pygame"))
> + (out (assoc-ref outputs "out"))
> + (site (string-append "/lib/python"
> + ,(version-major+minor
> + (package-version python-2))
> + "/site-packages")))
> + (chdir "module")
> + (apply (assoc-ref %standard-phases 'install) args)
> + (chdir build-root)
> + (copy-recursively "renpy"
> + (string-append out site "/renpy"))))
> + (getcwd) args)
> + #t))

See above. It might be more readable to use one phase before, and one
after.

Toggle quote (9 lines)
> + (inputs
> + `(("ffmpeg" ,ffmpeg)
> + ("freetype" ,freetype)
> + ("glew" ,glew)
> + ("libpng" ,libpng)
> + ("sdl-union"
> + ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))
> + ("python" ,python)))

So it needs both Python 2 and Python 3?

Could you order alphabetically the inputs?

Toggle quote (8 lines)
> + (outputs
> + (list "out" "launcher" "tutorial" "the-question"))
> + (propagated-inputs
> + `(("python2-pygame"
> + ,(python2-pygame-for-renpy
> + version
> + "1gwbqkyv7763813x7nmzb3nz4r8673d33ggsp6lgp1d640rimlpb"))))

Could you see if there's a way to not propagate this input? What happens
if it is a simple input?

Toggle quote (11 lines)
> + (native-inputs
> + `(("python2-cython" ,python2-cython)))
> + (home-page "http://www.renpy.org/")
> + (synopsis "The Ren'Py Visual Novel Engine -- libary files")
> + (description "Ren'Py is a visual novel engine -- used by thousands 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
> +Python scripting is enough for complex simulation games.")

You need to add two spaces at the end of sentences.

Toggle quote (2 lines)
> + (license license:x11)))

I this should be license:expat.

Could you send an updated patch?

Thank you for the work.


Regards,

--
Nicolas Goaziou
L
L
Leo Prikler wrote on 19 Oct 2019 22:59
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 37714@debbugs.gnu.org)
ccc9aa8a069dbef7d413ba77733cb99bd1e83daf.camel@student.tugraz.at
After some work, I've come up with this new patchset.
- 0001 is an update of the previous 0001 with most of the issues raised
(hopefully) being addressed. It still uses git from source and wraps
the build and install phase, though.
- 0002 causes the packages to use the main site instead of git.
- 0003 splits renpy into the python package python2-renpy and the
program itself. This makes the build rules a little easier to read,
even if they themselves did not change much.
- 0004 fixes the launcher (mostly). One can now set a project
directory, create projects, launch created projects and open project
directories in the default file explorer. However, setting the editor
(and hence launching one) still does not work.

Regards,

Leo
L
L
Leo Prikler wrote on 20 Oct 2019 14:09
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 37714@debbugs.gnu.org)
a0c62c0f41f25a2032bde0741db0e504f53fd199.camel@student.tugraz.at
Am Samstag, den 19.10.2019, 22:59 +0200 schrieb Leo Prikler:
Toggle quote (3 lines)
> - 0003 splits renpy into the python package python2-renpy and the
> program itself. This makes the build rules a little easier to read,
> even if they themselves did not change much.
Now also with a package description for python2-renpy.
Toggle quote (4 lines)
> - 0004 fixes the launcher (mostly). One can now set a project
> directory, create projects, launch created projects and open project
> directories in the default file explorer. However, setting the editor
> (and hence launching one) still does not work.
Adjusted accordingly.
- 0005 uses pre-install renpy to compile the games. I've also updated
the comments on #:tests? that are inaccurate as of 0002.

Regards,

Leo
From 9866ea5245979ccb61a0a71499e268b0234d92ff Mon Sep 17 00:00:00 2001
From: Comrade Yuri <yuri@nijino>
Date: Sun, 20 Oct 2019 14:02:19 +0200
Subject: [PATCH 5/5] gnu: compile Ren'py games

* /gnu/packages/game-development: (python2-renpy) [arguments]: Update comment
on #:tests?
(renpy) [arguments]: Ditto.
[start-xserver]: New phase.
[build]: New phase.
[inputs]: Add xorg-server.
---
gnu/packages/game-development.scm | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)

Toggle diff (66 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index a57cddfbcb..10111ebf1c 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1033,7 +1033,7 @@ developed mainly for Ren'py.")
(sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))))
(build-system python-build-system)
(arguments
- `(#:tests? #f ; non-trivial tests require a more complete Ren'py
+ `(#:tests? #f ; Ren'py doesn't seem to package tests
#:python ,python-2
#:phases
(modify-phases %standard-phases
@@ -1066,7 +1066,6 @@ developed mainly for Ren'py.")
(invoke "python" "-m" "compileall" "renpy"))
(getcwd) args)
#t))
-
(replace 'install
(lambda args
(apply
@@ -1110,9 +1109,7 @@ of renpy.")
(version "7.3.5")
(build-system python-build-system)
(arguments
- `(;; TODO: We currently can't run renpy inside the guixbuilder.
- ;; Perhaps we should set up an X server.
- #:tests? #f
+ `(#:tests? #f ; see python2-renpy
#:python ,python-2
#:phases
(modify-phases %standard-phases
@@ -1138,8 +1135,19 @@ of renpy.")
"launcher/game/gui7/images.py")
((", \"game\",") ","))
#t))
- ;; TODO: Here we would use ren'py to compile the games.
- (delete 'build)
+ (add-before 'build 'start-xserver
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((xorg-server (assoc-ref inputs "xorg-server")))
+ (setenv "HOME" (getcwd))
+ (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
+ (setenv "DISPLAY" ":1")
+ #t)))
+ (replace 'build
+ (lambda _
+ (invoke "python" "renpy.py" "launcher" "quit")
+ (invoke "python" "renpy.py" "the_question" "quit")
+ (invoke "python" "renpy.py" "tutorial" "quit")
+ #t))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
;; Here we install our custom renpy program.
@@ -1272,7 +1280,8 @@ if __name__ == \"__main__\":
(inputs
`(("python2-tkinter" ,python-2 "tk")
("python2-pygame" ,python2-pygame-sdl2)
- ("python2-renpy" ,python2-renpy)))
+ ("python2-renpy" ,python2-renpy)
+ ("xorg-server" ,xorg-server)))
(outputs
(list "out" "tutorial" "the-question"))
(home-page "http://www.renpy.org/")
--
2.23.0
N
N
Nicolas Goaziou wrote on 21 Oct 2019 09:26
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 37714@debbugs.gnu.org)
87k18y7e5j.fsf@nicolasgoaziou.fr
Hello,

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

Toggle quote (13 lines)
> Am Samstag, den 19.10.2019, 22:59 +0200 schrieb Leo Prikler:
>> - 0003 splits renpy into the python package python2-renpy and the
>> program itself. This makes the build rules a little easier to read,
>> even if they themselves did not change much.
> Now also with a package description for python2-renpy.
>> - 0004 fixes the launcher (mostly). One can now set a project
>> directory, create projects, launch created projects and open project
>> directories in the default file explorer. However, setting the editor
>> (and hence launching one) still does not work.
> Adjusted accordingly.
> - 0005 uses pre-install renpy to compile the games. I've also updated
> the comments on #:tests? that are inaccurate as of 0002.

Could you squeeze all those patches into a single one and send it again?

Thank you for all the work so far!

Regards,

--
Nicolas Goaziou
L
L
Leo Prikler wrote on 21 Oct 2019 09:35
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 37714@debbugs.gnu.org)
e60246631dc584be1fe2b0bc7e99a81f0d1979bd.camel@student.tugraz.at
Am Montag, den 21.10.2019, 09:26 +0200 schrieb Nicolas Goaziou:
Toggle quote (28 lines)
> Hello,
>
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>
> > Am Samstag, den 19.10.2019, 22:59 +0200 schrieb Leo Prikler:
> > > - 0003 splits renpy into the python package python2-renpy and the
> > > program itself. This makes the build rules a little easier to
> > > read,
> > > even if they themselves did not change much.
> > Now also with a package description for python2-renpy.
> > > - 0004 fixes the launcher (mostly). One can now set a project
> > > directory, create projects, launch created projects and open
> > > project
> > > directories in the default file explorer. However, setting the
> > > editor
> > > (and hence launching one) still does not work.
> > Adjusted accordingly.
> > - 0005 uses pre-install renpy to compile the games. I've also
> > updated
> > the comments on #:tests? that are inaccurate as of 0002.
>
> Could you squeeze all those patches into a single one and send it
> again?
>
> Thank you for all the work so far!
>
> Regards,
>
Sure.

Regards,

Leo
N
N
Nicolas Goaziou wrote on 30 Oct 2019 00:04
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 37714-done@debbugs.gnu.org)
87imo717c7.fsf@nicolasgoaziou.fr
Hello,

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

Toggle quote (2 lines)
> Subject: [PATCH] gnu: Add renpy

I applied your patch and added a line to your name in the authors list,
at the beginning of the file. I used the name from your commit. Let me
know if it should be otherwise.

Thank you!

Regards,

--
Nicolas Goaziou
Closed
L
L
Leo Prikler wrote on 30 Oct 2019 10:16
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 37714-done@debbugs.gnu.org)
a79883f775a67b011af0c42b1f8a637a34df3447.camel@student.tugraz.at
Am Mittwoch, den 30.10.2019, 00:04 +0100 schrieb Nicolas Goaziou:
Toggle quote (11 lines)
> Hello,
>
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>
> > Subject: [PATCH] gnu: Add renpy
>
> I applied your patch and added a line to your name in the authors
> list,
> at the beginning of the file. I used the name from your commit. Let
> me
> know if it should be otherwise.
Ah, that was my mistake, I messed up my git environment and the two
were different. It should be "Leo Prikler <
leo.prikler@student.tugraz.at>" as in the sender of the email.
Closed
N
N
Nicolas Goaziou wrote on 30 Oct 2019 14:45
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 37714-done@debbugs.gnu.org)
87d0eee494.fsf@nicolasgoaziou.fr
Hello,

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

Toggle quote (4 lines)
> Ah, that was my mistake, I messed up my git environment and the two
> were different. It should be "Leo Prikler <
> leo.prikler@student.tugraz.at>" as in the sender of the email.

I fixed the attribution line.

Regards,

--
Nicolas Goaziou
Closed
?