Subject: [PATCH] gnu: Add exult.
From: Tobias Geerinckx-Rice <[email-masked]>
To: [email-masked]
Date: Sun, 31 Jul 2022 12:46:35 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/games.scm (exult): New public variable.
---

Hi Guix,

This started as a series of ‘guix shell’ questions by ncbfg36 in #guix, and as those tend to turn into packages, especially when you're waiting for Dell firmware to decide how it's going to fail to boot in 2 minutes, here's one.

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index b00bff3e7b..f7b86ae3d5 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3909,6 +3909,70 @@ (define-public extremetuxracer
     (home-page "https://sourceforge.net/projects/extremetuxracer/")
     (license license:gpl2+)))
 
+(define-public exult
+  (package
+    (name "exult")
+    (version "1.8")
+    (source
+     (origin
+       ;; The release tarball isn't bootstrapped, and Git is more robust (SWH).
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/exult/exult")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1qfbkz05w8989vafc6dvw1wmdi1mvkr4kkgk3ccixadf4616kcb3"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:configure-flags
+           #~(list "--enable-shared"
+                   "--disable-static"
+                   "--enable-lto"
+                   "--enable-exult-studio"
+                   "--enable-exult-studio-support"
+                   "--enable-compiler"
+                   "--enable-mods"
+                   "--enable-gimp-plugin"
+                   ;; A few lines on stdout can save a lot of head-scratching:
+                   "CPPFLAGS=-DDEBUG_PATHS=1")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-game-home-directory
+                 (lambda _
+                   (substitute* "gamemgr/modmgr.cc"
+                     ;; EXULT_DATADIR is in the store where it's rather hard for
+                     ;; users to put game assets.  Use a more writable home by
+                     ;; default, which users can override in their ~/.exult.cfg.
+                     (("<GAMEHOME>")
+                      (string-append "<HOME>/.local/share/exult"))
+                     ;; …however, this causes a regression: the mods which we'll
+                     ;; install to EXULT_DATADIR are no longer found.  So: don't
+                     ;; look for mods alongside the assets by default.  This too
+                     ;; can be overridden in users' ~/.exult.cfg.
+                     (("game_path( \\+ \"/mods\")" _ +suffix)
+                      (string-append "get_system_path(\"<GAMEHOME>/\") + "
+                                     "cfgname" +suffix))))))))
+    (native-inputs
+     (list autoconf automake libtool pkg-config
+           ;; The following are needed only by the Usecode compiler.
+           bison flex))
+    (inputs
+     (list fluidsynth freetype libvorbis sdl2
+           ;; GTK is needed only by Exult Studio.
+           gtk+))
+    (synopsis "Role-playing game engine compatible with Ultima VII")
+    (description
+     "Exult is an Ultima 7 game engine that runs on modern operating systems.
+Ultima 7 (or Ultima VII) is a two-part @acronym{RPG, role-playing game} from the
+early 1990s.
+
+Exult is fully compatible with the original Ultima 7, but doesn't require any
+of its data files to be useful.  Explore entirely new game worlds---or create
+your own with the included game and map editor, Exult Studio.")
+    (home-page "http://exult.info/")
+    (license license:gpl2+)))
+
 (define-public supertuxkart
   (package
     (name "supertuxkart")
-- 
2.37.1