1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Tomáš Čech <sleep_walker@suse.cz>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015, 2018 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
7 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2016, 2017, 2020 Kei Kebreau <kkebreau@posteo.net>
9 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2016, 2017, 2018 Julian Graham <joolean@gmail.com>
11 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
13 ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
14 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2018, 2022 Marius Bakke <marius@gnu.org>
17 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
18 ;;; Copyright © 2019, 2020, 2021 Liliana Marie Prikler <liliana.prikler@gmail.com>
19 ;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
20 ;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
21 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
22 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
23 ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
24 ;;; Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
25 ;;; Copyright © 2020-2021 James Smith <jsubuntuxp@disroot.org>
26 ;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
27 ;;; Copyright © 2021 Andy Tai <atai@atai.org>
28 ;;; Copyright © 2022 Felix Gruber <felgru@posteo.net>
29 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
31 ;;; This file is part of GNU Guix.
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46 (define-module (gnu packages game-development)
47 #:use-module ((srfi srfi-1) #:hide (zip))
48 #:use-module (ice-9 match)
49 #:use-module ((guix licenses) #:prefix license:)
50 #:use-module (guix packages)
51 #:use-module (guix gexp)
52 #:use-module (guix download)
53 #:use-module (guix git-download)
54 #:use-module (guix svn-download)
55 #:use-module (guix utils)
56 #:use-module (guix build-system cmake)
57 #:use-module (guix build-system gnu)
58 #:use-module (guix build-system python)
59 #:use-module (guix build-system scons)
60 #:use-module (gnu packages)
61 #:use-module (gnu packages audio)
62 #:use-module (gnu packages autotools)
63 #:use-module (gnu packages base)
64 #:use-module (gnu packages bash)
65 #:use-module (gnu packages boost)
66 #:use-module (gnu packages build-tools)
67 #:use-module (gnu packages compression)
68 #:use-module (gnu packages check)
69 #:use-module (gnu packages curl)
70 #:use-module (gnu packages documentation)
71 #:use-module (gnu packages fltk)
72 #:use-module (gnu packages fonts)
73 #:use-module (gnu packages fontutils)
74 #:use-module (gnu packages freedesktop)
75 #:use-module (gnu packages fribidi)
76 #:use-module (gnu packages dbm)
77 #:use-module (gnu packages gettext)
78 #:use-module (gnu packages gl)
79 #:use-module (gnu packages glib)
80 #:use-module (gnu packages gnome)
81 #:use-module (gnu packages gnunet)
82 #:use-module (gnu packages graphics)
83 #:use-module (gnu packages graphviz)
84 #:use-module (gnu packages gtk)
85 #:use-module (gnu packages guile)
86 #:use-module (gnu packages image)
87 #:use-module (gnu packages linux)
88 #:use-module (gnu packages lua)
89 #:use-module (gnu packages m4)
90 #:use-module (gnu packages mp3)
91 #:use-module (gnu packages multiprecision)
92 #:use-module (gnu packages music)
93 #:use-module (gnu packages ncurses)
94 #:use-module (gnu packages pcre)
95 #:use-module (gnu packages pkg-config)
96 #:use-module (gnu packages pulseaudio)
97 #:use-module (gnu packages python)
98 #:use-module (gnu packages python-web)
99 #:use-module (gnu packages python-xyz)
100 #:use-module (gnu packages readline)
101 #:use-module (gnu packages qt)
102 #:use-module (gnu packages sdl)
103 #:use-module (gnu packages sphinx)
104 #:use-module (gnu packages stb)
105 #:use-module (gnu packages texinfo)
106 #:use-module (gnu packages textutils)
107 #:use-module (gnu packages tls)
108 #:use-module (gnu packages video)
109 #:use-module (gnu packages web)
110 #:use-module (gnu packages wxwidgets)
111 #:use-module (gnu packages xdisorg)
112 #:use-module (gnu packages xiph)
113 #:use-module (gnu packages xml)
114 #:use-module (gnu packages xorg))
116 (define-public bullet
123 (url "https://github.com/bulletphysics/bullet3/")
125 (file-name (git-file-name name version))
128 "0x1ghxbkvqr910sp01sjf4hlfy4sdgn2jx2qf0dsi697bzq1f3mr"))
129 (modules '((guix build utils)))
132 (for-each delete-file (find-files "build3" "premake*"))
133 (with-directory-excursion "examples/ThirdPartyLibs"
134 (for-each delete-file-recursively
135 '("Gwen" "clsocket" "enet" "glad" "imgui"
136 "lua-5.2.3" "midi" "minizip" "openvr"
137 "optionalX11" "serial" "zlib")))
139 ;; Tests fail on linking, cannot find -lBussIK.
140 (substitute* "test/CMakeLists.txt"
141 ((" InverseDynamics")
142 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
143 ; (("SharedMemory") ""))
145 (build-system cmake-build-system)
147 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
148 "-DBUILD_CPU_DEMOS=OFF"
149 "-DBUILD_OPENGL3_DEMOS=OFF"
150 "-DBUILD_BULLET2_DEMOS=OFF"
151 ;; openmw 0.47.0 requires bullet to be built with
153 ;; See <https://issues.guix.gnu.org/52953> for
155 "-DUSE_DOUBLE_PRECISION=ON"
156 ;; Extras/BulletRoboticsGUI needs files from
158 "-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF"
159 ;; Extras/BulletRobotics needs files from
161 "-DBUILD_BULLET_ROBOTICS_EXTRA=OFF"
162 (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
163 (or (getenv "CXXFLAGS") "")))
165 (modify-phases %standard-phases
166 (add-after 'unpack 'remove-failing-tests
167 ;; These tests fail specifically after removing 3rd party code.
169 (substitute* "test/SharedMemory/CMakeLists.txt"
170 (("ADD_TEST") "# ADD_TEST"))
171 (substitute* "test/InverseDynamics/CMakeLists.txt"
172 (("ADD_TEST\\(Test_BulletInverseForward")
173 "# ADD_TEST(Test_BulletInverseForward"))
176 (list glu libx11 mesa))
177 (home-page "https://pybullet.org/wordpress/")
178 (synopsis "3D physics engine library")
180 "Bullet is a physics engine library usable for collision detection. It
181 is used in some video games and movies.")
182 (license license:zlib)))
184 (define-public deutex
191 (uri (string-append "https://github.com/Doom-Utils/deutex"
192 "/releases/download/v" version "/"
193 "deutex-" version ".tar.zst"))
195 (base32 "0psb2za6ldrlak7s8pjvli98ij5yiwjx8j1ms2v7rj9yadx0xv8h"))))
196 (build-system gnu-build-system)
200 (list asciidoc pkg-config zstd))
201 (home-page "https://github.com/Doom-Utils/deutex")
202 (synopsis "WAD file composer for Doom and related games")
204 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
205 used to extract the lumps of a wad and save them as individual files.
206 Conversely, it can also build a wad from separate files. When extracting a
207 lump to a file, it does not just copy the raw data, it converts it to an
208 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
209 Conversely, when it reads files for inclusion in pwads, it does the necessary
210 conversions (for example, from PPM to Doom picture format). In addition,
211 DeuTex has functions such as merging wads, etc.")
212 (license license:gpl2+)))
214 (define-public grfcodec
221 (uri (string-append "https://binaries.openttd.org/extra/"
222 name "/" version "/" name "-" version
224 (patches (search-patches "grfcodec-gcc-compat.patch"))
226 (base32 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
227 (build-system gnu-build-system)
229 '(#:tests? #f ;no check target
231 (modify-phases %standard-phases
232 (delete 'configure) ;no configure script
233 (replace 'install ;no install target
234 (lambda* (#:key outputs #:allow-other-keys)
235 (let* ((out (assoc-ref outputs "out"))
236 (bin (string-append out "/bin"))
237 (doc (string-append out "/share/doc"))
238 (man (string-append out "/share/man/man1")))
239 (for-each (lambda (file)
240 (install-file file bin))
241 '("grfcodec" "grfid" "grfstrip" "nforenum"))
242 (install-file "COPYING" doc)
243 (with-directory-excursion "docs"
244 (for-each (lambda (file)
245 (install-file (string-append file ".txt") doc))
246 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
247 "readme" "readme.rpn"))
248 (for-each (lambda (file)
249 (install-file file man))
250 (find-files "." "\\.1")))))))))
252 (list boost libpng zlib))
253 (synopsis "GRF development tools")
255 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
256 tools for developing (New)GRFs. It includes a number of smaller programs, each
257 with a specific task:
259 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
260 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
261 @item @code{grfstrip} strips all sprites from a GRF.
262 @item @code{nforenum} checks NFO code for errors, making corrections when
265 (home-page "https://dev.openttdcoop.org/projects/grfcodec")
266 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
267 ;; NFORenum is under the GPL2+.
268 ;; The MD5 implementation contained in GRFID is under the zlib license.
269 (license (list license:gpl2 license:gpl2+ license:zlib))))
271 (define-public catcodec
278 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
279 version "/catcodec-" version "-source.tar.xz"))
281 (base32 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
282 (build-system gnu-build-system)
284 `(#:tests? #f ; no tests
285 #:make-flags (list (string-append "prefix=" %output))
286 #:phases (modify-phases %standard-phases
287 (delete 'configure))))
288 (home-page "https://dev.openttdcoop.org/projects/catcodec")
289 (synopsis "Encode/decode OpenTTD sounds")
290 (description "catcodec encodes and decodes sounds for OpenTTD. These
291 sounds are not much more than some metadata (description and filename) and raw
293 (license license:gpl2)))
295 (define-public gzochi
301 (uri (string-append "mirror://savannah/gzochi/gzochi-"
305 "1vcvf04qqzs3q8kaild2x7qvkwc6bwzfsisb78147b8z747j7hj0"))))
306 (build-system gnu-build-system)
308 '(#:phases (modify-phases %standard-phases
309 (add-before 'build 'no-Werror
311 ;; Don't abort builds due to things like GLib
312 ;; deprecation warnings.
313 (substitute* (find-files "." "^Makefile\\.in$")
316 (native-inputs `(("pkgconfig" ,pkg-config)))
324 (home-page "https://www.nongnu.org/gzochi/")
325 (synopsis "Scalable middleware for multiplayer games")
327 "gzochi is a framework for developing massively multiplayer online games.
328 A server container provides services to deployed games, which are written in
329 Guile Scheme, that abstract and simplify some of the most challenging and
330 error-prone aspects of online game development: Concurrency, data persistence,
331 and network communications. A very thin client library can be embedded to
332 provide connectivity for client applications written in any language.")
333 (license license:gpl3+)))
342 (uri (pypi-uri "nml" version))
344 (base32 "0l5pfs8q7jrl3xscqq7pnwh5h5d17fsyjy7xspkc73sa0ayjm9jx"))))
345 (build-system python-build-system)
346 ;; TODO: Fix test that fails with
347 ;; "AttributeError: partially initialized module 'nml.nmlop' has no
348 ;; attribute 'ADD' (most likely due to a circular import)"
352 (list python-pillow python-ply))
353 (home-page "https://github.com/OpenTTD/nml")
354 (synopsis "NML compiler")
356 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
357 compiling NML files (along with their associated language, sound and graphic
358 files) into @file{.grf} and/or @file{.nfo} files.")
359 (license license:gpl2+)))
361 (define-public python-sge
364 (version "2.0.post0")
368 (uri (pypi-uri "sge" version))
371 "0s5d5qzlzfmqb10iyrqi62n36ll94d99xjaznp5ca6dz1b91qkvr"))))
372 (build-system python-build-system)
374 (list python-pygame python-uniseg))
375 (home-page "https://python-sge.github.io/")
376 (synopsis "2D game engine for Python")
378 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
379 general-purpose 2D game engine. It takes care of several details for you so
380 you can focus on the game itself. This makes more rapid game development
381 possible, and it also makes the SGE easy to learn.")
382 (license license:lgpl3+)))
384 (define-public python-tmx
391 (uri (string-append "mirror://savannah/python-tmx/"
392 (version-major+minor version) "/tmx-"
396 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
397 (build-system python-build-system)
400 (home-page "http://python-tmx.nongnu.org")
401 (synopsis "Python library for the @code{Tiled} TMX format")
403 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
404 This is useful for map editors or generic level editors, and it's also useful
405 for using a map editor or generic level editor like Tiled to edit your game's
407 (license (list license:asl2.0
408 ;; Documentation (only available in the source tarball) is
409 ;; under the CC0 license.
412 (define-public python-xsge
415 (version "2020.09.07")
418 (uri (string-append "https://github.com/python-sge/xsge"
419 "/releases/download/v" version
420 "/xsge-" version ".zip"))
423 "136xgy3f9vw636wxpqbha022avk0wyxw63mm3a2dvwhh90s716f9"))))
424 (build-system python-build-system)
427 (modify-phases %standard-phases
428 ;; xSGE's setup.py script does not support one of the Python build
429 ;; system's default flags, "--single-version-externally-managed".
431 (lambda* (#:key outputs #:allow-other-keys)
432 (invoke "python" "setup.py" "install"
433 (string-append "--prefix=" (assoc-ref outputs "out"))
435 #:tests? #f)) ; no check target
440 (home-page "https://python-sge.github.io/")
441 (synopsis "Extensions for the SGE Game Engine")
443 "xSGE is a collection of modules that make doing certain tasks with the SGE
444 Game Engine easier. In addition to SGE's conveniences, the user has access to a
445 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
447 (license license:gpl3+)))
457 (url "https://github.com/sirjuddington/SLADE")
459 (sha256 (base32 "009yc5m6y074wfalvwbrnv2zsmaf9yhbi8hzgs973di0zqnqv011"))
460 (file-name (git-file-name name version))))
461 (build-system cmake-build-system)
464 (list "-DWX_GTK3=ON" "-DNO_WEBVIEW=ON"
465 (string-append "-DWITH_WXPATH="
466 (assoc-ref %build-inputs "wxwidgets") "/bin")
467 (string-append "-DwxWidgets_LIBRARIES="
468 (assoc-ref %build-inputs "wxwidgets") "/lib"))
470 (modify-phases %standard-phases
471 (add-before 'build 'reset-slade.pk3-timestamps
472 ;; This is neccessary to make slade reproducible due to
473 ;; <https://bugs.gnu.org/44741>. TODO: Remove on next core update
476 (invoke "find" "../source/dist/res" "-exec" "touch"
477 "--no-dereference" "-t" "197001010000.00" "{}"
479 (add-after 'install 'wrap-with-x11-gdk-backend
480 ;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
481 ;; See https://github.com/sirjuddington/SLADE/issues/1097 for details.
482 (lambda* (#:key outputs #:allow-other-keys)
484 (string-append (assoc-ref outputs "out")
486 '("GDK_BACKEND" = ("x11"))))))
487 #:tests? #f)) ;; No test suite.
489 `(("bash" ,bash-minimal)
491 ("fluidsynth" ,fluidsynth)
492 ("freeimage" ,freeimage)
497 ("wxwidgets" ,wxwidgets-3.1)))
499 (list pkg-config which zip))
500 (home-page "https://slade.mancubus.net")
501 (synopsis "Doom game data editor")
502 (description "SLADE3 is a modern editor for Doom-engine based games and
503 source ports. It has the ability to view, modify, and write many different game-
504 specific formats, and even convert between some of them, or from/to other generic
505 formats such as PNG.")
506 (license license:gpl2+)))
515 (url "https://github.com/mapeditor/tiled")
516 (commit (string-append "v" version))))
517 (file-name (git-file-name name version))
520 "0iimfj4kbhmjk94586fqz11bk4i7v0zsxby8agx7450cqlh2y3zi"))))
521 (build-system gnu-build-system)
523 (list qtbase-5 qtdeclarative-5 qtsvg-5 zlib))
528 (modify-phases %standard-phases
530 (lambda* (#:key inputs outputs #:allow-other-keys)
531 (substitute* "translations/translations.pro"
533 (string-append "LRELEASE = "
534 (search-input-file inputs "/bin/lrelease")
536 (let ((out (assoc-ref outputs "out")))
538 (string-append "PREFIX=" out))))))))
539 (home-page "https://www.mapeditor.org/")
540 (synopsis "Tile map editor")
542 "Tiled is a general purpose tile map editor. It is meant to be used for
543 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
546 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
548 (license license:gpl2+)))
550 (define-public tsukundere
557 (url "https://gitlab.com/lilyp/tsukundere")
559 (file-name (git-file-name name version))
562 "11glghnff27rqh2s34g51afg93g3f5ryfz9mkyb7qj35ngl8vw5f"))))
563 (build-system gnu-build-system)
565 `(#:modules ((ice-9 match)
567 ((guix build guile-build-system)
568 #:select (target-guile-effective-version))
569 ,@%gnu-build-system-modules)
570 #:imported-modules ((guix build guile-build-system)
571 ,@%gnu-build-system-modules)
573 (modify-phases %standard-phases
574 (add-after 'unpack 'patch-command
575 (lambda* (#:key inputs outputs #:allow-other-keys)
576 (let* ((scm (lambda (in)
577 (string-append in "/share/guile/site/"
578 (target-guile-effective-version))))
580 (string-append in "/lib/guile/"
581 (target-guile-effective-version)
585 (assoc-ref outputs "out")
588 (("guile" . pkg) pkg)
590 (and (string-prefix? "guile-" label) pkg)))
592 (substitute* "tsukundere.scm"
593 (("exec guile (.*)" _ args)
595 ;; XXX: Prevent Guile-SDL2 from blowing up by not knowing
596 ;; where the SDL2 libaries are.
597 "unset LD_LIBRARY_PATH\n"
598 (format #f "export GUILE_LOAD_PATH=\"~@?\"~%"
599 "~{~a~^:~}" (map scm pkgs))
600 (format #f "export GUILE_LOAD_COMPILED_PATH=\"~@?\"~%"
601 "~{~a~^:~}" (map ccache pkgs))
603 (assoc-ref inputs "guile")
604 "/bin/guile " args)))
607 `(("autoconf" ,autoconf)
608 ("automake" ,automake)
609 ("gettext" ,gettext-minimal)
612 ("pkg-config" ,pkg-config)
613 ("texinfo" ,texinfo)))
615 `(("guile-sdl2" ,guile3.0-sdl2)
619 (home-page "https://gitlab.com/lilyp/tsukundere")
620 (synopsis "Visual novel engine")
621 (description "Tsukundere is a game engine geared heavily towards the
622 development of visual novels, written on top of Guile-SDL2. It is still
624 (license license:lgpl3+)))
632 ;; Do not fetch the archives from
633 ;; http://mirror0.sfml-dev.org/files/ because files there seem
634 ;; to be changed in place.
636 (url "https://github.com/SFML/SFML")
638 (file-name (git-file-name name version))
641 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
642 (modules '((guix build utils)))
645 ;; Ensure system libraries are used.
646 (delete-file-recursively "extlibs")
648 (build-system cmake-build-system)
651 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
652 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
653 #:tests? #f)) ; no tests
660 ("xcb-util-image" ,xcb-util-image)
661 ("libxrandr" ,libxrandr)
663 ("libjpeg" ,libjpeg-turbo)
664 ("libsndfile" ,libsndfile)
665 ("stb-image" ,stb-image)
666 ("stb-image-write" ,stb-image-write)))
668 ;; In Requires.private of pkg-config files.
669 (list flac freetype libvorbis openal))
670 (home-page "https://www.sfml-dev.org")
671 (synopsis "Simple and Fast Multimedia Library")
673 "SFML provides a simple interface to the various computer components,
674 to ease the development of games and multimedia applications. It is composed
675 of five modules: system, window, graphics, audio and network.")
676 (license license:zlib)))
684 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
687 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
688 (build-system gnu-build-system)
690 `(#:phases (modify-phases %standard-phases
691 (delete 'configure) ; no configure script
692 (add-before 'build 'patch-makefile
693 (lambda* (#:key outputs #:allow-other-keys)
694 (let ((out (assoc-ref outputs "out")))
695 (substitute* "Makefile"
696 (("\\$\\(DESTDIR\\)/usr") out))
697 (substitute* "main.cpp"
699 (string-append out "/share")))
701 #:tests? #f)) ; no tests
703 (list pkg-config desktop-file-utils))
706 (synopsis "Simple sound effect generator")
707 (description "Sfxr is a tool for quickly generating simple sound effects.
708 Originally created for use in video game prototypes, it can generate random
709 sounds from presets such as \"explosion\" or \"powerup\".")
710 (home-page "http://www.drpetter.se/project_sfxr.html")
711 (license license:expat)))
713 (define-public surgescript
721 (url "https://github.com/alemart/surgescript")
722 (commit (string-append "v" version))))
723 (file-name (git-file-name name version))
725 (base32 "0xwd4g7n0b0rxkpbyshkzyl472h1y606ghyvf8gv034n3jz2g4jk"))))
726 (build-system cmake-build-system)
729 (let ((share (string-append (assoc-ref %outputs "out") "/share")))
730 (list "-DWANT_STATIC=NO"
731 (string-append "-DICON_PATH=" share "/pixmaps")
732 (string-append "-DMETAINFO_PATH=" share "/metainfo")))
734 (home-page "https://docs.opensurge2d.org")
735 (synopsis "Scripting language for games")
736 (description "@code{SurgeScript} is a dynamically typed object-oriented
737 scripting language designed for games. Each object is a state machine that
738 can be customized by attaching other objects. The language supports automatic
739 garbage collection and can be extended with plugins.")
740 (license license:asl2.0)))
742 (define-public physfs
749 "https://icculus.org/physfs/downloads/physfs-"
751 (file-name (string-append name "-" version ".tar.gz"))
754 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
755 (build-system cmake-build-system)
757 '(#:tests? #f ; no check target
758 #:configure-flags '("-DPHYSFS_BUILD_STATIC=OFF")
759 #:phases (modify-phases %standard-phases
760 (add-after 'unpack 'patch-CMakeLists.txt
762 (substitute* "CMakeLists.txt"
763 ;; XXX: For some reason CMakeLists.txt disables
764 ;; RUNPATH manipulation when the compiler is GCC.
765 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
771 (home-page "https://icculus.org/physfs")
772 (synopsis "File system abstraction library")
774 "PhysicsFS is a library to provide abstract access to various archives.
775 It is intended for use in video games. For security, no file writing done
776 through the PhysicsFS API can leave a defined @emph{write directory}. For
777 file reading, a @emph{search path} with archives and directories is defined,
778 and it becomes a single, transparent hierarchical file system. So archive
779 files can be accessed in the same way as you access files directly on a disk,
780 and it makes it easy to ship a new archive that will override a previous
781 archive on a per-file basis.")
782 (license license:zlib)))
791 (uri (string-append "https://github.com/love2d/love/releases/download/"
792 version "/love-" version "-linux-src.tar.gz"))
794 (base32 "0sak3zjpzfs3ys315m8qvszi946fz76jcpsb58j11wplyp5fwbz3"))))
795 (build-system gnu-build-system)
810 (synopsis "2D game framework for Lua")
811 (description "LÖVE is a framework for making 2D games in the Lua
812 programming language.")
813 (home-page "https://love2d.org/")
814 (license license:zlib)))
816 (define-public love-nuklear
818 (name "love-nuklear")
823 (url "https://github.com/keharriso/love-nuklear/")
824 (commit (string-append "v" version))
826 ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
827 ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
828 (file-name (git-file-name name version))
831 "090xp5c975155hd1pa7bdssdlawvygs5s6icdkwbyc8il5kg5kgv"))))
832 (build-system cmake-build-system)
834 `(#:build-type "Release"
837 (modify-phases %standard-phases
838 (add-after 'unpack 'patch-cmake
840 (substitute* "CMakeLists.txt"
841 (("DESTINATION .") "DESTINATION lib/love")))))))
844 (synopsis "Lightweight immediate mode GUI for LÖVE games")
845 (description "LÖVE is a Lua framework for making 2D games. Nuklear
846 is a minimal state immediate mode graphical user interface toolkit. This
847 package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
848 (home-page "https://github.com/keharriso/love-nuklear/")
849 (license license:expat)))
851 (define-public allegro-4
857 (uri (string-append "https://github.com/liballeg/allegro5/"
858 "releases/download/" version "/allegro-"
862 "1m6lz35nk07dli26kkwz3wa50jsrxs1kb6w1nj14a911l34xn6gc"))))
863 (build-system cmake-build-system)
866 (modify-phases %standard-phases
867 (add-after 'unpack 'patch-build-system
869 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
870 ;; via a command line option doesn't work because it is
871 ;; unconditionally clobbered in the build script.
872 (substitute* '("CMakeLists.txt")
873 (("ADDON_LINKAGE STATIC")
874 "ADDON_LINKAGE SHARED")))))))
876 (list glu libpng libvorbis mesa zlib))
877 (synopsis "Game programming library")
878 (description "Allegro is a library mainly aimed at video game and
879 multimedia programming. It handles common, low-level tasks such as creating
880 windows, accepting user input, loading data, drawing images, playing sounds,
882 (home-page "https://liballeg.org")
883 (license license:giftware)))
885 (define-public allegro
891 (uri (string-append "https://github.com/liballeg/allegro5/releases"
892 "/download/" version "/allegro-"
896 "034pmbmbq6jagpp4lhnyjqmf8gcz5fx74d9rknrm7d4wv4cv7qy1"))))
897 (build-system cmake-build-system)
898 (arguments `(#:tests? #f)) ; there are no tests
900 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
902 ("freetype" ,freetype)
905 ("libjpeg" ,libjpeg-turbo)
907 ("libtheora" ,libtheora)
908 ("libvorbis" ,libvorbis)
909 ("libxcursor" ,libxcursor)
910 ("libxinerama" ,libxinerama)
911 ("libxrandr" ,libxrandr)
918 (synopsis "Game programming library")
919 (description "Allegro is a library mainly aimed at video game and
920 multimedia programming. It handles common, low-level tasks such as creating
921 windows, accepting user input, loading data, drawing images, playing sounds,
923 (home-page "https://liballeg.org")
924 (license license:bsd-3)))
926 (define-public allegro-5.0
927 (package (inherit allegro)
932 (uri (string-append "https://github.com/liballeg/allegro5/releases"
933 "/download/" version "/allegro-"
934 (if (equal? "0" (string-take-right version 1))
935 (string-drop-right version 2)
938 (patches (search-patches
939 "allegro-mesa-18.2.5-and-later.patch"))
942 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
944 (define-public aseprite
947 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
948 ;; TODO: Unbundle third party software.
950 (method url-fetch/zipbomb)
951 (uri (string-append "https://github.com/aseprite/aseprite"
952 "/releases/download/v" version
953 "/Aseprite-v" version "-Source.zip"))
956 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
957 (build-system cmake-build-system)
960 ;; Use shared libraries instead of building bundled source.
961 (list "-DWITH_WEBP_SUPPORT=1"
962 "-DUSE_SHARED_CURL=1"
963 "-DUSE_SHARED_GIFLIB=1"
964 "-DUSE_SHARED_JPEGLIB=1"
965 "-DUSE_SHARED_ZLIB=1"
966 "-DUSE_SHARED_LIBPNG=1"
967 "-DUSE_SHARED_LIBLOADPNG=1"
968 "-DUSE_SHARED_LIBWEBP=1"
969 "-DUSE_SHARED_TINYXML=1"
970 "-DUSE_SHARED_PIXMAN=1"
971 "-DUSE_SHARED_FREETYPE=1"
972 "-DUSE_SHARED_ALLEGRO4=1"
973 "-DENABLE_UPDATER=0" ; no auto-updates
974 (string-append "-DFREETYPE_INCLUDE_DIR="
975 (assoc-ref %build-inputs "freetype")
976 "/include/freetype2"))))
979 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
980 ;; patched version is bundled with Aseprite, but the patches should be
981 ;; extracted and applied on top of a standalone Allegro 4 package.
983 `(("allegro" ,allegro-4)
985 ("freetype" ,freetype)
987 ("libjpeg" ,libjpeg-turbo)
992 ("libxxf86vm" ,libxxf86vm)
996 (synopsis "Animated sprite editor and pixel art tool")
997 (description "Aseprite is a tool for creating 2D pixel art for video
998 games. In addition to basic pixel editing features, Aseprite can assist in
999 the creation of animations, tiled graphics, texture atlases, and more.")
1000 (home-page "https://www.aseprite.org/")
1001 (license license:gpl2+)))
1003 (define-public libresprite
1005 (name "libresprite")
1007 ;; TODO: Unbundle third party software.
1008 ;; - duktape is bundled inside the project but it's hard to unbundle:
1009 ;; there are many differences from a version to the next and it is not
1010 ;; really designed to work as a shared lib.
1014 (url "https://github.com/LibreSprite/LibreSprite")
1015 (commit (string-append "v" version))
1017 (file-name (git-file-name name version))
1020 "0djbjjh21ahlxzh0b0jp4mpfycam8h9157i4wbxkd618fraadhbp"))))
1021 (build-system cmake-build-system)
1024 (list "-DWITH_WEBP_SUPPORT=1")
1025 ;; Tests are unmaintained
1028 `(("pkg-config" ,pkg-config)))
1031 ("freetype" ,freetype)
1033 ("googletest" ,googletest)
1034 ("libjpeg" ,libjpeg-turbo)
1036 ("libwebp" ,libwebp)
1038 ("libxext" ,libxext)
1039 ("libxxf86dga" ,libxxf86dga)
1040 ("libxxf86vm" ,libxxf86vm)
1041 ("lua" ,lua) ; Optional
1044 ("sdl2-image" ,sdl2-image)
1045 ("tinyxml" ,tinyxml)
1047 (synopsis "Animated sprite editor and pixel art tool")
1048 (description "LibreSprite is a tool for creating 2D pixel art for video
1049 games. In addition to basic pixel editing features, it can assist in the
1050 creation of animations, tiled graphics, texture atlases, and more.
1051 LibreSprite is a fork of the latest GPLv2 commit of Aseprite.")
1052 (home-page "https://libresprite.github.io/")
1053 (license license:gpl2+)))
1055 (define-public qqwing
1062 "https://qqwing.com/"
1063 name "-" version ".tar.gz"))
1066 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
1067 (build-system gnu-build-system)
1070 (home-page "https://qqwing.com/")
1071 (synopsis "Sudoku puzzle solver and generator")
1073 "QQWing is a Sudoku puzzle generator and solver.
1074 It offers the following features:
1076 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
1077 @item Uses logic. Uses as many solve techniques as possible when solving
1078 puzzles rather than guessing.
1079 @item Rates puzzles. Most generators don't give an indication of the difficulty
1080 of a Sudoku puzzle. QQwing does.
1081 @item Can print solve instructions for any puzzle.
1082 @item Customizable output style, including a CSV style that is easy to
1083 import into a database.
1085 (license license:gpl2+)))
1087 (define-public quesoglc
1093 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1094 name "-" version "-free.tar.bz2"))
1097 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
1098 (build-system gnu-build-system)
1099 (native-inputs (list pkg-config))
1100 (inputs (list fontconfig freeglut fribidi glew))
1101 (home-page "http://quesoglc.sourceforge.net")
1102 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
1104 "The OpenGL Character Renderer (GLC) is a state machine that provides
1105 OpenGL programs with character rendering services via an application programming
1107 (license (list license:expat license:lgpl2.1+))))
1109 (define-public python-pygame
1111 (name "python-pygame")
1115 (uri (pypi-uri "pygame" version))
1118 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
1119 (build-system python-build-system)
1121 `(#:tests? #f ; tests require pygame to be installed first
1123 (modify-phases %standard-phases
1124 ;; Set the paths to the dependencies manually because
1125 ;; the configure script does not allow passing them as
1126 ;; parameters. This also means we can skip the configure
1128 (add-before 'build 'set-library-paths
1129 (lambda* (#:key inputs outputs #:allow-other-keys)
1130 (let ((sdl-ref (assoc-ref inputs "sdl"))
1131 (font-ref (assoc-ref inputs "sdl-ttf"))
1132 (image-ref (assoc-ref inputs "sdl-image"))
1133 (mixer-ref (assoc-ref inputs "sdl-mixer"))
1134 (smpeg-ref (assoc-ref inputs "libsmpeg"))
1135 (png-ref (assoc-ref inputs "libpng"))
1136 (jpeg-ref (assoc-ref inputs "libjpeg"))
1137 (freetype-ref (assoc-ref inputs "freetype"))
1138 (v4l-ref (assoc-ref inputs "v4l-utils"))
1139 (out-ref (assoc-ref outputs "out")))
1140 (substitute* "Setup.in"
1141 (("SDL = -I/usr/include/SDL")
1142 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
1143 (substitute* "Setup.in"
1144 (("FONT = -lSDL_ttf")
1145 (string-append "FONT = -I" font-ref "/include/SDL -L"
1146 font-ref "/lib -lSDL_ttf")))
1147 (substitute* "Setup.in"
1148 (("IMAGE = -lSDL_image")
1149 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
1150 image-ref "/lib -lSDL_image")))
1151 (substitute* "Setup.in"
1152 (("MIXER = -lSDL_mixer")
1153 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
1154 mixer-ref "/lib -lSDL_mixer")))
1155 (substitute* "Setup.in"
1156 (("SMPEG = -lsmpeg")
1157 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
1158 smpeg-ref "/lib -lsmpeg")))
1159 (substitute* "Setup.in"
1161 (string-append "PNG = -I" png-ref "/include -L"
1162 png-ref "/lib -lpng")))
1163 (substitute* "Setup.in"
1165 (string-append "JPEG = -I" jpeg-ref "/include -L"
1166 jpeg-ref "/lib -ljpeg")))
1168 (substitute* "Setup.in"
1169 (("FREETYPE = -lfreetype")
1170 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
1171 freetype-ref "/lib -lfreetype")))
1173 (substitute* "Setup.in"
1174 (("^pypm") "#pypm"))
1175 ;; Create a path to a header file provided by v4l-utils.
1176 (system* "mkdir" "linux")
1177 (system* "ln" "--symbolic"
1178 (string-append v4l-ref "/include/libv4l1-videodev.h")
1180 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
1182 `(("freetype" ,freetype)
1184 ("sdl-image" ,sdl-image)
1185 ("sdl-mixer" ,sdl-mixer)
1186 ("sdl-ttf" ,sdl-ttf)
1187 ("sdl-gfx" ,sdl-gfx)
1188 ("libjpeg" ,libjpeg-turbo)
1191 ("libsmpeg" ,libsmpeg)
1192 ("portmidi" ,portmidi)
1193 ("v4l-utils" ,v4l-utils)))
1194 (home-page "https://www.pygame.org")
1195 (synopsis "SDL wrapper for Python")
1196 (description "Pygame is a set of Python modules designed for writing games.
1197 Pygame adds functionality on top of the excellent SDL library. This allows you
1198 to create fully featured games and multimedia programs in the python language.")
1199 (license (list license:bsd-2
1200 ;; python numeric license as listed by Debian looks like
1201 ;; an Expat-style license with a warranty disclaimer for
1202 ;; the U.S. government and the University of California.
1208 license:public-domain
1209 license:lgpl2.1+))))
1211 (define-public python-pygame-sdl2
1212 (let ((real-version "2.1.0")
1213 (renpy-version "8.0.0"))
1215 (inherit python-pygame)
1216 (name "python-pygame-sdl2")
1217 (version (string-append real-version "-for-renpy-" renpy-version))
1221 (uri (string-append "https://www.renpy.org/dl/" renpy-version
1222 "/pygame_sdl2-" version ".tar.gz"))
1223 (sha256 (base32 "0majf64pdfba5byjlv41pgsdmwvy09hw3m7143jz3kc1wjd2gaw8"))
1224 (modules '((guix build utils)))
1227 ;; drop generated sources
1228 (delete-file-recursively "gen")
1229 (delete-file-recursively "gen3")
1230 (delete-file-recursively "gen-static")))))
1231 (build-system python-build-system)
1233 `(#:tests? #f ; tests require pygame to be installed first
1235 (modify-phases %standard-phases
1236 (add-after 'set-paths 'set-sdl-vars
1237 (lambda* (#:key inputs #:allow-other-keys)
1238 (setenv "PYGAME_SDL2_CFLAGS"
1240 (assoc-ref inputs "sdl-union")
1241 "/include/SDL2 -D_REENTRANT"))
1242 (setenv "PYGAME_SDL2_LDFLAGS"
1244 (assoc-ref inputs "sdl-union")
1246 (assoc-ref inputs "sdl-union")
1247 "/lib -Wl,--enable-new-dtags -lSDL2"))
1250 (list (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))))
1252 (list python-cython))
1253 (home-page "https://www.renpy.org/")
1254 (synopsis "Reimplementation of the Pygame API using SDL2")
1255 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1256 staying close to the original, but also adding some SDL2-specific features.
1257 While it aims to be used as a drop-in replacement, it appears to be
1258 developed mainly for Ren'py.")
1259 (license (list license:lgpl2.1 license:zlib)))))
1261 (define-public python-renpy
1263 (name "python-renpy")
1268 (uri (string-append "https://www.renpy.org/dl/" version
1269 "/renpy-" version "-source.tar.bz2"))
1270 (sha256 (base32 "09z3r16j4cxddkb50ghmi4xp0s05s15q4pzdmfajy85ignwqhjdi"))
1271 (modules '((guix build utils)))
1274 "renpy-use-system-fribidi.patch"))
1276 '(with-directory-excursion "module"
1277 ;; drop fribidi sources
1278 (delete-file-recursively "fribidi-src")
1279 ;; drop _renpytfd, as there are missing sources
1280 (substitute* "setup.py"
1281 (("cython\\(\"_renpytfd\"" all)
1282 (string-append "pass # " all)))))))
1283 (build-system python-build-system)
1285 `(#:tests? #f ; Ren'py doesn't seem to package tests
1287 (modify-phases %standard-phases
1288 (add-after 'unpack 'fix-commands
1289 (lambda* (#:key inputs #:allow-other-keys)
1290 (substitute* "renpy/editor.py"
1292 (string-append (assoc-ref inputs "xdg-utils")
1293 "/bin/xdg-open")))))
1294 (add-after 'unpack 'fix-include-paths
1295 (lambda* (#:key inputs #:allow-other-keys)
1296 (substitute* "module/setup.py"
1297 (("/usr/include/fribidi")
1298 (search-input-directory inputs "include/fribidi")))))
1299 (add-after 'set-paths 'set-build-vars
1300 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1301 (setenv "RENPY_CYTHON"
1302 (search-input-file (or native-inputs inputs)
1304 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))))
1306 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1307 ;; The "module" subdirectory contains a python (really cython)
1308 ;; project, which is built using a script, that is thankfully
1309 ;; named "setup.py".
1310 (with-directory-excursion "module"
1311 (apply (assoc-ref %standard-phases 'build) args))
1312 ;; The above only builds the cython modules, but nothing else,
1313 ;; so we do that here.
1314 (invoke "python" "-m" "compileall" "renpy")))
1316 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1317 ;; Again, we have to wrap the module installation.
1318 ;; Additionally, we want to install the python code
1319 ;; (both source and compiled) in the same directory.
1320 (let* ((out (assoc-ref outputs "out"))
1321 (site (string-append "/lib/python"
1323 (assoc-ref inputs "python"))
1325 (with-directory-excursion "module"
1326 (apply (assoc-ref %standard-phases 'install) args))
1327 (copy-recursively "renpy"
1328 (string-append out site "/renpy"))
1329 (delete-file-recursively (string-append out site
1330 "/renpy/common"))))))))
1331 (native-inputs (list python-cython))
1338 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))
1340 (propagated-inputs (list python-future python-pygame-sdl2))
1341 (home-page "https://www.renpy.org/")
1342 (synopsis "Ren'py python module")
1343 (description "This package contains the shared libraries and Python modules
1344 of Ren'py. While functional, they are not meaningful on their own without
1345 the launcher and common Ren'py code provided by the @code{renpy} package and
1346 are only used to bootstrap it.")
1347 (license license:expat)))
1349 (define-public renpy
1351 (inherit python-renpy)
1353 (build-system python-build-system)
1356 #:tests? #f ; see python-renpy
1357 #:modules '((srfi srfi-1)
1358 (guix build python-build-system)
1360 #:imported-modules `((srfi srfi-1) ,@%python-build-system-modules)
1362 #~(modify-phases %standard-phases
1363 (add-after 'unpack 'fix-commands
1364 (lambda* (#:key inputs outputs #:allow-other-keys)
1365 (substitute* "launcher/game/choose_directory.rpy"
1366 (("/usr/bin/python")
1367 (search-input-file inputs "/bin/python3")))
1368 (substitute* "launcher/game/front_page.rpy"
1370 (search-input-file inputs "/bin/xdg-open")))
1371 (substitute* "launcher/game/project.rpy"
1372 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1373 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1375 ;; Projects are still created in the usual style, so we need
1376 ;; to adjust the path.
1377 (("cmd.append\\(self.path\\)")
1378 "cmd.append(self.path + \"/game\")"))))
1379 (add-after 'unpack 'drop-game-from-paths
1381 (substitute* (list "launcher/game/gui7.rpy"
1382 "launcher/game/gui7/images.py")
1383 ((", \"game\",") ","))
1385 (add-before 'build 'start-xserver
1386 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1387 (let ((Xvfb (search-input-file (or native-inputs inputs)
1389 (setenv "HOME" (getcwd))
1390 (system (format #f "~a :1 &" Xvfb))
1391 (setenv "DISPLAY" ":1"))))
1394 (invoke "python" "renpy.py" "launcher" "quit")
1395 (invoke "python" "renpy.py" "the_question" "quit")
1396 (invoke "python" "renpy.py" "tutorial" "quit")))
1398 (lambda* (#:key inputs outputs #:allow-other-keys)
1399 ;; Here we install our custom renpy program.
1400 ;; After finishing this step, "out" will have the following:
1402 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1406 ;; Note that common shares the source files that would be installed
1407 ;; by python2-renpy (which are instead deleted from that package),
1408 ;; but also contains their byte-compiled versions.
1409 ;; On other systems, renpy_base would point to site-packages or
1410 ;; even somewhere in /opt.
1411 ;; The former approach is not as straightforward as it seems
1412 ;; -- it causes renpy to load files twice for some weird reason --
1413 ;; and the latter is impossible on Guix. Hence the detour through
1414 ;; share/renpy and the custom renpy program.
1416 ;; As a convention, other games should be installed as
1417 ;; subdirectories of share/renpy in their respective outputs as
1418 ;; well. This differs from the traditional layout, which is
1419 ;; roughly the following:
1420 ;; `-- Super Awesome Game
1421 ;; |-- game ; <- the folder we actually want
1422 ;; |-- lib ; compiled renpy module and dependencies
1423 ;; |-- renpy ; yet another copy of Ren'py's code
1424 ;; | |-- common ; the common folder from above
1425 ;; | `-- ... ; Python code (source + compiled)
1426 ;; |-- Super Awesome Game.py
1427 ;; `-- Super Awesome Game.sh
1428 (let* ((out (assoc-ref outputs "out"))
1429 (bin/renpy (string-append out "/bin/renpy")))
1430 (copy-recursively "renpy/common"
1431 (string-append out "/share/renpy/common"))
1432 (copy-recursively "gui"
1433 (string-append out "/share/renpy/gui"))
1434 (copy-recursively "sdk-fonts"
1435 (string-append out "/share/renpy/sdk-fonts"))
1437 (mkdir-p (string-append out "/bin"))
1438 (copy-file #$(local-file (search-auxiliary-file "renpy/renpy.in"))
1440 (substitute* bin/renpy
1441 (("@PYTHON@") (search-input-file inputs "bin/python3"))
1442 (("@RENPY_BASE@") (string-append out "/share/renpy")))
1443 (chmod bin/renpy #o755))))
1445 (add-after 'install 'install-games
1446 (lambda* (#:key inputs outputs #:allow-other-keys)
1447 (define renpy (assoc-ref outputs "out"))
1448 ;; TODO: We should offer a renpy-build-system to make the
1449 ;; installation of Ren'py games easier.
1450 (define* (install-renpy-game #:key output game name (renpy renpy)
1452 (let* ((name (or name (basename game)))
1453 (launcher (string-append output "/bin/renpy-" name))
1454 (share (string-append output "/share/renpy/" name)))
1455 (copy-recursively (string-append game "/game") share)
1456 (mkdir-p (string-append output "/bin"))
1457 (with-output-to-file launcher
1460 "#!~a~%~a ~a \"$@\""
1461 (search-input-file inputs "/bin/bash")
1462 (string-append renpy "/bin/renpy")
1464 (chmod launcher #o755)))
1466 (install-renpy-game #:output (assoc-ref outputs "out")
1469 (install-renpy-game #:output (assoc-ref outputs "the-question")
1470 #:game "the_question"
1471 #:name "the-question")
1473 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1474 #:game "tutorial")))
1476 (lambda* (#:key inputs outputs #:allow-other-keys)
1477 (let ((out (assoc-ref outputs "out"))
1478 (site (string-append "/lib/python"
1480 (assoc-ref inputs "python"))
1482 (wrap-program (string-append out "/bin/renpy")
1483 `("GUIX_PYTHONPATH" =
1484 (,@(delete-duplicates
1486 (lambda (store-path)
1487 (string-append store-path site))
1488 (cons (assoc-ref outputs "out")
1492 (string-prefix? "python" (car input)))
1493 inputs))))))))))))))
1494 (inputs (list bash-minimal
1502 (propagated-inputs '())
1503 (native-inputs (list xorg-server-for-tests))
1504 (outputs (list "out" "tutorial" "the-question"))
1505 (home-page "https://www.renpy.org/")
1506 (synopsis "Visual Novel Engine")
1507 (description "Ren'Py is a visual novel engine that helps you use words,
1508 images, and sounds to tell interactive stories that run on computers and
1509 mobile devices. These can be both visual novels and life simulation games.
1510 The easy to learn script language allows anyone to efficiently write large
1511 visual novels, while its Python scripting is enough for complex simulation
1513 (license license:expat)))
1515 (define-public python-pyxel
1517 (name "python-pyxel")
1524 (url "https://github.com/kitao/pyxel")
1525 (commit (string-append "v" version))))
1526 (file-name (git-file-name name version))
1529 "0bwsgb5yq5s479cnf046v379zsn5ybp5195kbfvzr9l11qbaicm9"))
1530 (modules '((guix build utils)))
1533 (delete-file-recursively "pyxel/core/bin")))))
1534 (build-system python-build-system)
1536 `(#:tests? #f ; "Tests" are actually example programs that never halt.
1538 (modify-phases %standard-phases
1539 (add-after 'unpack 'patch-build-files
1540 (lambda* (#:key inputs #:allow-other-keys)
1541 (substitute* "setup.py"
1542 (("\"pyxel\\.core\\.bin\\.(.*)\"," all arch)
1543 (if (string=? arch "linux")
1546 (substitute* "pyxel/core/Makefile"
1548 (string-append "`sdl2-config --prefix="
1549 (assoc-ref inputs "sdl2"))))))
1550 (add-before 'build 'prebuild
1552 (invoke "make" "-C" "pyxel/core"))))))
1554 `(("gifsicle" ,gifsicle)
1555 ("sdl2" ,(sdl-union (list sdl2 sdl2-image)))))
1556 (home-page "https://github.com/kitao/pyxel")
1557 (synopsis "Retro game engine for Python")
1558 (description "Pyxel is a game engine inspired by retro gaming consoles.
1559 It has a fixed 16-color palette, can hold up to 3 image banks and 8 tilemaps
1560 (256x256 pixels each) and 4 sound channels with 64 definable sounds. It
1561 also comes with a built-in image and sound editor.")
1562 (license license:expat)))
1564 (define-public grafx2
1570 ;; XXX: There is no URL that contains the version. :(
1571 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1572 (file-name (string-append "grafx2-" version ".tgz"))
1575 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1576 (build-system gnu-build-system)
1579 (modify-phases %standard-phases
1580 (delete 'configure) ; no configure script
1581 (add-before 'build 'change-to-src-directory
1586 ;; SDL header files are referenced without the preceeding "SDL/".
1587 (list (string-append "CFLAGS=-I"
1588 (assoc-ref %build-inputs "sdl-union")
1591 (string-append "prefix="
1592 (assoc-ref %outputs "out")))
1593 #:tests? #f)) ; no check target
1597 (list libpng lua-5.1
1598 (sdl-union (list sdl sdl-image sdl-ttf))))
1599 (synopsis "Bitmap paint program")
1600 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1601 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1602 includes a very large number of tools and effects that make it particularly
1603 suitable for pixel art, game graphics, and generally any detailed graphics
1604 painted with a mouse.")
1605 (home-page "http://pulkomandy.tk/projects/GrafX2")
1606 (license license:gpl2))) ; GPLv2 only
1616 (url "https://github.com/wgois/OIS")
1617 (commit (string-append "v" version))))
1618 (file-name (git-file-name name version))
1620 (base32 "0nkh0zrsbyv47c0i0vhdna3jsnvs69pb1svg75avxw6z7kwskgla"))))
1621 (build-system cmake-build-system)
1623 `(#:tests? #f)) ; no test suite
1626 (synopsis "Object Oriented Input System")
1628 "Cross Platform Object Oriented Input Lib System is a cross platform,
1629 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1630 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1631 robust and compatible with many systems and operating systems.")
1632 (home-page "https://github.com/wgois/OIS")
1633 (license license:zlib)))
1635 (define-public mygui
1643 (url "https://github.com/MyGUI/mygui")
1644 (commit (string-append "MyGUI" version))))
1645 (file-name (git-file-name name version))
1648 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
1649 (build-system cmake-build-system)
1651 '(#:tests? #f ; No test target
1653 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1654 (string-append "-DOGRE_INCLUDE_DIR="
1655 (assoc-ref %build-inputs "ogre")
1657 ;; Demos and tools are Windows-specific:
1658 ;; https://github.com/MyGUI/mygui/issues/24.
1659 "-DMYGUI_BUILD_DEMOS=FALSE"
1660 "-DMYGUI_BUILD_TOOLS=FALSE")))
1662 (list boost doxygen pkg-config))
1670 (synopsis "Fast, flexible and simple GUI")
1672 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1673 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1675 (home-page "http://mygui.info/")
1676 (license license:expat)))
1678 (define-public mygui-gl
1679 ;; Closure size is reduced by some 800 MiB.
1685 (substitute-keyword-arguments (package-arguments mygui)
1686 ((#:configure-flags _)
1687 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1688 ;; We can't reuse the flags because of the mention to Ogre.
1689 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1690 ;; Demos and tools are Windows-specific:
1691 ;; https://github.com/MyGUI/mygui/issues/24.
1692 "-DMYGUI_BUILD_DEMOS=FALSE"
1693 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1695 (modify-inputs (package-inputs mygui)
1697 (prepend mesa glu)))
1698 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1700 (define-public openmw
1708 (url "https://github.com/OpenMW/openmw")
1709 (commit (string-append "openmw-" version))))
1710 (file-name (git-file-name name version))
1713 "19mcbnjl4279qalb97msf965bjax48mx1r1qczyvwhn28h6n3bsy"))))
1714 (build-system cmake-build-system)
1716 `(#:tests? #f ; No test target
1718 (list "-DDESIRED_QT_VERSION=5"
1719 "-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=ON")))
1721 (list boost doxygen pkg-config))
1727 mygui-gl ; OpenMW does not need Ogre.
1729 openmw-openscenegraph
1734 (synopsis "Re-implementation of the RPG Morrowind engine")
1736 "OpenMW is a game engine which reimplements and extends the one that runs
1737 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1738 called OpenMW-CS which allows the user to edit or create their own original
1740 (home-page "https://openmw.org")
1741 (license license:gpl3)))
1743 (define-public godot
1750 (url "https://github.com/godotengine/godot")
1751 (commit (string-append version "-stable"))))
1752 (file-name (git-file-name name version))
1755 "1bm9yl995chvx6jwkdia12yjrgwcpzb1r9bmj606q8z264aw2ma5"))
1756 (modules '((guix build utils)
1761 ;; Keep only those bundled files we have not (yet) replaced
1762 ;; with Guix versions. Note that some of these may be
1763 ;; modified; see "thirdparty/README.md".
1764 (with-directory-excursion "thirdparty"
1765 (let* ((preserved-files
1790 (for-each delete-file-recursively
1791 (lset-difference string=?
1793 (cons* "." ".." preserved-files)))))))))
1794 (build-system scons-build-system)
1796 `(#:scons ,scons-python2
1797 #:scons-flags (list "platform=x11" "target=release_debug"
1798 ;; Avoid using many of the bundled libs.
1799 ;; Note: These options can be found in the SConstruct file.
1801 "builtin_freetype=no"
1803 "builtin_libmpdec=no"
1806 "builtin_libtheora=no"
1807 "builtin_libvorbis=no"
1809 "builtin_libwebp=no"
1810 "builtin_mbedtls=no"
1816 #:tests? #f ; There are no tests
1818 (modify-phases %standard-phases
1819 (add-after 'unpack 'scons-use-env
1821 ;; Scons does not use the environment variables by default,
1822 ;; but this substitution makes it do so.
1823 (substitute* "SConstruct"
1824 (("env_base = Environment\\(tools=custom_tools\\)")
1826 "env_base = Environment(tools=custom_tools)\n"
1827 "env_base = Environment(ENV=os.environ)")))))
1828 ;; Build headless tools, used for packaging games without depending on X.
1829 (add-after 'build 'build-headless
1830 (lambda* (#:key scons-flags #:allow-other-keys)
1831 (apply invoke "scons"
1832 `(,(string-append "-j" (number->string (parallel-job-count)))
1833 "platform=server" ,@(delete "platform=x11" scons-flags)))))
1835 (lambda* (#:key inputs outputs #:allow-other-keys)
1836 (let* ((out (assoc-ref outputs "out"))
1837 (headless (assoc-ref outputs "headless"))
1838 (zenity (assoc-ref inputs "zenity")))
1839 ;; Strip build info from filenames.
1840 (with-directory-excursion "bin"
1843 (let ((dest (car (string-split (basename file) #\.))))
1844 (rename-file file dest)))
1845 (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
1846 (install-file "godot" (string-append out "/bin"))
1847 (install-file "godot_server" (string-append headless "/bin")))
1848 ;; Tell the editor where to find zenity for OS.alert().
1849 (wrap-program (string-append out "/bin/godot")
1850 `("PATH" ":" prefix (,(string-append zenity "/bin")))))))
1851 (add-after 'install 'wrap
1852 (lambda* (#:key inputs outputs #:allow-other-keys)
1853 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
1854 ;; fix of the mesa package we wrap the pcb executable such that
1855 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
1856 ;; also append ld path for pulseaudio and alsa-lib
1857 (let* ((out (assoc-ref outputs "out"))
1858 (udev_path (string-append (assoc-ref inputs "eudev") "/lib"))
1859 (pulseaudio_path (string-append (assoc-ref inputs "pulseaudio") "/lib"))
1860 (alas_lib_path (string-append (assoc-ref inputs "alsa-lib") "/lib")))
1861 (wrap-program (string-append out "/bin/godot")
1862 `("LD_LIBRARY_PATH" ":" prefix (,udev_path ,pulseaudio_path ,alas_lib_path))))))
1863 (add-after 'install 'install-godot-desktop
1864 (lambda* (#:key outputs #:allow-other-keys)
1865 (let* ((out (assoc-ref outputs "out"))
1866 (applications (string-append out "/share/applications"))
1867 (icons (string-append out "/share/icons/hicolor")))
1868 (mkdir-p applications)
1869 (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
1870 (string-append applications "/godot.desktop"))
1871 (for-each (lambda (icon dest)
1872 (mkdir-p (dirname dest))
1873 (copy-file icon dest))
1874 '("icon.png" "icon.svg")
1875 `(,(string-append icons "/256x256/apps/godot.png")
1876 ,(string-append icons "/scalable/apps/godot.svg")))))))))
1877 (outputs '("out" "headless"))
1900 eudev ; FIXME: required by mesa
1904 (home-page "https://godotengine.org/")
1905 (synopsis "Advanced 2D and 3D game engine")
1907 "Godot is an advanced multi-platform game engine written in C++. If
1908 features design tools such as a visual editor, can import 3D models and
1909 provide high-quality 3D rendering, it contains an animation editor, and can be
1910 scripted in a Python-like language.")
1911 (license license:expat)))
1920 (url "https://github.com/skypjack/entt")
1921 (commit (string-append "v" version))))
1922 (file-name (git-file-name name version))
1925 "151jg3m262xwaywl2rqnc90yr6p48rhmgi5mxyv6bwqvmfli2m5p"))))
1926 (build-system cmake-build-system)
1928 `(#:configure-flags (list "-DENTT_BUILD_TESTING=ON"
1929 "-DENTT_FIND_GTEST_PACKAGE=ON"
1930 "-DENTT_BUILD_DOCS=ON")
1931 ;; Only tests are compiled, and they need assertions to work correctly.
1932 #:build-type "Debug"))
1934 (list ;; for testing
1936 ;; for documentation
1938 (synopsis "Entity component system")
1939 (description "EnTT is a header-only library, containing (among other things)
1941 @item an entity component system based on sparse sets,
1942 @item a configuration system using the monostate pattern,
1943 @item a static reflection system,
1944 @item and a cooperative scheduler.
1946 (home-page "https://github.com/skypjack/entt")
1947 (license (list license:expat ; code
1948 license:cc-by4.0)))) ; documentation
1950 (define-public eureka
1956 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1958 ;; version without dots e.g 1.21 => 121
1959 (string-join (string-split version #\.) "")
1963 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1964 (build-system gnu-build-system)
1968 (let ((out (assoc-ref %outputs "out")))
1969 (list (string-append "PREFIX=" out)))
1971 (modify-phases %standard-phases
1973 (add-before 'build 'prepare-install-directories
1974 (lambda* (#:key outputs #:allow-other-keys)
1975 (let ((out (assoc-ref outputs "out")))
1976 (mkdir-p (string-append out "/bin"))
1977 (mkdir-p (string-append out "/share"))
1979 (with-fluids ((%default-port-encoding #f))
1980 (substitute* "./src/main.cc"
1981 (("/usr/local") out)))
1983 (substitute* "Makefile"
1984 (("-o root") ""))))))))
1985 (inputs `(("mesa" ,mesa)
1987 ("libxinerama" ,libxinerama)
1988 ("libfontconfig" ,fontconfig)
1989 ("libjpeg" ,libjpeg-turbo)
1993 (native-inputs (list pkg-config xdg-utils))
1994 (synopsis "Doom map editor")
1995 (description "Eureka is a map editor for the classic DOOM games, and a few
1996 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1998 (home-page "http://eureka-editor.sourceforge.net/")
1999 (license license:gpl2+)))
2001 (define-public guile-chickadee
2003 (name "guile-chickadee")
2007 (uri (string-append "https://files.dthompson.us/chickadee/"
2008 "chickadee-" version ".tar.gz"))
2011 "1k2dml2z57lnc36wrmwhh7avnpczxgxnshlfhpbk174vg6v609n0"))))
2012 (build-system gnu-build-system)
2014 '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
2016 `(("guile-opengl" ,guile3.0-opengl)
2017 ("guile-sdl2" ,guile-sdl2)))
2026 (list guile-3.0-latest pkg-config texinfo))
2027 (home-page "https://dthompson.us/projects/chickadee.html")
2028 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
2029 (description "Chickadee is a game development toolkit for Guile Scheme
2030 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
2031 that parenthetically inclined game developers need to make 2D (and eventually
2032 3D) games in Scheme, such as:
2035 @item extensible, fixed-timestep game loop
2036 @item OpenGL-based rendering engine
2037 @item keyboard, mouse, controller input
2038 @item REPL-driven development model
2040 (license license:gpl3+)))
2042 (define-public bennu-game-development
2044 (name "bennu-game-development")
2049 (url "http://svn.code.sf.net/p/bennugd/code")
2050 (revision (string->number version))))
2051 (file-name (string-append name "-" version))
2054 "1iri58ryk9lbqn585cbccnvrfkj8qxlbcsk8rpih40jhvs1j101l"))
2055 (modules '((guix build utils)))
2058 (delete-file-recursively "3rdparty") #t))))
2059 (build-system gnu-build-system)
2062 (modify-phases %standard-phases
2063 (add-after 'unpack 'patch-configure-to-use-openssl
2064 (lambda* (#:key outputs #:allow-other-keys)
2066 (delete-file "configure")
2067 (substitute* "configure.in"
2070 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
2071 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
2078 (inputs (list openssl zlib))
2079 (native-inputs (list pkg-config autoconf automake libtool))
2080 (synopsis "Programming language to create games")
2081 (description "Bennu Game Development, also known as bennudg, is a
2082 programming language tailored at game development. It is the successor of
2084 (home-page "https://sourceforge.net/projects/bennugd/")
2085 (license license:zlib)))
2087 (define-public bennu-game-development-modules
2089 (inherit bennu-game-development)
2090 (name "bennu-game-development-modules")
2093 (modify-phases %standard-phases
2094 (add-after 'unpack 'patch-conflicting-definitions
2096 (with-fluids ((%default-port-encoding #f))
2097 (substitute* "core/include/fmath.h"
2098 (("extern fixed fmul\\( int x, int y \\);") "")
2099 (("extern fixed fdiv\\( int x, int y \\);") "")))
2100 (chdir "modules"))))))
2101 (inputs (list zlib libpng openssl sdl-mixer bennu-game-development))
2102 (synopsis "Modules for the Bennu Game Development programming language")
2103 (description "This package contains a collection of modules for the Bennu
2104 Game Development programming language, from CD handling through SDL to
2105 joystick support.")))
2113 (uri (string-append "http://plib.sourceforge.net/dist/"
2114 "plib-" version ".tar.gz"))
2117 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
2118 (patches (search-patches "plib-CVE-2011-4620.patch"
2119 "plib-CVE-2012-4552.patch"))))
2120 (build-system gnu-build-system)
2122 (list mesa libxi libxmu))
2125 (home-page "http://plib.sourceforge.net/")
2126 (synopsis "Suite of portable game libraries")
2127 (description "PLIB is a set of libraries that will permit programmers to
2128 write games and other realtime interactive applications that are 100% portable
2129 across a wide range of hardware and operating systems. PLIB includes sound
2130 effects, music, a complete 3D engine, font rendering, a simple Windowing
2131 library, a game scripting language, a GUI, networking, 3D math library and a
2132 collection of handy utility functions. All are 100% portable across nearly
2133 all modern computing platforms. Each library component is fairly independent
2135 (license license:lgpl2.0+)))
2137 (define-public ioquake3
2138 ;; We follow master since it seems that there won't be releases after 1.3.6.
2139 (let ((revision "2")
2140 (commit "29b0cc3a4d037046eb3247fc04f4b703f6a33452"))
2143 (version (git-version "1.3.6" revision commit))
2148 (url "https://github.com/ioquake/ioq3")
2150 (file-name (git-file-name name version))
2152 (base32 "0fqq2qpnrgpgf3gs71wvxlkcihxcrvhvllh88ii4ip134c1qbs9q"))))
2153 (build-system gnu-build-system)
2165 (list which ; else SDL_version.h won't be found.
2169 #:tests? #f ; no tests
2171 #~(list (string-append "CC=" #$(cc-for-target))
2172 "USE_INTERNAL_LIBS=0"
2174 "USE_RENDERER_DLOPEN=0"
2175 "USE_OPENAL_DLOPEN=0"
2176 "USE_CURL_DLOPEN=0")
2178 #~(modify-phases %standard-phases
2179 (delete 'configure) ; no configure-script
2181 (lambda* (#:key make-flags outputs #:allow-other-keys)
2182 (apply invoke "make" "copyfiles"
2183 (string-append "COPYDIR="
2184 (assoc-ref outputs "out")
2187 (home-page "https://ioquake3.org/")
2188 (synopsis "FPS game engine based on Quake 3")
2189 (description "ioquake3 is a free software first person shooter engine
2190 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
2191 the original, ioquake3 has been cleaned up, bugs have been fixed and features
2192 added. The permanent goal is to create a Quake 3 distribution upon which
2193 people base their games, ports to new platforms, and other projects.")
2194 (license license:gpl2))))
2196 (define-public instead
2200 (build-system cmake-build-system)
2205 (url "https://github.com/instead-hub/instead")
2207 (file-name (git-file-name name version))
2209 (base32 "02j8cw623j51qmr4991i5hsbrzmnp0qfzds8m6nwwr15sjv3hv1g"))
2212 "instead-use-games-path.patch"))
2213 (modules '((guix build utils)))
2216 (delete-file-recursively "src/zlib")))))
2219 (list (string-append
2220 "-DLUA_INCLUDE_DIR="
2221 (assoc-ref %build-inputs "luajit") "/include/luajit-2.1/")
2229 ("pkg-config" ,pkg-config)
2230 ("sdl2-images" ,sdl2-image)
2231 ("sdl2-ttf" ,sdl2-ttf)
2232 ("sdl2-mixer" ,sdl2-mixer)
2234 (home-page "https://instead3.syscall.ru/")
2235 (synopsis "Text adventure interpreter")
2236 (description "The STEAD (Simple TExt ADventures) interpreter provides
2237 functionality to play games that mix elements of visual novels, interactive
2238 fiction and classic point-and-click adventures.")
2239 (native-search-paths
2240 (list (search-path-specification
2241 (variable "INSTEAD_GAMES_PATH")
2242 (separator #f) ;single entry
2243 (files '("share/instead/games")))))
2244 (license license:expat)))
2246 (define-public openvr
2250 (home-page "https://github.com/ValveSoftware/openvr/")
2256 (commit (string-append "v" version))))
2257 (file-name (git-file-name name version))
2259 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
2260 (build-system cmake-build-system)
2264 #:configure-flags (list "-DBUILD_SHARED=1")))
2265 (synopsis "Virtual reality software development kit")
2266 (description "OpenVR is an API and runtime that allows access to VR
2267 hardware from multiple vendors without requiring that applications have
2268 specific knowledge of the hardware they are targeting.")
2269 (license license:bsd-3)))
2271 (define-public flatzebra
2278 (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
2279 "flatzebra-" version ".tar.gz"))
2281 (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
2282 (build-system gnu-build-system)
2285 (modify-phases %standard-phases
2286 (add-after 'unpack 'fix-sdl-config
2287 (lambda* (#:key inputs #:allow-other-keys)
2288 ;; XXX: sdl-config in sdl-union is a link to sdl-config from
2289 ;; plain sdl package. As a consequence, the prefix is wrong.
2290 ;; Force correct one with "--prefix" argument.
2291 (let ((sdl-union (assoc-ref inputs "sdl")))
2292 (setenv "SDL_CONFIG"
2293 (string-append sdl-union
2294 "/bin/sdl-config --prefix="
2300 `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
2301 (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
2302 (synopsis "Generic game engine for 2D double-buffering animation")
2304 "Flatzebra is a simple, generic C++ game engine library supporting 2D
2306 (license license:gpl2+)))
2308 (define-public libccd
2316 (url "https://github.com/danfis/libccd")
2317 (commit (string-append "v" version))))
2318 (file-name (git-file-name name version))
2320 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2321 (build-system cmake-build-system)
2323 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2324 "-DBUILD_TESTING=ON"
2325 "-DENABLE_DOUBLE_PRECISION=ON")))
2327 (list python-sphinx))
2328 (home-page "https://github.com/danfis/libccd")
2329 (synopsis "Library for collision detection between two convex shapes")
2330 (description "@code{libccd} is library for a collision detection
2331 between two convex shapes. @code{libccd} implements variation on
2332 Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2333 and also implements algorithm Minkowski Portal Refinement (MPR,
2334 a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2335 (license license:expat)))
2344 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2345 "ode-" version ".tar.gz"))
2347 (base32 "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj"))
2348 (modules '((guix build utils)))
2351 (delete-file-recursively "libccd")
2353 (build-system cmake-build-system)
2355 `(#:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
2357 (modify-phases %standard-phases
2358 (add-after 'unpack 'unbundle-libccd
2360 (substitute* "CMakeLists.txt"
2361 (("configure_file\\(libccd/.*") ""))
2364 (list glu libccd mesa))
2365 (home-page "https://www.ode.org/")
2366 (synopsis "High performance library for simulating rigid body dynamics")
2367 (description "ODE is a high performance library for simulating
2368 rigid body dynamics. It is fully featured, stable, mature and
2369 platform independent with an easy to use C/C++ API. It has advanced
2370 joint types and integrated collision detection with friction. ODE is
2371 useful for simulating vehicles, objects in virtual reality
2372 environments and virtual creatures. It is currently used in many
2373 computer games, 3D authoring tools and simulation tools.")
2374 ;; Software is dual-licensed.
2375 (license (list license:lgpl2.1+ license:expat))))
2377 (define-public chipmunk
2385 (url "https://github.com/slembcke/Chipmunk2D")
2386 (commit (string-append "Chipmunk-" version))))
2387 (file-name (git-file-name name version))
2389 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2390 (build-system cmake-build-system)
2392 `(#:tests? #f ;no test
2393 #:configure-flags '("-DBUILD_STATIC=OFF"
2394 "-DBUILD_DEMOS=OFF")))
2396 (list freeglut libxmu libxrandr))
2397 (home-page "https://chipmunk-physics.net/")
2398 (synopsis "Fast and lightweight 2D game physics library")
2399 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2400 rigid body physics library written in C.")
2401 (license license:expat)))
2403 (define-public box2d
2411 (url "https://github.com/erincatto/box2d")
2412 (commit (string-append "v" version))))
2413 (file-name (git-file-name name version))
2415 (base32 "1ja9cahf3z9zzrdaqcw44lpjmqf2ir2g4chwz0iwqwlkckwhpgvh"))
2416 (modules '((guix build utils)))
2419 ;; Remove bundled code only used for the testbed.
2420 (delete-file-recursively "extern")
2421 ;; Remove bundled copy of doctest, and adjust tests accordingly.
2422 (delete-file "unit-test/doctest.h")
2423 (substitute* "unit-test/CMakeLists.txt"
2426 (substitute* (find-files "unit-test" "\\.cpp$")
2427 (("include \"doctest\\.h\"")
2428 "include <doctest/doctest.h>"))))))
2429 (build-system cmake-build-system)
2431 `(#:test-target "unit_test"
2432 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
2433 "-DBOX2D_BUILD_TESTBED=OFF")))
2435 (list doctest)) ;for tests
2438 (home-page "https://box2d.org/")
2439 (synopsis "2D physics engine for games")
2440 (description "Box2D is a 2D rigid body simulation library for games.
2441 Programmers can use it in their games to make objects move in realistic ways and
2442 make the game world more interactive. From the game engine's point of view, a
2443 physics engine is just a system for procedural animation.")
2444 (license license:expat)))
2446 (define-public libtcod
2453 (url "https://github.com/libtcod/libtcod")
2455 (file-name (git-file-name name version))
2458 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
2459 (modules '((guix build utils)))
2461 (delete-file-recursively "src/vendor/utf8proc")
2462 (delete-file-recursively "src/vendor/zlib")
2463 (delete-file "src/vendor/stb_truetype.h")
2464 (delete-file "src/vendor/stb_sprintf.h")
2465 (delete-file "src/vendor/lodepng.cpp")
2466 (delete-file "src/vendor/lodepng.h")
2468 (substitute* "buildsys/autotools/sources.am"
2469 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
2470 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
2471 "../../src/vendor/stb.c")
2472 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
2474 (substitute* "src/libtcod/sys_sdl_img_png.cpp"
2475 (("\\.\\./vendor/") ""))
2477 (substitute* '("src/libtcod/color/canvas.cpp"
2478 "src/libtcod/sys_sdl_img_png.cpp"
2479 "src/libtcod/tileset/truetype.cpp"
2480 "src/libtcod/tileset/tilesheet.cpp")
2481 (("\\.\\./\\.\\./vendor/") ""))
2483 (substitute* "src/libtcod/console/printing.cpp"
2484 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
2486 (build-system gnu-build-system)
2488 `(#:configure-flags '("--with-gnu-ld"
2489 "LIBS=-lutf8proc -llodepng")
2491 (modify-phases %standard-phases
2492 (add-after 'unpack 'change-to-build-dir
2494 (chdir "buildsys/autotools")
2495 (patch-shebang "get_version.py"))))))
2505 (list lodepng sdl2 utf8proc zlib))
2506 (home-page "https://github.com/libtcod/libtcod")
2507 (synopsis "Library specifically designed for writing roguelikes")
2509 "libtcod is a fast, portable and uncomplicated API for roguelike
2510 developers providing an advanced true color console, input, and lots of other
2511 utilities frequently used in roguelikes.")
2512 (license license:bsd-3)))
2514 (define-public warsow-qfusion
2515 ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
2516 ;; The 2.5 beta as published on the homepage is commit
2517 ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
2518 (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
2520 (name "warsow-qfusion")
2521 (version (git-version "2.5" "1" commit)) ; 2.5-beta
2525 (url "https://github.com/Warsow/qfusion/")
2528 (file-name (git-file-name name version))
2531 "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
2532 ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
2533 (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
2534 (modules '((guix build utils)))
2536 (delete-file-recursively "platforms")
2537 (delete-file-recursively "debian")
2538 (delete-file-recursively "libsrcs")
2540 (build-system cmake-build-system)
2542 `(#:tests? #f ; No tests.
2543 #:configure-flags '("-DQFUSION_GAME=Warsow")
2546 (guix build cmake-build-system)
2549 (modify-phases %standard-phases
2550 (add-after 'unpack 'change-to-build-dir
2554 (add-after 'install 'really-install
2555 (lambda* (#:key outputs system #:allow-other-keys)
2556 (let ((arch (match system
2557 ("x86_64-linux" "x86_64")
2558 ("i686-linux" "i386")))
2559 (out (assoc-ref outputs "out")))
2560 (install-file (string-append "../source/build/basewsw/libgame_"
2562 (string-append out "/lib/"))
2563 (install-file (string-append "../source/build/libui_" arch ".so")
2564 (string-append out "/lib/"))
2567 (install-file file (string-append out "/bin/")))
2568 (append (find-files "../source/build" "warsow")
2569 (find-files "../source/build" "wsw_server."))))
2572 `(("alsa-lib" ,alsa-lib)
2574 ("freetype" ,freetype)
2576 ("libjpeg" ,libjpeg-turbo)
2579 ("libtheora" ,libtheora)
2580 ("libvorbis" ,libvorbis)
2583 ("pulseaudio" ,pulseaudio)
2584 ("qtbase" ,qtbase-5)
2585 ("qtdeclarative-5" ,qtdeclarative-5)
2587 ("uuid.h" ,util-linux "lib")
2591 (home-page "https://github.com/Warsow/qfusion")
2592 (supported-systems '("i686-linux" "x86_64-linux"))
2593 (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
2595 "This package contains the game engine of Warsow, a first-person
2596 shooter video game. The engine is based on qfusion, the id Tech 2 derived
2597 game engine. id Tech 2 is the engine originally behind Quake 2.")
2598 (license license:gpl2+))))
2600 (define-public dhewm3
2607 "https://github.com/dhewm/dhewm3/releases/download/"
2608 version "/dhewm3-" version "-src.tar.xz"))
2611 "10p0w1x5wx9b7d8mzvb6yqjia9prhkjwz04vbvphy8p383r33am6"))))
2612 (build-system cmake-build-system)
2614 `(#:tests? #f ; No tests.
2616 (modify-phases %standard-phases
2617 (add-after 'unpack 'change-to-build-dir
2626 (home-page "https://dhewm3.org/")
2627 (synopsis "Port of the original Doom 3 engine")
2629 "@command{dhewm3} is a source port of the original Doom 3 engine (not
2630 Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
2631 version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
2632 sound effects on all operating systems and hardware (via OpenAL Softs EFX
2633 support), has much better support for widescreen resolutions and has 64bit
2635 (license license:gpl3)))
2637 (define-public tesseract-engine
2638 (let ((svn-revision 2411))
2640 (name "tesseract-engine")
2641 (version (string-append "20200615-" (number->string svn-revision)))
2646 (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
2647 (revision svn-revision)))
2648 (file-name (git-file-name name version))
2650 (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
2651 (modules '((guix build utils)))
2654 (for-each delete-file-recursively
2656 ;; Remove "media" since some files such as
2657 ;; media/sound/game/soundsnap/info.txt refer to a
2658 ;; non-commercial license.
2665 (build-system gnu-build-system)
2667 `(#:make-flags (list "CC=gcc")
2668 #:tests? #f ; No tests.
2670 (modify-phases %standard-phases
2672 (add-after 'unpack 'cd-src
2673 (lambda _ (chdir "src") #t))
2674 (add-before 'build 'fix-env
2675 (lambda* (#:key inputs #:allow-other-keys)
2678 (search-input-directory inputs "include/SDL2")
2679 ":" (or (getenv "CPATH") "")))))
2680 (add-after 'install 'really-install
2681 (lambda* (#:key outputs #:allow-other-keys)
2682 (let* ((out (assoc-ref outputs "out"))
2683 (share (string-append out "/share/tesseract"))
2684 (bin (string-append out "/bin/tesseract"))
2685 (client (string-append out "/bin/tesseract-client")))
2686 (chdir "..") ; Back to root.
2689 (mkdir-p (string-append share "/" dir))
2690 (copy-recursively dir (string-append share "/" dir)))
2692 (mkdir-p (string-append out "/bin/"))
2693 (copy-file "bin_unix/native_client" client)
2694 (copy-file "bin_unix/native_server"
2695 (string-append out "/bin/tesseract-server"))
2696 (call-with-output-file bin
2701 TESS_OPTIONS=\"-u$HOME/.tesseract\"
2703 exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
2708 (install-file "src/readme_tesseract.txt"
2709 (string-append out "/share/licenses/tesseract/LICENSE")))
2712 `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
2716 (home-page "http://tesseract.gg/")
2717 (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
2718 (description "This package contains the game engine of Tesseract, a
2719 first-person shooter focused on cooperative in-game map editing.
2721 The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
2722 upgraded modern rendering techniques. The new rendering features include
2723 fully dynamic omnidirectional shadows, global illumination, HDR lighting,
2724 deferred shading, morphological / temporal / multisample anti-aliasing, and
2726 (license license:zlib))))
2728 (define-public recastnavigation
2729 ;; We follow master since there hasn't been a release since 1.5.1 in 2016.
2730 (let ((commit "c5cbd53024c8a9d8d097a4371215e3342d2fdc87")
2733 (name "recastnavigation")
2734 (version (git-version "1.5.1" revision commit))
2738 (url "https://github.com/recastnavigation/recastnavigation")
2740 (file-name (git-file-name name version))
2743 "034bm47gc3r285w1pnvkhmm74zz99d204b1r865gisaiq4qfbza0"))))
2744 (build-system cmake-build-system)
2746 `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
2747 "-DRECASTNAVIGATION_DEMO=OFF"
2748 "-DRECASTNAVIGATION_TESTS=ON"
2749 "-DRECASTNAVIGATION_EXAMPLES=OFF")))
2750 (synopsis "Navigation system for games")
2751 (description "Recast is state of the art navigation mesh
2752 construction toolset for games.
2755 @item It is automatic, which means that you can throw any level geometry
2756 at it and you will get robust mesh out.
2757 @item It is fast which means swift turnaround times for level designers.
2760 The Recast process starts with constructing a voxel mold from a level
2761 geometry and then casting a navigation mesh over it. The process
2762 consists of three steps, building the voxel mold, partitioning the mold
2763 into simple regions, peeling off the regions as simple polygons.
2765 Recast is accompanied with Detour, path-finding and spatial reasoning
2766 toolkit. You can use any navigation mesh with Detour, but of course the
2767 data generated with Recast fits perfectly.
2769 Detour offers simple static navigation mesh which is suitable for many
2770 simple cases, as well as tiled navigation mesh which allows you to plug
2771 in and out pieces of the mesh. The tiled mesh allows you to create
2772 systems where you stream new navigation data in and out as the player
2773 progresses the level, or you may regenerate tiles as the world changes.")
2774 (home-page "https://github.com/recastnavigation/recastnavigation")
2775 (license license:zlib))))