diff mbox series

[bug#40035] Add widelands game

Message ID 87o8t2gpqx.fsf@posteo.mx
State Accepted
Headers show
Series [bug#40035] Add widelands game | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Alberto EFG March 12, 2020, 4:29 a.m. UTC
Hello.

This is my first patch. I hope everything is correct, but I know there
might be some mistakes. Pleaste let me know.

 guix lint - I ran it and I think I have no errors now.
 guix size - Around 1.4 gb. I am not sure what to do
 guix refresh --list-dependent - Nothing is dependent

Building in my platform (x86_64) works 

Building with qemu -
    armhf   - not working
    aarch64 - working
    i68     - working
    x86_64  - working

Comments

Nicolas Goaziou March 12, 2020, 2:31 p.m. UTC | #1
Hello,

Alberto EFG <albertoefg@posteo.mx> writes:

> This is my first patch.

Thank you, and congratulations!

> +(define-public widelands
> +  (let ((commit "d9513d413f2558f9ef6f033a7685bf9881fbdbb3")
> +	(revision "1"))

I suggest to add a comment explaining why we rely on a commit, and, if
that makes sense, why this particular one, e.g., "No official release."

> +    (package
> +     (name "widelands")
> +     (version (git-version "20" revision commit))

Where is this "20" coming from?

> +     (source (origin

Nitpick: I suggest to move `origin' to a line on its own.

> +     (arguments
> +      `(#:tests? #f

Why are the tests disabled? We usually provide a comment when disabling
tests.

> +	#:configure-flags
> +	(let* ((out (assoc-ref %outputs "out"))
> +	       (share (string-append out "/share")))
> +	  (list    "-DCMAKE_BUILD_TYPE=Release"
> +		   (string-append "-DCMAKE_INSTALL_PREFIX=" out "/bin")
> +		   (string-append "-DWL_INSTALL_BASEDIR=" share "/widelands")
> +		   (string-append "-DWL_INSTALL_DATADIR=" share "/widelands")
> +		   "-DOPTION_BUILD_WEBSITE_TOOLS=OFF"))))
> +     (inputs
> +      `(("sdl" ,(sdl-union (list sdl2
> +				 sdl2-image
> +				 sdl2-mixer
> +				 sdl2-ttf)))

Nitpick: all can go into a single line.

> +	("gettext" ,gettext-minimal)

This probably belongs to `native-inputs' not `inputs'.

> +        ("icu4c" ,icu4c)

Indentation is off here.

> +	("libpng" ,libpng)
> +	("zlib" ,zlib)
> +	("boost" ,boost)
> +	("python" ,python)

This one may also be a native input. Could you check?

> +	("glew" ,glew)))

Could you re-order inputs alphabetically?

> +     (synopsis "Real-time strategy game")

It is a bit terse. Debian uses the slightly more accurate:

  "Fantasy real-time strategy game"

Maybe it is worth mentioning. Or better, something like:

   "Fantasy real-time strategy game with singleplayer campaigns and multiplayer mode"

It could make sense since in the description I suggest below, there is
no reference to campaigns nor multiplayer.

> +     (description
> +      "Widelands is a free, open source real-time strategy game with

You can remove "free" and "open source". All is free in Guix!

> + singleplayer campaigns and a multiplayer mode.  The game was inspired
> + by Settlers II but has significantly more variety and depth to it.  ")

Mind the spurious spaces at the end.

Again, Debian uses:

    Widelands is a strategy game aiming for gameplay similar to Settlers II by
    BlueByte.

    In this game, you start out on a small piece of land with nothing more than
    a few of useful resources.  Using those, you can build yourself an empire
    with many thousands of inhabitants.  On your way towards this goal, you will
    have to build up an economic infrastructure, explore the lands around you
    and face enemies who are trying to rule the world just like you do.

Would it be better to use it?

> +     (home-page "https://www.widelands.org/")

Nitpick: home-page is usually located above synopsis. I don't know if
there's a strong rule about it, tho.

> +     (license license:gpl2+))))

You are missing out some licenses (CC-based) from the assets in the
game. Could you add them too?

Could you send an updated patch?

Regards,
ashish.is--- via Guix-patches" via June 19, 2020, 12:30 p.m. UTC | #2
Alberto,

Alberto EFG 写道:
>  guix size - Around 1.4 gb. I am not sure what to do

You don't need to do anything.  Games like these are expected to 
be biggish, and people tend not to mind because, well, they're 
games.

95% of people (if not more) who play widelands already have almost 
all of its dependencies installed already, for their desktop. 
‘guix size’ is the absolute worst case.

There are some large dependencies that probably aren't used by the 
game itself:

  $ guix graph --path widelands ghostscript-with-cups
  # read each newline as ‘depends on’:
  widelands@build20
  sdl-union@1.2.15
  sdl2@2.0.12
  fcitx@4.2.9.7
  gtk+@2.24.32
  cups@2.3.3
  cups-filters@1.27.4
  ghostscript-with-cups@9.52

but that's nothing you need to can fix in widelands itself.

>  guix refresh --list-dependent - Nothing is dependent

This command lists the number of other packages that depend on 
your package.  It's useful mainly for updates.

For a new package the number will always be 0 — unless you created 
a dependency yourself.  That would require modifying an existing 
package which you didn't do.

Kind regards,

T G-R
diff mbox series

Patch

From a58ad8525f0293abbc7fd0b93214c40940b7870b Mon Sep 17 00:00:00 2001
From: Alberto Eleuterio Flores Guerrero <barbanegra+guix@posteo.mx>
Date: Wed, 11 Mar 2020 21:50:14 -0600
Subject: [PATCH] gnu: Add widelands.

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 322e309591..020d31bb70 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -46,6 +46,7 @@ 
 ;;; Copyright © 2019, 2020 Timotej Lazar <timotej.lazar@araneo.si>
 ;;; Copyright © 2019 Josh Holland <josh@inv.alid.pw>
 ;;; Copyright © 2017, 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2020 Alberto Eleuterio Flores Guerrero <barbanegra+guix@posteo.mx>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -10157,3 +10158,48 @@  best human chess grandmasters.  It can be used with UCI-compatible GUIs like
 ChessX.")
     (home-page "https://stockfishchess.org/")
     (license license:gpl3+)))
+
+(define-public widelands
+  (let ((commit "d9513d413f2558f9ef6f033a7685bf9881fbdbb3")
+	(revision "1"))
+    (package
+     (name "widelands")
+     (version (git-version "20" revision commit))
+     (source (origin
+	      (method git-fetch)
+	      (uri (git-reference
+		    (url "https://github.com/widelands/widelands.git")
+		    (commit commit)))
+	      (file-name (git-file-name name version))
+	      (sha256
+	       (base32 "0rsm25kb60xfvib8xk2hcqbppcyjgaiax1rpxxn6vlwrx68nndqp"))))
+     (build-system cmake-build-system)
+     (arguments
+      `(#:tests? #f
+	#:configure-flags
+	(let* ((out (assoc-ref %outputs "out"))
+	       (share (string-append out "/share")))
+	  (list    "-DCMAKE_BUILD_TYPE=Release"
+		   (string-append "-DCMAKE_INSTALL_PREFIX=" out "/bin")
+		   (string-append "-DWL_INSTALL_BASEDIR=" share "/widelands")
+		   (string-append "-DWL_INSTALL_DATADIR=" share "/widelands")
+		   "-DOPTION_BUILD_WEBSITE_TOOLS=OFF"))))
+     (inputs
+      `(("sdl" ,(sdl-union (list sdl2
+				 sdl2-image
+				 sdl2-mixer
+				 sdl2-ttf)))
+	("gettext" ,gettext-minimal)
+        ("icu4c" ,icu4c)
+	("libpng" ,libpng)
+	("zlib" ,zlib)
+	("boost" ,boost)
+	("python" ,python)
+	("glew" ,glew)))
+     (synopsis "Real-time strategy game")
+     (description
+      "Widelands is a free, open source real-time strategy game with
+ singleplayer campaigns and a multiplayer mode.  The game was inspired
+ by Settlers II but has significantly more variety and depth to it.  ")
+     (home-page "https://www.widelands.org/")
+     (license license:gpl2+))))
-- 
2.25.1