aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/games.scm
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2018-06-19 04:49:33 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2018-06-19 22:20:15 +0200
commit8893218a7d9c750e657cde17e3a670621ec3ea2e (patch)
tree336ba98228d262d3136a834e7f40239a466c470b /gnu/packages/games.scm
parent3110c74b98eab04183a0fc4573a97f9997ea818c (diff)
downloadguix-8893218a7d9c750e657cde17e3a670621ec3ea2e.tar
guix-8893218a7d9c750e657cde17e3a670621ec3ea2e.tar.gz
gnu: mrrescue: Work on Löve 11.
* gnu/packages/games.scm (mrrescue)[arguments]: Extract & patch the game data, and point ‘love’ to this modified copy. Minor cosmetic tweaks. [native-inputs]: Add unzip, patch, and the love-11.patch which is... * gnu/packages/patches/mrrescue-support-love-11.patch: ...a new file. * gnu/local.mk (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu/packages/games.scm')
-rw-r--r--gnu/packages/games.scm47
1 files changed, 34 insertions, 13 deletions
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index e5d5765ff3..ff9adbbd57 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3267,25 +3267,46 @@ colors, pictures, and sounds.")
"0jwzbwkgp1l5ia6c7s760gmdirbsncp6nfqp7vqdqsfb63la9gl2"))))
(build-system trivial-build-system)
(arguments
- '(#:modules ((guix build utils))
+ `(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
- (let* ((out (assoc-ref %outputs "out"))
- (bindir (string-append out "/bin"))
- (prog (string-append bindir "/mrrescue"))
- (source (assoc-ref %build-inputs "source"))
- (bash (string-append (assoc-ref %build-inputs "bash")
- "/bin/bash"))
- (love (string-append (assoc-ref %build-inputs "love")
- "/bin/love")))
- (mkdir-p bindir)
- (with-output-to-file prog
+ (let* ((out (assoc-ref %outputs "out"))
+ (script (string-append out "/bin/" ,name))
+ (data (string-append out "/share/" ,name))
+ (source (assoc-ref %build-inputs "source"))
+ (unzip (string-append (assoc-ref %build-inputs "unzip")
+ "/bin/unzip"))
+ (patch (string-append (assoc-ref %build-inputs "patch")
+ "/bin/patch"))
+ (bash (string-append (assoc-ref %build-inputs "bash")
+ "/bin/bash"))
+ (love (string-append (assoc-ref %build-inputs "love")
+ "/bin/love")))
+
+ (mkdir-p (dirname script))
+ (with-output-to-file script
(lambda ()
(format #t "#!~a~%" bash)
- (format #t "exec -a mrrescue \"~a\" \"~a\"~%" love source)))
- (chmod prog #o755)
+ (format #t "exec -a ~a \"~a\" \"~a\"~%" ,name love data)))
+ (chmod script #o755)
+
+ ;; The better way to package this game would be to install *only* the
+ ;; script above, pointing to the unextracted .love file in the store.
+ ;; However, mrrescue 1.02e needs to be patched to work with Love 11.
+ ;; Instead of extracting the .love file, patching it, and re-zipping
+ ;; it to the store, simply point the script to the extracted patched
+ ;; data directory directly.
+ (mkdir-p data)
+ (with-directory-excursion data
+ (invoke unzip source)
+ (invoke patch "-p1" "-i"
+ (assoc-ref %build-inputs "love-11.patch")))
#t))))
+ (native-inputs
+ `(("unzip" ,unzip)
+ ("patch" ,patch)
+ ("love-11.patch" ,(search-patch "mrrescue-support-love-11.patch"))))
(inputs
`(("bash" ,bash)
("love" ,love)))