* gnu/packages/aux-files/renpy/renpy.in: New file.
* gnu/packages/game-development.scm (renpy)[install]: Use renpy.in with
* Makefile.am (AUX_FILES): Add it here.
gnu/packages/aux-files/renpy/renpy.in | 48 +++++++++++++++++++
gnu/packages/game-development.scm | 68 ++++-----------------------
3 files changed, 57 insertions(+), 60 deletions(-)
create mode 100644 gnu/packages/aux-files/renpy/renpy.in
Toggle diff (159 lines)
diff --git a/Makefile.am b/Makefile.am
index c4ccee65f1..627cf3ca64 100644
@@ -403,6 +403,7 @@ AUX_FILES = \
gnu/packages/aux-files/pack-audit.c \
gnu/packages/aux-files/python/sanity-check.py \
gnu/packages/aux-files/python/sitecustomize.py \
+ gnu/packages/aux-files/renpy/renpy.in \
gnu/packages/aux-files/run-in-namespace.c
diff --git a/gnu/packages/aux-files/renpy/renpy.in b/gnu/packages/aux-files/renpy/renpy.in
index 0000000000..914a735fa4
+++ b/gnu/packages/aux-files/renpy/renpy.in
+from __future__ import print_function
+def path_to_common(renpy_base):
+ return renpy_base + "/common"
+def path_to_saves(gamedir, save_directory=None):
+ if save_directory is None:
+ save_directory = renpy.config.save_directory
+ save_directory = renpy.exports.fsencode(save_directory)
+ return gamedir + "/saves"
+ return os.path.join(os.path.expanduser("~/.renpy"), save_directory)
+ print("""Could not import renpy.bootstrap.
+Please ensure you decompressed Ren'py correctly, preserving the directory
+structure.""", file=sys.stderr)
+ args = renpy.arguments.bootstrap()
+ print("""This Ren'py requires a basedir to launch.
+The basedir is the directory, in which .rpy source files or compiled .rpyc files
+live -- usually the 'game' subdirectory of a game packaged by Ren'py.
+If you want the Ren'py launcher, use \"renpy-launcher\" instead.""",
+ renpy.bootstrap.bootstrap("@RENPY_BASE@")
+if __name__ == "__main__":
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index fb8744382c..955d630704 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1444,70 +1444,17 @@ (define-public renpy
;; `-- Super Awesome Game.sh
(let* ((out (assoc-ref outputs "out"))
(bin/renpy (string-append out "/bin/renpy")))
- (mkdir-p (string-append out "/bin"))
(copy-recursively "renpy/common"
(string-append out "/share/renpy/common"))
(string-append out "/share/renpy/gui"))
- (call-with-output-file bin/renpy
- (format port "#!~a/bin/python2~%"
- (assoc-ref inputs "python2"))
-from __future__ import print_function
-def path_to_common(renpy_base):
- return renpy_base + \"/common\"
-def path_to_saves(gamedir, save_directory=None):
- import renpy # @UnresolvedImport
- if save_directory is None:
- save_directory = renpy.config.save_directory
- save_directory = renpy.exports.fsencode(save_directory)
- return gamedir + \"/saves\"
- return os.path.expanduser(\"~~/.renpy/\" + save_directory)
-def path_to_renpy_base():
- renpy_base = path_to_renpy_base()
- print(\"\"\"Could not import renpy.bootstrap.
-Please ensure you decompressed Ren'Py correctly, preserving the directory
-structure.\"\"\", file=sys.stderr)
- args = renpy.arguments.bootstrap()
- print(\"\"\"This Ren'py requires a basedir to launch.
-The basedir is the directory, in which .rpy files live -- usually the 'game'
-subdirectory of a game packaged by Ren'py.
-If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
- renpy.bootstrap.bootstrap(renpy_base)
-if __name__ == \"__main__\":
- (string-append out "/share/renpy"))))
- (chmod bin/renpy #o755)
+ (mkdir-p (string-append out "/bin"))
+ (copy-file (assoc-ref inputs "renpy.in") bin/renpy)
+ (("@PYTHON@") (search-input-file inputs "bin/python2"))
+ (("@RENPY_BASE@") (string-append out "/share/renpy")))
+ (chmod bin/renpy #o755))))
(add-after 'install 'install-games
(lambda* (#:key outputs #:allow-other-keys)
@@ -1561,7 +1508,8 @@ (define* (install-renpy-game #:key output game name (renpy renpy)
- `(("python2-renpy" ,python2-renpy)
+ `(("renpy.in" ,(search-auxiliary-file "renpy/renpy.in"))
+ ("python2-renpy" ,python2-renpy)
("python2-tkinter" ,python-2 "tk")
("python2" ,python-2) ; for ‘fix-commands’ and ‘wrap’
("xdg-utils" ,xdg-utils)))