gnu: hyperrogue: Update to 12.1a.

* gnu/packages/games.scm (hyperrogue): Update to 12.1a.
[source]<origin>: Set upstream to GitHub.
[arguments]: Use G-expressions.
<phases>: Remove INSTALL-DATA phase. Remove trailing #T.
[home-page]: Fix URL.
This commit is contained in:
Nicolas Goaziou 2022-09-18 19:56:20 +02:00
parent 1066a424dc
commit 31a56967e2
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -5892,101 +5892,63 @@ (define-public mrrescue
(define-public hyperrogue (define-public hyperrogue
(package (package
(name "hyperrogue") (name "hyperrogue")
(version "11.3a") (version "12.1a")
;; When updating this package, be sure to update the "hyperrogue-data" (source
;; origin in native-inputs. (origin
(source (origin (method git-fetch)
(method url-fetch) (uri (git-reference
(uri (string-append (url "https://github.com/zenorogue/hyperrogue")
"https://www.roguetemple.com/z/hyper/hyperrogue" (commit (string-append "v" version))))
(string-join (string-split version #\.) "") (file-name (git-file-name name version))
"-src.tgz"))
(sha256 (sha256
(base32 (base32
"1yxabbswq02fc5frigvs43f83m5vlxybc7n5mynkwzj2c70lfp2k")))) "1l09d1r3jdwp54zq071fk09hpggif5phjn0gsapzrjy3i289jran"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:tests? #f ; no check target (list
#:make-flags '("HYPERROGUE_USE_GLEW=1" #:tests? #f ; no check target
#:make-flags #~(list "HYPERROGUE_USE_GLEW=1"
"HYPERROGUE_USE_PNG=1") "HYPERROGUE_USE_PNG=1")
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'set-paths 'set-sdl-paths (add-after 'set-paths 'set-sdl-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(setenv "CPATH" (setenv "CPATH"
(string-append (or (getenv "CPATH") "") ":" (string-append (or (getenv "CPATH") "") ":"
(assoc-ref inputs "sdl-union") (search-input-directory inputs
"/include/SDL")))) "/include/SDL")))))
(replace 'configure (replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let ((share-dir (string-append #$output "/share/hyperrogue/"))
(share-dir (string-append out "/share/hyperrogue")) (fonts-dir (dirname
(dejavu-dir (string-append (search-input-file inputs
(assoc-ref inputs "font-dejavu") "DejaVuSans-Bold.ttf"))))
"/share/fonts/truetype")) ;; Set fonts and music path.
(dejavu-font "DejaVuSans-Bold.ttf") (substitute* "sysconfig.h"
(music-file "hyperrogue-music.txt")) (("(#define HYPERPATH ).*" _ lead)
;; Fix font and music paths. (string-append lead "\"" share-dir "\"\n"))
(substitute* "basegraph.cpp" (("(#define HYPERFONTPATH ).*" _ lead)
((dejavu-font) (string-append lead "\"" fonts-dir "/\"\n")))
(string-append dejavu-dir "/" dejavu-font)))
(substitute* music-file
(("\\*/")
(string-append share-dir "/sounds/")))
(substitute* "sound.cpp"
(("musicfile = \"\"")
(string-append "musicfile = \""
share-dir "/" music-file "\"")))
;; Disable build machine CPU optimizations and warnings treated ;; Disable build machine CPU optimizations and warnings treated
;; as errors. ;; as errors.
(substitute* "Makefile" (substitute* "Makefile"
(("-march=native") "") (("-march=native") "")
(("-Werror") ""))) (("-Werror") "")))))
#t))
(replace 'install (replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (install-file "hyperrogue" (string-append #$output "/bin"))
(bin (string-append out "/bin")) (let ((share-dir (string-append #$output "/share/hyperrogue/")))
(share-dir (string-append out "/share/hyperrogue"))) (install-file "hyperrogue-music.txt" share-dir)
(mkdir-p bin) (for-each (lambda (dir)
(install-file "hyperrogue" bin) (copy-recursively dir
(install-file "hyperrogue-music.txt" share-dir)) (string-append share-dir dir)))
#t)) '("music" "sounds"))))))))
(add-after 'install 'install-data
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((data (assoc-ref inputs "hyperrogue-data"))
(out (assoc-ref outputs "out"))
(sounds (string-append out "/share/hyperrogue/sounds"))
(unzip (search-input-file inputs "/bin/unzip")))
;; Extract media license information into sounds directory.
(invoke unzip "-j" data
(string-append
"hyperrogue"
(string-join (string-split ,version #\.) "")
"/sounds/credits.txt") "-d" sounds)
;; Extract sounds and music into sounds directory.
(invoke "unzip" "-j" data
(string-append
"hyperrogue"
(string-join (string-split ,version #\.) "")
"/*.ogg") "-d" sounds)))))))
(native-inputs
`(("hyperrogue-data"
,(origin
(method url-fetch)
(uri
(string-append
"https://www.roguetemple.com/z/hyper/hyperrogue"
(string-join (string-split version #\.) "")
"-win.zip"))
(sha256
(base32
"11yhbia45f1w9z0j67h9nynwjqmvakr9l6rnrmdrdkzin6lvzzj4"))))
("unzip" ,unzip)))
(inputs (inputs
(list font-dejavu glew libpng (list font-dejavu
glew
libpng
(sdl-union (list sdl sdl-gfx sdl-mixer sdl-ttf)))) (sdl-union (list sdl sdl-gfx sdl-mixer sdl-ttf))))
(home-page "https://www.roguetemple.com/z/hyper/") (home-page "https://roguetemple.com/z/hyper")
(synopsis "Non-euclidean graphical rogue-like game") (synopsis "Non-euclidean graphical rogue-like game")
(description (description
"HyperRogue is a game in which the player collects treasures and fights "HyperRogue is a game in which the player collects treasures and fights