gnu: colobot: Improve package style.

* gnu/packages/games.scm (colobot)[arguments]: Use G-expressions.
<#:phases>: Remove trailing #T.
[native-inputs, inputs]: Remove labels.
This commit is contained in:
Nicolas Goaziou 2023-10-14 14:06:47 +02:00
parent b24ec42686
commit 85f934ccff
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -7768,56 +7768,63 @@ (define-public colobot
(base32 "0bpy5nzkvq5nfr0w8jf7bl7zs8yz2cpzp87pnkdlgwl3adcn9nsw")))) (base32 "0bpy5nzkvq5nfr0w8jf7bl7zs8yz2cpzp87pnkdlgwl3adcn9nsw"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:tests? #f ;no test (list
#:phases #:tests? #f ;no test
(modify-phases %standard-phases #:modules '((guix build cmake-build-system)
(add-after 'unpack 'make-git-checkout-writable (guix build utils)
(lambda _ (srfi srfi-1)
(for-each make-file-writable (find-files ".")) (ice-9 match)
#t)) (ice-9 regex))
(add-after 'unpack 'fix-directories #:phases
(lambda _ #~(modify-phases %standard-phases
(substitute* "CMakeLists.txt" (add-after 'unpack 'make-git-checkout-writable
(("(\\$\\{CMAKE_INSTALL_PREFIX\\})/games" _ prefix) (lambda _
(string-append prefix "/bin")) (for-each make-file-writable (find-files "."))))
(("(\\$\\{CMAKE_INSTALL_PREFIX\\}/share)/games/colobot" _ prefix) (add-after 'unpack 'fix-directories
(string-append prefix "/colobot"))) (lambda _
#t)) (substitute* "CMakeLists.txt"
(add-after 'fix-directories 'install-music (("(\\$\\{CMAKE_INSTALL_PREFIX\\})/games" _ prefix)
;; Retrieve and install music files. (string-append prefix "/bin"))
(lambda* (#:key inputs #:allow-other-keys) (("(\\$\\{CMAKE_INSTALL_PREFIX\\}/share)/games/colobot" _ prefix)
;; Installation process tries to download music files using (string-append prefix "/colobot")))))
;; "wget" if not already present. Since we are going another (add-after 'fix-directories 'install-music
;; route, skip "wget" command check. ;; Retrieve and install music files.
(substitute* "data/music/CMakeLists.txt" (lambda* (#:key inputs #:allow-other-keys)
(("find_program\\(WGET wget\\)") "")) ;; Installation process tries to download music files using
;; Populate "music/" directory. ;; "wget" if not already present. Since we are going another
(let ((data (assoc-ref inputs "colobot-music"))) ;; route, skip "wget" command check.
(invoke "tar" "-xvf" data "-Cdata/music")) (substitute* "data/music/CMakeLists.txt"
#t))))) (("find_program\\(WGET wget\\)") ""))
;; Populate "music/" directory.
(let ((data
(any
(match-lambda ((_ . input)
(and (string-match "colobot-music" input)
input)))
inputs)))
(invoke "tar" "-xvf" data "-Cdata/music")))))))
(native-inputs (native-inputs
`(("colobot-music" (list (origin
,(origin (method url-fetch)
(method url-fetch) (uri (string-append "https://colobot.info/files/music/"
(uri (string-append "https://colobot.info/files/music/" "colobot-music_ogg_" version ".tar.gz"))
"colobot-music_ogg_" version ".tar.gz")) (sha256
(sha256 (base32
(base32 "1s86cd36rwkff329mb1ay1wi5qqyi35564ppgr3f4qqz9wj9vs2m")))
"1s86cd36rwkff329mb1ay1wi5qqyi35564ppgr3f4qqz9wj9vs2m")))) gettext-minimal
("gettext" ,gettext-minimal) (librsvg-for-system)
("librsvg" ,(librsvg-for-system)) po4a
("po4a" ,po4a) python-wrapper))
("python" ,python-wrapper)))
(inputs (inputs
`(("boost" ,boost) (list boost
("glew" ,glew) glew
("libogg" ,libogg) libogg
("libpng" ,libpng) libpng
("libsndfile" ,libsndfile) libsndfile
("libvorbis" ,libvorbis) libvorbis
("openal" ,openal) openal
("physfs" ,physfs) physfs
("sdl" ,(sdl-union (list sdl2 sdl2-image sdl2-ttf))))) (sdl-union (list sdl2 sdl2-image sdl2-ttf))))
(synopsis "Educational programming strategy game") (synopsis "Educational programming strategy game")
(description "Colobot: Gold Edition is a real-time strategy game, where (description "Colobot: Gold Edition is a real-time strategy game, where
you can program your units (bots) in a language called CBOT, which is similar you can program your units (bots) in a language called CBOT, which is similar