From 89d928f412f53f74ed4bce79214384352426d300 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 7 Feb 2022 18:33:22 +0100 Subject: gnu: mame: Use G-expressions. * gnu/packages/emulators.scm (mame)[arguments]<#:phases>: Use G-expressions. --- gnu/packages/emulators.scm | 118 ++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 61 deletions(-) diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index 1b32306223..1323568f33 100644 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -1745,50 +1745,47 @@ This is a part of the TiLP project.") "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib"))) #:tests? #f ;no test in regular release #:phases - `(modify-phases %standard-phases - (delete 'configure) - (add-after 'build 'build-documentation - (lambda _ (invoke "make" "-C" "docs" "man" "info"))) - (replace 'install - ;; Upstream does not provide an installation phase. - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (share (string-append out "/share/mame"))) - ;; Install data. - (for-each (lambda (dir) - (copy-recursively dir (string-append share "/" dir))) - '("artwork" "bgfx" "ctrlr" "hash" "ini" "language" - "plugins" "samples")) - (let ((keymaps (string-append share "/keymaps"))) - (for-each (lambda (file) (install-file file keymaps)) - (find-files "keymaps" ".*LINUX\\.map"))) - (let ((fonts (string-append share "/fonts"))) - (install-file "uismall.bdf" fonts)) - (when (file-exists? "mame64") - (rename-file "mame64" "mame")) - (install-file "mame" (string-append out "/bin"))))) - (add-after 'install 'install-documentation - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (man (string-append out "/share/man/man1")) - (info (string-append out "/share/info"))) - (install-file "docs/build/man/MAME.1" man) - (install-file "docs/build/texinfo/MAME.info" info)))) - (add-after 'install 'install-ini-file - ;; 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 - ;; "mame -createconfig" and the package is later GC'ed. - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (share (string-append out "/share/mame")) - (ini (string-append share "/ini"))) - (with-output-to-file (string-append ini "/mame.ini") - (lambda _ - (format #t - "inipath $HOME/.mame;~a/ini~@ + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'build 'build-documentation + (lambda _ (invoke "make" "-C" "docs" "man" "info"))) + (replace 'install + ;; Upstream does not provide an installation phase. + (lambda _ + (let ((share (string-append #$output "/share/mame"))) + ;; Install data. + (for-each (lambda (dir) + (copy-recursively dir (string-append share "/" dir))) + '("artwork" "bgfx" "ctrlr" "hash" "ini" "language" + "plugins" "samples")) + (let ((keymaps (string-append share "/keymaps"))) + (for-each (lambda (file) (install-file file keymaps)) + (find-files "keymaps" ".*LINUX\\.map"))) + (let ((fonts (string-append share "/fonts"))) + (install-file "uismall.bdf" fonts)) + (when (file-exists? "mame64") + (rename-file "mame64" "mame")) + (install-file "mame" (string-append #$output "/bin"))))) + (add-after 'install 'install-documentation + (lambda _ + (let ((man (string-append #$output "/share/man/man1")) + (info (string-append #$output "/share/info"))) + (install-file "docs/build/man/MAME.1" man) + (install-file "docs/build/texinfo/MAME.info" info)))) + (add-after 'install 'install-ini-file + ;; 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 + ;; "mame -createconfig" and the package is later GC'ed. + (lambda _ + (let* ((share (string-append #$output "/share/mame")) + (ini (string-append share "/ini"))) + (with-output-to-file (string-append ini "/mame.ini") + (lambda _ + (format #t + "inipath $HOME/.mame;~a/ini~@ homepath $HOME/mame~@ rompath $HOME/mame/roms~@ samplepath $HOME/mame/samples;~a/samples~@ @@ -1808,12 +1805,12 @@ This is a part of the TiLP project.") state_directory $HOME/.mame/sta~@ diff_directory $HOME/.mame/diff~@ comment_directory $HOME/.mame/comments~%" - share share share share share share share share - share))) - (with-output-to-file (string-append ini "/ui.ini") - (lambda _ - (format #t - "historypath $HOME/mame/history~@ + share share share share share share share share + share))) + (with-output-to-file (string-append ini "/ui.ini") + (lambda _ + (format #t + "historypath $HOME/mame/history~@ categorypath $HOME/mame/folders~@ cabinets_directory $HOME/mame/cabinets~@ cpanels_directory $HOME/mame/cpanel~@ @@ -1833,16 +1830,15 @@ This is a part of the TiLP project.") icons_directory $HOME/mame/icons~@ covers_directory $HOME/mame/covers~@ ui_path $HOME/.mame/ui~%")))))) - (add-after 'install 'install-desktop-file - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (desktop (string-append out "/share/applications")) - (executable (string-append out "/bin/mame"))) - (mkdir-p desktop) - (with-output-to-file (string-append desktop "/mame.desktop") - (lambda _ - (format #t - "[Desktop Entry]~@ + (add-after 'install 'install-desktop-file + (lambda _ + (let ((desktop (string-append #$output "/share/applications")) + (executable (string-append #$output "/bin/mame"))) + (mkdir-p desktop) + (with-output-to-file (string-append desktop "/mame.desktop") + (lambda _ + (format #t + "[Desktop Entry]~@ Name=mame~@ Comment=Multi-purpose emulation framework~@ Exec=~a~@ @@ -1851,7 +1847,7 @@ This is a part of the TiLP project.") Type=Application~@ Categories=Game;Emulator;~@ Keywords=Game;Emulator;Arcade;~%" - executable))))))))) + executable))))))))) (native-inputs (list pkg-config python-sphinx -- cgit v1.2.3