unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Kei Kebreau <kei@openmailbox.org>
To: 26267@debbugs.gnu.org
Cc: Kei Kebreau <kei@openmailbox.org>
Subject: bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c.
Date: Mon, 27 Mar 2017 16:40:17 -0400	[thread overview]
Message-ID: <20170327204017.3529-1-kei@openmailbox.org> (raw)
In-Reply-To: <20170326200643.5256-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(-)

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

  parent reply	other threads:[~2017-03-27 20:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170326200643.5256-1-kei@openmailbox.org>
2017-03-27 19:11 ` bug#26267: [PATCH] gnu: hyperrogue: Update to 9.4c Leo Famulari
2017-03-27 20:42   ` Kei Kebreau
2017-03-27 20:40 ` Kei Kebreau [this message]
2017-03-27 21:29   ` Marius Bakke
2017-03-28 11:37     ` Kei Kebreau
2017-03-28 13:35       ` Marius Bakke
2017-03-28 15:35         ` Kei Kebreau
2017-03-29  1:16           ` Marius Bakke
2017-03-28 11:36 ` Kei Kebreau
2017-03-28 15:31 ` Kei Kebreau
2017-03-29  3:40 ` Kei Kebreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170327204017.3529-1-kei@openmailbox.org \
    --to=kei@openmailbox.org \
    --cc=26267@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).