* [bug#39153] [PATCH] gnu: Refactor renpy build.
@ 2020-01-16 17:43 Leo Prikler
2020-01-16 22:41 ` Nicolas Goaziou
2020-01-16 22:42 ` bug#39153: " Nicolas Goaziou
0 siblings, 2 replies; 3+ messages in thread
From: Leo Prikler @ 2020-01-16 17:43 UTC (permalink / raw)
To: 39153
* 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(-)
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [bug#39153] [PATCH] gnu: Refactor renpy build.
2020-01-16 17:43 [bug#39153] [PATCH] gnu: Refactor renpy build Leo Prikler
@ 2020-01-16 22:41 ` Nicolas Goaziou
2020-01-16 22:42 ` bug#39153: " Nicolas Goaziou
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2020-01-16 22:41 UTC (permalink / raw)
To: Leo Prikler; +Cc: 39153
Hello,
Leo Prikler <leo.prikler@student.tugraz.at> writes:
> * 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#39153: [PATCH] gnu: Refactor renpy build.
2020-01-16 17:43 [bug#39153] [PATCH] gnu: Refactor renpy build Leo Prikler
2020-01-16 22:41 ` Nicolas Goaziou
@ 2020-01-16 22:42 ` Nicolas Goaziou
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2020-01-16 22:42 UTC (permalink / raw)
To: 39153-done
Applied as 37c52b5b15c6debed78dba41a74370a051ad7878. Closing.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-16 22:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-16 17:43 [bug#39153] [PATCH] gnu: Refactor renpy build Leo Prikler
2020-01-16 22:41 ` Nicolas Goaziou
2020-01-16 22:42 ` bug#39153: " Nicolas Goaziou
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).