[PATCH] gnu: Add mangband.

  • Open
  • quality assurance status badge
Details
2 participants
  • Nicolas Goaziou
  • Adam Kandur
Owner
unassigned
Submitted by
Adam Kandur
Severity
normal
A
A
Adam Kandur wrote on 8 Mar 2021 00:07
(name . Guix Patches)(address . guix-patches@gnu.org)
MVDwVnt--3-2@tuta.io
master 921bea8c76a52d10091585f3f4ebf0b950c9b758
Author:     Adam Kandur <rndd@tuta.io>
AuthorDate: Mon Mar 8 02:03:00 2021 +0300
Commit:     Adam Kandur <rndd@tuta.io>
CommitDate: Mon Mar 8 02:03:00 2021 +0300

Parent:     76c32fcab4 gnu: nimf: Disable qt4 support.
Merged:     master
Contained:  master
Follows:    bootstrap-20190815 (28240)

gnu: Add mangband.

* gnu/packages/games.scm (mangband): New variable.

1 file changed, 30 insertions(+)
gnu/packages/games.scm | 30 ++++++++++++++++++++++++++++++

modified   gnu/packages/games.scm
@@ -2952,6 +2952,36 @@ the depths below Angband, seeking riches, fighting monsters, and preparing to
 fight Morgoth, the Lord of Darkness.")
     (license license:gpl2)))
 
+(define-public mangband
+  (package
+    (name "mangband")
+    (version "v1.5.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+         (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1m7fixv0cbcdzrvxqrjs3jfpzkhq2aj3zip3y67w38a3fbhwdq1k"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("ncurses" ,ncurses)
+       ("sdl2" ,sdl2)
+       ("automake", automake)
+       ("autoconf", autoconf)))
+    (synopsis "A free online multi-player realtime roguelike game based on Angband.")
+    (description "To win the game you must build up a character, selected from any one
+of 10 races and 6 classes, to be powerful enough to defeat Morgoth, Lord of Darkness,
+who lives in the dungeon 5000 feet below the surface of the town.  As you work towards
+this near-impossible goal, you will chart unexplored dungeon passageways,
+do battle with legendary creatures, and find lost artifacts.  And of course
+throughout your journeys you will encounter many
+other adventurers -- whether they be friend or foe is up to you to decide!")
+    (license license:expat)))
+
 (define-public pingus
   (package
     (name "pingus")
N
N
Nicolas Goaziou wrote on 13 Mar 2021 12:05
(name . Adam Kandur via Guix-patches via)(address . guix-patches@gnu.org)
875z1vz542.fsf@nicolasgoaziou.fr
Hello,

Adam Kandur via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (4 lines)
> gnu: Add mangband.
>
> * gnu/packages/games.scm (mangband): New variable.

Thank you. Some comments follow.

Toggle quote (8 lines)
> 1 file changed, 30 insertions(+)
> gnu/packages/games.scm | 30 ++++++++++++++++++++++++++++++
>
> modified   gnu/packages/games.scm
> @@ -2952,6 +2952,36 @@ the depths below Angband, seeking riches, fighting monsters, and preparing to
>  fight Morgoth, the Lord of Darkness.")
>      (license license:gpl2)))

Something is wrong with your indentation, as there are nbsp inserted
throughout your patch.

I couldn't also apply your patch cleanly. Did you try using git
format-patch?

Toggle quote (5 lines)
> +(define-public mangband
> +  (package
> +    (name "mangband")
> +    (version "v1.5.3")

Version should be "1.5.3", the "v" is prepended in the commit.

Toggle quote (14 lines)
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +         (url "https://github.com/mangband/mangband")
> +         (commit version)))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "1m7fixv0cbcdzrvxqrjs3jfpzkhq2aj3zip3y67w38a3fbhwdq1k"))))
> +    (build-system gnu-build-system)
> +    (inputs
> +     `(("ncurses" ,ncurses)
> +       ("sdl2" ,sdl2)

I don't think this is sufficient, MAngband also looks for sdl2-image and
sdl2-ttf.

Toggle quote (3 lines)
> +       ("automake", automake)
> +       ("autoconf", autoconf)))

automake and autoconf belong to native-inputs, not inputs. Also, inputs
ought to be sorted alphabetically (nitpick).

Toggle quote (2 lines)
The home page is https://www.mangband.org

Toggle quote (2 lines)
> +    (synopsis "A free online multi-player realtime roguelike game based on Angband.")

Synopsis must not start with an article, and "free" should be removed as
everything in Guix is free. There is no final full stop either in
a synopsis.

You may want to run guix lint mangband to catch some common errors.

Toggle quote (2 lines)
> +    (license license:expat)))

I think this is more complex than that. Looking at the COPYING file,
there's also, at least, public-domain and bsd-2 involved.

But, more importantly, I couldn't make this game work. Running
mangclient fails with a segmentation error, while running mangband fails
with the following fatal error: "Cannot create the
'/gnu/store/…-mangband-1.5.3/var/mangband/data/scores.raw' file!"

Could you look into it. I paste here my "improved" version of the
package definition, if that helps.

Toggle snippet (46 lines)
(define-public mangband
(package
(name "mangband")
(version "1.5.3")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/mangband/mangband")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "1m7fixv0cbcdzrvxqrjs3jfpzkhq2aj3zip3y67w38a3fbhwdq1k"))))
(build-system gnu-build-system)
(arguments
`(#: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/SDL2:"
(or (getenv "CPATH") "")))
#t)))))
(native-inputs
`(("autoconf", autoconf)
("automake", automake)))
(inputs
`(("ncurses" ,ncurses)
("sdl-union" ,(sdl-union (list sdl2 sdl2-image sdl2-ttf)))))
(home-page "https://www.mangband.org")
(synopsis "Online multi-player realtime roguelike game based on Angband")
(description
"MAngband is a free online multiplayer real-time roguelike game, derived
from the single player game Angband.

To win the game you must build up a character, selected from any one of 10
races and 6 classes, to be powerful enough to defeat Morgoth, Lord of
Darkness, who lives in the dungeon 5000 feet below the surface of the town.
As you work towards this near-impossible goal, you will chart unexplored
dungeon passageways, do battle with legendary creatures, and find lost
artifacts. And of course throughout your journeys you will encounter many
other adventurers -- whether they be friend or foe is up to you to decide!")
(license (list license:expat license:bsd-2 license:public-domain))))

Regards,
--
Nicolas Goaziou
?