guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 1cf5b5ce74e114aaa2413b5c4897099843944938
Author: Hugo Buddelmeijer <[email protected]>
AuthorDate: Fri Jun 5 09:57:02 2026 +0200

    gnu: manaplus: Fix build.
    
    * gnu/packages/games.scm (manaplus): Fix build.
    [source]: Switch to git-fetch.
    [arguments]<#:configure-flags>: Add "CXXFLAGS=-std=c++98" and
    "--enable-unittests".
    <#:phases>: Add fix-libxml-and-time and set-home phase.
    [native-inputs]: Add autoconf, automake, and gettext-minimal.
    [license]: Switch to cc-by-sa3 where appropriate.
    
    Merges guix/guix!9056
    Fixes: guix/guix#9107
    
    Signed-off-by: Cayetano Santos <[email protected]>
---
 gnu/packages/games.scm | 48 ++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 40 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 6db0168ccf..000e1f2007 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -5937,19 +5937,51 @@ on the screen and keyboard to display letters.")
     (version "2.1.3.17")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://repo.manaplus.org/manaplus/download/";
-             version "/manaplus-" version ".tar.xz"))
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://gitlab.com/manaplus/manaplus.git";)
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "0ggswsa3xq7lss3j4k7fyzn56sw7hlrwk744i3d9w0n4932nmlg8"))))
+        (base32 "1b1mgj6pdccjhb3hvlag3ia1phkzndd7cmw053aqs2480bcpswsm"))))
     (build-system gnu-build-system)
     (arguments
      (list
       #:configure-flags
-      #~(list "--with-sdl2")))
+      #~(list "--with-sdl2"
+              "--enable-unittests"
+              ;; Standards c++0x or greater set GXX_EXPERIMENTAL_CXX0X which
+              ;; causes stdint.h not to be included.
+              "CXXFLAGS=-std=c++98")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'configure 'fix-libxml-and-time
+            (lambda _
+              ;; Fix libxml2 migration.
+              ;; See <https://gitlab.com/manaplus/manaplus/-/work_items/33>.
+              (substitute* (list "src/utils/dumplibs.cpp"
+                                 "src/unittests/utils/dumplibs.cc")
+                (("const char \\*\\*xmlVersion")
+                 "const char * const *xmlVersion")
+                (("__xmlParserVersion\\(\\)")
+                 "&xmlParserVersion"))
+              (substitute* "src/utils/xml/libxml.inc"
+                (("ifdef ENABLE_LIBXML")
+                 "ifdef ENABLE_LIBXML\n#include <libxml/parser.h>"))
+              ;; Include ctime when necessary.
+              ;; See  <https://gitlab.com/manaplus/manaplus/-/work_items/32>.
+              (substitute* (list "src/resources/wallpaper.cpp"
+                                 "src/progs/dyecmd/client.cpp")
+                (("include \"debug.h\"")
+                 "include \"debug.h\"\n#include <ctime>"))))
+          (add-before 'check 'set-home
+            (lambda _
+              (setenv "HOME" (getcwd)))))))
     (native-inputs
-     (list pkg-config))
+     (list autoconf
+           automake
+           gettext-minimal
+           pkg-config))
     (inputs
      (list curl
            glu
@@ -5970,7 +6002,7 @@ world}, @uref{http://evolonline.org, Evol Online} and
     ;; "src/debug/*" and "src/sdl2gfx/*" are under Zlib.
     ;; "data/themes/{golden-delicious,jewelry}/*" are under CC-BY-SA.
     ;; The rest is under GPL2+.
-    (license (list license:gpl2+ license:zlib license:cc-by-sa4.0))))
+    (license (list license:gpl2+ license:zlib license:cc-by-sa3.0))))
 
 (define-public openttd-engine
   (package

Reply via email to