Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / game-development.scm
index 7f00f70..f7e0bcf 100644 (file)
@@ -6,14 +6,19 @@
 ;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
-;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.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 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; 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>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages game-development)
+  #:use-module (srfi srfi-1)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix svn-download)
   #:use-module (guix utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
@@ -43,6 +50,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #: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 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)
@@ -87,7 +99,7 @@
 (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"))
@@ -149,15 +160,15 @@ is used in some video games and movies.")
 (define-public deutex
   (package
    (name "deutex")
-   (version "5.1.2")
+   (version "5.2.1")
    (source (origin
             (method url-fetch)
-            (uri (string-append "https://github.com/Doom-Utils/" name
+            (uri (string-append "https://github.com/Doom-Utils/deutex"
                                 "/releases/download/v" version "/"
-                                name "-" version ".tar.xz"))
+                                "deutex-" version ".tar.xz"))
             (sha256
              (base32
-              "1rj3w4xa0n4jixy4j7p6gbclylbgxvhdnji7xnkydrqii9rxnbp4"))))
+              "07w3asqxx89wl2wfv1z3cak8v83h3ys3b39mq9qq4gyf3xdhs76n"))))
    (build-system gnu-build-system)
    (native-inputs `(("asciidoc" ,asciidoc)))
    (home-page "https://github.com/Doom-Utils/deutex")
@@ -310,6 +321,16 @@ provide connectivity for client applications written in any language.")
         (base32
          "1pmvvm3sgnpngfa7884mqhq3fwdjh9sr0ca07ypnidcg0y341w53"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fix-pillow
+           (lambda _
+             ;; pillow's version is not in PIL.Image.VERSION anymore
+             (substitute* "nml/version_info.py"
+               (("from PIL import Image") "import PIL")
+               (("Image.VERSION") "PIL.__version__"))
+             #t)))))
     (propagated-inputs
      `(("python-pillow" ,python-pillow)
        ("python-ply" ,python-ply)))
@@ -431,7 +452,7 @@ support.")
 (define-public tiled
   (package
     (name "tiled")
-    (version "1.2.2")
+    (version "1.2.5")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -440,7 +461,7 @@ support.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0ay4x1b6h5xfax1cqry2fklcmqi6a16klgmci4gkhga7as66lnnn"))))
+                "14v2zfka2y3h0r0biw1rl59585lji5074x958s4xnb352jm5h9b9"))))
     (build-system gnu-build-system)
     (inputs
      `(("qtbase" ,qtbase)
@@ -461,7 +482,7 @@ support.")
              (let ((out (assoc-ref outputs "out")))
                (invoke "qmake"
                        (string-append "PREFIX=" out))))))))
-    (home-page "http://www.mapeditor.org/")
+    (home-page "https://www.mapeditor.org/")
     (synopsis "Tile map editor")
     (description
      "Tiled is a general purpose tile map editor.  It is meant to be used for
@@ -509,7 +530,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)))
@@ -567,7 +588,7 @@ sounds from presets such as \"explosion\" or \"powerup\".")
 (define-public physfs
   (package
     (name "physfs")
-    (version "3.0.1")
+    (version "3.0.2")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -576,7 +597,7 @@ sounds from presets such as \"explosion\" or \"powerup\".")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1wgj2zqpnfbnyyi1i7bq5pshcc9n5cvwlpzp8im67nb8662ryyxp"))))
+                "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
     (build-system cmake-build-system)
     (arguments
      '(#:tests? #f                      ; no check target
@@ -608,14 +629,14 @@ archive on a per-file basis.")
 (define-public love
   (package
     (name "love")
-    (version "11.1")
+    (version "11.3")
     (source (origin
              (method url-fetch)
              (uri (string-append "https://bitbucket.org/rude/love/downloads/"
                                  "love-" version "-linux-src.tar.gz"))
              (sha256
               (base32
-               "1pkwiszmjs0xrwk0wqbc5cp9108b1y8gwsid0gqk1s0x09q9lpmw"))))
+               "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)))
@@ -638,6 +659,37 @@ programming language.")
     (home-page "https://love2d.org/")
     (license license:zlib)))
 
+(define-public love-nuklear
+  (let ((version "v2.6")
+        (commit "fef4e00a602efb16c57ae962850b6e7a01f7a29a"))
+    (package
+      (name "love-nuklear")
+      (version (git-version version "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/keharriso/love-nuklear/")
+                      (commit commit)
+                      (recursive? #t)))
+                ;; NOTE: the HEAD of the Nuklear git-submodule is at commit 
+                ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "15qmy8mfwkxy2x9rmxs6f9cyvjvwwj6yf78bs863xmc56dmjzzbn"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:build-type "Release"
+         #:tests? #f))
+      (inputs
+       `(("luajit" ,luajit)))
+      (synopsis "Lightweight immediate mode GUI for LÖVE games")
+      (description "LÖVE is a Lua framework for making 2D games.  Nuklear
+is a minimal state immediate mode graphical user interface toolkit.  This
+package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
+      (home-page "https://github.com/keharriso/love-nuklear/")
+      (license license:expat))))
+
 (define-public allegro-4
   (package
     (name "allegro")
@@ -674,32 +726,30 @@ programming language.")
 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
   (package
     (name "allegro")
-    (version "5.2.4.0")
+    (version "5.2.5.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/liballeg/allegro5/releases"
                                   "/download/" version "/allegro-"
                                   version ".tar.gz"))
-              (patches (search-patches
-                        "allegro-mesa-18.2.5-and-later.patch"))
               (sha256
                (base32
-                "1w9a5yqi5q03b2qvmx5ff90paz0xbr9cy7i7f0xiqa65ava66q9l"))))
+                "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
     (build-system cmake-build-system)
-    (arguments `(#:tests? #f)) ; there are no tests
+    (arguments `(#:tests? #f))          ; there are no tests
     (inputs
      ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
      `(("flac" ,flac)
        ("freetype" ,freetype)
        ("glu" ,glu)
        ("gtk" ,gtk+-2)
-       ("libjpeg" ,libjpeg)
+       ("libjpeg" ,libjpeg-turbo)
        ("libpng" ,libpng)
        ("libtheora" ,libtheora)
        ("libvorbis" ,libvorbis)
@@ -717,7 +767,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
@@ -781,7 +831,7 @@ etc.")
        ("curl" ,curl)
        ("freetype" ,freetype)
        ("giflib" ,giflib)
-       ("libjpeg" ,libjpeg)
+       ("libjpeg" ,libjpeg-turbo)
        ("libpng" ,libpng)
        ("libwebp" ,libwebp)
        ("libx11" ,libx11)
@@ -857,16 +907,16 @@ interface (API).")
 (define-public python-pygame
   (package
     (name "python-pygame")
-    (version "1.9.3")
+    (version "1.9.4")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "pygame" version))
               (sha256
                (base32
-                "1hlydiyygl444bq5m5g8n3jsxsgrdyxlm42ipmfbw36wkf0j243m"))))
+                "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
     (build-system python-build-system)
     (arguments
-     `(#:tests? #f ; Tests require pygame to be installed first.
+     `(#:tests? #f                ; tests require pygame to be installed first
        #:phases
        (modify-phases %standard-phases
          ;; Set the paths to the dependencies manually because
@@ -891,23 +941,23 @@ interface (API).")
                (substitute* "Setup.in"
                  (("FONT = -lSDL_ttf")
                   (string-append "FONT = -I" font-ref "/include/SDL -L"
-                                             font-ref "/lib -lSDL_ttf")))
+                                 font-ref "/lib -lSDL_ttf")))
                (substitute* "Setup.in"
                  (("IMAGE = -lSDL_image")
                   (string-append "IMAGE = -I" image-ref "/include/SDL -L"
-                                              image-ref "/lib -lSDL_image")))
+                                 image-ref "/lib -lSDL_image")))
                (substitute* "Setup.in"
                  (("MIXER = -lSDL_mixer")
                   (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
-                                              mixer-ref "/lib -lSDL_mixer")))
+                                 mixer-ref "/lib -lSDL_mixer")))
                (substitute* "Setup.in"
                  (("SMPEG = -lsmpeg")
                   (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
-                                              smpeg-ref "/lib -lsmpeg")))
+                                 smpeg-ref "/lib -lsmpeg")))
                (substitute* "Setup.in"
                  (("PNG = -lpng")
                   (string-append "PNG = -I" png-ref "/include -L"
-                                            png-ref "/lib -lpng")))
+                                 png-ref "/lib -lpng")))
                (substitute* "Setup.in"
                  (("JPEG = -ljpeg")
                   (string-append "JPEG = -I" jpeg-ref "/include -L"
@@ -933,7 +983,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)
@@ -959,6 +1009,321 @@ to create fully featured games and multimedia programs in the python language.")
 (define-public python2-pygame
   (package-with-python2 python-pygame))
 
+(define-public python2-pygame-sdl2
+  (let ((real-version "2.1.0")
+        (renpy-version "7.3.5"))
+    (package
+      (inherit python2-pygame)
+      (name "python2-pygame-sdl2")
+      (version (string-append real-version "-for-renpy-" renpy-version))
+      (source
+       (origin
+         (method url-fetch)
+         (uri (string-append "https://www.renpy.org/dl/" renpy-version
+                             "/pygame_sdl2-" version ".tar.gz"))
+         (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))))
+      (build-system python-build-system)
+      (arguments
+       `(#:tests? #f                ; tests require pygame to be installed first
+         #:python ,python-2
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'set-paths 'set-sdl-vars
+             (lambda* (#:key inputs #:allow-other-keys)
+               (setenv "PYGAME_SDL2_CFLAGS"
+                       (string-append "-I"
+                                      (assoc-ref inputs "sdl-union")
+                                      "/include/SDL2 -D_REENTRANT"))
+               (setenv "PYGAME_SDL2_LDFLAGS"
+                       (string-append "-L"
+                                      (assoc-ref inputs "sdl-union")
+                                      "/lib -Wl,-rpath,"
+                                      (assoc-ref inputs "sdl-union")
+                                      "/lib -Wl,--enable-new-dtags -lSDL2"))
+               #t))
+           (add-before 'build 'drop-generated-files
+             (lambda args
+               (delete-file-recursively "gen")
+               (delete-file-recursively "gen3")
+               #t)))))
+      (inputs
+       `(("sdl-union"
+          ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
+      (native-inputs
+       `(("python2-cython" ,python2-cython)))
+      (home-page "http://www.renpy.org/")
+      (synopsis "Reimplementation of the Pygame API using SDL2")
+      (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
+staying close to the original, but also adding some SDL2-specific features.
+While it aims to be used as a drop-in replacement, it appears to be
+developed mainly for Ren'py.")
+      (license (list license:lgpl2.1 license:zlib)))))
+
+(define-public python2-renpy
+  (package
+    (name "python2-renpy")
+    (version "7.3.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.renpy.org/dl/" version
+                           "/renpy-" version "-source.tar.bz2"))
+       (sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ; Ren'py doesn't seem to package tests
+       #:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-commands
+           (lambda _
+             (substitute* "renpy/editor.py"
+               (("xdg-open")
+                (which "xdg-open")))
+             #t))
+         (add-after 'set-paths 'set-build-vars
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "RENPY_CYTHON"
+                     (string-append (assoc-ref inputs "python2-cython")
+                                    "/bin/cython"))
+             (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
+             #t))
+         (replace 'build
+           (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* (#: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)
+       ("freetype" ,freetype)
+       ("glew" ,glew)
+       ("libpng" ,libpng)
+       ("python2-pygame" ,python2-pygame-sdl2)
+       ("sdl-union"
+        ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
+    (native-inputs
+     `(("python2-cython" ,python2-cython)
+       ("xdg-utils" ,xdg-utils)))
+    (home-page "http://www.renpy.org/")
+    (synopsis "Ren'py python module")
+    (description "This package contains the shared libraries and Python
+modules of Ren'py.")
+    (license license:expat)))
+
+(define-public renpy
+  (package
+    (inherit python2-renpy)
+    (name "renpy")
+    (version "7.3.5")
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ; see python2-renpy
+       #:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-commands
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "launcher/game/choose_directory.rpy"
+               (("/usr/bin/python") (which "python2")))
+             (substitute* "launcher/game/front_page.rpy"
+               (("xdg-open")
+                (which "xdg-open")))
+             (substitute* "launcher/game/project.rpy"
+               (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
+                (string-append "cmd = [ \"" (assoc-ref outputs "out")
+                               "/bin/renpy\" ]"))
+               ;; Projects are still created in the usual style, so we need
+               ;; to adjust the path.
+               (("cmd.append\\(self.path\\)")
+                "cmd.append(self.path + \"/game\")"))
+             #t))
+         (add-after 'unpack 'drop-game-from-paths
+           (lambda _
+             (substitute* (list "launcher/game/gui7.rpy"
+                                "launcher/game/gui7/images.py")
+               ((", \"game\",") ","))
+             #t))
+         (add-before 'build 'start-xserver
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((xorg-server (assoc-ref inputs "xorg-server")))
+               (setenv "HOME" (getcwd))
+               (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
+               (setenv "DISPLAY" ":1")
+               #t)))
+         (replace 'build
+           (lambda _
+             (invoke "python" "renpy.py" "launcher" "quit")
+             (invoke "python" "renpy.py" "the_question" "quit")
+             (invoke "python" "renpy.py" "tutorial" "quit")
+             #t))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Here we install our custom renpy program.
+             ;; After finishing this step, "out" will have the following:
+             ;; |-- bin/renpy
+             ;; `-- share/renpy ; i.e. path_to_renpy_base()
+             ;;     `-- common
+             ;;
+             ;; Note that common is also a de facto unused directory in
+             ;; python2-renpy. On other systems, renpy_base would point to
+             ;; site-packages or even somewhere in /opt.
+             ;; The former approach is not as straightforward as it seems
+             ;; -- it causes renpy to load files twice for some weird reason --
+             ;; and the latter is impossible on Guix. Hence the detour through
+             ;; share/renpy and the custom renpy program.
+             ;;
+             ;; As a convention, other games should be installed as
+             ;; subdirectories of share/renpy in their respective outputs as
+             ;; well. This differs from the traditional layout, which is
+             ;; roughly the following:
+             ;; `-- Super Awesome Game
+             ;;     |-- game      ; <- the folder we actually want
+             ;;     |-- lib       ; compiled renpy module and dependencies
+             ;;     |-- renpy     ; Ren'py python code (source + compiled)
+             ;;     |-- Super Awesome Game.py
+             ;;     `-- Super Awesome Game.sh
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin/renpy (string-append out "/bin/renpy")))
+               (mkdir-p (string-append out "/bin"))
+               (copy-recursively "renpy/common"
+                                 (string-append out "/share/renpy/common"))
+               (copy-recursively "gui"
+                                 (string-append out "/share/renpy/gui"))
+
+               (call-with-output-file bin/renpy
+                 (lambda (port)
+                   (format port "#!~a~%" (which "python2"))
+                   (format port "
+from __future__ import print_function
+
+import os
+import sys
+import warnings
+
+def path_to_common(renpy_base):
+    return renpy_base + \"/common\"
+
+def path_to_saves(gamedir, save_directory=None):
+    import renpy  # @UnresolvedImport
+
+    if save_directory is None:
+        save_directory = renpy.config.save_directory
+        save_directory = renpy.exports.fsencode(save_directory)
+
+    if not save_directory:
+        return gamedir + \"/saves\"
+
+    return os.path.expanduser(\"~~/.renpy/\" + save_directory)
+
+def path_to_renpy_base():
+    return \"~a\"
+
+def main():
+    renpy_base = path_to_renpy_base()
+    try:
+        import renpy.bootstrap
+        import renpy.arguments
+    except ImportError:
+        print(\"\"\"Could not import renpy.bootstrap.
+Please ensure you decompressed Ren'Py correctly, preserving the directory
+structure.\"\"\", file=sys.stderr)
+        raise
+
+    args = renpy.arguments.bootstrap()
+    if not args.basedir:
+        print(\"\"\"This Ren'py requires a basedir to launch.
+The basedir is the directory, in which .rpy files live -- usually the 'game'
+subdirectory of a game packaged by Ren'py.
+
+If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
+              file=sys.stderr)
+        sys.exit()
+
+    renpy.bootstrap.bootstrap(renpy_base)
+
+if __name__ == \"__main__\":
+    main()
+"
+                           (string-append out "/share/renpy"))))
+               (chmod bin/renpy #o755)
+               #t)))
+
+         (add-after 'install 'install-games
+           (lambda* (#:key outputs #:allow-other-keys)
+             (define renpy (assoc-ref outputs "out"))
+             ;; TODO: We should offer a renpy-build-system to make the
+             ;; installation of Ren'py games easier.
+             (define* (install-renpy-game #:key output game name (renpy renpy)
+                                          #:allow-other-keys)
+               (let* ((name (or name (basename game)))
+                      (launcher (string-append output "/bin/renpy-" name))
+                      (share (string-append output "/share/renpy/" name)))
+                 (copy-recursively (string-append game "/game") share)
+                 (mkdir-p (string-append output "/bin"))
+                 (with-output-to-file launcher
+                   (lambda ()
+                     (format #t
+                             "#!~a~%~a ~a \"$@\""
+                             (which "bash")
+                             (string-append renpy "/bin/renpy")
+                             share)))
+                 (chmod launcher #o755)))
+
+             (install-renpy-game #:output (assoc-ref outputs "out")
+                                 #:game "launcher")
+
+             (install-renpy-game #:output (assoc-ref outputs "the-question")
+                                 #:game "the_question"
+                                 #:name "the-question")
+
+             (install-renpy-game #:output (assoc-ref outputs "tutorial")
+                                 #:game "tutorial")
+             #t))
+         (replace 'wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (wrap-program (string-append (assoc-ref outputs "out")
+                                          "/bin/renpy")
+               `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
+             #t)))))
+    (inputs
+     `(("python2-tkinter" ,python-2 "tk")
+       ("python2-pygame" ,python2-pygame-sdl2)
+       ("python2-renpy" ,python2-renpy)
+       ("xorg-server" ,xorg-server)))
+    (outputs
+     (list "out" "tutorial" "the-question"))
+    (home-page "http://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
+mobile devices.  These can be both visual novels and life simulation games.
+The easy to learn script language allows anyone to efficiently write large
+visual novels, while its Python scripting is enough for complex simulation
+games.")
+    (license license:expat)))
+
 (define-public grafx2
   (package
     (name "grafx2")
@@ -1035,13 +1400,14 @@ robust and compatible with many systems and operating systems.")
     (version "3.2.2")
     (source
      (origin
-       (method url-fetch)
-       (uri
-        (string-append "https://github.com/MyGUI/" name
-                       "/archive/MyGUI" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/MyGUI/mygui")
+             (commit (string-append "MyGUI" version))))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "13x7cydmj7gjmsg702sqjbfi53z265iv6j7binv3r6a7ibndfa0a"))))
+         "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
     (build-system cmake-build-system)
     (arguments
      '(#:tests? #f                      ; No test target
@@ -1049,7 +1415,11 @@ robust and compatible with many systems and operating systems.")
        (list "-DMYGUI_INSTALL_DOCS=TRUE"
              (string-append "-DOGRE_INCLUDE_DIR="
                             (assoc-ref %build-inputs "ogre")
-                            "/include/OGRE"))))
+                            "/include/OGRE")
+             ;; Demos and tools are Windows-specific:
+             ;; https://github.com/MyGUI/mygui/issues/24.
+             "-DMYGUI_BUILD_DEMOS=FALSE"
+             "-DMYGUI_BUILD_TOOLS=FALSE")))
     (native-inputs
      `(("boost" ,boost)
        ("doxygen" ,doxygen)
@@ -1069,19 +1439,42 @@ of use.")
     (home-page "http://mygui.info/")
     (license license:expat)))
 
+(define-public mygui-gl
+  ;; Closure size is reduced by some 800 MiB.
+  (package
+    (inherit mygui)
+    (name "mygui-gl")
+    (version "3.2.2")
+    (arguments
+     (substitute-keyword-arguments (package-arguments mygui)
+       ((#:configure-flags _)
+        `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
+                ;; We can't reuse the flags because of the mention to Ogre.
+                (list "-DMYGUI_INSTALL_DOCS=TRUE"
+                      ;; Demos and tools are Windows-specific:
+                      ;; https://github.com/MyGUI/mygui/issues/24.
+                      "-DMYGUI_BUILD_DEMOS=FALSE"
+                      "-DMYGUI_BUILD_TOOLS=FALSE")))))
+    (inputs
+     `(("mesa" ,mesa)
+       ("glu" ,glu)
+       ,@(fold alist-delete (package-inputs mygui)
+               '("ogre"))))
+    (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
+
 (define-public openmw
   (package
     (name "openmw")
-    (version "0.44.0")
+    (version "0.45.0")
     (source
      (origin
        (method url-fetch)
        (uri
         (string-append "https://github.com/OpenMW/openmw/archive/"
-                       name "-" version ".tar.gz"))
+                       "openmw-" version ".tar.gz"))
        (sha256
         (base32
-         "03fgm2f2r7y0aqlgp038pdlnllgvm3jimrp968p4nhz1sffvjzcy"))))
+         "0r0wgvv1faan8z8lbply8lks4hcnppifjrcz04l5zvq6yiqzjg5n"))))
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f                      ; No test target
@@ -1095,9 +1488,9 @@ of use.")
      `(("bullet" ,bullet)
        ("ffmpeg" ,ffmpeg)
        ("libxt" ,libxt)
-       ("mygui" ,mygui)
+       ("mygui" ,mygui-gl)              ; OpenMW does not need Ogre.
        ("openal" ,openal)
-       ("openscenegraph" ,openscenegraph)
+       ("openscenegraph" ,openmw-openscenegraph)
        ("qtbase" ,qtbase)
        ("sdl" ,sdl2)
        ("unshield" ,unshield)))
@@ -1113,7 +1506,7 @@ games.")
 (define-public godot
   (package
     (name "godot")
-    (version "3.0.6")
+    (version "3.2")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1122,25 +1515,42 @@ games.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0g64h0x8dlv6aa9ggfcidk2mknkfl5li7z1phcav8aqp9srj8avf"))
-              (modules '((guix build utils)))
+                "0f15izjl4i2xlz1xj5pcslzl9gm3rmr3c21gh256ynpi2zhhkcdd"))
+              (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
@@ -1151,6 +1561,7 @@ games.")
                                '())
                            ;; 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"
@@ -1160,9 +1571,12 @@ games.")
                            "builtin_libvorbis=no"
                            "builtin_libvpx=no"
                            "builtin_libwebp=no"
-                           "builtin_openssl=no"
+                           "builtin_mbedtls=no"
                            "builtin_opus=no"
-                           "builtin_zlib=no")
+                           "builtin_pcre2=no"
+                           "builtin_wslay=no"
+                           "builtin_zlib=no"
+                           "builtin_zstd=no")
        #:tests? #f ; There are no tests
        #:phases
        (modify-phases %standard-phases
@@ -1185,6 +1599,10 @@ games.")
                      (rename-file "godot.x11.tools.64" "godot")
                      (rename-file "godot.x11.tools.32" "godot"))
                  (install-file "godot" bin))
+               ;; Tell Godot where to find zenity for OS.alert().
+               (wrap-program (string-append bin "/godot")
+                 `("PATH" ":" prefix
+                   (,(string-append (assoc-ref %build-inputs "zenity") "/bin"))))
                #t)))
          (add-after 'install 'install-godot-desktop
            (lambda* (#:key outputs #:allow-other-keys)
@@ -1209,6 +1627,7 @@ games.")
                #t))))))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs `(("alsa-lib" ,alsa-lib)
+              ("bullet" ,bullet)
               ("freetype" ,freetype)
               ("glew" ,glew)
               ("glu" ,glu)
@@ -1221,10 +1640,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
@@ -1237,7 +1660,7 @@ scripted in a Python-like language.")
 (define-public eureka
   (package
     (name "eureka")
-    (version "1.21")
+    (version "1.24")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
@@ -1247,7 +1670,7 @@ scripted in a Python-like language.")
                                   "-source.tar.gz"))
               (sha256
                (base32
-                "1a7pf7xi56fcz7jc8layih5gq5m66g2ss4x5j61kzgip07j6rkir"))))
+                "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f
@@ -1273,7 +1696,7 @@ scripted in a Python-like language.")
               ("libxft" ,libxft)
               ("libxinerama" ,libxinerama)
               ("libfontconfig" ,fontconfig)
-              ("libjpeg" ,libjpeg)
+              ("libjpeg" ,libjpeg-turbo)
               ("libpng" ,libpng)
               ("fltk" ,fltk)
               ("zlib" ,zlib)))
@@ -1289,24 +1712,15 @@ a 2D editor view.")
 (define-public guile-chickadee
   (package
     (name "guile-chickadee")
-    (version "0.3.0")
+    (version "0.4.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://files.dthompson.us/chickadee/"
                                   "chickadee-" version ".tar.gz"))
               (sha256
                (base32
-                "0jl223dybsj5gvs7z4q60gnafj1b7kgi5mx0kj58m5knrp8qwg5h"))))
+                "1fdicsgls5cp0yffcm5vjmav67gv9bxhz1s3jvdvinspxb485x7l"))))
     (build-system gnu-build-system)
-    (arguments
-     '(#:make-flags '("GUILE_AUTO_COMPILE=0")
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'patch-godir
-           (lambda _
-             ;; Install compiled '.go' files into the site directory.
-             (substitute* "Makefile.in"
-               (("/ccache") "/site-ccache")))))))
     (propagated-inputs
      `(("guile-opengl" ,guile-opengl)
        ("guile-sdl2" ,guile-sdl2)))
@@ -1329,3 +1743,346 @@ that parenthetically inclined game developers need to make 2D (and eventually
 @item REPL-driven development model
 @end enumerate\n")
     (license license:gpl3+)))
+
+(define-public bennu-game-development
+  (package
+    (name "bennu-game-development")
+    (version "348")
+    (source (origin
+              (method svn-fetch)
+              (uri (svn-reference
+                    (url "http://svn.code.sf.net/p/bennugd/code")
+                    (revision (string->number version))))
+              (file-name (string-append name "-" version))
+              (sha256
+               (base32
+                "0wpzsbh4zi3931493dnyl5ffmh1b7fj2sx3mzrq304z9zs4d6lqq"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (delete-file-recursively "3rdparty") #t))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-configure-to-use-openssl
+           (lambda* (#:key outputs #:allow-other-keys)
+             (chdir "core")
+             (delete-file "configure")
+             (substitute* "configure.in"
+               (("i\\*86\\)")
+                "*)
+                COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
+                COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
+                LIBSSL=\"crypto\"
+                USE_OPENSSL=yes
+                ;;
+
+            i*86)"))
+               #t)))))
+    (inputs `(("openssl" ,openssl)
+              ("zlib" ,zlib)))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("autoconf" ,autoconf)
+                     ("automake" ,automake)
+                     ("libtool" ,libtool)))
+    (synopsis "Programming language to create games")
+    (description "Bennu Game Development, also known as bennudg, is a
+programming language tailored at game development.  It is the successor of
+Fenix.")
+    (home-page "https://sourceforge.net/projects/bennugd/")
+    (license license:zlib)))
+
+(define-public bennu-game-development-modules
+  (package
+    (inherit bennu-game-development)
+    (name "bennu-game-development-modules")
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-conflicting-definitions
+           (lambda _
+             (with-fluids ((%default-port-encoding #f))
+               (substitute* "core/include/fmath.h"
+                 (("extern fixed fmul\\( int x, int y \\);") "")
+                 (("extern fixed fdiv\\( int x, int y \\);") "")))
+             (chdir "modules"))))))
+    (inputs `(("zlib" ,zlib)
+              ("libpng" ,libpng)
+              ("openssl" ,openssl)
+              ("sdl-mixer" ,sdl-mixer)
+              ("bennu-game-development" ,bennu-game-development)))
+    (synopsis "Modules for the Bennu Game Development programming language")
+    (description "This package contains a collection of modules for the Bennu
+Game Development programming language, from CD handling through SDL to
+joystick support.")))
+
+(define-public plib
+  (package
+    (name "plib")
+    (version "1.8.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://plib.sourceforge.net/dist/"
+                                  "plib-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
+              (patches (search-patches "plib-CVE-2011-4620.patch"
+                                       "plib-CVE-2012-4552.patch"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("mesa" ,mesa)
+       ("libxi" ,libxi)
+       ("libxmu" ,libxmu)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (home-page "http://plib.sourceforge.net/")
+    (synopsis "Suite of portable game libraries")
+    (description "PLIB is a set of libraries that will permit programmers to
+write games and other realtime interactive applications that are 100% portable
+across a wide range of hardware and operating systems.  PLIB includes sound
+effects, music, a complete 3D engine, font rendering, a simple Windowing
+library, a game scripting language, a GUI, networking, 3D math library and a
+collection of handy utility functions.  All are 100% portable across nearly
+all modern computing platforms.  Each library component is fairly independent
+of the others")
+    (license license:lgpl2.0+)))
+
+(define-public ioquake3
+  ;; We follow master since it seems that there won't be releases after 1.3.6.
+  (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
+    (package
+      (name "ioquake3")
+      (version (git-version "1.3.6" "1" commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ioquake/ioq3.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
+      (build-system gnu-build-system)
+      (inputs
+       `(("sdl2" ,sdl2)
+         ("libjpeg" ,libjpeg-turbo)
+         ("openal" ,openal)
+         ("curl" ,curl)
+         ("opusfile" ,opusfile)
+         ("opus" ,opus)
+         ("libvorbis" ,libvorbis)
+         ("freetype" ,freetype)
+         ("libogg" ,libogg)))
+      (native-inputs
+       `(("which" ,which)               ; Else SDL_version.h won't be found.
+         ("pkg-config" ,pkg-config)))
+      (arguments
+       '(#:tests? #f                    ; No tests.
+         #:make-flags '("CC=gcc"
+                        "USE_INTERNAL_LIBS=0"
+                        "USE_FREETYPE=1"
+                        "USE_RENDERER_DLOPEN=0"
+                        "USE_OPENAL_DLOPEN=0"
+                        "USE_CURL_DLOPEN=0")
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (invoke "make" "copyfiles" "CC=gcc"
+                        "USE_INTERNAL_LIBS=0"
+                       (string-append "COPYDIR="
+                                      (assoc-ref outputs "out")
+                                      "/bin")))))))
+      (home-page "https://ioquake3.org/")
+      (synopsis "FPS game engine based on Quake 3")
+      (description "ioquake3 is a free software first person shooter engine
+based on the Quake 3: Arena and Quake 3: Team Arena source code.  Compared to
+the original, ioquake3 has been cleaned up, bugs have been fixed and features
+added.  The permanent goal is to create the open source Quake 3 distribution
+upon which people base their games, ports to new platforms, and other
+projects.")
+      (license license:gpl2))))
+
+(define-public openvr
+  (package
+    (name "openvr")
+    (version "1.8.19")
+    (home-page "https://github.com/ValveSoftware/openvr/")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url home-page)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
+    (build-system cmake-build-system)
+    (arguments
+     ;; No tests.
+     '(#:tests? #f
+       #:configure-flags (list "-DBUILD_SHARED=1")))
+    (synopsis "Virtual reality software development kit")
+    (description "OpenVR is an API and runtime that allows access to VR
+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")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
+                           "ode-" version ".tar.gz"))
+       (sha256
+        (base32 "09xzrarxwxcf6rdv5jsjfjh454jnn29dpcw3wh6ic50kkipvg8sb"))
+       (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.
+     `(#: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 "http://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)))