unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add hyperrogue.
@ 2016-10-03 23:15 Kei Kebreau
  2016-10-04 15:56 ` Alex Kost
  0 siblings, 1 reply; 5+ messages in thread
From: Kei Kebreau @ 2016-10-03 23:15 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 118 bytes --]

If anyone would like to check this for fun, that would be great. The geometry
makes this game especially interesting.

[-- Attachment #1.2: 0001-gnu-Add-hyperrogue.patch --]
[-- Type: text/plain, Size: 4885 bytes --]

From e0171e159612c12419de1c6f9a230843ff8d826a Mon Sep 17 00:00:00 2001
From: Kei Kebreau <kei@openmailbox.org>
Date: Mon, 3 Oct 2016 19:09:35 -0400
Subject: [PATCH] gnu: Add hyperrogue.

* gnu/packages/games.scm (hyperrogue): New variable.
---
 gnu/packages/games.scm | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index cd5cf6f..e9b11a7 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2896,3 +2896,91 @@ extinguishing action, intense boss battles, a catchy soundtrack and lots of
 throwing people around in pseudo-randomly generated buildings.")
     (license (list license:zlib             ; for source code
                    license:cc-by-sa3.0))))  ; for graphics and music assets
+
+(define-public hyperrogue
+  (package
+    (name "hyperrogue")
+    (version "8.3j")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://www.roguetemple.com/z/hyper/"
+                    name "-83j.zip"))
+              (sha256
+               (base32
+                "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
+              (modules '((guix build utils)))
+              ;; remove .exe and .dll files
+              (snippet
+               '(begin
+                  (for-each delete-file (find-files "." "\\.(exe|dll)$"))))))
+    (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
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "CPATH"
+                     (string-append (assoc-ref inputs "sdl-union")
+                                    "/include/SDL"))))
+         ;; 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"))
+               (chdir "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/music")))
+               (chdir ".."))
+             #t))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (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)))))
+    (inputs
+     `(("font-dejavu" ,font-dejavu)
+       ("glew" ,glew)
+       ("libpng" ,libpng)
+       ("sdl-union" ,(sdl-union (list sdl
+                                      sdl-gfx
+                                      sdl-mixer
+                                      sdl-ttf)))))
+    (home-page "http://www.roguetemple.com/z/hyper/")
+    (synopsis "Non-euclidean graphical rogue-like game")
+    (description
+     "HyperRogue is a game in which the player collects treasures and fights
+monsters -- rogue-like but for the fact that it is played on the hyperbolic
+plane and not in euclidean space.
+
+In HyperRogue, the player can move through different parts of the world, which
+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:gpl2+))))     ; remaining files
-- 
2.10.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add hyperrogue.
  2016-10-03 23:15 [PATCH] gnu: Add hyperrogue Kei Kebreau
@ 2016-10-04 15:56 ` Alex Kost
  2016-10-04 20:01   ` Kei Kebreau
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Kost @ 2016-10-04 15:56 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: guix-devel

Kei Kebreau (2016-10-03 19:15 -0400) wrote:

> If anyone would like to check this for fun, that would be great. The geometry
> makes this game especially interesting.

Wow, indeed!  Psychodelic game :-)

Overall the patch looks good to me, except the music files are not
installed and configured to be used (see below).  Did you check the
music?  It looks like you were trying to fix these music stuff but
didn't finish it, perhaps you sent a wrong patch, no?

> From e0171e159612c12419de1c6f9a230843ff8d826a Mon Sep 17 00:00:00 2001
> From: Kei Kebreau <kei@openmailbox.org>
> Date: Mon, 3 Oct 2016 19:09:35 -0400
> Subject: [PATCH] gnu: Add hyperrogue.
>
> * gnu/packages/games.scm (hyperrogue): New variable.
> ---
>  gnu/packages/games.scm | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 88 insertions(+)
>
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index cd5cf6f..e9b11a7 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -2896,3 +2896,91 @@ extinguishing action, intense boss battles, a catchy soundtrack and lots of
>  throwing people around in pseudo-randomly generated buildings.")
>      (license (list license:zlib             ; for source code
>                     license:cc-by-sa3.0))))  ; for graphics and music assets
> +
> +(define-public hyperrogue
> +  (package
> +    (name "hyperrogue")
> +    (version "8.3j")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "http://www.roguetemple.com/z/hyper/"
> +                    name "-83j.zip"))
> +              (sha256
> +               (base32
> +                "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
> +              (modules '((guix build utils)))
> +              ;; remove .exe and .dll files
> +              (snippet
> +               '(begin
> +                  (for-each delete-file (find-files "." "\\.(exe|dll)$"))))))

'begin' is not needed here, just: (snippet '(for-each ...))

> +    (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
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (setenv "CPATH"
> +                     (string-append (assoc-ref inputs "sdl-union")
> +                                    "/include/SDL"))))
> +         ;; fix font and music paths

By convention such comments (commented lines starting with ;;) are full
phrases, i.e. they begin with uppercase letters and end with periods:

            ;; 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"))
> +               (chdir "src")
> +               (substitute* "graph.cpp"
> +                 ((dejavu-font)
> +                  (string-append dejavu-dir "/" dejavu-font))
> +                 (((string-append "\\./" music-file))
> +                  (string-append out "/share/hyperrogue" music-file)))
                                                          ^
There should be a trailing "/" here, otherwise the file name will be:

  ".../share/hyperroguehyperrogue-music.txt"

> +               (substitute* music-file
> +                 (("\\*/")
> +                  (string-append out "/share/music")))
                                                     ^
And a trailing "/" here for the same reason.  But actually since you
copy .ogg files into "/share/hyperrogue/" then you should use this
directory instead of "/share/music/".

> +               (chdir ".."))

Instead of chdir-ing into "src" and back, you can use:

               (with-directory-excursion "src"
                 (substitute* "graph.cpp"
                  ...))

> +             #t))
> +         (replace 'install
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (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$")))

I think you meant:          (find-files "." "\\.ogg$")

With your regexp the music files are not found (and not installed).

> +             #t)))))
> +    (inputs
> +     `(("font-dejavu" ,font-dejavu)
> +       ("glew" ,glew)
> +       ("libpng" ,libpng)
> +       ("sdl-union" ,(sdl-union (list sdl
> +                                      sdl-gfx
> +                                      sdl-mixer
> +                                      sdl-ttf)))))
> +    (home-page "http://www.roguetemple.com/z/hyper/")
> +    (synopsis "Non-euclidean graphical rogue-like game")
> +    (description
> +     "HyperRogue is a game in which the player collects treasures and fights
> +monsters -- rogue-like but for the fact that it is played on the hyperbolic

"--" looks unusual to me, I would just write "-" although the right
would probably be "---", but I actually don't know; nevermind, it's not
worth bothering.

> +plane and not in euclidean space.
> +
> +In HyperRogue, the player can move through different parts of the world, which
> +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:gpl2+))))     ; remaining files

Thanks, great work on this package!

-- 
Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add hyperrogue.
  2016-10-04 15:56 ` Alex Kost
@ 2016-10-04 20:01   ` Kei Kebreau
  2016-10-05  8:04     ` Alex Kost
  0 siblings, 1 reply; 5+ messages in thread
From: Kei Kebreau @ 2016-10-04 20:01 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 6897 bytes --]

Alex Kost <alezost@gmail.com> writes:

> Kei Kebreau (2016-10-03 19:15 -0400) wrote:
>
>> If anyone would like to check this for fun, that would be great. The
>> geometry
>> makes this game especially interesting.
>
> Wow, indeed!  Psychodelic game :-)
>
> Overall the patch looks good to me, except the music files are not
> installed and configured to be used (see below).  Did you check the
> music?  It looks like you were trying to fix these music stuff but
> didn't finish it, perhaps you sent a wrong patch, no?
>
>> From e0171e159612c12419de1c6f9a230843ff8d826a Mon Sep 17 00:00:00 2001
>> From: Kei Kebreau <kei@openmailbox.org>
>> Date: Mon, 3 Oct 2016 19:09:35 -0400
>> Subject: [PATCH] gnu: Add hyperrogue.
>>
>> * gnu/packages/games.scm (hyperrogue): New variable.
>> ---
>>  gnu/packages/games.scm | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 88 insertions(+)
>>
>> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
>> index cd5cf6f..e9b11a7 100644
>> --- a/gnu/packages/games.scm
>> +++ b/gnu/packages/games.scm
>> @@ -2896,3 +2896,91 @@ extinguishing action, intense boss battles, a catchy soundtrack and lots of
>>  throwing people around in pseudo-randomly generated buildings.")
>>      (license (list license:zlib             ; for source code
>>                     license:cc-by-sa3.0))))  ; for graphics and music assets
>> +
>> +(define-public hyperrogue
>> +  (package
>> +    (name "hyperrogue")
>> +    (version "8.3j")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append
>> +                    "http://www.roguetemple.com/z/hyper/"
>> +                    name "-83j.zip"))
>> +              (sha256
>> +               (base32
>> +                "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
>> +              (modules '((guix build utils)))
>> +              ;; remove .exe and .dll files
>> +              (snippet
>> +               '(begin
>> +                  (for-each delete-file (find-files "." "\\.(exe|dll)$"))))))
>
> 'begin' is not needed here, just: (snippet '(for-each ...))
>
>> +    (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
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (setenv "CPATH"
>> +                     (string-append (assoc-ref inputs "sdl-union")
>> +                                    "/include/SDL"))))
>> +         ;; fix font and music paths
>
> By convention such comments (commented lines starting with ;;) are full
> phrases, i.e. they begin with uppercase letters and end with periods:
>
>             ;; 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"))
>> +               (chdir "src")
>> +               (substitute* "graph.cpp"
>> +                 ((dejavu-font)
>> +                  (string-append dejavu-dir "/" dejavu-font))
>> +                 (((string-append "\\./" music-file))
>> +                  (string-append out "/share/hyperrogue" music-file)))
>                                                           ^
> There should be a trailing "/" here, otherwise the file name will be:
>
>   ".../share/hyperroguehyperrogue-music.txt"
>
>> +               (substitute* music-file
>> +                 (("\\*/")
>> +                  (string-append out "/share/music")))
>                                                      ^
> And a trailing "/" here for the same reason.  But actually since you
> copy .ogg files into "/share/hyperrogue/" then you should use this
> directory instead of "/share/music/".
>
>> +               (chdir ".."))
>
> Instead of chdir-ing into "src" and back, you can use:
>
>                (with-directory-excursion "src"
>                  (substitute* "graph.cpp"
>                   ...))
>
>> +             #t))
>> +         (replace 'install
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             (let* ((out (assoc-ref outputs "out"))
>> +                    (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$")))
>
> I think you meant:          (find-files "." "\\.ogg$")
>
> With your regexp the music files are not found (and not installed).
>
>> +             #t)))))
>> +    (inputs
>> +     `(("font-dejavu" ,font-dejavu)
>> +       ("glew" ,glew)
>> +       ("libpng" ,libpng)
>> +       ("sdl-union" ,(sdl-union (list sdl
>> +                                      sdl-gfx
>> +                                      sdl-mixer
>> +                                      sdl-ttf)))))
>> +    (home-page "http://www.roguetemple.com/z/hyper/")
>> +    (synopsis "Non-euclidean graphical rogue-like game")
>> +    (description
>> + "HyperRogue is a game in which the player collects treasures and
>> fights
>> +monsters -- rogue-like but for the fact that it is played on the hyperbolic
>
> "--" looks unusual to me, I would just write "-" although the right
> would probably be "---", but I actually don't know; nevermind, it's not
> worth bothering.
>
>> +plane and not in euclidean space.
>> +
>> +In HyperRogue, the player can move through different parts of the
>> world, which
>> +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:gpl2+))))     ; remaining files
>
> Thanks, great work on this package!

All issues corrected! If you could check over it a second time to be
sure, that would be appreciated. Thanks for your assistance! :-)

[-- Attachment #1.2: 0001-gnu-Add-hyperrogue.patch --]
[-- Type: text/plain, Size: 4869 bytes --]

From bff2f006ca78a54955857afc5559e5662e21c7e1 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <kei@openmailbox.org>
Date: Tue, 4 Oct 2016 15:58:21 -0400
Subject: [PATCH] gnu: Add hyperrogue.

* gnu/packages/games.scm (hyperrogue): New variable.
---
 gnu/packages/games.scm | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index cd5cf6f..5d61487 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2896,3 +2896,89 @@ extinguishing action, intense boss battles, a catchy soundtrack and lots of
 throwing people around in pseudo-randomly generated buildings.")
     (license (list license:zlib             ; for source code
                    license:cc-by-sa3.0))))  ; for graphics and music assets
+
+(define-public hyperrogue
+  (package
+    (name "hyperrogue")
+    (version "8.3j")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://www.roguetemple.com/z/hyper/"
+                    name "-83j.zip"))
+              (sha256
+               (base32
+                "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
+              (modules '((guix build utils)))
+              ;; remove .exe and .dll files
+              (snippet
+               '(for-each delete-file (find-files "." "\\.(exe|dll)$")))))
+    (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
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "CPATH"
+                     (string-append (assoc-ref inputs "sdl-union")
+                                    "/include/SDL"))))
+         ;; 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/")))))
+             #t))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (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)))))
+    (inputs
+     `(("font-dejavu" ,font-dejavu)
+       ("glew" ,glew)
+       ("libpng" ,libpng)
+       ("sdl-union" ,(sdl-union (list sdl
+                                      sdl-gfx
+                                      sdl-mixer
+                                      sdl-ttf)))))
+    (home-page "http://www.roguetemple.com/z/hyper/")
+    (synopsis "Non-euclidean graphical rogue-like game")
+    (description
+     "HyperRogue is a game in which the player collects treasures and fights
+monsters -- rogue-like but for the fact that it is played on the hyperbolic
+plane and not in euclidean space.
+
+In HyperRogue, the player can move through different parts of the world, which
+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:gpl2+))))     ; remaining files
-- 
2.10.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add hyperrogue.
  2016-10-04 20:01   ` Kei Kebreau
@ 2016-10-05  8:04     ` Alex Kost
  2016-10-05 14:11       ` Kei Kebreau
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Kost @ 2016-10-05  8:04 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: guix-devel

Kei Kebreau (2016-10-04 16:01 -0400) wrote:

[...]
> All issues corrected! If you could check over it a second time to be
> sure, that would be appreciated. Thanks for your assistance! :-)

I think it's OK now, thanks!

And I've just lost an hour playing this game :-)

> From bff2f006ca78a54955857afc5559e5662e21c7e1 Mon Sep 17 00:00:00 2001
> From: Kei Kebreau <kei@openmailbox.org>
> Date: Tue, 4 Oct 2016 15:58:21 -0400
> Subject: [PATCH] gnu: Add hyperrogue.
>
> * gnu/packages/games.scm (hyperrogue): New variable.
> ---
>  gnu/packages/games.scm | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 86 insertions(+)
>
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index cd5cf6f..5d61487 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -2896,3 +2896,89 @@ extinguishing action, intense boss battles, a catchy soundtrack and lots of
>  throwing people around in pseudo-randomly generated buildings.")
>      (license (list license:zlib             ; for source code
>                     license:cc-by-sa3.0))))  ; for graphics and music assets
> +
> +(define-public hyperrogue
> +  (package
> +    (name "hyperrogue")
> +    (version "8.3j")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "http://www.roguetemple.com/z/hyper/"
> +                    name "-83j.zip"))
> +              (sha256
> +               (base32
> +                "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
> +              (modules '((guix build utils)))
> +              ;; remove .exe and .dll files

Rather:          ;; Remove .exe and .dll files.

> +              (snippet
> +               '(for-each delete-file (find-files "." "\\.(exe|dll)$")))))
> +    (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
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (setenv "CPATH"
> +                     (string-append (assoc-ref inputs "sdl-union")
> +                                    "/include/SDL"))))
> +         ;; 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/")))))
> +             #t))
> +         (replace 'install
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (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)))))
> +    (inputs
> +     `(("font-dejavu" ,font-dejavu)
> +       ("glew" ,glew)
> +       ("libpng" ,libpng)
> +       ("sdl-union" ,(sdl-union (list sdl
> +                                      sdl-gfx
> +                                      sdl-mixer
> +                                      sdl-ttf)))))
> +    (home-page "http://www.roguetemple.com/z/hyper/")
> +    (synopsis "Non-euclidean graphical rogue-like game")
> +    (description
> +     "HyperRogue is a game in which the player collects treasures and fights
> +monsters -- rogue-like but for the fact that it is played on the hyperbolic
> +plane and not in euclidean space.
> +
> +In HyperRogue, the player can move through different parts of the world, which
> +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:gpl2+))))     ; remaining files

-- 
Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add hyperrogue.
  2016-10-05  8:04     ` Alex Kost
@ 2016-10-05 14:11       ` Kei Kebreau
  0 siblings, 0 replies; 5+ messages in thread
From: Kei Kebreau @ 2016-10-05 14:11 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 5497 bytes --]

Alex Kost <alezost@gmail.com> writes:

> Kei Kebreau (2016-10-04 16:01 -0400) wrote:
>
> [...]
>> All issues corrected! If you could check over it a second time to be
>> sure, that would be appreciated. Thanks for your assistance! :-)
>
> I think it's OK now, thanks!
>
> And I've just lost an hour playing this game :-)
>
Bwahahahaha!
>> From bff2f006ca78a54955857afc5559e5662e21c7e1 Mon Sep 17 00:00:00 2001
>> From: Kei Kebreau <kei@openmailbox.org>
>> Date: Tue, 4 Oct 2016 15:58:21 -0400
>> Subject: [PATCH] gnu: Add hyperrogue.
>>
>> * gnu/packages/games.scm (hyperrogue): New variable.
>> ---
>>  gnu/packages/games.scm | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 86 insertions(+)
>>
>> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
>> index cd5cf6f..5d61487 100644
>> --- a/gnu/packages/games.scm
>> +++ b/gnu/packages/games.scm
>> @@ -2896,3 +2896,89 @@ extinguishing action, intense boss battles, a catchy soundtrack and lots of
>>  throwing people around in pseudo-randomly generated buildings.")
>>      (license (list license:zlib             ; for source code
>>                     license:cc-by-sa3.0))))  ; for graphics and music assets
>> +
>> +(define-public hyperrogue
>> +  (package
>> +    (name "hyperrogue")
>> +    (version "8.3j")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append
>> +                    "http://www.roguetemple.com/z/hyper/"
>> +                    name "-83j.zip"))
>> +              (sha256
>> +               (base32
>> +                "1ag95d84m4j0rqyn9hj7655znixw2j57bpf93nk14nfy02xz1g6p"))
>> +              (modules '((guix build utils)))
>> +              ;; remove .exe and .dll files
>
> Rather:          ;; Remove .exe and .dll files.
>
>> +              (snippet
>> +               '(for-each delete-file (find-files "." "\\.(exe|dll)$")))))
>> +    (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
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (setenv "CPATH"
>> +                     (string-append (assoc-ref inputs "sdl-union")
>> +                                    "/include/SDL"))))
>> +         ;; 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/")))))
>> +             #t))
>> +         (replace 'install
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             (let* ((out (assoc-ref outputs "out"))
>> +                    (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)))))
>> +    (inputs
>> +     `(("font-dejavu" ,font-dejavu)
>> +       ("glew" ,glew)
>> +       ("libpng" ,libpng)
>> +       ("sdl-union" ,(sdl-union (list sdl
>> +                                      sdl-gfx
>> +                                      sdl-mixer
>> +                                      sdl-ttf)))))
>> +    (home-page "http://www.roguetemple.com/z/hyper/")
>> +    (synopsis "Non-euclidean graphical rogue-like game")
>> +    (description
>> +     "HyperRogue is a game in which the player collects treasures and fights
>> +monsters -- rogue-like but for the fact that it is played on the hyperbolic
>> +plane and not in euclidean space.
>> +
>> +In HyperRogue, the player can move through different parts of the
>> world, which
>> +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:gpl2+))))     ; remaining files

Corrected and pushed as cd1869cdbda5538fb47b4690126d24a9dae3f7ba!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-05 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-03 23:15 [PATCH] gnu: Add hyperrogue Kei Kebreau
2016-10-04 15:56 ` Alex Kost
2016-10-04 20:01   ` Kei Kebreau
2016-10-05  8:04     ` Alex Kost
2016-10-05 14:11       ` Kei Kebreau

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).