me
/
guix
Archived
1
0
Fork 0

gnu: mame: Use G-expressions.

* gnu/packages/emulators.scm (mame)[arguments]<#:phases>: Use G-expressions.
master
Nicolas Goaziou 2022-02-07 18:33:22 +01:00
parent 6f1b57ef43
commit 89d928f412
No known key found for this signature in database
GPG Key ID: DA00B4F048E92F2D
1 changed files with 57 additions and 61 deletions

View File

@ -1745,50 +1745,47 @@ This is a part of the TiLP project.")
"pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib"))) "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
#:tests? #f ;no test in regular release #:tests? #f ;no test in regular release
#:phases #:phases
`(modify-phases %standard-phases #~(modify-phases %standard-phases
(delete 'configure) (delete 'configure)
(add-after 'build 'build-documentation (add-after 'build 'build-documentation
(lambda _ (invoke "make" "-C" "docs" "man" "info"))) (lambda _ (invoke "make" "-C" "docs" "man" "info")))
(replace 'install (replace 'install
;; Upstream does not provide an installation phase. ;; Upstream does not provide an installation phase.
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (let ((share (string-append #$output "/share/mame")))
(share (string-append out "/share/mame"))) ;; Install data.
;; Install data. (for-each (lambda (dir)
(for-each (lambda (dir) (copy-recursively dir (string-append share "/" dir)))
(copy-recursively dir (string-append share "/" dir))) '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
'("artwork" "bgfx" "ctrlr" "hash" "ini" "language" "plugins" "samples"))
"plugins" "samples")) (let ((keymaps (string-append share "/keymaps")))
(let ((keymaps (string-append share "/keymaps"))) (for-each (lambda (file) (install-file file keymaps))
(for-each (lambda (file) (install-file file keymaps)) (find-files "keymaps" ".*LINUX\\.map")))
(find-files "keymaps" ".*LINUX\\.map"))) (let ((fonts (string-append share "/fonts")))
(let ((fonts (string-append share "/fonts"))) (install-file "uismall.bdf" fonts))
(install-file "uismall.bdf" fonts)) (when (file-exists? "mame64")
(when (file-exists? "mame64") (rename-file "mame64" "mame"))
(rename-file "mame64" "mame")) (install-file "mame" (string-append #$output "/bin")))))
(install-file "mame" (string-append out "/bin"))))) (add-after 'install 'install-documentation
(add-after 'install 'install-documentation (lambda _
(lambda* (#:key outputs #:allow-other-keys) (let ((man (string-append #$output "/share/man/man1"))
(let* ((out (assoc-ref outputs "out")) (info (string-append #$output "/share/info")))
(man (string-append out "/share/man/man1")) (install-file "docs/build/man/MAME.1" man)
(info (string-append out "/share/info"))) (install-file "docs/build/texinfo/MAME.info" info))))
(install-file "docs/build/man/MAME.1" man) (add-after 'install 'install-ini-file
(install-file "docs/build/texinfo/MAME.info" info)))) ;; Generate an ini file so as to set some directories (e.g., roms)
(add-after 'install 'install-ini-file ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
;; Generate an ini file so as to set some directories (e.g., roms) ;;
;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/". ;; XXX: We need to insert absolute references to the store. It can
;; ;; be an issue if they leak into user's home directory, e.g., with
;; XXX: We need to insert absolute references to the store. It can ;; "mame -createconfig" and the package is later GC'ed.
;; be an issue if they leak into user's home directory, e.g., with (lambda _
;; "mame -createconfig" and the package is later GC'ed. (let* ((share (string-append #$output "/share/mame"))
(lambda* (#:key outputs #:allow-other-keys) (ini (string-append share "/ini")))
(let* ((out (assoc-ref outputs "out")) (with-output-to-file (string-append ini "/mame.ini")
(share (string-append out "/share/mame")) (lambda _
(ini (string-append share "/ini"))) (format #t
(with-output-to-file (string-append ini "/mame.ini") "inipath $HOME/.mame;~a/ini~@
(lambda _
(format #t
"inipath $HOME/.mame;~a/ini~@
homepath $HOME/mame~@ homepath $HOME/mame~@
rompath $HOME/mame/roms~@ rompath $HOME/mame/roms~@
samplepath $HOME/mame/samples;~a/samples~@ samplepath $HOME/mame/samples;~a/samples~@
@ -1808,12 +1805,12 @@ This is a part of the TiLP project.")
state_directory $HOME/.mame/sta~@ state_directory $HOME/.mame/sta~@
diff_directory $HOME/.mame/diff~@ diff_directory $HOME/.mame/diff~@
comment_directory $HOME/.mame/comments~%" comment_directory $HOME/.mame/comments~%"
share share share share share share share share share share share share share share share share
share))) share)))
(with-output-to-file (string-append ini "/ui.ini") (with-output-to-file (string-append ini "/ui.ini")
(lambda _ (lambda _
(format #t (format #t
"historypath $HOME/mame/history~@ "historypath $HOME/mame/history~@
categorypath $HOME/mame/folders~@ categorypath $HOME/mame/folders~@
cabinets_directory $HOME/mame/cabinets~@ cabinets_directory $HOME/mame/cabinets~@
cpanels_directory $HOME/mame/cpanel~@ cpanels_directory $HOME/mame/cpanel~@
@ -1833,16 +1830,15 @@ This is a part of the TiLP project.")
icons_directory $HOME/mame/icons~@ icons_directory $HOME/mame/icons~@
covers_directory $HOME/mame/covers~@ covers_directory $HOME/mame/covers~@
ui_path $HOME/.mame/ui~%")))))) ui_path $HOME/.mame/ui~%"))))))
(add-after 'install 'install-desktop-file (add-after 'install 'install-desktop-file
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (let ((desktop (string-append #$output "/share/applications"))
(desktop (string-append out "/share/applications")) (executable (string-append #$output "/bin/mame")))
(executable (string-append out "/bin/mame"))) (mkdir-p desktop)
(mkdir-p desktop) (with-output-to-file (string-append desktop "/mame.desktop")
(with-output-to-file (string-append desktop "/mame.desktop") (lambda _
(lambda _ (format #t
(format #t "[Desktop Entry]~@
"[Desktop Entry]~@
Name=mame~@ Name=mame~@
Comment=Multi-purpose emulation framework~@ Comment=Multi-purpose emulation framework~@
Exec=~a~@ Exec=~a~@
@ -1851,7 +1847,7 @@ This is a part of the TiLP project.")
Type=Application~@ Type=Application~@
Categories=Game;Emulator;~@ Categories=Game;Emulator;~@
Keywords=Game;Emulator;Arcade;~%" Keywords=Game;Emulator;Arcade;~%"
executable))))))))) executable)))))))))
(native-inputs (native-inputs
(list pkg-config (list pkg-config
python-sphinx python-sphinx