[PATCH] gnu: hyperrogue: Update to 9.4c.

  • Done
  • quality assurance status badge
Details
3 participants
  • Kei Kebreau
  • Leo Famulari
  • Marius Bakke
Owner
unassigned
Submitted by
Kei Kebreau
Severity
normal

Debbugs page

Kei Kebreau wrote 8 years ago
(address . guix-patches@gnu.org)(name . Kei Kebreau)(address . kei@openmailbox.org)
20170326200643.5256-1-kei@openmailbox.org
* gnu/packages/games.scm (hyperrogue): Update to 9.4c.
---
gnu/packages/games.scm | 89 ++++++++++++++++++++++++++++++++------------------
1 file changed, 58 insertions(+), 31 deletions(-)

Toggle diff (132 lines)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 67fcb7b49..fcfa656e3 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3163,23 +3163,19 @@ throwing people around in pseudo-randomly generated buildings.")
(define-public hyperrogue
(package
(name "hyperrogue")
- (version "8.3j")
+ (version "9.4c")
(source (origin
(method url-fetch)
(uri (string-append
"http://www.roguetemple.com/z/hyper/"
- name "-83j.zip"))
+ name (string-join (string-split version #\.) "")
+ "-src.tgz"))
(sha256
(base32
- "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
- (modules '((guix build utils)))
- ;; Remove .exe and .dll files.
- (snippet
- '(for-each delete-file (find-files "." "\\.(exe|dll)$")))))
+ "1ri5fllnhqjm3dlnl1xbb9mlv79iigc940vbvcnk0v5k6p58pavq"))))
(build-system gnu-build-system)
(arguments
'(#:tests? #f ; no check target
- #:make-flags '("-Csrc")
#:phases
(modify-phases %standard-phases
(add-after 'set-paths 'set-sdl-paths
@@ -3190,21 +3186,24 @@ throwing people around in pseudo-randomly generated buildings.")
;; Fix font and music paths.
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (dejavu-dir (string-append
- (assoc-ref inputs "font-dejavu")
- "/share/fonts/truetype"))
- (dejavu-font "DejaVuSans-Bold.ttf")
- (music-file "hyperrogue-music.txt"))
- (with-directory-excursion "src"
- (substitute* "graph.cpp"
- ((dejavu-font)
- (string-append dejavu-dir "/" dejavu-font))
- (((string-append "\\./" music-file))
- (string-append out "/share/hyperrogue/" music-file)))
- (substitute* music-file
- (("\\*/")
- (string-append out "/share/hyperrogue/")))))
+ (let* ((out (assoc-ref outputs "out"))
+ (share-dir (string-append out "/share/hyperrogue"))
+ (dejavu-dir (string-append
+ (assoc-ref inputs "font-dejavu")
+ "/share/fonts/truetype"))
+ (dejavu-font "DejaVuSans-Bold.ttf")
+ (music-file "hyperrogue-music.txt"))
+ (substitute* "graph.cpp"
+ ((dejavu-font)
+ (string-append dejavu-dir "/" dejavu-font)))
+ (substitute* "sound.cpp"
+ (((string-append "\\./" music-file))
+ (string-append share-dir "/" music-file))
+ (("sounds/")
+ (string-append share-dir "/sounds/")))
+ (substitute* music-file
+ (("\\*/")
+ (string-append share-dir "/sounds/"))))
#t))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
@@ -3212,13 +3211,25 @@ throwing people around in pseudo-randomly generated buildings.")
(bin (string-append out "/bin"))
(share-dir (string-append out "/share/hyperrogue")))
(mkdir-p bin)
- (copy-file "src/hyper" (string-append bin "/hyperrogue"))
- (mkdir-p share-dir)
- (copy-file "src/hyperrogue-music.txt"
- (string-append share-dir "/hyperrogue-music.txt"))
- (for-each (lambda (file)
- (copy-file file (string-append share-dir "/" file)))
- (find-files "." "\\.ogg$")))
+ (copy-file "hyper" (string-append bin "/hyperrogue"))
+ (install-file "hyperrogue-music.txt" share-dir))
+ #t))
+ (add-after 'install 'install-data
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((data (assoc-ref inputs "hyperrogue-data"))
+ (out (assoc-ref outputs "out"))
+ (share-dir (string-append out "/share/hyperrogue")))
+ (system* "tar" "xvf" data "-C" ".")
+ (with-directory-excursion "hyperrogue94c-win"
+ (for-each
+ (lambda (file)
+ (install-file file (string-append share-dir "/sounds")))
+ (append (find-files "." "\\.ogg$")
+ (find-files "sounds" ".*$")))
+ (for-each
+ (lambda (file)
+ (install-file file share-dir))
+ '("papermodeldata.txt" "papermodeldata-help.txt"))))
#t)))))
(inputs
`(("font-dejavu" ,font-dejavu)
@@ -3227,7 +3238,23 @@ throwing people around in pseudo-randomly generated buildings.")
("sdl-union" ,(sdl-union (list sdl
sdl-gfx
sdl-mixer
- sdl-ttf)))))
+ sdl-ttf)))
+ ("hyperrogue-data"
+ ,(origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "http://www.roguetemple.com/z/hyper/" name
+ (string-join (string-split version #\.) "")
+ "-win.zip"))
+ (sha256
+ (base32
+ "1cyyrsnrixygg3zyz97hpsm6jzwbhydiwk3kl0lm7qjnw2nzkhhh"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Remove .exe and .dll files.
+ (for-each delete-file (find-files "." "\\.(exe|dll)$"))))))))
(home-page "http://www.roguetemple.com/z/hyper/")
(synopsis "Non-euclidean graphical rogue-like game")
(description
--
2.12.0
Leo Famulari wrote 8 years ago
(name . Kei Kebreau)(address . kei@openmailbox.org)(address . 26267@debbugs.gnu.org)
20170327191137.GA16539@jasmine
On Sun, Mar 26, 2017 at 04:06:43PM -0400, Kei Kebreau wrote:
Toggle quote (2 lines)
> * gnu/packages/games.scm (hyperrogue): Update to 9.4c.

Can you complete the changelog and send a revised patch?
Kei Kebreau wrote 8 years ago
[PATCH] gnu: hyperrogue: Update to 9.4c.
(address . 26267@debbugs.gnu.org)(name . Kei Kebreau)(address . kei@openmailbox.org)
20170327204017.3529-1-kei@openmailbox.org
* gnu/packages/games.scm (hyperrogue): Update to 9.4c.
[source]: Remove snippet.
[arguments]: Remove #:make-flags; adjust configure and install phases; add
install-data phase.
[inputs]: Add hyperrogue-data.
---
gnu/packages/games.scm | 89 ++++++++++++++++++++++++++++++++------------------
1 file changed, 58 insertions(+), 31 deletions(-)

Toggle diff (132 lines)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 67fcb7b49..fcfa656e3 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3163,23 +3163,19 @@ throwing people around in pseudo-randomly generated buildings.")
(define-public hyperrogue
(package
(name "hyperrogue")
- (version "8.3j")
+ (version "9.4c")
(source (origin
(method url-fetch)
(uri (string-append
"http://www.roguetemple.com/z/hyper/"
- name "-83j.zip"))
+ name (string-join (string-split version #\.) "")
+ "-src.tgz"))
(sha256
(base32
- "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
- (modules '((guix build utils)))
- ;; Remove .exe and .dll files.
- (snippet
- '(for-each delete-file (find-files "." "\\.(exe|dll)$")))))
+ "1ri5fllnhqjm3dlnl1xbb9mlv79iigc940vbvcnk0v5k6p58pavq"))))
(build-system gnu-build-system)
(arguments
'(#:tests? #f ; no check target
- #:make-flags '("-Csrc")
#:phases
(modify-phases %standard-phases
(add-after 'set-paths 'set-sdl-paths
@@ -3190,21 +3186,24 @@ throwing people around in pseudo-randomly generated buildings.")
;; Fix font and music paths.
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (dejavu-dir (string-append
- (assoc-ref inputs "font-dejavu")
- "/share/fonts/truetype"))
- (dejavu-font "DejaVuSans-Bold.ttf")
- (music-file "hyperrogue-music.txt"))
- (with-directory-excursion "src"
- (substitute* "graph.cpp"
- ((dejavu-font)
- (string-append dejavu-dir "/" dejavu-font))
- (((string-append "\\./" music-file))
- (string-append out "/share/hyperrogue/" music-file)))
- (substitute* music-file
- (("\\*/")
- (string-append out "/share/hyperrogue/")))))
+ (let* ((out (assoc-ref outputs "out"))
+ (share-dir (string-append out "/share/hyperrogue"))
+ (dejavu-dir (string-append
+ (assoc-ref inputs "font-dejavu")
+ "/share/fonts/truetype"))
+ (dejavu-font "DejaVuSans-Bold.ttf")
+ (music-file "hyperrogue-music.txt"))
+ (substitute* "graph.cpp"
+ ((dejavu-font)
+ (string-append dejavu-dir "/" dejavu-font)))
+ (substitute* "sound.cpp"
+ (((string-append "\\./" music-file))
+ (string-append share-dir "/" music-file))
+ (("sounds/")
+ (string-append share-dir "/sounds/")))
+ (substitute* music-file
+ (("\\*/")
+ (string-append share-dir "/sounds/"))))
#t))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
@@ -3212,13 +3211,25 @@ throwing people around in pseudo-randomly generated buildings.")
(bin (string-append out "/bin"))
(share-dir (string-append out "/share/hyperrogue")))
(mkdir-p bin)
- (copy-file "src/hyper" (string-append bin "/hyperrogue"))
- (mkdir-p share-dir)
- (copy-file "src/hyperrogue-music.txt"
- (string-append share-dir "/hyperrogue-music.txt"))
- (for-each (lambda (file)
- (copy-file file (string-append share-dir "/" file)))
- (find-files "." "\\.ogg$")))
+ (copy-file "hyper" (string-append bin "/hyperrogue"))
+ (install-file "hyperrogue-music.txt" share-dir))
+ #t))
+ (add-after 'install 'install-data
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((data (assoc-ref inputs "hyperrogue-data"))
+ (out (assoc-ref outputs "out"))
+ (share-dir (string-append out "/share/hyperrogue")))
+ (system* "tar" "xvf" data "-C" ".")
+ (with-directory-excursion "hyperrogue94c-win"
+ (for-each
+ (lambda (file)
+ (install-file file (string-append share-dir "/sounds")))
+ (append (find-files "." "\\.ogg$")
+ (find-files "sounds" ".*$")))
+ (for-each
+ (lambda (file)
+ (install-file file share-dir))
+ '("papermodeldata.txt" "papermodeldata-help.txt"))))
#t)))))
(inputs
`(("font-dejavu" ,font-dejavu)
@@ -3227,7 +3238,23 @@ throwing people around in pseudo-randomly generated buildings.")
("sdl-union" ,(sdl-union (list sdl
sdl-gfx
sdl-mixer
- sdl-ttf)))))
+ sdl-ttf)))
+ ("hyperrogue-data"
+ ,(origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "http://www.roguetemple.com/z/hyper/" name
+ (string-join (string-split version #\.) "")
+ "-win.zip"))
+ (sha256
+ (base32
+ "1cyyrsnrixygg3zyz97hpsm6jzwbhydiwk3kl0lm7qjnw2nzkhhh"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Remove .exe and .dll files.
+ (for-each delete-file (find-files "." "\\.(exe|dll)$"))))))))
(home-page "http://www.roguetemple.com/z/hyper/")
(synopsis "Non-euclidean graphical rogue-like game")
(description
--
2.12.0
Kei Kebreau wrote 8 years ago
(name . Leo Famulari)(address . leo@famulari.name)(address . 26267@debbugs.gnu.org)
87inmua1uq.fsf@openmailbox.org
Leo Famulari <leo@famulari.name> writes:

Toggle quote (5 lines)
> On Sun, Mar 26, 2017 at 04:06:43PM -0400, Kei Kebreau wrote:
>> * gnu/packages/games.scm (hyperrogue): Update to 9.4c.
>
> Can you complete the changelog and send a revised patch?

The new patch is submitted.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAljZeR0ACgkQ5qXuPBlG
eg2BDw//YuL1kWD66APB9B2jT4VyNFYKlrhukC6VMvxzgOCSnZKaKerwHW7tIHxJ
Err5W6HrW263DrrTR/OMX4r3FT3eZiUGyHIisnY0N043qwVrdTK4R6G4voYeOCE1
hFCg1w5xuG5LnQQ4493vDwG8jGbBGdfOG3otI1FDBZC0D61GnQ5ShT8DCvFXk30u
VC9rCMZ9O7nOIdO2tHs41iaPFpX3coKD6DMu142W89brC70sc3BAzaB/cWn3GecF
D7ihoxAiL5MRRJsqWkCvCMXn98cJxpobhIyGHWg4V8xu4sAnVpXp7ePH90RC9hzX
26wK73QONttee2BX3CdVTxh555wmdI8p43AWz/+MOeRmHUdS6MK4Msz18HY8Dz86
xArqT+Yb+jycGQqgx+MN/kVslCiSvM7wdxnfOufwIvDfv4qac6KmLySScSxogANm
CwDnepE+eKYIjg9DUFPZxFNT0wQhs6SjvH/8fAawxZEXGO/aTWHKs34WOr8n2gEA
OdGMEP8/1Y1IP9YUStWlazA57rm2lnRpcnBlFp/gjFvakWa1weIryY0XmZg8NImy
c5nMsUgl+jMvBW+tYiJzkKjwkMV0kWb98hHruG6xruwdtzbNKO6JdeOa07JjD5kn
rD8vIkgw2cAQiayQ+3FBS7xiP4mcXuqTjj+dOpq9Ph36cZ1y5eA=
=5Jdn
-----END PGP SIGNATURE-----

Marius Bakke wrote 8 years ago
(name . Kei Kebreau)(address . kei@openmailbox.org)
87y3vqv26x.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me
Kei Kebreau <kei@openmailbox.org> writes:

Toggle quote (6 lines)
> * gnu/packages/games.scm (hyperrogue): Update to 9.4c.
> [source]: Remove snippet.
> [arguments]: Remove #:make-flags; adjust configure and install phases; add
> install-data phase.
> [inputs]: Add hyperrogue-data.

Thanks!

[...]

Toggle quote (8 lines)
> + (add-after 'install 'install-data
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (let* ((data (assoc-ref inputs "hyperrogue-data"))
> + (out (assoc-ref outputs "out"))
> + (share-dir (string-append out "/share/hyperrogue")))
> + (system* "tar" "xvf" data "-C" ".")
> + (with-directory-excursion "hyperrogue94c-win"

You can access the "version" variable here by "unquoting" it (with
comma). Another approach is skipping the "top folder" of the tarball
with "--strip-components=1". Maybe the "sounds" subdirectory can be
extracted directly to "out/share/sounds"? See e.g.
"font-adobe-source-code-pro" for some tar trickery.

Toggle quote (30 lines)
> + (for-each
> + (lambda (file)
> + (install-file file (string-append share-dir "/sounds")))
> + (append (find-files "." "\\.ogg$")
> + (find-files "sounds" ".*$")))
> + (for-each
> + (lambda (file)
> + (install-file file share-dir))
> + '("papermodeldata.txt" "papermodeldata-help.txt"))))
> #t)))))
> (inputs
> `(("font-dejavu" ,font-dejavu)
> @@ -3227,7 +3238,23 @@ throwing people around in pseudo-randomly generated buildings.")
> ("sdl-union" ,(sdl-union (list sdl
> sdl-gfx
> sdl-mixer
> - sdl-ttf)))))
> + sdl-ttf)))
> + ("hyperrogue-data"
> + ,(origin
> + (method url-fetch)
> + (uri
> + (string-append
> + "http://www.roguetemple.com/z/hyper/" name
> + (string-join (string-split version #\.) "")
> + "-win.zip"))
> + (sha256
> + (base32
> + "1cyyrsnrixygg3zyz97hpsm6jzwbhydiwk3kl0lm7qjnw2nzkhhh"))

It would be good to have a comment near the source stating "remember to
update hyperrogue-data as well". Otherwise, if the enterprising Guix
contributor already have the old tarball in their store, they may not
notice the impending version/hash mismatch.

Also, this can be a "native-input" since it's downloaded, extracted and
thrown away, and only carry platform-independent data (for us, anyway).

Toggle quote (6 lines)
> + (modules '((guix build utils)))
> + (snippet
> + '(begin
> + ;; Remove .exe and .dll files.
> + (for-each delete-file (find-files "." "\\.(exe|dll)$"))))))))

...for the same reason, I don't think this is necessary, especially if
we can avoid extracting these files to begin with. It will just use up
*more* space in the store, since it creates a derivation in addition to
the tarball. :-)

The rest LGTM, thanks!

Toggle quote (5 lines)
> (synopsis "Non-euclidean graphical rogue-like game")
> (description
> --
> 2.12.0
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAljZhCYACgkQoqBt8qM6
VPoqKwgA0NPaTiREYR9crMVlD7AkHxKuF0QegkQrW15rRiM2WnBo+RbkwPDpyOVc
IwmTh7FWA1MHKIj6naHXKyWhTsa83Ee82AAuBaPJep2rR1hBI3Kie2Fog9jvx88G
MyC6gHyUwRz1TjS+//D+O2NKNPl0uokDKpMkMdeNjx9uWNCvnKStGt9Oq5wv9uNN
6S7yt0fzdndgMEahJP5alYAD4l+iaexFKo9t9OrDN4kWJzRZwS3zZQVNSdHMTRI2
q5MWLXx3i0YTgAyTcK762ZrKWkGdQdJHwpA82v6mR9oQCTPa3nEtUn+qmaqweKxZ
ody0repq76ymM76rn3m+gRTesWVdbA==
=RAHh
-----END PGP SIGNATURE-----

Kei Kebreau wrote 8 years ago
(address . 26267@debbugs.gnu.org)
87inmtpr9i.fsf@openmailbox.org
* gnu/packages/games.scm (hyperrogue): Update to 9.4c.
[source]: Remove snippet.
[arguments]: Remove #:make-flags; adjust configure and install phases; add
install-data phase.
[native-inputs]: Add hyperrogue-data and unzip.
---
gnu/packages/games.scm | 94 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 62 insertions(+), 32 deletions(-)

Toggle diff (129 lines)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 67fcb7b49..6c92cffd2 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3163,23 +3163,21 @@ throwing people around in pseudo-randomly generated buildings.")
(define-public hyperrogue
(package
(name "hyperrogue")
- (version "8.3j")
+ (version "9.4c")
+ ;; When updating this package, be sure to update the "hyperrogue-data"
+ ;; origin in native-inputs.
(source (origin
(method url-fetch)
(uri (string-append
"http://www.roguetemple.com/z/hyper/"
- name "-83j.zip"))
+ name (string-join (string-split version #\.) "")
+ "-src.tgz"))
(sha256
(base32
- "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
- (modules '((guix build utils)))
- ;; Remove .exe and .dll files.
- (snippet
- '(for-each delete-file (find-files "." "\\.(exe|dll)$")))))
+ "1ri5fllnhqjm3dlnl1xbb9mlv79iigc940vbvcnk0v5k6p58pavq"))))
(build-system gnu-build-system)
(arguments
- '(#:tests? #f ; no check target
- #:make-flags '("-Csrc")
+ `(#:tests? #f ; no check target
#:phases
(modify-phases %standard-phases
(add-after 'set-paths 'set-sdl-paths
@@ -3190,21 +3188,24 @@ throwing people around in pseudo-randomly generated buildings.")
;; Fix font and music paths.
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (dejavu-dir (string-append
- (assoc-ref inputs "font-dejavu")
- "/share/fonts/truetype"))
- (dejavu-font "DejaVuSans-Bold.ttf")
- (music-file "hyperrogue-music.txt"))
- (with-directory-excursion "src"
- (substitute* "graph.cpp"
- ((dejavu-font)
- (string-append dejavu-dir "/" dejavu-font))
- (((string-append "\\./" music-file))
- (string-append out "/share/hyperrogue/" music-file)))
- (substitute* music-file
- (("\\*/")
- (string-append out "/share/hyperrogue/")))))
+ (let* ((out (assoc-ref outputs "out"))
+ (share-dir (string-append out "/share/hyperrogue"))
+ (dejavu-dir (string-append
+ (assoc-ref inputs "font-dejavu")
+ "/share/fonts/truetype"))
+ (dejavu-font "DejaVuSans-Bold.ttf")
+ (music-file "hyperrogue-music.txt"))
+ (substitute* "graph.cpp"
+ ((dejavu-font)
+ (string-append dejavu-dir "/" dejavu-font)))
+ (substitute* "sound.cpp"
+ (((string-append "\\./" music-file))
+ (string-append share-dir "/" music-file))
+ (("sounds/")
+ (string-append share-dir "/sounds/")))
+ (substitute* music-file
+ (("\\*/")
+ (string-append share-dir "/sounds/"))))
#t))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
@@ -3212,14 +3213,43 @@ throwing people around in pseudo-randomly generated buildings.")
(bin (string-append out "/bin"))
(share-dir (string-append out "/share/hyperrogue")))
(mkdir-p bin)
- (copy-file "src/hyper" (string-append bin "/hyperrogue"))
- (mkdir-p share-dir)
- (copy-file "src/hyperrogue-music.txt"
- (string-append share-dir "/hyperrogue-music.txt"))
- (for-each (lambda (file)
- (copy-file file (string-append share-dir "/" file)))
- (find-files "." "\\.ogg$")))
- #t)))))
+ (copy-file "hyper" (string-append bin "/hyperrogue"))
+ (install-file "hyperrogue-music.txt" share-dir))
+ #t))
+ (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 (string-append (assoc-ref inputs "unzip") "/bin/unzip")))
+ (and
+ ;; Extract music into sounds directory.
+ (zero?
+ (system* unzip "-j" data
+ (string-append
+ "'hyperrogue"
+ (string-join (string-split ,version #\.) "")
+ "-win/sounds/*'") "-d" sounds))
+ ;; Extract sounds into sounds directory.
+ (zero?
+ (system* "unzip" "-j" data
+ (string-append
+ "'hyperrogue"
+ (string-join (string-split ,version #\.) "")
+ "-win/*.ogg'") "-d" sounds)))))))))
+ (native-inputs
+ `(("hyperrogue-data"
+ ,(origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "http://www.roguetemple.com/z/hyper/" name
+ (string-join (string-split version #\.) "")
+ "-win.zip"))
+ (sha256
+ (base32
+ "1cyyrsnrixygg3zyz97hpsm6jzwbhydiwk3kl0lm7qjnw2nzkhhh"))))
+ ("unzip" ,unzip)))
(inputs
`(("font-dejavu" ,font-dejavu)
("glew" ,glew)
--
2.12.0
Kei Kebreau wrote 8 years ago
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 26267@debbugs.gnu.org)
87fuhxpr72.fsf@openmailbox.org
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (83 lines)
> Kei Kebreau <kei@openmailbox.org> writes:
>
>> * gnu/packages/games.scm (hyperrogue): Update to 9.4c.
>> [source]: Remove snippet.
>> [arguments]: Remove #:make-flags; adjust configure and install phases; add
>> install-data phase.
>> [inputs]: Add hyperrogue-data.
>
> Thanks!
>
> [...]
>
>> + (add-after 'install 'install-data
>> + (lambda* (#:key inputs outputs #:allow-other-keys)
>> + (let* ((data (assoc-ref inputs "hyperrogue-data"))
>> + (out (assoc-ref outputs "out"))
>> + (share-dir (string-append out "/share/hyperrogue")))
>> + (system* "tar" "xvf" data "-C" ".")
>> + (with-directory-excursion "hyperrogue94c-win"
>
> You can access the "version" variable here by "unquoting" it (with
> comma). Another approach is skipping the "top folder" of the tarball
> with "--strip-components=1". Maybe the "sounds" subdirectory can be
> extracted directly to "out/share/sounds"? See e.g.
> "font-adobe-source-code-pro" for some tar trickery.
>
>> + (for-each
>> + (lambda (file)
>> + (install-file file (string-append share-dir "/sounds")))
>> + (append (find-files "." "\\.ogg$")
>> + (find-files "sounds" ".*$")))
>> + (for-each
>> + (lambda (file)
>> + (install-file file share-dir))
>> + '("papermodeldata.txt" "papermodeldata-help.txt"))))
>> #t)))))
>> (inputs
>> `(("font-dejavu" ,font-dejavu)
>> @@ -3227,7 +3238,23 @@ throwing people around in pseudo-randomly generated buildings.")
>> ("sdl-union" ,(sdl-union (list sdl
>> sdl-gfx
>> sdl-mixer
>> - sdl-ttf)))))
>> + sdl-ttf)))
>> + ("hyperrogue-data"
>> + ,(origin
>> + (method url-fetch)
>> + (uri
>> + (string-append
>> + "http://www.roguetemple.com/z/hyper/" name
>> + (string-join (string-split version #\.) "")
>> + "-win.zip"))
>> + (sha256
>> + (base32
>> + "1cyyrsnrixygg3zyz97hpsm6jzwbhydiwk3kl0lm7qjnw2nzkhhh"))
>
> It would be good to have a comment near the source stating "remember to
> update hyperrogue-data as well". Otherwise, if the enterprising Guix
> contributor already have the old tarball in their store, they may not
> notice the impending version/hash mismatch.
>
> Also, this can be a "native-input" since it's downloaded, extracted and
> thrown away, and only carry platform-independent data (for us, anyway).
>
>> + (modules '((guix build utils)))
>> + (snippet
>> + '(begin
>> + ;; Remove .exe and .dll files.
>> + (for-each delete-file (find-files "." "\\.(exe|dll)$"))))))))
>
> ...for the same reason, I don't think this is necessary, especially if
> we can avoid extracting these files to begin with. It will just use up
> *more* space in the store, since it creates a derivation in addition to
> the tarball. :-)
>
> The rest LGTM, thanks!
>
>> (home-page "http://www.roguetemple.com/z/hyper/")
>> (synopsis "Non-euclidean graphical rogue-like game")
>> (description
>> --
>> 2.12.0

The new patch that I sent attempts to take care of these issues, but the
unzip pattern matching in the install-data phase is not working for some
reason. Any ideas?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJY2ksSAAoJEOal7jwZRnoNxLwP/jT+L7wX2U5cp/IydHpCZarm
9ROq+FuFwtkGSRtI7mfgxDwPmWPCAbYVGT+0HjoZjUkcepdJzJpPA2+CmNbJF8AB
b3IuyhgPO9fcMOj+POUC+11rASzZeF6UvnZeI6TXPhXqtW/lxOswbT9OVPulQEKn
jA+wsuX/NI0LQ3cTPQ6mgvseSXE1Qugfm5CoGKngyourcfYjLeGRtBioYCox7caH
5EQ5jZV07ZWaGoOmauyD7jUOytJ0tWdEurC8P7xzxWNOwF51/t+p8LV6vR/jbKvi
UmAY4uo4c3FI5L88k0Cpq8ofgDv1kTmPNPEnhMAR1OhkhHX9PYGujWrtzcdEe4EZ
R+TIsCkfPgiRC5aoft/5+ZSpEEsOfegNAwzMs1Zjg12phFGWavWS+L2XaTw3U+7f
SQn5tS+Q9tWcWkB6ttTO9m92+sSXSTIbd9hf7JCM+CYC2yh9d7JV5Xen20v7EcO/
c6PZNwkOCsnco4Wr0NC+XV+zPWxEKfbkeUE9KzViP/H7tnuN+koq3DB3fOgAFvaa
FWBibhxnkG8v5WyTfCD0k2xdLrEpVSdSPozbDyJnIgYlRdjErYGjqH+ujRWexxia
n9O5zcnbnI6e0sU72VCGR8U93jPBbId5x0kb+CSzOvKWYeS0c5WQ/E3YBJy7xZjR
MsD/ssIolgrGWBZCjKo6
=0/Fw
-----END PGP SIGNATURE-----

Marius Bakke wrote 8 years ago
(name . Kei Kebreau)(address . kei@openmailbox.org)(address . 26267@debbugs.gnu.org)
87vaqtttfz.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me
Kei Kebreau <kei@openmailbox.org> writes:

Toggle quote (4 lines)
> The new patch that I sent attempts to take care of these issues, but the
> unzip pattern matching in the install-data phase is not working for some
> reason. Any ideas?

I was able to extract it by removing the single quotes (these strings
are already 'quoted' when passed to the unzip command). However the
second extraction seems to match some files from the first, perhaps an
additional filter needs to be passed to avoid descending into sounds/.

The example for the '-x' option in the manual looks like it should do
the job.

LGTM and HTH! :-)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAljaZrAACgkQoqBt8qM6
VPrL9wgAlBJMtudXhsJ0NMdrWsL6thtUcFx0WNXOLBNaJnmHT61ny43ur+SRkplV
6YveLG3rEXOh3bHlcamR/uDO0Js4QnJVUEUliTDEY2qO6JXZyaTv8Ut85ORmcGfn
ghjMxrmmsEGxOuN6sETY+SmYhFvh8NdxPdw9iRHL3b3Xc1Z6Nek9+gJhIDW+Fx7Y
MjT6zLmFhVpJfLXEts2blIF3ha0XHIhYHsesdBbTbaHM3auVE7zK1I62znSrKw+e
NYduWlAoOeolx3SIRrKt8tTrOM0VoejCI4Wxk0zuRypPk9AHQbGef9DrG53vqLfa
4Q0g5YoO5XiCHB2OpvJ0enAHmw7OZw==
=AXEG
-----END PGP SIGNATURE-----

Kei Kebreau wrote 8 years ago
(address . 26267@debbugs.gnu.org)
87bmslpge5.fsf@openmailbox.org
* gnu/packages/games.scm (hyperrogue): Update to 9.4c.
[source]: Remove snippet.
[arguments]: Remove #:make-flags; adjust configure and install phases; add
install-data phase.
[native-inputs]: Add hyperrogue-data and unzip.
[license]: Add cc-by-sa4.0 and cc0 licenses for sounds.
---
gnu/packages/games.scm | 104 ++++++++++++++++++++++++++++++++-----------------
1 file changed, 68 insertions(+), 36 deletions(-)

Toggle diff (146 lines)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 67fcb7b49..19f9c9d39 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3163,23 +3163,21 @@ throwing people around in pseudo-randomly generated buildings.")
(define-public hyperrogue
(package
(name "hyperrogue")
- (version "8.3j")
+ (version "9.4c")
+ ;; When updating this package, be sure to update the "hyperrogue-data"
+ ;; origin in native-inputs.
(source (origin
(method url-fetch)
(uri (string-append
"http://www.roguetemple.com/z/hyper/"
- name "-83j.zip"))
+ name (string-join (string-split version #\.) "")
+ "-src.tgz"))
(sha256
(base32
- "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
- (modules '((guix build utils)))
- ;; Remove .exe and .dll files.
- (snippet
- '(for-each delete-file (find-files "." "\\.(exe|dll)$")))))
+ "1ri5fllnhqjm3dlnl1xbb9mlv79iigc940vbvcnk0v5k6p58pavq"))))
(build-system gnu-build-system)
(arguments
- '(#:tests? #f ; no check target
- #:make-flags '("-Csrc")
+ `(#:tests? #f ; no check target
#:phases
(modify-phases %standard-phases
(add-after 'set-paths 'set-sdl-paths
@@ -3190,21 +3188,24 @@ throwing people around in pseudo-randomly generated buildings.")
;; Fix font and music paths.
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (dejavu-dir (string-append
- (assoc-ref inputs "font-dejavu")
- "/share/fonts/truetype"))
- (dejavu-font "DejaVuSans-Bold.ttf")
- (music-file "hyperrogue-music.txt"))
- (with-directory-excursion "src"
- (substitute* "graph.cpp"
- ((dejavu-font)
- (string-append dejavu-dir "/" dejavu-font))
- (((string-append "\\./" music-file))
- (string-append out "/share/hyperrogue/" music-file)))
- (substitute* music-file
- (("\\*/")
- (string-append out "/share/hyperrogue/")))))
+ (let* ((out (assoc-ref outputs "out"))
+ (share-dir (string-append out "/share/hyperrogue"))
+ (dejavu-dir (string-append
+ (assoc-ref inputs "font-dejavu")
+ "/share/fonts/truetype"))
+ (dejavu-font "DejaVuSans-Bold.ttf")
+ (music-file "hyperrogue-music.txt"))
+ (substitute* "graph.cpp"
+ ((dejavu-font)
+ (string-append dejavu-dir "/" dejavu-font)))
+ (substitute* "sound.cpp"
+ (((string-append "\\./" music-file))
+ (string-append share-dir "/" music-file))
+ (("sounds/")
+ (string-append share-dir "/sounds/")))
+ (substitute* music-file
+ (("\\*/")
+ (string-append share-dir "/sounds/"))))
#t))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
@@ -3212,14 +3213,43 @@ throwing people around in pseudo-randomly generated buildings.")
(bin (string-append out "/bin"))
(share-dir (string-append out "/share/hyperrogue")))
(mkdir-p bin)
- (copy-file "src/hyper" (string-append bin "/hyperrogue"))
- (mkdir-p share-dir)
- (copy-file "src/hyperrogue-music.txt"
- (string-append share-dir "/hyperrogue-music.txt"))
- (for-each (lambda (file)
- (copy-file file (string-append share-dir "/" file)))
- (find-files "." "\\.ogg$")))
- #t)))))
+ (copy-file "hyper" (string-append bin "/hyperrogue"))
+ (install-file "hyperrogue-music.txt" share-dir))
+ #t))
+ (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 (string-append (assoc-ref inputs "unzip") "/bin/unzip")))
+ (and
+ ;; Extract media license information into sounds directory.
+ (zero?
+ (system* unzip "-j" data
+ (string-append
+ "hyperrogue"
+ (string-join (string-split ,version #\.) "")
+ "-win/sounds/credits.txt") "-d" sounds))
+ ;; Extract sounds and music into sounds directory.
+ (zero?
+ (system* "unzip" "-j" data
+ (string-append
+ "hyperrogue"
+ (string-join (string-split ,version #\.) "")
+ "-win/*.ogg") "-d" sounds)))))))))
+ (native-inputs
+ `(("hyperrogue-data"
+ ,(origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "http://www.roguetemple.com/z/hyper/" name
+ (string-join (string-split version #\.) "")
+ "-win.zip"))
+ (sha256
+ (base32
+ "1cyyrsnrixygg3zyz97hpsm6jzwbhydiwk3kl0lm7qjnw2nzkhhh"))))
+ ("unzip" ,unzip)))
(inputs
`(("font-dejavu" ,font-dejavu)
("glew" ,glew)
@@ -3240,10 +3270,12 @@ are home to particular creatures and may be subject to own rules of \"physics\".
While it can use ASCII characters to display the world the classical rogue
symbols, the game needs graphics to render the non-euclidean world.")
- (license (list license:bsd-3 ; src/glew.c, src/mtrand.*
- license:cc-by-sa3.0 ; *.ogg
- license:public-domain ; src/direntx.*
- license:zlib ; src/savepng.*
+ (license (list license:bsd-3 ; glew.c, mtrand.*
+ license:cc-by-sa3.0 ; music
+ license:cc-by-sa4.0 ; sounds
+ license:cc0
+ license:public-domain ; direntx.*, some sounds
+ license:zlib ; savepng.*
license:gpl2+)))) ; remaining files
(define-public kobodeluxe
--
2.12.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJY2oHCAAoJEOal7jwZRnoNPSQQAMCyDmg977KrUxBuDoLLxLc/
mbgzQdCk6etFK0UydAPED6EBjWd384/hL7biddQnr0sao8ZjKG9pzZV3oPxqksnO
dpv+8brhu9Lr3MF2YX9QVOw3NBg1gJTp1VG6a3IU66RI6DF5trN0CNLwRfeauxh1
uZGmMOdNRKcZXFF0WaljRPu44KT9u74+Jo/oq9/jnk6B0wUcn1tKx2RkPReBt8du
+cdE7+lGJ0xwHmfxi4mg1wNw38cuGS4kjAVUVIbNFUejWNLTiDcQHLP8ruCVpZRv
46lQ7jDupzl96CK8Dcrw5EBC9/R3Mu2FTJC3iXb6vbfji0kgkLl0Vlov+rJnts2Z
mvzqQSP3c8/hKX6ZKggScKNoBkWLegGuJV8ysBfvdxrt5hq+U9iCpZKHWyyfEsLb
GObx8yv53brrwlWSwBZRRox/3Mkj81IPzfTTaRpaiGzxTPB6nNHVUaNpWeGMf2S0
VwK38sCWbsBZr7okz7C3jIkMgwxsbPrjfVkVMzKPSXqH/QpEtmrkp7l4aXnoRa2D
rCRdKwKsFLnGdSPh3zUGdQ8urp2kppYkc14czSgDCsozxXODVRMy1oO8PYpJ5Ak3
fcX/OlGDgPebMH2PrN0EFBJSj5SzAb9RNdyzKusJ93qzE0XC57wVyzmOQm7Hylr9
/jC3S9VsufFWZ8VJrqRC
=tIAA
-----END PGP SIGNATURE-----

Kei Kebreau wrote 8 years ago
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 26267@debbugs.gnu.org)
878tnppg72.fsf@openmailbox.org
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (3 lines)
> I was able to extract it by removing the single quotes (these strings
> are already 'quoted' when passed to the unzip command).

I learned something new today. :-P

Toggle quote (8 lines)
> However the
> second extraction seems to match some files from the first, perhaps an
> additional filter needs to be passed to avoid descending into sounds/.
>
> The example for the '-x' option in the manual looks like it should do
> the job.
>

I only needed to include the credits.txt file in the sounds directory,
so I just used "extract all .ogg files + the credits.txt file."

Toggle quote (2 lines)
> LGTM and HTH! :-)

I submitted one last patch in case I missed anything obvious. Thanks to
you and Leo for the reviews.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJY2oLBAAoJEOal7jwZRnoNJawQAMDaCd0d7s7bCr7FhPOYT27a
YgzxFRPi4RREPjQjEO47F418CAkRN99NTy36xdGIcgKMHx44XM/fjg4Ui/qPPAK/
ckJgQVFzZxvVhXOPL6EAb7KW7iYaCRS8HI3INDiCjkOK3ZKh9km0dK+vIV2e5uI6
vQu8ZprhphlP4U9vBo4aDn6rsyu9FYUS5ucx7tmR3aMv7DxlBdUVcOMuwZtimy9T
FLjOSpxMg3Sw5KD0PChA4BndrTgjPD44noCJ7uFD+bsWTg463GUnrbiQCF+PeW0Q
8Ammi/AqzUWKosIFEn+86nDekPq7D+ckVmP76VFvG30YRtjIhwquzzpG8apu0C1S
b63oYktLW9jtAsN4qJdrFv9GQWv3rh/12PY/Q0Bw87cBJ7TFLwHMLamUxSBWhVuc
B8Hx5PeQqge8JJSpgQvlJQkoh7UJnRXdSV3ttoxCZCBb3whnUwoQqKq4XYrGHKb7
bTTEFkp9hAF/B6gi3ModrGjGz0xVB+7L1WcgEsjNp7leMWFC9jz1Bl3Xp/U+QoSF
ppSJToJmsgGY7yJUzyU1Bt202/ujVTZgtYL6W0NJqjVuJlrhfTxGghxdZ6UW+uzq
C2JOI1T6rgpBFnGBsL7yX469HVO5YE8qCAbOxbhW/eM+BLqdwM2YAk5qvHyZ+8k5
VqKQo0XOaXqPr/DY/OMi
=wu5U
-----END PGP SIGNATURE-----

Marius Bakke wrote 8 years ago
(name . Kei Kebreau)(address . kei@openmailbox.org)(address . 26267@debbugs.gnu.org)
87d1d0ubjs.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me
Kei Kebreau <kei@openmailbox.org> writes:

Toggle quote (18 lines)
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> I was able to extract it by removing the single quotes (these strings
>> are already 'quoted' when passed to the unzip command).
>
> I learned something new today. :-P
>
>> However the
>> second extraction seems to match some files from the first, perhaps an
>> additional filter needs to be passed to avoid descending into sounds/.
>>
>> The example for the '-x' option in the manual looks like it should do
>> the job.
>>
>
> I only needed to include the credits.txt file in the sounds directory,
> so I just used "extract all .ogg files + the credits.txt file."

Great. :-)

Toggle quote (6 lines)
>
>> LGTM and HTH! :-)
>
> I submitted one last patch in case I missed anything obvious. Thanks to
> you and Leo for the reviews.

LGTM!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAljbCwgACgkQoqBt8qM6
VPrH4gf/ZK2z6w7+9KRkBTpmqQLsnZRVt9vazs3Af/PUB59WGFsX6CSBORy8iAtH
dtdDEV7WBU5nBsTEqAJrgpuuL8tAwMWByUOQt2t/Ek9Chlx17OhwuSgJcbuCup4a
wlMAFn3EBbJfSAQf45BXU8uC/HgVpyxaCm9btJMaG32WBR5YV90Dw6dzDlCVUsIX
xP5+Gi7l3/qPBjvbrqdeeYHvk7LN6lHHjP41dED+DaxQGv1Ga7bytBfXD3mmy2qg
Y/TtjvNb03uE4rKnJUQe+/NCTtE90alGCgKZOezQ6r9d7d8rsGHcWNkAYkObfSo4
F3JdAL3pBXWhbTh/7bVNTb5Rov94Hw==
=Pe3S
-----END PGP SIGNATURE-----

Kei Kebreau wrote 8 years ago
(address . 26267-done@debbugs.gnu.org)
8760ispx6m.fsf@openmailbox.org
Pushed to master as f8279ba46baa5a1ad7e6c32546d71819eff72e4e.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJY2yzBAAoJEOal7jwZRnoN5K8QALxnPSpOuDY8/ZYsfaezuIZV
sEVD1OjuZRSj6NiP66mwXA1zDfQ9D2zFkOg/xifalY4RlUmwauCBOeITBlCKJtKO
dMYkEdKA0gev4ZHbQh+Ddn4CIVkKlzUJa1fBvchcafHaD7+Kz3XsC5uIcMu4OdOZ
NfMlRF0DywTcc3Se+6GCHskCihF5/m8zP7fBI7j1n+roL46ItpIIcQT+JBl7ZGwy
sAZ00KY5Nzq4bRnSlYgHurXEAK7XX5WQ0ZxVK7VJRlkaz+0CpeVfbEwXSiXitOjQ
+DaW+u5fwwVsTtZaadfxePyKRkpvDubuxGlOJfklbkYFXl6Ag1K0NmzKLCWAlvIr
KoKABVAZ+4eJuJ+eYX6BEociIuqOhQRAnglOUe1788sLS5+Tuyzu2/9yEHFLdhc8
pFa88cdgaV7BepG+BXsybFp9XptM/4QOskQLjMf31YZP+p3tE2S+mc48eQOG6NW0
HQVhlNCEcxCLVhdofZ4imeZCh5BcTpHN/wj/a592cXpKYenfI9jFTUIl0CYhc1W0
IbGAZBlwxmf9gSWdPdhBlGuUTz7SnKcpTgsnfdA4HqTysb5GEhGOmyRKcG0xI6HB
oV1vFmgi8Uuf3iZPvTF+AT+aOuksj3txxKxwsGyYBcKmMDEFP6xY4BUbalYE/NHK
qu7apzoVECynEmqzHf07
=qBph
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 26267@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 26267
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help