Archived
1
0
Fork 0

gnu: python-renpy: Use G-Expressions.

* gnu/packages/game-development.scm (python-renpy)[arguments]: Convert to
list of G-Expressions.
This commit is contained in:
Liliana Marie Prikler 2023-05-19 12:14:28 +02:00
parent eb3a7b6646
commit d64d6ea2cf
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -1359,47 +1359,48 @@ developed mainly for Ren'py.")
(("official = official and .*") "")))))) (("official = official and .*") ""))))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:tests? #f ; Ren'py doesn't seem to package tests (list
#:phases #:tests? #f ; Ren'py doesn't seem to package tests
(modify-phases %standard-phases #:phases
(add-after 'unpack 'fix-commands #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'fix-commands
(substitute* "renpy/editor.py" (lambda* (#:key inputs #:allow-other-keys)
(("xdg-open") (substitute* "renpy/editor.py"
(string-append (assoc-ref inputs "xdg-utils") (("xdg-open")
"/bin/xdg-open"))))) (string-append (assoc-ref inputs "xdg-utils")
(add-after 'set-paths 'set-build-vars "/bin/xdg-open")))))
(lambda* (#:key inputs native-inputs #:allow-other-keys) (add-after 'set-paths 'set-build-vars
(setenv "RENPY_CYTHON" (lambda* (#:key inputs native-inputs #:allow-other-keys)
(search-input-file (or native-inputs inputs) (setenv "RENPY_CYTHON"
"/bin/cython")) (search-input-file (or native-inputs inputs)
(setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":")))) "/bin/cython"))
(replace 'build (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))))
(lambda* (#:key inputs outputs #:allow-other-keys #:rest args) (replace 'build
;; The "module" subdirectory contains a python (really cython) (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
;; project, which is built using a script, that is thankfully ;; The "module" subdirectory contains a python (really cython)
;; named "setup.py". ;; project, which is built using a script, that is thankfully
(with-directory-excursion "module" ;; named "setup.py".
(apply (assoc-ref %standard-phases 'build) args)) (with-directory-excursion "module"
;; The above only builds the cython modules, but nothing else, (apply (assoc-ref %standard-phases 'build) args))
;; so we do that here. ;; The above only builds the cython modules, but nothing else,
(invoke "python" "-m" "compileall" "renpy"))) ;; so we do that here.
(replace 'install (invoke "python" "-m" "compileall" "renpy")))
(lambda* (#:key inputs outputs #:allow-other-keys #:rest args) (replace 'install
;; Again, we have to wrap the module installation. (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
;; Additionally, we want to install the python code ;; Again, we have to wrap the module installation.
;; (both source and compiled) in the same directory. ;; Additionally, we want to install the python code
(let* ((out (assoc-ref outputs "out")) ;; (both source and compiled) in the same directory.
(site (string-append "/lib/python" (let* ((out (assoc-ref outputs "out"))
(python-version (site (string-append "/lib/python"
(assoc-ref inputs "python")) (python-version
"/site-packages"))) (assoc-ref inputs "python"))
(with-directory-excursion "module" "/site-packages")))
(apply (assoc-ref %standard-phases 'install) args)) (with-directory-excursion "module"
(copy-recursively "renpy" (apply (assoc-ref %standard-phases 'install) args))
(string-append out site "/renpy")) (copy-recursively "renpy"
(delete-file-recursively (string-append out site (string-append out site "/renpy"))
"/renpy/common")))))))) (delete-file-recursively (string-append out site
"/renpy/common"))))))))
(native-inputs (list python-cython)) (native-inputs (list python-cython))
(inputs (inputs
(list ffmpeg (list ffmpeg