GNU bug report logs - #26267
[PATCH] gnu: hyperrogue: Update to 9.4c.

Previous Next

Package: guix-patches;

Reported by: Kei Kebreau <kei <at> openmailbox.org>

Date: Sun, 26 Mar 2017 20:08:01 UTC

Severity: normal

Tags: patch

Done: Kei Kebreau <kei <at> openmailbox.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26267 in the body.
You can then email your comments to 26267 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Sun, 26 Mar 2017 20:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kei Kebreau <kei <at> openmailbox.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 26 Mar 2017 20:08:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: guix-patches <at> gnu.org
Cc: Kei Kebreau <kei <at> openmailbox.org>
Subject: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Sun, 26 Mar 2017 16:06:43 -0400
* gnu/packages/games.scm (hyperrogue): Update to 9.4c.
---
 gnu/packages/games.scm | 89 ++++++++++++++++++++++++++++++++------------------
 1 file changed, 58 insertions(+), 31 deletions(-)

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





Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Mon, 27 Mar 2017 19:12:01 GMT) Full text and rfc822 format available.

Message #8 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 26267 <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Mon, 27 Mar 2017 15:11:37 -0400
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?




Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Mon, 27 Mar 2017 20:41:02 GMT) Full text and rfc822 format available.

Message #11 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: 26267 <at> debbugs.gnu.org
Cc: Kei Kebreau <kei <at> openmailbox.org>
Subject: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Mon, 27 Mar 2017 16:40:17 -0400
* 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(-)

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





Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Mon, 27 Mar 2017 20:43:01 GMT) Full text and rfc822 format available.

Message #14 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: Leo Famulari <leo <at> famulari.name>
Cc: 26267 <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Mon, 27 Mar 2017 16:42:05 -0400
[Message part 1 (text/plain, inline)]
Leo Famulari <leo <at> famulari.name> writes:

> 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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Mon, 27 Mar 2017 21:30:02 GMT) Full text and rfc822 format available.

Message #17 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Kei Kebreau <kei <at> openmailbox.org>, 26267 <at> debbugs.gnu.org
Cc: Kei Kebreau <kei <at> openmailbox.org>
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Mon, 27 Mar 2017 23:29:10 +0200
[Message part 1 (text/plain, inline)]
Kei Kebreau <kei <at> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Tue, 28 Mar 2017 11:37:02 GMT) Full text and rfc822 format available.

Message #20 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: 26267 <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Tue, 28 Mar 2017 07:36:25 -0400
* 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(-)

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





Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Tue, 28 Mar 2017 11:39:01 GMT) Full text and rfc822 format available.

Message #23 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 26267 <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Tue, 28 Mar 2017 07:37:53 -0400
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Kei Kebreau <kei <at> 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?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Tue, 28 Mar 2017 13:36:02 GMT) Full text and rfc822 format available.

Message #26 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 26267 <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Tue, 28 Mar 2017 15:35:44 +0200
[Message part 1 (text/plain, inline)]
Kei Kebreau <kei <at> openmailbox.org> writes:

> 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! :-)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Tue, 28 Mar 2017 15:32:01 GMT) Full text and rfc822 format available.

Message #29 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: 26267 <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Tue, 28 Mar 2017 11:31:14 -0400
[Message part 1 (text/plain, inline)]
* 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(-)

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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Tue, 28 Mar 2017 15:36:02 GMT) Full text and rfc822 format available.

Message #32 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 26267 <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Tue, 28 Mar 2017 11:35:29 -0400
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> 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."

> LGTM and HTH! :-)

I submitted one last patch in case I missed anything obvious. Thanks to
you and Leo for the reviews.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26267; Package guix-patches. (Wed, 29 Mar 2017 01:17:01 GMT) Full text and rfc822 format available.

Message #35 received at 26267 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: 26267 <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Wed, 29 Mar 2017 03:16:55 +0200
[Message part 1 (text/plain, inline)]
Kei Kebreau <kei <at> openmailbox.org> writes:

> Marius Bakke <mbakke <at> 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. :-)

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

LGTM!
[signature.asc (application/pgp-signature, inline)]

Reply sent to Kei Kebreau <kei <at> openmailbox.org>:
You have taken responsibility. (Wed, 29 Mar 2017 03:42:01 GMT) Full text and rfc822 format available.

Notification sent to Kei Kebreau <kei <at> openmailbox.org>:
bug acknowledged by developer. (Wed, 29 Mar 2017 03:42:02 GMT) Full text and rfc822 format available.

Message #40 received at 26267-done <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kei <at> openmailbox.org>
To: 26267-done <at> debbugs.gnu.org
Subject: Re: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Tue, 28 Mar 2017 23:40:49 -0400
[Message part 1 (text/plain, inline)]
Pushed to master as f8279ba46baa5a1ad7e6c32546d71819eff72e4e.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 26 Apr 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.