mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-17 20:27:36 -05:00
gnu: flare-game: Improve package style.
* gnu/packages/games.scm (flare-game)[arguments]: Use G-expressions. Use SEARCH-INPUT-DIRECTORY and SEARCH-INPUT-FILE.
This commit is contained in:
parent
644be96305
commit
7047ca22e6
1 changed files with 37 additions and 40 deletions
|
@ -8951,37 +8951,35 @@ (define-public flare-game
|
|||
"0l0d4j2l1szdwrk8casaiskdk16wkbmms7cid4y751d42czg4ffw"))))
|
||||
(build-system cmake-build-system)
|
||||
(arguments
|
||||
`(#:tests? #f ;no test
|
||||
#:configure-flags '("-DDATADIR=share/flare")
|
||||
(list
|
||||
#:tests? #f ;no test
|
||||
#:configure-flags #~(list "-DDATADIR=share/flare")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
#~(modify-phases %standard-phases
|
||||
;; Flare expects the mods to be located in the same folder.
|
||||
;; Yet, "default" mod is in the engine, whereas the others
|
||||
;; are in the current package. Merge everything here with
|
||||
;; a symlink.
|
||||
(add-after 'install 'add-default-mod
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(mods (string-append out "/share/flare/mods")))
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(let ((mods (string-append #$output "/share/flare/mods")))
|
||||
(with-directory-excursion mods
|
||||
(symlink (string-append (assoc-ref inputs "flare-engine")
|
||||
(symlink (search-input-directory inputs
|
||||
"/share/flare/mods/default")
|
||||
"default")
|
||||
(symlink (string-append (assoc-ref inputs "flare-engine")
|
||||
(symlink (search-input-file inputs
|
||||
"/share/flare/mods/mods.txt")
|
||||
"mods.txt")))
|
||||
#t))
|
||||
"mods.txt")))))
|
||||
(add-after 'install 'install-executable
|
||||
;; The package only provides assets for the game, the
|
||||
;; executable coming from "flare-engine". Since more than
|
||||
;; one game may use the engine, we create a new executable,
|
||||
;; "flare-game", which launches the engine with appropriate
|
||||
;; parameters.
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(bash (search-input-file inputs "/bin/bash"))
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(let ((bash (search-input-file inputs "/bin/bash"))
|
||||
(flare (search-input-file inputs "/bin/flare"))
|
||||
(script (string-append out "/bin/flare-game")))
|
||||
(script (string-append #$output "/bin/flare-game")))
|
||||
(mkdir-p (dirname script))
|
||||
(call-with-output-file script
|
||||
(lambda (port)
|
||||
|
@ -8990,9 +8988,8 @@ (define-public flare-game
|
|||
exec ~a --data-path=~a/share/flare --mods=empyrean_campaign~%"
|
||||
bash
|
||||
flare
|
||||
out)))
|
||||
(chmod script #o755))
|
||||
#t)))))
|
||||
#$output)))
|
||||
(chmod script #o755)))))))
|
||||
(inputs
|
||||
(list flare-engine))
|
||||
(home-page "http://www.flarerpg.org/")
|
||||
|
|
Loading…
Reference in a new issue