gnu: renpy: Move renpy command to aux-files.
* gnu/packages/aux-files/renpy/renpy.in: New file. * gnu/packages/game-development.scm (renpy)[install]: Use renpy.in with substitute*. * Makefile.am (AUX_FILES): Add it here.
This commit is contained in:
parent
72d43df66d
commit
0f9e73841e
|
@ -405,6 +405,7 @@ AUX_FILES = \
|
||||||
gnu/packages/aux-files/pack-audit.c \
|
gnu/packages/aux-files/pack-audit.c \
|
||||||
gnu/packages/aux-files/python/sanity-check.py \
|
gnu/packages/aux-files/python/sanity-check.py \
|
||||||
gnu/packages/aux-files/python/sitecustomize.py \
|
gnu/packages/aux-files/python/sitecustomize.py \
|
||||||
|
gnu/packages/aux-files/renpy/renpy.in \
|
||||||
gnu/packages/aux-files/run-in-namespace.c
|
gnu/packages/aux-files/run-in-namespace.c
|
||||||
|
|
||||||
# Templates, examples.
|
# Templates, examples.
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
#! @PYTHON@
|
||||||
|
# -*- mode: python -*-
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
def path_to_common(renpy_base):
|
||||||
|
return renpy_base + "/common"
|
||||||
|
|
||||||
|
def path_to_saves(gamedir, save_directory=None):
|
||||||
|
import renpy
|
||||||
|
|
||||||
|
if save_directory is None:
|
||||||
|
save_directory = renpy.config.save_directory
|
||||||
|
save_directory = renpy.exports.fsencode(save_directory)
|
||||||
|
|
||||||
|
if not save_directory:
|
||||||
|
return gamedir + "/saves"
|
||||||
|
|
||||||
|
return os.path.join(os.path.expanduser("~/.renpy"), save_directory)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
try:
|
||||||
|
import renpy.bootstrap
|
||||||
|
import renpy.arguments
|
||||||
|
except ImportError:
|
||||||
|
print("""Could not import renpy.bootstrap.
|
||||||
|
Please ensure you decompressed Ren'py correctly, preserving the directory
|
||||||
|
structure.""", file=sys.stderr)
|
||||||
|
raise
|
||||||
|
|
||||||
|
args = renpy.arguments.bootstrap()
|
||||||
|
if not args.basedir:
|
||||||
|
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.""",
|
||||||
|
file=sys.stderr)
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
renpy.bootstrap.bootstrap("@RENPY_BASE@")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
|
@ -1448,70 +1448,17 @@ are only used to bootstrap it.")
|
||||||
;; `-- Super Awesome Game.sh
|
;; `-- Super Awesome Game.sh
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
(bin/renpy (string-append out "/bin/renpy")))
|
(bin/renpy (string-append out "/bin/renpy")))
|
||||||
(mkdir-p (string-append out "/bin"))
|
|
||||||
(copy-recursively "renpy/common"
|
(copy-recursively "renpy/common"
|
||||||
(string-append out "/share/renpy/common"))
|
(string-append out "/share/renpy/common"))
|
||||||
(copy-recursively "gui"
|
(copy-recursively "gui"
|
||||||
(string-append out "/share/renpy/gui"))
|
(string-append out "/share/renpy/gui"))
|
||||||
|
|
||||||
(call-with-output-file bin/renpy
|
(mkdir-p (string-append out "/bin"))
|
||||||
(lambda (port)
|
(copy-file (assoc-ref inputs "renpy.in") bin/renpy)
|
||||||
(format port "#!~a/bin/python2~%"
|
(substitute* bin/renpy
|
||||||
(assoc-ref inputs "python2"))
|
(("@PYTHON@") (search-input-file inputs "bin/python2"))
|
||||||
(format port "
|
(("@RENPY_BASE@") (string-append out "/share/renpy")))
|
||||||
from __future__ import print_function
|
(chmod bin/renpy #o755))))
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
if not save_directory:
|
|
||||||
return gamedir + \"/saves\"
|
|
||||||
|
|
||||||
return os.path.expanduser(\"~~/.renpy/\" + save_directory)
|
|
||||||
|
|
||||||
def path_to_renpy_base():
|
|
||||||
return \"~a\"
|
|
||||||
|
|
||||||
def main():
|
|
||||||
renpy_base = path_to_renpy_base()
|
|
||||||
try:
|
|
||||||
import renpy.bootstrap
|
|
||||||
import renpy.arguments
|
|
||||||
except ImportError:
|
|
||||||
print(\"\"\"Could not import renpy.bootstrap.
|
|
||||||
Please ensure you decompressed Ren'Py correctly, preserving the directory
|
|
||||||
structure.\"\"\", file=sys.stderr)
|
|
||||||
raise
|
|
||||||
|
|
||||||
args = renpy.arguments.bootstrap()
|
|
||||||
if not args.basedir:
|
|
||||||
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.\"\"\",
|
|
||||||
file=sys.stderr)
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
renpy.bootstrap.bootstrap(renpy_base)
|
|
||||||
|
|
||||||
if __name__ == \"__main__\":
|
|
||||||
main()
|
|
||||||
"
|
|
||||||
(string-append out "/share/renpy"))))
|
|
||||||
(chmod bin/renpy #o755)
|
|
||||||
#t)))
|
|
||||||
|
|
||||||
(add-after 'install 'install-games
|
(add-after 'install 'install-games
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
|
@ -1565,7 +1512,8 @@ if __name__ == \"__main__\":
|
||||||
inputs))))))))
|
inputs))))))))
|
||||||
#t))))))
|
#t))))))
|
||||||
(inputs
|
(inputs
|
||||||
`(("python2-renpy" ,python2-renpy)
|
`(("renpy.in" ,(search-auxiliary-file "renpy/renpy.in"))
|
||||||
|
("python2-renpy" ,python2-renpy)
|
||||||
("python2-tkinter" ,python-2 "tk")
|
("python2-tkinter" ,python-2 "tk")
|
||||||
("python2" ,python-2) ; for ‘fix-commands’ and ‘wrap’
|
("python2" ,python-2) ; for ‘fix-commands’ and ‘wrap’
|
||||||
("xdg-utils" ,xdg-utils)))
|
("xdg-utils" ,xdg-utils)))
|
||||||
|
|
Loading…
Reference in New Issue