From patchwork Wed Apr 24 16:57:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Goaziou X-Patchwork-Id: 13743 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1655B16F10; Wed, 24 Apr 2019 18:01:37 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 471D616F0D for ; Wed, 24 Apr 2019 18:01:36 +0100 (BST) Received: from localhost ([127.0.0.1]:44617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJLH5-00087z-MD for patchwork@mira.cbaines.net; Wed, 24 Apr 2019 13:01:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJLDg-0005S5-Df for guix-patches@gnu.org; Wed, 24 Apr 2019 12:58:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJLDe-0007G0-DV for guix-patches@gnu.org; Wed, 24 Apr 2019 12:58:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42824) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJLDe-0007Fa-6x for guix-patches@gnu.org; Wed, 24 Apr 2019 12:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hJLDe-00015k-3f for guix-patches@gnu.org; Wed, 24 Apr 2019 12:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35411] [PATCH] Add hedgewars Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Apr 2019 16:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35411 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ricardo Wurmus Received: via spool by 35411-submit@debbugs.gnu.org id=B35411.15561250524158 (code B ref 35411); Wed, 24 Apr 2019 16:58:02 +0000 Received: (at 35411) by debbugs.gnu.org; 24 Apr 2019 16:57:32 +0000 Received: from localhost ([127.0.0.1]:56365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJLD8-00014y-L0 for submit@debbugs.gnu.org; Wed, 24 Apr 2019 12:57:31 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:54783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJLD6-00014o-6Q for 35411@debbugs.gnu.org; Wed, 24 Apr 2019 12:57:29 -0400 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 0FDF920002; Wed, 24 Apr 2019 16:57:25 +0000 (UTC) From: Nicolas Goaziou References: <87y33zrfyu.fsf@nicolasgoaziou.fr> <87mukf65wr.fsf@elephly.net> <87sgu7r5ca.fsf@nicolasgoaziou.fr> <87k1fj5t0y.fsf@elephly.net> Date: Wed, 24 Apr 2019 18:57:24 +0200 In-Reply-To: <87k1fj5t0y.fsf@elephly.net> (Ricardo Wurmus's message of "Wed, 24 Apr 2019 17:20:45 +0200") Message-ID: <87o94vqr2j.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 35411@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello again, Ricardo Wurmus 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, From 65c3d7de785821a1aaf4928fa9827cea0ce3d88d Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou 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