gnu: openttd: Include openttd-openmsx and openttd-opensfx.

* gnu/packages/games.scm (openttd-opengfx)[arguments]: Change installation
directory from /share/openttd/baseset/opengfx to
/share/games/openttd/baseset/opengfx.
(openttd-engine)[arguments]: Support #:configure-flags keyword argument in
'configure' phase.
(openttd)[inputs]: Add timidity++.
[native-inputs]: Add openttd-openmsx and openttd-opensfx.
[arguments]: Configure with timidity as MIDI player. Install data from
openttd-openmsx and openttd-opensfx.

Signed-off-by: Kei Kebreau <kkebreau@posteo.net>
This commit is contained in:
Arun Isaac 2017-09-14 04:19:26 +05:30 committed by Kei Kebreau
parent 823e121848
commit 857b2f53bd
No known key found for this signature in database
GPG Key ID: E6A5EE3C19467A0D
1 changed files with 30 additions and 27 deletions

View File

@ -2427,17 +2427,19 @@ and a game metadata scraper.")
;; The build process fails if the configure script is passed the ;; The build process fails if the configure script is passed the
;; option "--enable-fast-install". ;; option "--enable-fast-install".
(replace 'configure (replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs (configure-flags '())
#:allow-other-keys)
(let ((out (assoc-ref outputs "out")) (let ((out (assoc-ref outputs "out"))
(lzo (assoc-ref inputs "lzo"))) (lzo (assoc-ref inputs "lzo")))
(zero? (zero?
(system* "./configure" (apply system* "./configure"
(string-append "--prefix=" out) (string-append "--prefix=" out)
;; Provide the "lzo" path. ;; Provide the "lzo" path.
(string-append "--with-liblzo2=" (string-append "--with-liblzo2="
lzo "/lib/liblzo2.a") lzo "/lib/liblzo2.a")
;; Put the binary in 'bin' instead of 'games'. ;; Put the binary in 'bin' instead of 'games'.
"--binary-dir=bin")))))))) "--binary-dir=bin"
configure-flags))))))))
(native-inputs `(("pkg-config" ,pkg-config))) (native-inputs `(("pkg-config" ,pkg-config)))
(inputs (inputs
`(("allegro" ,allegro-4) `(("allegro" ,allegro-4)
@ -2464,10 +2466,6 @@ engine. When you start it you will be prompted to download a graphics set.")
;; different terms. ;; different terms.
(license (list license:bsd-3 license:gpl2 license:lgpl2.1+ license:zlib)))) (license (list license:bsd-3 license:gpl2 license:lgpl2.1+ license:zlib))))
;; TODO Add 'openttd-opengfx' and 'openttd-openmsx' packages and make
;; 'openttd' a wrapper around them. The engine is playable by itself,
;; but it asks a user to download graphics if it's not found.
(define openttd-opengfx (define openttd-opengfx
(package (package
(name "openttd-opengfx") (name "openttd-opengfx")
@ -2485,7 +2483,7 @@ engine. When you start it you will be prompted to download a graphics set.")
'(#:make-flags (list "CC=gcc" '(#:make-flags (list "CC=gcc"
(string-append "INSTALL_DIR=" (string-append "INSTALL_DIR="
(assoc-ref %outputs "out") (assoc-ref %outputs "out")
"/share/openttd/baseset")) "/share/games/openttd/baseset/opengfx"))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(replace 'configure (replace 'configure
@ -2606,22 +2604,27 @@ Transport Tycoon Deluxe.")
(inherit openttd-engine) (inherit openttd-engine)
(name "openttd") (name "openttd")
(arguments (arguments
(substitute-keyword-arguments (package-arguments openttd-engine) `(#:configure-flags
((#:phases phases) (list (string-append "--with-midi=" (assoc-ref %build-inputs "timidity++")
`(modify-phases ,phases "/bin/timidity"))
(add-after 'install 'install-data ,@(substitute-keyword-arguments (package-arguments openttd-engine)
(lambda* (#:key inputs outputs #:allow-other-keys) ((#:phases phases)
(let* `(modify-phases ,phases
((opengfx (assoc-ref inputs "opengfx")) (add-after 'install 'install-data
(out (assoc-ref outputs "out")) (lambda* (#:key inputs outputs #:allow-other-keys)
(gfx-dir (for-each
(string-append out (lambda (input)
"/share/games/openttd/baseset/opengfx"))) (copy-recursively (assoc-ref inputs input)
(mkdir-p gfx-dir) (assoc-ref outputs "out")))
(copy-recursively opengfx gfx-dir)) (list "opengfx" "openmsx" "opensfx"))
#t)))))) #t)))))))
(inputs
`(("timidity++" ,timidity++)
,@(package-inputs openttd-engine)))
(native-inputs (native-inputs
`(("opengfx" ,openttd-opengfx) `(("opengfx" ,openttd-opengfx)
("openmsx" ,openttd-openmsx)
("opensfx" ,openttd-opensfx)
,@(package-native-inputs openttd-engine))))) ,@(package-native-inputs openttd-engine)))))
(define-public pinball (define-public pinball