diff mbox series

[bug#37714] Add renpy package

Message ID a0c62c0f41f25a2032bde0741db0e504f53fd199.camel@student.tugraz.at
State Accepted
Headers show
Series [bug#37714] Add renpy package | expand

Commit Message

Leo Prikler Oct. 20, 2019, 12:09 p.m. UTC
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.

Regards,

Leo

Comments

Nicolas Goaziou Oct. 21, 2019, 7:26 a.m. UTC | #1
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,
diff mbox series

Patch

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(-)

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