GNU bug report logs - #35411
[PATCH] Add hedgewars

Previous Next

Package: guix-patches;

Reported by: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Date: Wed, 24 Apr 2019 08:14:02 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

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 35411 in the body.
You can then email your comments to 35411 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#35411; Package guix-patches. (Wed, 24 Apr 2019 08:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 24 Apr 2019 08:14:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add hedgewars
Date: Wed, 24 Apr 2019 09:59:37 +0200
[Message part 1 (text/plain, inline)]
Hello,

The following patch adds hedgewars game. It requires sdl2-net package,
which I submitted in a pending patch (see bug#35391).

Feedback welcome.

Regards,

-- 
Nicolas Goaziou
[0001-gnu-Add-hedgewars.patch (text/x-diff, inline)]
From f17328d8810b31653f3007bb4a4950822328a2e5 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Date: Wed, 24 Apr 2019 09:52:52 +0200
Subject: [PATCH] gnu: Add hedgewars.

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index da917e2870..d51ecc60fa 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -6998,3 +6998,107 @@ pursue their favorite interesting flight simulation idea, and last but
 certainly not least as a fun, realistic, and challenging desktop flight
 simulator.")
     (license license:gpl2+)))
+
+(define-public hedgewars
+  (package
+    (name "hedgewars")
+    (version "0.9.25")
+    (source (origin
+              (method hg-fetch)
+              (uri (hg-reference
+                    (url "https://hg.hedgewars.org/hedgewars/")
+                    (changeset (string-append version "-release"))))
+              (file-name (string-append name "-" version "-checkout"))
+              (sha256
+               (base32
+                "00rckhalhw596x7zpb7rwg9663019xbg1zafcxfnj4x3dg435rl5"))))
+    (build-system cmake-build-system)
+    (arguments
+     ;; XXX: Engine is written as Pascal source code, requiring Free Pascal
+     ;; Compiler, which we haven't packaged yet.  With the flag below, we use
+     ;; a Pascal to C translator and Clang instead.
+     `(#:configure-flags (list "-DBUILD_ENGINE_C=ON")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'remove-failing-test
+           ;; XXX: Remove single failing test.
+           (lambda _
+             (delete-file "tests/lua/staticmines.lua")
+             #t))
+         (add-after 'unpack 'fix-compiler
+           ;; XXX: Flag BUILD_ENGINE_C, as set above, implies using Clang to
+           ;; compile files.  However, using `clang' globally leads to the
+           ;; following issue:
+           ;; "qtbase-5.11.3/include/qt5/QtCore/qglobal.h:45:12: fatal error:
+           ;; 'type_traits' file not found".
+           ;;
+           ;; Therefore, we make sure to use `c++' everywhere but in the
+           ;; engine.
+           (lambda _
+             (substitute* "project_files/hwc/CMakeLists.txt"
+               (("find_package\\(SDL2_ttf 2 REQUIRED\\)" all)
+                (string-append all "\n"
+                               "set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})\n"
+                               "set(CMAKE_CXX_COMPILER ${CLANG_EXECUTABLE})")))
+             (substitute* "CMakeLists.txt"
+               (("set\\(CMAKE_C(XX)?_COMPILER \\$\\{CLANG_EXECUTABLE\\}\\)") ""))
+             #t))
+         (replace 'check
+           (lambda _
+             (invoke "ctest"))))))
+    (inputs
+     `(("clang" ,clang)
+       ("ffmpeg" ,ffmpeg)
+       ("freeglut" ,freeglut)
+       ("ghc" ,ghc)
+       ("ghc-entropy" ,ghc-entropy)
+       ("ghc-hslogger" ,ghc-hslogger)
+       ("ghc-network" ,ghc-network)
+       ("ghc-random" ,ghc-random)
+       ("ghc-regex-tdfa" ,ghc-regex-tdfa)
+       ("ghc-sandi" ,ghc-sandi)
+       ("ghc-sha" ,ghc-sha)
+       ("ghc-utf8-string" ,ghc-utf8-string)
+       ("ghc-vector" ,ghc-vector)
+       ("ghc-zlib" ,ghc-zlib)
+       ("glew" ,glew)
+       ("libpng" ,libpng)
+       ("lua" ,lua-5.1)
+       ("physfs" ,physfs)
+       ("qtbase" ,qtbase)
+       ("sdl" ,(sdl-union
+                (list sdl2 sdl2-mixer sdl2-net sdl2-ttf sdl2-image)))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("qttools" ,qttools)))
+    (home-page "https://hedgewars.org/")
+    (synopsis "Funny turn-based artillery game, featuring fighting hedgehogs!")
+    (description
+     "Each player controls a team of several hedgehogs.  During the course of
+the game, players take turns with one of their hedgehogs.  They then use
+whatever tools and weapons are available to attack and kill the opponents'
+hedgehogs, thereby winning the game.
+
+Hedgehogs may move around the terrain in a variety of ways, normally by
+walking and jumping but also by using particular tools such as the ``Rope'' or
+``Parachute'', to move to otherwise inaccessible areas.  Each turn is
+time-limited to ensure that players do not hold up the game with excessive
+thinking or moving.  A large variety of tools and weapons are available for
+players during the game: Grenade, Cluster Bomb, Bazooka, UFO, Homing Bee,
+Shotgun, Desert Eagle, Fire Punch, Baseball Bat, Dynamite, Mine, Rope,
+Pneumatic pick, Parachute.  Most weapons, when used, cause explosions that
+deform the terrain, removing circular chunks.
+
+The landscape is an island floating on a body of water, or a restricted cave
+with water at the bottom.  A hedgehog dies when it enters the water (either by
+falling off the island, or through a hole in the bottom of it), it is thrown
+off either side of the arena or when its health is reduced, typically from
+contact with explosions, to zero (the damage dealt to the attacked hedgehog or
+hedgehogs after a player's or CPU turn is shown only when all movement on the
+battlefield has ceased).")
+    ;; Software as a whole is licensed under GPL-2 terms.  Artwork and
+    ;; scripts are distributed under various terms.
+    (license (list license:gpl2
+                   license:bsd-2 license:bsd-3 license:cc-by3.0 license:cc0
+                   license:expat license:fdl-1.3+ license:public-domain
+                   license:zlib))))
-- 
2.21.0


Information forwarded to guix-patches <at> gnu.org:
bug#35411; Package guix-patches. (Wed, 24 Apr 2019 10:44:02 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 35411 <at> debbugs.gnu.org
Subject: Re: [bug#35411] [PATCH] Add hedgewars
Date: Wed, 24 Apr 2019 12:42:28 +0200
Hi Nicolas,

> The following patch adds hedgewars game. It requires sdl2-net package,
> which I submitted in a pending patch (see bug#35391).

Thank you.

> +     ;; XXX: Engine is written as Pascal source code, requiring Free Pascal
> +     ;; Compiler, which we haven't packaged yet.  With the flag below, we use
> +     ;; a Pascal to C translator and Clang instead.

I tried to package Free Pascal a long time ago, but the compiler is
written in Pascal and the GNU Pascal compiler which I tried to use for
bootstrapping could not be built…

What is this Pascal to C translator?  Does this mean that we’re using
generated C files here?

--
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#35411; Package guix-patches. (Wed, 24 Apr 2019 11:50:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 35411 <at> debbugs.gnu.org
Subject: Re: [bug#35411] [PATCH] Add hedgewars
Date: Wed, 24 Apr 2019 13:49:09 +0200
Hello,

Ricardo Wurmus <rekado <at> elephly.net> writes:

>> +     ;; XXX: Engine is written as Pascal source code, requiring Free Pascal
>> +     ;; Compiler, which we haven't packaged yet.  With the flag below, we use
>> +     ;; a Pascal to C translator and Clang instead.
>
> I tried to package Free Pascal a long time ago, but the compiler is
> written in Pascal and the GNU Pascal compiler which I tried to use for
> bootstrapping could not be built…

Ditto. According to http://www.stack.nl/~marcov/buildfaq.pdf (section
1.2.5), bootstrapping from source is vain.

> What is this Pascal to C translator?  Does this mean that we’re using
> generated C files here?

It is a Haskell program, named pas2c, bundled with hedgewars. See
<https://hg.hedgewars.org/hedgewars/file/tip/tools/pas2c>. AFAIU, it
turns ".pas" files into ".c", and the build process compiles those. IOW,
it looks good enough.

Regards,

-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#35411; Package guix-patches. (Wed, 24 Apr 2019 15:23:01 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 35411 <at> debbugs.gnu.org
Subject: Re: [bug#35411] [PATCH] Add hedgewars
Date: Wed, 24 Apr 2019 17:20:45 +0200
Hi Nicolas,

>> What is this Pascal to C translator?  Does this mean that we’re using
>> generated C files here?
>
> It is a Haskell program, named pas2c, bundled with hedgewars. See
> <https://hg.hedgewars.org/hedgewars/file/tip/tools/pas2c>. AFAIU, it
> turns ".pas" files into ".c", and the build process compiles those. IOW,
> it looks good enough.

Oh neat, this is great!

Let me go through the rest of the patch:

> +(define-public hedgewars
> +  (package
> +    (name "hedgewars")
> +    (version "0.9.25")
> +    (source (origin
> +              (method hg-fetch)
> +              (uri (hg-reference
> +                    (url "https://hg.hedgewars.org/hedgewars/")
> +                    (changeset (string-append version "-release"))))

Is there no release tarball?

[…]

> +         (add-after 'unpack 'remove-failing-test
> +           ;; XXX: Remove single failing test.
> +           (lambda _
> +             (delete-file "tests/lua/staticmines.lua")
> +             #t))

Do you know why it fails?  Is this an upstream problem or likely
something to do with Guix?

> +         (add-after 'unpack 'fix-compiler
> +           ;; XXX: Flag BUILD_ENGINE_C, as set above, implies using Clang to
> +           ;; compile files.  However, using `clang' globally leads to the
> +           ;; following issue:
> +           ;; "qtbase-5.11.3/include/qt5/QtCore/qglobal.h:45:12: fatal error:
> +           ;; 'type_traits' file not found".

Is it really necessary to compile with Clang at all?  What happens if
you compile with GCC?

> +    (inputs
> +     `(("clang" ,clang)

Is this not actually a native input?

> +       ("ffmpeg" ,ffmpeg)
> +       ("freeglut" ,freeglut)
> +       ("ghc" ,ghc)

I think this also might be a native input.

> +    (synopsis "Funny turn-based artillery game, featuring fighting hedgehogs!")

Please remove the final exclamation point and the comma.  Maybe remove
“Funny” because that’s subjective, but feel free to ignore me.

> +     "Each player controls a team of several hedgehogs.  During the course of
> +the game, players take turns with one of their hedgehogs.  They then use
> +whatever tools and weapons are available to attack and kill the opponents'
> +hedgehogs, thereby winning the game.
> +
> +Hedgehogs may move around the terrain in a variety of ways, normally by
> +walking and jumping but also by using particular tools such as the ``Rope'' or
> +``Parachute'', to move to otherwise inaccessible areas.  Each turn is
> +time-limited to ensure that players do not hold up the game with excessive
> +thinking or moving.  A large variety of tools and weapons are available for
> +players during the game: Grenade, Cluster Bomb, Bazooka, UFO, Homing Bee,
> +Shotgun, Desert Eagle, Fire Punch, Baseball Bat, Dynamite, Mine, Rope,
> +Pneumatic pick, Parachute.  Most weapons, when used, cause explosions that
> +deform the terrain, removing circular chunks.
> +
> +The landscape is an island floating on a body of water, or a restricted cave
> +with water at the bottom.  A hedgehog dies when it enters the water (either by
> +falling off the island, or through a hole in the bottom of it), it is thrown
> +off either side of the arena or when its health is reduced, typically from
> +contact with explosions, to zero (the damage dealt to the attacked hedgehog or
> +hedgehogs after a player's or CPU turn is shown only when all movement on the
> +battlefield has ceased).")

The description is a bit long.  We don’t need a list of weapons or the
rules of the game (“dies when it enters the water”).  Could you try to
shorten it and make sure that the first sentence describes what this is
all about?

Thanks for packaging it!

--
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#35411; Package guix-patches. (Wed, 24 Apr 2019 16:58:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 35411 <at> debbugs.gnu.org
Subject: Re: [bug#35411] [PATCH] Add hedgewars
Date: Wed, 24 Apr 2019 18:57:24 +0200
[Message part 1 (text/plain, inline)]
Hello again,

Ricardo Wurmus <rekado <at> elephly.net> writes:

>> +    (source (origin
>> +              (method hg-fetch)
>> +              (uri (hg-reference
>> +                    (url "https://hg.hedgewars.org/hedgewars/")
>> +                    (changeset (string-append version "-release"))))
>
> Is there no release tarball?

Oops. There is! I missed it the first time I looked at the tarballs, and
thought they only provided binaries and pointed to distributions
packages. Well, anyway, here it is.

>> +         (add-after 'unpack 'remove-failing-test
>> +           ;; XXX: Remove single failing test.
>> +           (lambda _
>> +             (delete-file "tests/lua/staticmines.lua")
>> +             #t))
>
> Do you know why it fails?  Is this an upstream problem or likely
> something to do with Guix?

I tried to make the tests more verbose, but I didn't succeed. Note that
it is a test in a "non-critical" directory. I assume this failure is
expected, somehow.
>
>> +         (add-after 'unpack 'fix-compiler
>> +           ;; XXX: Flag BUILD_ENGINE_C, as set above, implies using Clang to
>> +           ;; compile files.  However, using `clang' globally leads to the
>> +           ;; following issue:
>> +           ;; "qtbase-5.11.3/include/qt5/QtCore/qglobal.h:45:12: fatal error:
>> +           ;; 'type_traits' file not found".
>
> Is it really necessary to compile with Clang at all?  What happens if
> you compile with GCC?

The configure script yells at me as Clang is missing. If I eschew the
check in the CMakeLists.txt file, compilation halts with an error. Long
story short, I don't think we can build it without both clang and gcc.
>
>> +    (inputs
>> +     `(("clang" ,clang)
>
> Is this not actually a native input?

Indeed.

>> +       ("ghc" ,ghc)
>
> I think this also might be a native input.

OK.

>> +    (synopsis "Funny turn-based artillery game, featuring fighting hedgehogs!")
>
> Please remove the final exclamation point and the comma.  Maybe remove
> “Funny” because that’s subjective, but feel free to ignore me.

OK. I simply copied the description from the FSF directory.

> The description is a bit long.  We don’t need a list of weapons or the
> rules of the game (“dies when it enters the water”).  Could you try to
> shorten it and make sure that the first sentence describes what this is
> all about?

OK. Here is an update, taken from FSF directory. I also fixed a typo in
a license. Let me know if it is better now.

> Thanks for packaging it!

Thank you for the review.

Regards,

-- 
Nicolas Goaziou
[0001-gnu-Add-hedgewars.patch (text/x-diff, inline)]
From 65c3d7de785821a1aaf4928fa9827cea0ce3d88d Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Date: Wed, 24 Apr 2019 09:52:52 +0200
Subject: [PATCH] gnu: Add hedgewars.

* gnu/packages/games.scm (hedgewars): 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 da917e2870..435c440d7b 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -6998,3 +6998,89 @@ pursue their favorite interesting flight simulation idea, and last but
 certainly not least as a fun, realistic, and challenging desktop flight
 simulator.")
     (license license:gpl2+)))
+
+(define-public hedgewars
+  (package
+    (name "hedgewars")
+    (version "0.9.25")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://www.hedgewars.org/download/releases/"
+                                  "hedgewars-src-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "08x7fqpy0hpnbfq2k06g522xayi7s53bca819zfhalvqnqs76pdk"))))
+    (build-system cmake-build-system)
+    (arguments
+     ;; XXX: Engine is built as Pascal source code, requiring Free Pascal
+     ;; Compiler, which we haven't packaged yet.  With the flag below, we use
+     ;; a Pascal to C translator and Clang instead.
+     `(#:configure-flags (list "-DBUILD_ENGINE_C=ON")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'remove-failing-test
+           ;; XXX: Remove single failing test.  Note: it is marked
+           ;; a "non-critical" test.
+           (lambda _
+             (delete-file-recursively "tests/lua_noncritical")
+             #t))
+         (add-after 'unpack 'fix-compiler
+           ;; XXX: Flag BUILD_ENGINE_C, as set above, implies using Clang to
+           ;; compile files.  However, using `clang' globally leads to the
+           ;; error: qtbase-5.11.3/include/qt5/QtCore/qglobal.h:45:12: fatal
+           ;; error: 'type_traits' file not found.
+           ;;
+           ;; Therefore, we make sure to use `c++' everywhere but in the
+           ;; engine.
+           (lambda _
+             (substitute* "project_files/hwc/CMakeLists.txt"
+               (("find_package\\(SDL2_ttf 2 REQUIRED\\)" all)
+                (string-append all "\n"
+                               "set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})\n"
+                               "set(CMAKE_CXX_COMPILER ${CLANG_EXECUTABLE})")))
+             (substitute* "CMakeLists.txt"
+               (("set\\(CMAKE_C(XX)?_COMPILER" all) (string-append "#" all)))
+             #t))
+         (replace 'check
+           (lambda _
+             (invoke "ctest"))))))
+    (inputs
+     `(("ffmpeg" ,ffmpeg)
+       ("freeglut" ,freeglut)
+       ("ghc-entropy" ,ghc-entropy)
+       ("ghc-hslogger" ,ghc-hslogger)
+       ("ghc-network" ,ghc-network)
+       ("ghc-random" ,ghc-random)
+       ("ghc-regex-tdfa" ,ghc-regex-tdfa)
+       ("ghc-sandi" ,ghc-sandi)
+       ("ghc-sha" ,ghc-sha)
+       ("ghc-utf8-string" ,ghc-utf8-string)
+       ("ghc-vector" ,ghc-vector)
+       ("ghc-zlib" ,ghc-zlib)
+       ("glew" ,glew)
+       ("libpng" ,libpng)
+       ("lua" ,lua-5.1)
+       ("physfs" ,physfs)
+       ("qtbase" ,qtbase)
+       ("sdl" ,(sdl-union
+                (list sdl2 sdl2-mixer sdl2-net sdl2-ttf sdl2-image)))))
+    (native-inputs
+     `(("clang" ,clang)
+       ("ghc" ,ghc)
+       ("pkg-config" ,pkg-config)
+       ("qttools" ,qttools)))
+    (home-page "https://hedgewars.org/")
+    (synopsis "Turn-based artillery game featuring fighting hedgehogs")
+    (description
+     "Hedgewars is a turn based strategy, artillery, action and comedy game,
+featuring the antics of pink hedgehogs with attitude as they battle from the
+depths of hell to the depths of space.
+
+As commander, it's your job to assemble your crack team of hedgehog soldiers
+and bring the war to your enemy.")
+    ;; Software as a whole is licensed under GPL-2 terms.  Artwork and
+    ;; scripts are distributed under various terms.
+    (license (list license:gpl2
+                   license:bsd-2 license:bsd-3 license:cc-by3.0 license:cc0
+                   license:expat license:fdl1.3+ license:public-domain
+                   license:zlib))))
-- 
2.21.0


Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Mon, 29 Apr 2019 12:46:02 GMT) Full text and rfc822 format available.

Notification sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
bug acknowledged by developer. (Mon, 29 Apr 2019 12:46:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: 35411-done <at> debbugs.gnu.org
Subject: [PATCH] Add hedgewars
Date: Mon, 29 Apr 2019 14:45:29 +0200
Pushed as a3d4a631fed40c2ddfe41a700dde287458669ca4.

Thank you.

Regards,

-- 
Nicolas Goaziou




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

This bug report was last modified 4 years and 306 days ago.

Previous Next


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