[PATCH] gnu: Refactor renpy build.

  • 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 5 years ago
(address . guix-patches@gnu.org)
20200116174309.3058-1-leo.prikler@student.tugraz.at
* gnu/packages/game-development.scm (python2-renpy): Use directory excursions
instead of invoking `chdir' directly.
---
gnu/packages/game-development.scm | 54 +++++++++++++------------------
1 file changed, 23 insertions(+), 31 deletions(-)

Toggle diff (69 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 7aef6b09d2..697ede89e1 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1086,39 +1086,31 @@ developed mainly for Ren'py.")
(setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
#t))
(replace 'build
- (lambda args
- (apply
- (lambda* (build-root #:key inputs outputs #:allow-other-keys)
- ;; The "module" subdirectory contains a python (really cython)
- ;; project, which is built using a script, that is thankfully
- ;; named "setup.py".
- (chdir "module")
- (apply (assoc-ref %standard-phases 'build) args)
- ;; the above causes renpy.__init__ to be compiled but does not
- ;; compile anything else, hence we do that here
- (chdir build-root)
- (delete-file "renpy/__init__.pyc")
- (invoke "python" "-m" "compileall" "renpy"))
- (getcwd) args)
+ (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
+ ;; The "module" subdirectory contains a python (really cython)
+ ;; project, which is built using a script, that is thankfully
+ ;; named "setup.py".
+ (with-directory-excursion "module"
+ (apply (assoc-ref %standard-phases 'build) args))
+ ;; the above causes renpy.__init__ to be compiled but does not
+ ;; compile anything else, hence we do that here
+ (delete-file "renpy/__init__.pyc")
+ (invoke "python" "-m" "compileall" "renpy")
#t))
(replace 'install
- (lambda args
- (apply
- (lambda* (build-root #:key inputs outputs #:allow-other-keys)
- ;; Again, we have to wrap the module installation.
- ;; Additionally, we want to install the python code
- ;; (both source and compiled) in the same directory.
- (let* ((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)
+ (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
+ ;; Again, we have to wrap the module installation.
+ ;; Additionally, we want to install the python code
+ ;; (both source and compiled) in the same directory.
+ (let* ((out (assoc-ref outputs "out"))
+ (site (string-append "/lib/python"
+ ,(version-major+minor
+ (package-version python-2))
+ "/site-packages")))
+ (with-directory-excursion "module"
+ (apply (assoc-ref %standard-phases 'install) args))
+ (copy-recursively "renpy"
+ (string-append out site "/renpy")))
#t)))))
(inputs
`(("ffmpeg" ,ffmpeg)
--
2.25.0
Nicolas Goaziou wrote 5 years ago
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 39153@debbugs.gnu.org)
87sgkft474.fsf@nicolasgoaziou.fr
Hello,

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

Toggle quote (3 lines)
> * gnu/packages/game-development.scm (python2-renpy): Use directory excursions
> instead of invoking `chdir' directly.

LGTM! I updated the copyright line for you and applied your patch (alas
not in this order…).

Thank you!

Regards,

--
Nicolas Goaziou
Nicolas Goaziou wrote 5 years ago
(address . 39153-done@debbugs.gnu.org)
87lfq7t45e.fsf@nicolasgoaziou.fr
Applied as 37c52b5b15c6debed78dba41a74370a051ad7878. Closing.
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 39153
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