gnu: catcodec: Use HTTPS home page URI.
[jackhill/guix/guix.git] / gnu / packages / game-development.scm
index febe15f..185f1be 100644 (file)
@@ -8,15 +8,18 @@
 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016, 2017, 2018 Julian Graham <joolean@gmail.com>
-;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
-;;; Copyright © 2019 Leo Prikler <leo.prikler@student.tugraz.at>
+;;; Copyright © 2019, 2020 Leo Prikler <leo.prikler@student.tugraz.at>
 ;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
+;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -35,6 +38,7 @@
 
 (define-module (gnu packages game-development)
   #:use-module (srfi srfi-1)
+  #:use-module (ice-9 match)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages m4)
+  #:use-module (gnu packages mono)
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages music)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages stb)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
 (define-public bullet
   (package
     (name "bullet")
-    (version "2.88")
+    (version "2.89")
     (source (origin
               (method git-fetch)
               (uri (git-reference
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "00qkif245yj7n2f262bgjaxv1bz3wmmcsfnjgy3qpzvlpzpns5z8"))
+                "10ncf2z474jnv7p5lv01ak2mk2hib3rj5rz1zr8v2v5pnciqbijl"))
               (modules '((guix build utils)))
               (snippet
                '(begin
                               '("Gwen" "clsocket" "enet" "glad" "imgui"
                                 "lua-5.2.3" "midi" "minizip" "openvr"
                                 "optionalX11" "serial" "zlib")))
-                  ;; These need files from ThirdPartyLibs
+                  ;; These need files from ThirdPartyLibs.
                   (substitute* "Extras/CMakeLists.txt"
-                    (("BulletRobotics") "")
-                    (("obj2sdf") ""))
-                  ;; Tests fail on linking, cannot find -lBussIK
+                    (("BulletRobotics") ""))
+                  ;; Tests fail on linking, cannot find -lBussIK.
                   (substitute* "test/CMakeLists.txt"
                     ((" InverseDynamics")
                      "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'remove-failing-tests
-           ;; These tests fail specifically after removing 3rd party code
+           ;; These tests fail specifically after removing 3rd party code.
            (lambda _
              (substitute* "test/SharedMemory/CMakeLists.txt"
                (("ADD_TEST") "# ADD_TEST"))
@@ -155,7 +163,7 @@ is used in some video games and movies.")
 (define-public deutex
   (package
    (name "deutex")
-   (version "5.2.0")
+   (version "5.2.1")
    (source (origin
             (method url-fetch)
             (uri (string-append "https://github.com/Doom-Utils/deutex"
@@ -163,7 +171,7 @@ is used in some video games and movies.")
                                 "deutex-" version ".tar.xz"))
             (sha256
              (base32
-              "1d536d3i78k4ch8mjg7lqnamnyfpp2x5x7mzx5smqi9ad8lb6hqz"))))
+              "07w3asqxx89wl2wfv1z3cak8v83h3ys3b39mq9qq4gyf3xdhs76n"))))
    (build-system gnu-build-system)
    (native-inputs `(("asciidoc" ,asciidoc)))
    (home-page "https://github.com/Doom-Utils/deutex")
@@ -248,15 +256,14 @@ necessary.
        (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
                            version "/catcodec-" version "-source.tar.xz"))
        (sha256
-        (base32
-         "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
+        (base32 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f ; no tests
        #:make-flags (list (string-append "prefix=" %output))
        #:phases (modify-phases %standard-phases
                   (delete 'configure))))
-    (home-page "http://dev.openttdcoop.org/projects/catcodec")
+    (home-page "https://dev.openttdcoop.org/projects/catcodec")
     (synopsis "Encode/decode OpenTTD sounds")
     (description "catcodec encodes and decodes sounds for OpenTTD.  These
 sounds are not much more than some metadata (description and filename) and raw
@@ -525,7 +532,7 @@ clone.")
        ("xcb-util-image" ,xcb-util-image)
        ("libxrandr" ,libxrandr)
        ("eudev" ,eudev)
-       ("libjpeg" ,libjpeg)
+       ("libjpeg" ,libjpeg-turbo)
        ("libsndfile" ,libsndfile)
        ("stb-image" ,stb-image)
        ("stb-image-write" ,stb-image-write)))
@@ -580,6 +587,34 @@ sounds from presets such as \"explosion\" or \"powerup\".")
     (home-page "http://www.drpetter.se/project_sfxr.html")
     (license license:expat)))
 
+(define-public surgescript
+  (package
+    (name "surgescript")
+    (version "0.5.4.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/alemart/surgescript.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "13q81439zg1bn7gskligskjgcfq0rdapp6f3llmrlk48vnyq49s0"))))
+     (build-system cmake-build-system)
+     (arguments
+      '(#:configure-flags
+        (let ((share (string-append (assoc-ref %outputs "out") "/share")))
+          (list (string-append "-DICON_PATH=" share "/pixmaps")
+                (string-append "-DMETAINFO_PATH=" share "/metainfo")))
+        #:tests? #f))
+     (home-page "https://docs.opensurge2d.org")
+     (synopsis "Scripting language for games")
+     (description "@code{SurgeScript} is a dynamically typed object-oriented
+scripting language designed for games.  Each object is a state machine that
+can be customized by attaching other objects.  The language supports automatic
+garbage collection and can be extended with plugins.")
+    (license license:asl2.0)))
+
 (define-public physfs
   (package
     (name "physfs")
@@ -721,7 +756,7 @@ package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
 multimedia programming.  It handles common, low-level tasks such as creating
 windows, accepting user input, loading data, drawing images, playing sounds,
 etc.")
-    (home-page "http://liballeg.org")
+    (home-page "https://liballeg.org")
     (license license:giftware)))
 
 (define-public allegro
@@ -744,7 +779,7 @@ etc.")
        ("freetype" ,freetype)
        ("glu" ,glu)
        ("gtk" ,gtk+-2)
-       ("libjpeg" ,libjpeg)
+       ("libjpeg" ,libjpeg-turbo)
        ("libpng" ,libpng)
        ("libtheora" ,libtheora)
        ("libvorbis" ,libvorbis)
@@ -762,7 +797,7 @@ etc.")
 multimedia programming.  It handles common, low-level tasks such as creating
 windows, accepting user input, loading data, drawing images, playing sounds,
 etc.")
-    (home-page "http://liballeg.org")
+    (home-page "https://liballeg.org")
     (license license:bsd-3)))
 
 (define-public allegro-5.0
@@ -826,7 +861,7 @@ etc.")
        ("curl" ,curl)
        ("freetype" ,freetype)
        ("giflib" ,giflib)
-       ("libjpeg" ,libjpeg)
+       ("libjpeg" ,libjpeg-turbo)
        ("libpng" ,libpng)
        ("libwebp" ,libwebp)
        ("libx11" ,libx11)
@@ -978,7 +1013,7 @@ interface (API).")
        ("sdl-mixer" ,sdl-mixer)
        ("sdl-ttf" ,sdl-ttf)
        ("sdl-gfx" ,sdl-gfx)
-       ("libjpeg" ,libjpeg)
+       ("libjpeg" ,libjpeg-turbo)
        ("libpng" ,libpng)
        ("libX11" ,libx11)
        ("libsmpeg" ,libsmpeg)
@@ -1084,39 +1119,31 @@ developed mainly for Ren'py.")
              (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
              #t))
          (replace 'build
-           (lambda args
-             (apply
-              (lambda* (build-root #:key inputs outputs #:allow-other-keys)
-                ;; The "module" subdirectory contains a python (really cython)
-                ;; project, which is built using a script, that is thankfully
-                ;; named "setup.py".
-                (chdir "module")
-                (apply (assoc-ref %standard-phases 'build) args)
-                ;; the above causes renpy.__init__ to be compiled but does not
-                ;; compile anything else, hence we do that here
-                (chdir build-root)
-                (delete-file "renpy/__init__.pyc")
-                (invoke "python" "-m" "compileall" "renpy"))
-              (getcwd) args)
+           (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
+             ;; The "module" subdirectory contains a python (really cython)
+             ;; project, which is built using a script, that is thankfully
+             ;; named "setup.py".
+             (with-directory-excursion "module"
+               (apply (assoc-ref %standard-phases 'build) args))
+             ;; the above causes renpy.__init__ to be compiled but does not
+             ;; compile anything else, hence we do that here
+             (delete-file "renpy/__init__.pyc")
+             (invoke "python" "-m" "compileall" "renpy")
              #t))
          (replace 'install
-           (lambda args
-             (apply
-              (lambda* (build-root #:key inputs outputs #:allow-other-keys)
-                ;; Again, we have to wrap the module installation.
-                ;; Additionally, we want to install the python code
-                ;; (both source and compiled) in the same directory.
-                (let* ((out (assoc-ref outputs "out"))
-                       (site (string-append "/lib/python"
-                                            ,(version-major+minor
-                                              (package-version python-2))
-                                            "/site-packages")))
-                  (chdir "module")
-                  (apply (assoc-ref %standard-phases 'install) args)
-                  (chdir build-root)
-                  (copy-recursively "renpy"
-                                    (string-append out site "/renpy"))))
-              (getcwd) args)
+           (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
+             ;; Again, we have to wrap the module installation.
+             ;; Additionally, we want to install the python code
+             ;; (both source and compiled) in the same directory.
+             (let* ((out (assoc-ref outputs "out"))
+                    (site (string-append "/lib/python"
+                                         ,(version-major+minor
+                                           (package-version python-2))
+                                         "/site-packages")))
+               (with-directory-excursion "module"
+                 (apply (assoc-ref %standard-phases 'install) args))
+               (copy-recursively "renpy"
+                                 (string-append out site "/renpy")))
              #t)))))
     (inputs
      `(("ffmpeg" ,ffmpeg)
@@ -1129,7 +1156,7 @@ developed mainly for Ren'py.")
     (native-inputs
      `(("python2-cython" ,python2-cython)
        ("xdg-utils" ,xdg-utils)))
-    (home-page "http://www.renpy.org/")
+    (home-page "https://www.renpy.org/")
     (synopsis "Ren'py python module")
     (description "This package contains the shared libraries and Python
 modules of Ren'py.")
@@ -1317,7 +1344,7 @@ if __name__ == \"__main__\":
        ("xorg-server" ,xorg-server)))
     (outputs
      (list "out" "tutorial" "the-question"))
-    (home-page "http://www.renpy.org/")
+    (home-page "https://www.renpy.org/")
     (synopsis "Visual Novel Engine")
     (description "Ren'Py is a visual novel engine that helps you use words,
 images, and sounds to tell interactive stories that run on computers and
@@ -1509,7 +1536,7 @@ games.")
 (define-public godot
   (package
     (name "godot")
-    (version "3.0.6")
+    (version "3.2.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1518,35 +1545,49 @@ games.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0g64h0x8dlv6aa9ggfcidk2mknkfl5li7z1phcav8aqp9srj8avf"))
-              (modules '((guix build utils)))
+                "1kndls0rklha7kz9l4i2ivjxab4jpk3b2j7dcgcg2qc3s81yd0r6"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)
+                         (srfi srfi-1)))
               (snippet
                '(begin
-                  ;; Drop libraries that we take from Guix.  Note that some
-                  ;; of these may be modified; see "thirdparty/README.md".
+                  ;; Keep only those bundled files we have not (yet) replaced
+                  ;; with Guix versions. Note that some of these may be
+                  ;; modified; see "thirdparty/README.md".
                   (with-directory-excursion "thirdparty"
-                    (for-each delete-file-recursively
-                              '("freetype"
-                                "libogg"
-                                "libpng"
-                                "libtheora"
-                                "libvorbis"
-                                "libvpx"
-                                "libwebp"
-                                "openssl"
-                                "opus"
-                                "zlib"))
-                    #t)))))
+                    (let* ((preserved-files
+                            '("README.md"
+                              "assimp"
+                              "certs"
+                              "cvtt"
+                              "enet"
+                              "etc2comp"
+                              "fonts"
+                              "glad"
+                              "jpeg-compressor"
+                              "libsimplewebm"
+                              "miniupnpc"
+                              "minizip"
+                              "misc"
+                              "nanosvg"
+                              "pvrtccompressor"
+                              "recastnavigation"
+                              "squish"
+                              "tinyexr"
+                              "vhacd"
+                              "xatlas")))
+                      (for-each delete-file-recursively
+                                (lset-difference string=?
+                                                 (scandir ".")
+                                                 (cons* "." ".." preserved-files)))))
+                  #t))))
     (build-system scons-build-system)
     (arguments
      `(#:scons ,scons-python2
-       #:scons-flags (list "platform=x11"
-                           ,@(if (string-prefix? "aarch64" (or (%current-target-system)
-                                                               (%current-system)))
-                               `("CCFLAGS=-DNO_THREADS")
-                               '())
+       #:scons-flags (list "platform=x11" "target=release_debug"
                            ;; Avoid using many of the bundled libs.
                            ;; Note: These options can be found in the SConstruct file.
+                           "builtin_bullet=no"
                            "builtin_freetype=no"
                            "builtin_glew=no"
                            "builtin_libmpdec=no"
@@ -1556,10 +1597,13 @@ games.")
                            "builtin_libvorbis=no"
                            "builtin_libvpx=no"
                            "builtin_libwebp=no"
-                           "builtin_openssl=no"
+                           "builtin_mbedtls=no"
                            "builtin_opus=no"
-                           "builtin_zlib=no")
-       #:tests? #f ; There are no tests
+                           "builtin_pcre2=no"
+                           "builtin_wslay=no"
+                           "builtin_zlib=no"
+                           "builtin_zstd=no")
+       #:tests? #f                      ; There are no tests
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'scons-use-env
@@ -1572,39 +1616,49 @@ games.")
                  "env_base = Environment(tools=custom_tools)\n"
                  "env_base = Environment(ENV=os.environ)")))
              #t))
+         ;; Build headless tools, used for packaging games without depending on X.
+         (add-after 'build 'build-headless
+           (lambda* (#:key scons-flags #:allow-other-keys)
+             (apply invoke "scons"
+                    `(,(string-append "-j" (number->string (parallel-job-count)))
+                      "platform=server" ,@(delete "platform=x11" scons-flags)))))
          (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin")))
+                    (headless (assoc-ref outputs "headless"))
+                    (zenity (assoc-ref inputs "zenity")))
+               ;; Strip build info from filenames.
                (with-directory-excursion "bin"
-                 (if (file-exists? "godot.x11.tools.64")
-                     (rename-file "godot.x11.tools.64" "godot")
-                     (rename-file "godot.x11.tools.32" "godot"))
-                 (install-file "godot" bin))
-               #t)))
+                 (for-each
+                  (lambda (file)
+                    (let ((dest (car (string-split (basename file) #\.))))
+                      (rename-file file dest)))
+                  (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
+                 (install-file "godot" (string-append out "/bin"))
+                 (install-file "godot_server" (string-append headless "/bin")))
+               ;; Tell the editor where to find zenity for OS.alert().
+               (wrap-program (string-append out "/bin/godot")
+                 `("PATH" ":" prefix (,(string-append zenity "/bin")))))
+             #t))
          (add-after 'install 'install-godot-desktop
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (desktop (string-append out "/share/applications"))
-                    (icon-dir (string-append out "/share/pixmaps")))
-               (rename-file "icon.png" "godot.png")
-               (install-file "godot.png" icon-dir)
-               (mkdir-p desktop)
-               (with-output-to-file
-                   (string-append desktop "/godot.desktop")
-                 (lambda _
-                   (format #t
-                           "[Desktop Entry]~@
-                           Name=godot~@
-                           Comment=The godot game engine~@
-                           Exec=~a/bin/godot~@
-                           TryExec=~@*~a/bin/godot~@
-                           Icon=godot~@
-                           Type=Application~%"
-                           out)))
-               #t))))))
+                    (applications (string-append out "/share/applications"))
+                    (icons (string-append out "/share/icons/hicolor")))
+               (mkdir-p applications)
+               (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
+                          (string-append applications "/godot.desktop"))
+               (for-each (lambda (icon dest)
+                           (mkdir-p (dirname dest))
+                           (copy-file icon dest))
+                         '("icon.png" "icon.svg")
+                         `(,(string-append icons "/256x256/apps/godot.png")
+                           ,(string-append icons "/scalable/apps/godot.svg"))))
+             #t)))))
+    (outputs '("out" "headless"))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs `(("alsa-lib" ,alsa-lib)
+              ("bullet" ,bullet)
               ("freetype" ,freetype)
               ("glew" ,glew)
               ("glu" ,glu)
@@ -1617,10 +1671,14 @@ games.")
               ("libxi" ,libxi)
               ("libxinerama" ,libxinerama)
               ("libxrandr" ,libxrandr)
+              ("mbedtls" ,mbedtls-apache)
               ("mesa" ,mesa)
-              ("openssl" ,openssl)
               ("opusfile" ,opusfile)
-              ("pulseaudio" ,pulseaudio)))
+              ("pcre2" ,pcre2)
+              ("pulseaudio" ,pulseaudio)
+              ("wslay" ,wslay)
+              ("zenity" ,zenity)
+              ("zstd" ,zstd "lib")))
     (home-page "https://godotengine.org/")
     (synopsis "Advanced 2D and 3D game engine")
     (description
@@ -1669,7 +1727,7 @@ scripted in a Python-like language.")
               ("libxft" ,libxft)
               ("libxinerama" ,libxinerama)
               ("libfontconfig" ,fontconfig)
-              ("libjpeg" ,libjpeg)
+              ("libjpeg" ,libjpeg-turbo)
               ("libpng" ,libpng)
               ("fltk" ,fltk)
               ("zlib" ,zlib)))
@@ -1709,6 +1767,42 @@ built on top of SDL2 and OpenGL.  Chickadee aims to provide all the features
 that parenthetically inclined game developers need to make 2D (and eventually
 3D) games in Scheme, such as:
 
+@enumerate
+@item extensible, fixed-timestep game loop
+@item OpenGL-based rendering engine
+@item keyboard, mouse, controller input
+@item REPL-driven development model
+@end enumerate\n")
+    (license license:gpl3+)))
+
+(define-public guile3.0-chickadee
+  (package
+    (inherit guile-chickadee)
+    (name "guile3.0-chickadee")
+    (version "0.4.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://files.dthompson.us/chickadee/"
+                                  "chickadee-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1fdicsgls5cp0yffcm5vjmav67gv9bxhz1s3jvdvinspxb485x7l"))))
+    (build-system gnu-build-system)
+    (propagated-inputs
+     `(("guile-opengl" ,guile3.0-opengl)
+       ("guile-sdl2" ,guile3.0-sdl2)))
+    (inputs
+     `(("guile" ,guile-3.0)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("texinfo" ,texinfo)))
+    (home-page "https://dthompson.us/projects/chickadee.html")
+    (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
+    (description "Chickadee is a game development toolkit for Guile Scheme
+built on top of SDL2 and OpenGL.  Chickadee aims to provide all the features
+that parenthetically inclined game developers need to make 2D (and eventually
+3D) games in Scheme, such as:
+
 @enumerate
 @item extensible, fixed-timestep game loop
 @item OpenGL-based rendering engine
@@ -1841,7 +1935,7 @@ of the others")
       (build-system gnu-build-system)
       (inputs
        `(("sdl2" ,sdl2)
-         ("libjpeg" ,libjpeg)
+         ("libjpeg" ,libjpeg-turbo)
          ("openal" ,openal)
          ("curl" ,curl)
          ("opusfile" ,opusfile)
@@ -1904,3 +1998,317 @@ projects.")
 hardware from multiple vendors without requiring that applications have
 specific knowledge of the hardware they are targeting.")
     (license license:bsd-3)))
+
+(define-public fna
+  (package
+    (name "fna")
+    (version "19.12.01")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/FNA-XNA/FNA.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f                      ; No tests.
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'link-dep-src
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
+                   (mojoshader (assoc-ref inputs "mojoshader-src"))
+                   (faudio (assoc-ref inputs "faudio-src"))
+                   (theorafile (assoc-ref inputs "theorafile-src")))
+               (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
+               (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
+               (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
+               (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
+         (delete 'configure)
+         (replace 'build
+           (lambda _
+             (invoke "make" "release")))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
+               #t))))))
+    (native-inputs
+     `(("mono" ,mono)))
+    (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
+              ("mojoshader-src" ,(package-source mojoshader-cs))
+              ("faudio-src" ,(package-source faudio))
+              ("theorafile-src" ,(package-source theorafile))))
+    (home-page "https://fna-xna.github.io/")
+    (synopsis "Accuracy-focused XNA4 reimplementation")
+    (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
+focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
+    (license (list license:ms-pl        ; FNA
+                   license:lgpl2.1      ; LzxDecoder.cs
+                   ;; Mono.Xna:
+                   license:expat))))
+
+(define-public libccd
+  (package
+    (name "libccd")
+    (version "2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/danfis/libccd.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
+                           "-DBUILD_TESTING=ON"
+                           "-DENABLE_DOUBLE_PRECISION=ON")))
+    (native-inputs
+     `(("python-sphinx" ,python-sphinx)))
+    (home-page "https://github.com/danfis/libccd")
+    (synopsis "Library for collision detection between two convex shapes")
+    (description "@code{libccd} is library for a collision detection
+between two convex shapes.  @code{libccd} implements variation on
+Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
+and also implements algorithm Minkowski Portal Refinement (MPR,
+a.k.a. XenoCollide) as described in Game Programming Gems 7.")
+    (license license:expat)))
+
+(define-public ode
+  (package
+    (name "ode")
+    (version "0.16.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
+                           "ode-" version ".tar.gz"))
+       (sha256
+        (base32 "1flfdqgdbcn1bx8nrrd4qnp6cvsxrhvk8cdg7vaq2dzkh6nsqa5j"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (delete-file-recursively "libccd")
+           #t))))
+    (build-system cmake-build-system)
+    (arguments
+     ;; Tests fail on all systems but x86_64.  This is fixed upstream and can
+     ;; be removed in 0.16.2+.
+     `(#:tests? ,(string-prefix? "x86_64-"
+                                 (or (%current-target-system)
+                                     (%current-system)))
+       #:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'unbundle-libccd
+           (lambda _
+             (substitute* "CMakeLists.txt"
+               (("configure_file\\(libccd/.*") ""))
+             #t)))))
+    (inputs
+     `(("glu" ,glu)
+       ("libccd" ,libccd)
+       ("mesa" ,mesa)))
+    (home-page "https://www.ode.org/")
+    (synopsis "High performance library for simulating rigid body dynamics")
+    (description "ODE is a high performance library for simulating
+rigid body dynamics.  It is fully featured, stable, mature and
+platform independent with an easy to use C/C++ API.  It has advanced
+joint types and integrated collision detection with friction.  ODE is
+useful for simulating vehicles, objects in virtual reality
+environments and virtual creatures.  It is currently used in many
+computer games, 3D authoring tools and simulation tools.")
+    ;; Software is dual-licensed.
+    (license (list license:lgpl2.1+ license:expat))))
+
+(define-public chipmunk
+  (package
+    (name "chipmunk")
+    (version "7.0.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/slembcke/Chipmunk2D.git")
+             (commit (string-append "Chipmunk-" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ;no test
+       #:configure-flags '("-DBUILD_STATIC=OFF"
+                           "-DBUILD_DEMOS=OFF")))
+    (inputs
+     `(("freeglut" ,freeglut)
+       ("libxmu" ,libxmu)
+       ("libxrandr" ,libxrandr)))
+    (home-page "https://chipmunk-physics.net/")
+    (synopsis "Fast and lightweight 2D game physics library")
+    (description "Chipmunk is a simple, lightweight, fast and portable 2D
+rigid body physics library written in C.")
+    (license license:expat)))
+
+(define-public libtcod
+  (package
+    (name "libtcod")
+    (version "1.15.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/libtcod/libtcod.git")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
+              (modules '((guix build utils)))
+              (snippet '(begin
+                          (delete-file-recursively "src/vendor/utf8proc")
+                          (delete-file-recursively "src/vendor/zlib")
+                          (delete-file "src/vendor/stb_truetype.h")
+                          (delete-file "src/vendor/stb_sprintf.h")
+                          (delete-file "src/vendor/lodepng.cpp")
+                          (delete-file "src/vendor/lodepng.h")
+
+                          (substitute* "buildsys/autotools/sources.am"
+                            (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
+                            (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
+                             "../../src/vendor/stb.c")
+                            (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
+
+                          (substitute* "src/libtcod/sys_sdl_img_png.cpp"
+                            (("\\.\\./vendor/") ""))
+
+                          (substitute* '("src/libtcod/color/canvas.cpp"
+                                         "src/libtcod/sys_sdl_img_png.cpp"
+                                         "src/libtcod/tileset/truetype.cpp"
+                                         "src/libtcod/tileset/tilesheet.cpp")
+                            (("\\.\\./\\.\\./vendor/") ""))
+
+                          (substitute* "src/libtcod/console/printing.cpp"
+                            (("\\.\\./\\.\\./vendor/utf8proc/") ""))
+                          #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags '("--with-gnu-ld"
+                           "LIBS=-lutf8proc -llodepng")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'change-to-build-dir
+           (lambda _
+             (chdir "buildsys/autotools")
+             (patch-shebang "get_version.py")
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("python" ,python)
+       ("pkg-config" ,pkg-config)
+       ("stb-sprintf" ,stb-sprintf)
+       ("stb-truetype" ,stb-truetype)))
+    (inputs
+     `(("lodepng" ,lodepng)
+       ("sdl2" ,sdl2)
+       ("utf8proc" ,utf8proc)
+       ("zlib" ,zlib)))
+    (home-page "https://github.com/libtcod/libtcod")
+    (synopsis "Library specifically designed for writing roguelikes")
+    (description
+     "libtcod is a fast, portable and uncomplicated API for roguelike
+developers providing an advanced true color console, input, and lots of other
+utilities frequently used in roguelikes.")
+    (license license:bsd-3)))
+
+(define-public warsow-qfusion
+  ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
+  ;; The 2.5 beta as published on the homepage is commit
+  ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
+  (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
+    (package
+      (name "warsow-qfusion")
+      (version (git-version "2.5" "1" commit)) ; 2.5-beta
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/Warsow/qfusion/")
+                      (commit commit)
+                      (recursive? #t)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
+                ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
+                (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
+                (modules '((guix build utils)))
+                (snippet '(begin
+                            (delete-file-recursively "platforms")
+                            (delete-file-recursively "debian")
+                            (delete-file-recursively "libsrcs")
+                            #t))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No tests.
+         #:configure-flags '("-DQFUSION_GAME=Warsow")
+         #:modules
+         ((guix build utils)
+          (guix build cmake-build-system)
+          (ice-9 match))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'change-to-build-dir
+             (lambda _
+               (chdir "source")
+               #t))
+           (add-after 'install 'really-install
+             (lambda* (#:key outputs system #:allow-other-keys)
+               (let ((arch (match system
+                             ("x86_64-linux" "x86_64")
+                             ("i686-linux" "i386")))
+                     (out (assoc-ref outputs "out")))
+                 (install-file (string-append "../source/build/basewsw/libgame_"
+                                              arch ".so")
+                               (string-append out "/lib/"))
+                 (install-file (string-append "../source/build/libui_" arch ".so")
+                               (string-append out "/lib/"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append out "/bin/")))
+                  (append (find-files "../source/build" "warsow")
+                          (find-files "../source/build" "wsw_server."))))
+               #t)))))
+      (inputs
+       `(("alsa-lib" ,alsa-lib)
+         ("curl" ,curl)
+         ("freetype" ,freetype)
+         ("ffmpeg" ,ffmpeg)
+         ("libjpeg" ,libjpeg-turbo)
+         ("libogg" ,libogg)
+         ("libpng" ,libpng)
+         ("libtheora" ,libtheora)
+         ("libvorbis" ,libvorbis)
+         ("mesa" ,mesa)
+         ("openal" ,openal)
+         ("pulseaudio" ,pulseaudio)
+         ("qtbase" ,qtbase)
+         ("qtdeclarative" ,qtdeclarative)
+         ("sdl2" ,sdl2)
+         ("uuid.h" ,util-linux "lib")
+         ("zlib" ,zlib)))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)))
+      (home-page "https://github.com/Warsow/qfusion")
+      (supported-systems '("i686-linux" "x86_64-linux"))
+      (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
+      (description
+       "This package contains the game engine of Warsow, a first-person
+shooter video game.  The engine is based on qfusion, the id Tech 2 derived
+game engine.  id Tech 2 is the engine originally behind Quake 2.")
+      (license license:gpl2+))))