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 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 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 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
18 ;;; Copyright © 2019, 2020, 2021 Leo Prikler <leo.prikler@student.tugraz.at>
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>
25 ;;; This file is part of GNU Guix.
27 ;;; GNU Guix is free software; you can redistribute it and/or modify it
28 ;;; under the terms of the GNU General Public License as published by
29 ;;; the Free Software Foundation; either version 3 of the License, or (at
30 ;;; your option) any later version.
32 ;;; GNU Guix is distributed in the hope that it will be useful, but
33 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
34 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 ;;; GNU General Public License for more details.
37 ;;; You should have received a copy of the GNU General Public License
38 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40 (define-module (gnu packages game-development)
41 #:use-module (srfi srfi-1)
42 #:use-module (ice-9 match)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix download)
46 #:use-module (guix git-download)
47 #:use-module (guix svn-download)
48 #:use-module (guix utils)
49 #:use-module (guix build-system cmake)
50 #:use-module (guix build-system gnu)
51 #:use-module (guix build-system python)
52 #:use-module (guix build-system scons)
53 #:use-module (gnu packages)
54 #:use-module (gnu packages audio)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages boost)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages check)
60 #:use-module (gnu packages curl)
61 #:use-module (gnu packages documentation)
62 #:use-module (gnu packages fltk)
63 #:use-module (gnu packages fonts)
64 #:use-module (gnu packages fontutils)
65 #:use-module (gnu packages freedesktop)
66 #:use-module (gnu packages fribidi)
67 #:use-module (gnu packages dbm)
68 #:use-module (gnu packages gcc)
69 #:use-module (gnu packages gl)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages gnunet)
73 #:use-module (gnu packages graphics)
74 #:use-module (gnu packages graphviz)
75 #:use-module (gnu packages gtk)
76 #:use-module (gnu packages guile)
77 #:use-module (gnu packages image)
78 #:use-module (gnu packages linux)
79 #:use-module (gnu packages lua)
80 #:use-module (gnu packages m4)
81 #:use-module (gnu packages mono)
82 #:use-module (gnu packages mp3)
83 #:use-module (gnu packages multiprecision)
84 #:use-module (gnu packages music)
85 #:use-module (gnu packages ncurses)
86 #:use-module (gnu packages pcre)
87 #:use-module (gnu packages pkg-config)
88 #:use-module (gnu packages pulseaudio)
89 #:use-module (gnu packages python)
90 #:use-module (gnu packages python-xyz)
91 #:use-module (gnu packages qt)
92 #:use-module (gnu packages sdl)
93 #:use-module (gnu packages sphinx)
94 #:use-module (gnu packages stb)
95 #:use-module (gnu packages texinfo)
96 #:use-module (gnu packages textutils)
97 #:use-module (gnu packages tls)
98 #:use-module (gnu packages video)
99 #:use-module (gnu packages web)
100 #:use-module (gnu packages xdisorg)
101 #:use-module (gnu packages xiph)
102 #:use-module (gnu packages xml)
103 #:use-module (gnu packages xorg))
105 (define-public bullet
112 (url "https://github.com/bulletphysics/bullet3/")
114 (file-name (git-file-name name version))
117 "10ncf2z474jnv7p5lv01ak2mk2hib3rj5rz1zr8v2v5pnciqbijl"))
118 (modules '((guix build utils)))
121 (for-each delete-file (find-files "build3" "premake*"))
122 (with-directory-excursion "examples/ThirdPartyLibs"
123 (for-each delete-file-recursively
124 '("Gwen" "clsocket" "enet" "glad" "imgui"
125 "lua-5.2.3" "midi" "minizip" "openvr"
126 "optionalX11" "serial" "zlib")))
127 ;; These need files from ThirdPartyLibs.
128 (substitute* "Extras/CMakeLists.txt"
129 (("BulletRobotics") ""))
130 ;; Tests fail on linking, cannot find -lBussIK.
131 (substitute* "test/CMakeLists.txt"
132 ((" InverseDynamics")
133 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
134 ; (("SharedMemory") ""))
136 (build-system cmake-build-system)
138 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
139 "-DBUILD_CPU_DEMOS=OFF"
140 "-DBUILD_OPENGL3_DEMOS=OFF"
141 "-DBUILD_BULLET2_DEMOS=OFF"
142 (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
143 (or (getenv "CXXFLAGS") "")))
145 (modify-phases %standard-phases
146 (add-after 'unpack 'remove-failing-tests
147 ;; These tests fail specifically after removing 3rd party code.
149 (substitute* "test/SharedMemory/CMakeLists.txt"
150 (("ADD_TEST") "# ADD_TEST"))
151 (substitute* "test/InverseDynamics/CMakeLists.txt"
152 (("ADD_TEST\\(Test_BulletInverseForward")
153 "# ADD_TEST(Test_BulletInverseForward"))
159 (home-page "https://pybullet.org/wordpress/")
160 (synopsis "3D physics engine library")
162 "Bullet is a physics engine library usable for collision detection. It
163 is used in some video games and movies.")
164 (license license:zlib)))
166 (define-public deutex
173 (uri (string-append "https://github.com/Doom-Utils/deutex"
174 "/releases/download/v" version "/"
175 "deutex-" version ".tar.zst"))
177 (base32 "0psb2za6ldrlak7s8pjvli98ij5yiwjx8j1ms2v7rj9yadx0xv8h"))))
178 (build-system gnu-build-system)
180 `(("libpng" ,libpng)))
182 `(("asciidoc" ,asciidoc)
183 ("pkg-config" ,pkg-config)
185 (home-page "https://github.com/Doom-Utils/deutex")
186 (synopsis "WAD file composer for Doom and related games")
188 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
189 used to extract the lumps of a wad and save them as individual files.
190 Conversely, it can also build a wad from separate files. When extracting a
191 lump to a file, it does not just copy the raw data, it converts it to an
192 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
193 Conversely, when it reads files for inclusion in pwads, it does the necessary
194 conversions (for example, from PPM to Doom picture format). In addition,
195 DeuTex has functions such as merging wads, etc.")
196 (license license:gpl2+)))
198 (define-public grfcodec
205 (uri (string-append "https://binaries.openttd.org/extra/"
206 name "/" version "/" name "-" version
209 (base32 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
210 (build-system gnu-build-system)
212 '(#:tests? #f ;no check target
214 (modify-phases %standard-phases
215 (delete 'configure) ;no configure script
216 (replace 'install ;no install target
217 (lambda* (#:key outputs #:allow-other-keys)
218 (let* ((out (assoc-ref outputs "out"))
219 (bin (string-append out "/bin"))
220 (doc (string-append out "/share/doc"))
221 (man (string-append out "/share/man/man1")))
222 (for-each (lambda (file)
223 (install-file file bin))
224 '("grfcodec" "grfid" "grfstrip" "nforenum"))
225 (install-file "COPYING" doc)
226 (with-directory-excursion "docs"
227 (for-each (lambda (file)
228 (install-file (string-append file ".txt") doc))
229 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
230 "readme" "readme.rpn"))
231 (for-each (lambda (file)
232 (install-file file man))
233 (find-files "." "\\.1"))))
239 (synopsis "GRF development tools")
241 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
242 tools for developing (New)GRFs. It includes a number of smaller programs, each
243 with a specific task:
245 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
246 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
247 @item @code{grfstrip} strips all sprites from a GRF.
248 @item @code{nforenum} checks NFO code for errors, making corrections when
251 (home-page "https://dev.openttdcoop.org/projects/grfcodec")
252 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
253 ;; NFORenum is under the GPL2+.
254 ;; The MD5 implementation contained in GRFID is under the zlib license.
255 (license (list license:gpl2 license:gpl2+ license:zlib))))
257 (define-public catcodec
264 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
265 version "/catcodec-" version "-source.tar.xz"))
267 (base32 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
268 (build-system gnu-build-system)
270 `(#:tests? #f ; no tests
271 #:make-flags (list (string-append "prefix=" %output))
272 #:phases (modify-phases %standard-phases
273 (delete 'configure))))
274 (home-page "https://dev.openttdcoop.org/projects/catcodec")
275 (synopsis "Encode/decode OpenTTD sounds")
276 (description "catcodec encodes and decodes sounds for OpenTTD. These
277 sounds are not much more than some metadata (description and filename) and raw
279 (license license:gpl2)))
281 (define-public gzochi
287 (uri (string-append "mirror://savannah/gzochi/gzochi-"
291 "1vcvf04qqzs3q8kaild2x7qvkwc6bwzfsisb78147b8z747j7hj0"))))
292 (build-system gnu-build-system)
294 '(#:phases (modify-phases %standard-phases
295 (add-before 'build 'no-Werror
297 ;; Don't abort builds due to things like GLib
298 ;; deprecation warnings.
299 (substitute* (find-files "." "^Makefile\\.in$")
302 (native-inputs `(("pkgconfig" ,pkg-config)))
303 (inputs `(("bdb" ,bdb)
306 ("libmicrohttpd" ,libmicrohttpd)
310 (home-page "https://www.nongnu.org/gzochi/")
311 (synopsis "Scalable middleware for multiplayer games")
313 "gzochi is a framework for developing massively multiplayer online games.
314 A server container provides services to deployed games, which are written in
315 Guile Scheme, that abstract and simplify some of the most challenging and
316 error-prone aspects of online game development: Concurrency, data persistence,
317 and network communications. A very thin client library can be embedded to
318 provide connectivity for client applications written in any language.")
319 (license license:gpl3+)))
328 (uri (pypi-uri "nml" version))
330 (base32 "0l5pfs8q7jrl3xscqq7pnwh5h5d17fsyjy7xspkc73sa0ayjm9jx"))))
331 (build-system python-build-system)
332 ;; TODO: Fix test that fails with
333 ;; "AttributeError: partially initialized module 'nml.nmlop' has no
334 ;; attribute 'ADD' (most likely due to a circular import)"
338 `(("python-pillow" ,python-pillow)
339 ("python-ply" ,python-ply)))
340 (home-page "https://github.com/OpenTTD/nml")
341 (synopsis "NML compiler")
343 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
344 compiling NML files (along with their associated language, sound and graphic
345 files) into @file{.grf} and/or @file{.nfo} files.")
346 (license license:gpl2+)))
348 (define-public python-sge
355 (uri (pypi-uri "sge" version))
358 "02fn6v6bxk3sngwd4kd3mglrp0jlnhx7x6h8nnkik6wdv150a0wv"))))
359 (build-system python-build-system)
361 `(("python-pygame" ,python-pygame)
362 ("python-uniseg" ,python-uniseg)))
363 (home-page "https://python-sge.github.io/")
364 (synopsis "2D game engine for Python")
366 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
367 general-purpose 2D game engine. It takes care of several details for you so
368 you can focus on the game itself. This makes more rapid game development
369 possible, and it also makes the SGE easy to learn.")
370 (license license:lgpl3+)))
372 (define-public python-sge-pygame
373 (deprecated-package "python-sge-pygame" python-sge))
375 (define-public python-tmx
382 (uri (string-append "mirror://savannah/python-tmx/"
383 (version-major+minor version) "/tmx-"
387 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
388 (build-system python-build-system)
390 `(("python-six" ,python-six)))
391 (home-page "http://python-tmx.nongnu.org")
392 (synopsis "Python library for the @code{Tiled} TMX format")
394 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
395 This is useful for map editors or generic level editors, and it's also useful
396 for using a map editor or generic level editor like Tiled to edit your game's
398 (license (list license:asl2.0
399 ;; Documentation (only available in the source tarball) is
400 ;; under the CC0 license.
403 (define-public python2-tmx
404 (let ((python2-tmx (package-with-python2 python-tmx)))
406 (inherit python2-tmx)
408 `(("python2-pathlib" ,python2-pathlib)
409 ,@(package-propagated-inputs python2-tmx))))))
411 (define-public python-xsge
414 (version "2020.09.07")
417 (uri (string-append "https://github.com/python-sge/xsge"
418 "/releases/download/v" version
419 "/xsge-" version ".zip"))
422 "136xgy3f9vw636wxpqbha022avk0wyxw63mm3a2dvwhh90s716f9"))))
423 (build-system python-build-system)
426 (modify-phases %standard-phases
427 ;; xSGE's setup.py script does not support one of the Python build
428 ;; system's default flags, "--single-version-externally-managed".
430 (lambda* (#:key outputs #:allow-other-keys)
431 (invoke "python" "setup.py" "install"
432 (string-append "--prefix=" (assoc-ref outputs "out"))
434 #:tests? #f)) ; no check target
438 `(("python-sge" ,python-sge)))
439 (home-page "https://python-sge.github.io/")
440 (synopsis "Extensions for the SGE Game Engine")
442 "xSGE is a collection of modules that make doing certain tasks with the SGE
443 Game Engine easier. In addition to SGE's conveniences, the user has access to a
444 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
446 (license license:gpl3+)))
455 (url "https://github.com/bjorn/tiled")
456 (commit (string-append "v" version))))
457 (file-name (git-file-name name version))
460 "1prajkx1xpp3csa0xpkrn3c2cnzvmwzxgrqb9d3gqszp3sllr2dg"))))
461 (build-system gnu-build-system)
464 ("qtdeclarative" ,qtdeclarative)
468 `(("qttools" ,qttools)))
471 (modify-phases %standard-phases
473 (lambda* (#:key inputs outputs #:allow-other-keys)
474 (substitute* "translations/translations.pro"
476 (string-append "LRELEASE = "
477 (assoc-ref inputs "qttools")
479 (let ((out (assoc-ref outputs "out")))
481 (string-append "PREFIX=" out))))))))
482 (home-page "https://www.mapeditor.org/")
483 (synopsis "Tile map editor")
485 "Tiled is a general purpose tile map editor. It is meant to be used for
486 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
489 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
491 (license license:gpl2+)))
493 (define-public tsukundere
500 (url "https://gitlab.com/leoprikler/tsukundere")
502 (file-name (git-file-name name version))
505 "05ckds2df810441wfavllx9lsw5jsc9h3nb7m31df01nsj56azdw"))))
506 (build-system gnu-build-system)
508 `(#:modules (((guix build guile-build-system)
509 #:select (target-guile-effective-version))
510 ,@%gnu-build-system-modules)
511 #:imported-modules ((guix build guile-build-system)
512 ,@%gnu-build-system-modules)
514 (modify-phases %standard-phases
515 (add-after 'unpack 'patch-command
516 (lambda* (#:key outputs #:allow-other-keys)
517 (let* ((out (assoc-ref outputs "out"))
518 (version (target-guile-effective-version))
519 (scm (string-append out "/share/guile/site/"
521 (go (string-append out "/lib/guile/"
522 version "/site-ccache")))
524 (substitute* "bin/tsukundere"
525 (("exec guile .*" all)
527 (format #f "export GUILE_LOAD_PATH=~@?~%"
528 "\"~a:~a\"" scm (getenv "GUILE_LOAD_PATH"))
529 (format #f "export GUILE_LOAD_COMPILED_PATH=~@?~%"
530 "\"~a:~a\"" go (getenv "GUILE_LOAD_COMPILED_PATH"))
534 `(("autoconf" ,autoconf)
535 ("automake" ,automake)
537 ("pkg-config" ,pkg-config)
538 ("texinfo" ,texinfo)))
540 `(("guile-sdl2" ,guile3.0-sdl2)))
541 (home-page "https://gitlab.com/leoprikler/tsukundere")
542 (synopsis "Visual novel engine")
543 (description "Tsukundere is a game engine geared heavily towards the
544 development of visual novels, written on top of Guile-SDL2. It is still
546 (license license:lgpl3+)))
554 ;; Do not fetch the archives from
555 ;; http://mirror0.sfml-dev.org/files/ because files there seem
556 ;; to be changed in place.
558 (url "https://github.com/SFML/SFML")
560 (file-name (git-file-name name version))
563 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
564 (modules '((guix build utils)))
567 ;; Ensure system libraries are used.
568 (delete-file-recursively "extlibs")
570 (build-system cmake-build-system)
573 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
574 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
575 #:tests? #f)) ; no tests
577 `(("pkg-config" ,pkg-config)))
582 ("xcb-util-image" ,xcb-util-image)
583 ("libxrandr" ,libxrandr)
585 ("libjpeg" ,libjpeg-turbo)
586 ("libsndfile" ,libsndfile)
587 ("stb-image" ,stb-image)
588 ("stb-image-write" ,stb-image-write)))
590 ;; In Requires.private of pkg-config files.
592 ("freetype" ,freetype)
593 ("libvorbis" ,libvorbis)
595 (home-page "https://www.sfml-dev.org")
596 (synopsis "Simple and Fast Multimedia Library")
598 "SFML provides a simple interface to the various computer components,
599 to ease the development of games and multimedia applications. It is composed
600 of five modules: system, window, graphics, audio and network.")
601 (license license:zlib)))
609 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
612 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
613 (build-system gnu-build-system)
615 `(#:phases (modify-phases %standard-phases
616 (delete 'configure) ; no configure script
617 (add-before 'build 'patch-makefile
618 (lambda* (#:key outputs #:allow-other-keys)
619 (let ((out (assoc-ref outputs "out")))
620 (substitute* "Makefile"
621 (("\\$\\(DESTDIR\\)/usr") out))
622 (substitute* "main.cpp"
624 (string-append out "/share")))
626 #:tests? #f)) ; no tests
628 `(("pkg-config" ,pkg-config)
629 ("desktop-file-utils" ,desktop-file-utils)))
633 (synopsis "Simple sound effect generator")
634 (description "Sfxr is a tool for quickly generating simple sound effects.
635 Originally created for use in video game prototypes, it can generate random
636 sounds from presets such as \"explosion\" or \"powerup\".")
637 (home-page "http://www.drpetter.se/project_sfxr.html")
638 (license license:expat)))
640 (define-public surgescript
648 (url "https://github.com/alemart/surgescript")
649 (commit (string-append "v" version))))
650 (file-name (git-file-name name version))
652 (base32 "0xwd4g7n0b0rxkpbyshkzyl472h1y606ghyvf8gv034n3jz2g4jk"))))
653 (build-system cmake-build-system)
656 (let ((share (string-append (assoc-ref %outputs "out") "/share")))
657 (list "-DWANT_STATIC=NO"
658 (string-append "-DICON_PATH=" share "/pixmaps")
659 (string-append "-DMETAINFO_PATH=" share "/metainfo")))
661 (home-page "https://docs.opensurge2d.org")
662 (synopsis "Scripting language for games")
663 (description "@code{SurgeScript} is a dynamically typed object-oriented
664 scripting language designed for games. Each object is a state machine that
665 can be customized by attaching other objects. The language supports automatic
666 garbage collection and can be extended with plugins.")
667 (license license:asl2.0)))
669 (define-public physfs
676 "https://icculus.org/physfs/downloads/physfs-"
678 (file-name (string-append name "-" version ".tar.gz"))
681 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
682 (build-system cmake-build-system)
684 '(#:tests? #f ; no check target
685 #:configure-flags '("-DPHYSFS_BUILD_STATIC=OFF")
686 #:phases (modify-phases %standard-phases
687 (add-after 'unpack 'patch-CMakeLists.txt
689 (substitute* "CMakeLists.txt"
690 ;; XXX: For some reason CMakeLists.txt disables
691 ;; RUNPATH manipulation when the compiler is GCC.
692 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
697 `(("doxygen" ,doxygen)))
698 (home-page "https://icculus.org/physfs")
699 (synopsis "File system abstraction library")
701 "PhysicsFS is a library to provide abstract access to various archives.
702 It is intended for use in video games. For security, no file writing done
703 through the PhysicsFS API can leave a defined @emph{write directory}. For
704 file reading, a @emph{search path} with archives and directories is defined,
705 and it becomes a single, transparent hierarchical file system. So archive
706 files can be accessed in the same way as you access files directly on a disk,
707 and it makes it easy to ship a new archive that will override a previous
708 archive on a per-file basis.")
709 (license license:zlib)))
717 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
718 "love-" version "-linux-src.tar.gz"))
721 "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
722 (build-system gnu-build-system)
724 `(("pkg-config" ,pkg-config)))
727 ("freetype" ,freetype)
728 ("libmodplug" ,libmodplug)
729 ("libtheora" ,libtheora)
730 ("libvorbis" ,libvorbis)
737 (synopsis "2D game framework for Lua")
738 (description "LÖVE is a framework for making 2D games in the Lua
739 programming language.")
740 (home-page "https://love2d.org/")
741 (license license:zlib)))
743 (define-public love-nuklear
744 (let ((version "v2.6")
745 (commit "fef4e00a602efb16c57ae962850b6e7a01f7a29a"))
747 (name "love-nuklear")
748 (version (git-version version "1" commit))
752 (url "https://github.com/keharriso/love-nuklear/")
755 ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
756 ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
757 (file-name (git-file-name name version))
760 "15qmy8mfwkxy2x9rmxs6f9cyvjvwwj6yf78bs863xmc56dmjzzbn"))))
761 (build-system cmake-build-system)
763 `(#:build-type "Release"
766 `(("luajit" ,luajit)))
767 (synopsis "Lightweight immediate mode GUI for LÖVE games")
768 (description "LÖVE is a Lua framework for making 2D games. Nuklear
769 is a minimal state immediate mode graphical user interface toolkit. This
770 package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
771 (home-page "https://github.com/keharriso/love-nuklear/")
772 (license license:expat))))
774 (define-public allegro-4
780 (uri (string-append "https://github.com/liballeg/allegro5/"
781 "releases/download/" version "/allegro-"
785 "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
786 (build-system cmake-build-system)
789 (modify-phases %standard-phases
790 (add-after 'unpack 'patch-build-system
792 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
793 ;; via a command line option doesn't work because it is
794 ;; unconditionally clobbered in the build script.
795 (substitute* '("CMakeLists.txt")
796 (("ADDON_LINKAGE STATIC")
797 "ADDON_LINKAGE SHARED"))
802 ("libvorbis" ,libvorbis)
805 (synopsis "Game programming library")
806 (description "Allegro is a library mainly aimed at video game and
807 multimedia programming. It handles common, low-level tasks such as creating
808 windows, accepting user input, loading data, drawing images, playing sounds,
810 (home-page "https://liballeg.org")
811 (license license:giftware)))
813 (define-public allegro
819 (uri (string-append "https://github.com/liballeg/allegro5/releases"
820 "/download/" version "/allegro-"
824 "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
825 (build-system cmake-build-system)
826 (arguments `(#:tests? #f)) ; there are no tests
828 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
830 ("freetype" ,freetype)
833 ("libjpeg" ,libjpeg-turbo)
835 ("libtheora" ,libtheora)
836 ("libvorbis" ,libvorbis)
837 ("libxcursor" ,libxcursor)
838 ("libxinerama" ,libxinerama)
839 ("libxrandr" ,libxrandr)
845 `(("pkg-config" ,pkg-config)))
846 (synopsis "Game programming library")
847 (description "Allegro is a library mainly aimed at video game and
848 multimedia programming. It handles common, low-level tasks such as creating
849 windows, accepting user input, loading data, drawing images, playing sounds,
851 (home-page "https://liballeg.org")
852 (license license:bsd-3)))
854 (define-public allegro-5.0
855 (package (inherit allegro)
860 (uri (string-append "https://github.com/liballeg/allegro5/releases"
861 "/download/" version "/allegro-"
862 (if (equal? "0" (string-take-right version 1))
863 (string-drop-right version 2)
866 (patches (search-patches
867 "allegro-mesa-18.2.5-and-later.patch"))
870 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
872 (define-public aseprite
875 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
876 ;; TODO: Unbundle third party software.
878 (method url-fetch/zipbomb)
879 (uri (string-append "https://github.com/aseprite/aseprite"
880 "/releases/download/v" version
881 "/Aseprite-v" version "-Source.zip"))
884 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
885 (build-system cmake-build-system)
888 ;; Use shared libraries instead of building bundled source.
889 (list "-DWITH_WEBP_SUPPORT=1"
890 "-DUSE_SHARED_CURL=1"
891 "-DUSE_SHARED_GIFLIB=1"
892 "-DUSE_SHARED_JPEGLIB=1"
893 "-DUSE_SHARED_ZLIB=1"
894 "-DUSE_SHARED_LIBPNG=1"
895 "-DUSE_SHARED_LIBLOADPNG=1"
896 "-DUSE_SHARED_LIBWEBP=1"
897 "-DUSE_SHARED_TINYXML=1"
898 "-DUSE_SHARED_PIXMAN=1"
899 "-DUSE_SHARED_FREETYPE=1"
900 "-DUSE_SHARED_ALLEGRO4=1"
901 "-DENABLE_UPDATER=0" ; no auto-updates
902 (string-append "-DFREETYPE_INCLUDE_DIR="
903 (assoc-ref %build-inputs "freetype")
904 "/include/freetype2"))))
906 `(("pkg-config" ,pkg-config)))
907 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
908 ;; patched version is bundled with Aseprite, but the patches should be
909 ;; extracted and applied on top of a standalone Allegro 4 package.
911 `(("allegro" ,allegro-4)
913 ("freetype" ,freetype)
915 ("libjpeg" ,libjpeg-turbo)
920 ("libxxf86vm" ,libxxf86vm)
924 (synopsis "Animated sprite editor and pixel art tool")
925 (description "Aseprite is a tool for creating 2D pixel art for video
926 games. In addition to basic pixel editing features, Aseprite can assist in
927 the creation of animations, tiled graphics, texture atlases, and more.")
928 (home-page "https://www.aseprite.org/")
929 (license license:gpl2+)))
931 (define-public qqwing
938 "https://qqwing.com/"
939 name "-" version ".tar.gz"))
942 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
943 (build-system gnu-build-system)
945 `(("pkg-config" ,pkg-config)))
946 (home-page "https://qqwing.com/")
947 (synopsis "Sudoku puzzle solver and generator")
949 "QQWing is a Sudoku puzzle generator and solver.
950 It offers the following features:
952 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
953 @item Uses logic. Uses as many solve techniques as possible when solving
954 puzzles rather than guessing.
955 @item Rates puzzles. Most generators don't give an indication of the difficulty
956 of a Sudoku puzzle. QQwing does.
957 @item Can print solve instructions for any puzzle.
958 @item Customizable output style, including a CSV style that is easy to
959 import into a database.
961 (license license:gpl2+)))
963 (define-public quesoglc
969 (uri (string-append "mirror://sourceforge/" name "/" version "/"
970 name "-" version "-free.tar.bz2"))
973 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
974 (build-system gnu-build-system)
975 (native-inputs `(("pkg-config" ,pkg-config)))
976 (inputs `(("fontconfig" ,fontconfig)
977 ("freeglute" ,freeglut)
980 (home-page "http://quesoglc.sourceforge.net")
981 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
983 "The OpenGL Character Renderer (GLC) is a state machine that provides
984 OpenGL programs with character rendering services via an application programming
986 (license (list license:expat license:lgpl2.1+))))
988 (define-public python-pygame
990 (name "python-pygame")
994 (uri (pypi-uri "pygame" version))
997 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
998 (build-system python-build-system)
1000 `(#:tests? #f ; tests require pygame to be installed first
1002 (modify-phases %standard-phases
1003 ;; Set the paths to the dependencies manually because
1004 ;; the configure script does not allow passing them as
1005 ;; parameters. This also means we can skip the configure
1007 (add-before 'build 'set-library-paths
1008 (lambda* (#:key inputs outputs #:allow-other-keys)
1009 (let ((sdl-ref (assoc-ref inputs "sdl"))
1010 (font-ref (assoc-ref inputs "sdl-ttf"))
1011 (image-ref (assoc-ref inputs "sdl-image"))
1012 (mixer-ref (assoc-ref inputs "sdl-mixer"))
1013 (smpeg-ref (assoc-ref inputs "libsmpeg"))
1014 (png-ref (assoc-ref inputs "libpng"))
1015 (jpeg-ref (assoc-ref inputs "libjpeg"))
1016 (freetype-ref (assoc-ref inputs "freetype"))
1017 (v4l-ref (assoc-ref inputs "v4l-utils"))
1018 (out-ref (assoc-ref outputs "out")))
1019 (substitute* "Setup.in"
1020 (("SDL = -I/usr/include/SDL")
1021 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
1022 (substitute* "Setup.in"
1023 (("FONT = -lSDL_ttf")
1024 (string-append "FONT = -I" font-ref "/include/SDL -L"
1025 font-ref "/lib -lSDL_ttf")))
1026 (substitute* "Setup.in"
1027 (("IMAGE = -lSDL_image")
1028 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
1029 image-ref "/lib -lSDL_image")))
1030 (substitute* "Setup.in"
1031 (("MIXER = -lSDL_mixer")
1032 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
1033 mixer-ref "/lib -lSDL_mixer")))
1034 (substitute* "Setup.in"
1035 (("SMPEG = -lsmpeg")
1036 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
1037 smpeg-ref "/lib -lsmpeg")))
1038 (substitute* "Setup.in"
1040 (string-append "PNG = -I" png-ref "/include -L"
1041 png-ref "/lib -lpng")))
1042 (substitute* "Setup.in"
1044 (string-append "JPEG = -I" jpeg-ref "/include -L"
1045 jpeg-ref "/lib -ljpeg")))
1047 (substitute* "Setup.in"
1048 (("FREETYPE = -lfreetype")
1049 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
1050 freetype-ref "/lib -lfreetype")))
1052 (substitute* "Setup.in"
1053 (("^pypm") "#pypm"))
1054 ;; Create a path to a header file provided by v4l-utils.
1055 (system* "mkdir" "linux")
1056 (system* "ln" "--symbolic"
1057 (string-append v4l-ref "/include/libv4l1-videodev.h")
1059 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
1061 `(("freetype" ,freetype)
1063 ("sdl-image" ,sdl-image)
1064 ("sdl-mixer" ,sdl-mixer)
1065 ("sdl-ttf" ,sdl-ttf)
1066 ("sdl-gfx" ,sdl-gfx)
1067 ("libjpeg" ,libjpeg-turbo)
1070 ("libsmpeg" ,libsmpeg)
1071 ("portmidi" ,portmidi)
1072 ("v4l-utils" ,v4l-utils)))
1073 (home-page "https://www.pygame.org")
1074 (synopsis "SDL wrapper for Python")
1075 (description "Pygame is a set of Python modules designed for writing games.
1076 Pygame adds functionality on top of the excellent SDL library. This allows you
1077 to create fully featured games and multimedia programs in the python language.")
1078 (license (list license:bsd-2
1079 ;; python numeric license as listed by Debian looks like
1080 ;; an Expat-style license with a warranty disclaimer for
1081 ;; the U.S. government and the University of California.
1087 license:public-domain
1088 license:lgpl2.1+))))
1090 (define-public python2-pygame
1091 (package-with-python2 python-pygame))
1093 (define-public python2-pygame-sdl2
1094 (let ((real-version "2.1.0")
1095 (renpy-version "7.4.4"))
1097 (inherit python2-pygame)
1098 (name "python2-pygame-sdl2")
1099 (version (string-append real-version "-for-renpy-" renpy-version))
1103 (uri (string-append "https://www.renpy.org/dl/" renpy-version
1104 "/pygame_sdl2-" version ".tar.gz"))
1105 (sha256 (base32 "1lj5c3kfnl8s824j3hs47dg3g5rlabscmwrbb0lgpyy4633pv9ka"))
1106 (modules '((guix build utils)))
1109 ;; drop generated sources
1110 (delete-file-recursively "gen")
1111 (delete-file-recursively "gen-static")
1113 (build-system python-build-system)
1115 `(#:tests? #f ; tests require pygame to be installed first
1118 (modify-phases %standard-phases
1119 (add-after 'set-paths 'set-sdl-vars
1120 (lambda* (#:key inputs #:allow-other-keys)
1121 (setenv "PYGAME_SDL2_CFLAGS"
1123 (assoc-ref inputs "sdl-union")
1124 "/include/SDL2 -D_REENTRANT"))
1125 (setenv "PYGAME_SDL2_LDFLAGS"
1127 (assoc-ref inputs "sdl-union")
1129 (assoc-ref inputs "sdl-union")
1130 "/lib -Wl,--enable-new-dtags -lSDL2"))
1134 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1136 `(("python2-cython" ,python2-cython)))
1137 (home-page "https://www.renpy.org/")
1138 (synopsis "Reimplementation of the Pygame API using SDL2")
1139 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1140 staying close to the original, but also adding some SDL2-specific features.
1141 While it aims to be used as a drop-in replacement, it appears to be
1142 developed mainly for Ren'py.")
1143 (license (list license:lgpl2.1 license:zlib)))))
1145 (define-public python2-renpy
1147 (name "python2-renpy")
1152 (uri (string-append "https://www.renpy.org/dl/" version
1153 "/renpy-" version "-source.tar.bz2"))
1154 (sha256 (base32 "1cbbvsk1snjrsh59blb8q2h86555gi23pylmwlnk9dx0jxckdi21"))
1155 (modules '((guix build utils)))
1158 "renpy-use-system-fribidi.patch"))
1160 '(with-directory-excursion "module"
1161 ;; drop generated sources
1162 (delete-file-recursively "gen")
1163 ;; drop fribidi sources
1164 (delete-file-recursively "fribidi-src")
1166 (build-system python-build-system)
1168 `(#:tests? #f ; Ren'py doesn't seem to package tests
1171 (modify-phases %standard-phases
1172 (add-after 'unpack 'fix-commands
1174 (substitute* "renpy/editor.py"
1176 (which "xdg-open")))
1178 (add-after 'unpack 'fix-include-paths
1179 (lambda* (#:key inputs #:allow-other-keys)
1180 (substitute* "module/setup.py"
1181 (("/usr/include/fribidi")
1182 (string-append (assoc-ref inputs "fribidi")
1183 "/include/fribidi")))
1185 (add-after 'set-paths 'set-build-vars
1186 (lambda* (#:key inputs #:allow-other-keys)
1187 (setenv "RENPY_CYTHON"
1188 (string-append (assoc-ref inputs "python2-cython")
1190 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
1193 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1194 ;; The "module" subdirectory contains a python (really cython)
1195 ;; project, which is built using a script, that is thankfully
1196 ;; named "setup.py".
1197 (with-directory-excursion "module"
1198 (apply (assoc-ref %standard-phases 'build) args))
1199 ;; the above causes renpy.__init__ to be compiled but does not
1200 ;; compile anything else, hence we do that here
1201 (delete-file "renpy/__init__.pyc")
1202 (invoke "python" "-m" "compileall" "renpy")
1205 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1206 ;; Again, we have to wrap the module installation.
1207 ;; Additionally, we want to install the python code
1208 ;; (both source and compiled) in the same directory.
1209 (let* ((out (assoc-ref outputs "out"))
1210 (site (string-append "/lib/python"
1212 (assoc-ref inputs "python"))
1214 (with-directory-excursion "module"
1215 (apply (assoc-ref %standard-phases 'install) args))
1216 (copy-recursively "renpy"
1217 (string-append out site "/renpy")))
1220 `(("ffmpeg" ,ffmpeg)
1221 ("freetype" ,freetype)
1222 ("fribidi" ,fribidi)
1226 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1228 `(("python2-future" ,python2-future)
1229 ("python2-pygame" ,python2-pygame-sdl2)))
1231 `(("gcc" ,gcc-8) ; for const variables as initializer elements
1232 ("python2-cython" ,python2-cython)
1233 ("xdg-utils" ,xdg-utils)))
1234 (home-page "https://www.renpy.org/")
1235 (synopsis "Ren'py python module")
1236 (description "This package contains the shared libraries and Python
1237 modules of Ren'py.")
1238 (license license:expat)))
1240 (define-public renpy
1242 (inherit python2-renpy)
1244 (build-system python-build-system)
1246 `(#:tests? #f ; see python2-renpy
1249 (modify-phases %standard-phases
1250 (add-after 'unpack 'fix-commands
1251 (lambda* (#:key outputs #:allow-other-keys)
1252 (substitute* "launcher/game/choose_directory.rpy"
1253 (("/usr/bin/python") (which "python2")))
1254 (substitute* "launcher/game/front_page.rpy"
1256 (which "xdg-open")))
1257 (substitute* "launcher/game/project.rpy"
1258 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1259 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1261 ;; Projects are still created in the usual style, so we need
1262 ;; to adjust the path.
1263 (("cmd.append\\(self.path\\)")
1264 "cmd.append(self.path + \"/game\")"))
1266 (add-after 'unpack 'drop-game-from-paths
1268 (substitute* (list "launcher/game/gui7.rpy"
1269 "launcher/game/gui7/images.py")
1270 ((", \"game\",") ","))
1272 (add-before 'build 'start-xserver
1273 (lambda* (#:key inputs #:allow-other-keys)
1274 (let ((xorg-server (assoc-ref inputs "xorg-server")))
1275 (setenv "HOME" (getcwd))
1276 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
1277 (setenv "DISPLAY" ":1")
1281 (invoke "python" "renpy.py" "launcher" "quit")
1282 (invoke "python" "renpy.py" "the_question" "quit")
1283 (invoke "python" "renpy.py" "tutorial" "quit")
1286 (lambda* (#:key inputs outputs #:allow-other-keys)
1287 ;; Here we install our custom renpy program.
1288 ;; After finishing this step, "out" will have the following:
1290 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1293 ;; Note that common is also a de facto unused directory in
1294 ;; python2-renpy. On other systems, renpy_base would point to
1295 ;; site-packages or even somewhere in /opt.
1296 ;; The former approach is not as straightforward as it seems
1297 ;; -- it causes renpy to load files twice for some weird reason --
1298 ;; and the latter is impossible on Guix. Hence the detour through
1299 ;; share/renpy and the custom renpy program.
1301 ;; As a convention, other games should be installed as
1302 ;; subdirectories of share/renpy in their respective outputs as
1303 ;; well. This differs from the traditional layout, which is
1304 ;; roughly the following:
1305 ;; `-- Super Awesome Game
1306 ;; |-- game ; <- the folder we actually want
1307 ;; |-- lib ; compiled renpy module and dependencies
1308 ;; |-- renpy ; Ren'py python code (source + compiled)
1309 ;; |-- Super Awesome Game.py
1310 ;; `-- Super Awesome Game.sh
1311 (let* ((out (assoc-ref outputs "out"))
1312 (bin/renpy (string-append out "/bin/renpy")))
1313 (mkdir-p (string-append out "/bin"))
1314 (copy-recursively "renpy/common"
1315 (string-append out "/share/renpy/common"))
1316 (copy-recursively "gui"
1317 (string-append out "/share/renpy/gui"))
1319 (call-with-output-file bin/renpy
1321 (format port "#!~a~%" (which "python2"))
1323 from __future__ import print_function
1329 def path_to_common(renpy_base):
1330 return renpy_base + \"/common\"
1332 def path_to_saves(gamedir, save_directory=None):
1333 import renpy # @UnresolvedImport
1335 if save_directory is None:
1336 save_directory = renpy.config.save_directory
1337 save_directory = renpy.exports.fsencode(save_directory)
1339 if not save_directory:
1340 return gamedir + \"/saves\"
1342 return os.path.expanduser(\"~~/.renpy/\" + save_directory)
1344 def path_to_renpy_base():
1348 renpy_base = path_to_renpy_base()
1350 import renpy.bootstrap
1351 import renpy.arguments
1353 print(\"\"\"Could not import renpy.bootstrap.
1354 Please ensure you decompressed Ren'Py correctly, preserving the directory
1355 structure.\"\"\", file=sys.stderr)
1358 args = renpy.arguments.bootstrap()
1359 if not args.basedir:
1360 print(\"\"\"This Ren'py requires a basedir to launch.
1361 The basedir is the directory, in which .rpy files live -- usually the 'game'
1362 subdirectory of a game packaged by Ren'py.
1364 If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
1368 renpy.bootstrap.bootstrap(renpy_base)
1370 if __name__ == \"__main__\":
1373 (string-append out "/share/renpy"))))
1374 (chmod bin/renpy #o755)
1377 (add-after 'install 'install-games
1378 (lambda* (#:key outputs #:allow-other-keys)
1379 (define renpy (assoc-ref outputs "out"))
1380 ;; TODO: We should offer a renpy-build-system to make the
1381 ;; installation of Ren'py games easier.
1382 (define* (install-renpy-game #:key output game name (renpy renpy)
1384 (let* ((name (or name (basename game)))
1385 (launcher (string-append output "/bin/renpy-" name))
1386 (share (string-append output "/share/renpy/" name)))
1387 (copy-recursively (string-append game "/game") share)
1388 (mkdir-p (string-append output "/bin"))
1389 (with-output-to-file launcher
1392 "#!~a~%~a ~a \"$@\""
1394 (string-append renpy "/bin/renpy")
1396 (chmod launcher #o755)))
1398 (install-renpy-game #:output (assoc-ref outputs "out")
1401 (install-renpy-game #:output (assoc-ref outputs "the-question")
1402 #:game "the_question"
1403 #:name "the-question")
1405 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1409 (lambda* (#:key inputs outputs #:allow-other-keys)
1410 (wrap-program (string-append (assoc-ref outputs "out")
1412 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
1415 `(("python2-tkinter" ,python-2 "tk")
1416 ("python2-pygame" ,python2-pygame-sdl2)
1417 ("python2-renpy" ,python2-renpy)
1418 ("xorg-server" ,xorg-server)))
1420 (list "out" "tutorial" "the-question"))
1421 (home-page "https://www.renpy.org/")
1422 (synopsis "Visual Novel Engine")
1423 (description "Ren'Py is a visual novel engine that helps you use words,
1424 images, and sounds to tell interactive stories that run on computers and
1425 mobile devices. These can be both visual novels and life simulation games.
1426 The easy to learn script language allows anyone to efficiently write large
1427 visual novels, while its Python scripting is enough for complex simulation
1429 (license license:expat)))
1431 (define-public grafx2
1437 ;; XXX: There is no URL that contains the version. :(
1438 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1441 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1442 (build-system gnu-build-system)
1445 (modify-phases %standard-phases
1446 (delete 'configure) ; no configure script
1447 (add-before 'build 'change-to-src-directory
1452 ;; SDL header files are referenced without the preceeding "SDL/".
1453 (list (string-append "CFLAGS=-I"
1454 (assoc-ref %build-inputs "sdl-union")
1456 (string-append "prefix="
1457 (assoc-ref %outputs "out")))
1458 #:tests? #f)) ; no check target
1460 `(("pkg-config" ,pkg-config)))
1462 `(("libpng" ,libpng)
1464 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
1465 (synopsis "Bitmap paint program")
1466 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1467 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1468 includes a very large number of tools and effects that make it particularly
1469 suitable for pixel art, game graphics, and generally any detailed graphics
1470 painted with a mouse.")
1471 (home-page "http://pulkomandy.tk/projects/GrafX2")
1472 (license license:gpl2))) ; GPLv2 only
1482 (url "https://github.com/wgois/OIS")
1483 (commit (string-append "v" version))))
1484 (file-name (git-file-name name version))
1486 (base32 "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa"))))
1487 (build-system cmake-build-system)
1489 `(#:tests? #f)) ; no test suite
1491 `(("libx11" ,libx11)))
1492 (synopsis "Object Oriented Input System")
1494 "Cross Platform Object Oriented Input Lib System is a cross platform,
1495 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1496 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1497 robust and compatible with many systems and operating systems.")
1498 (home-page "https://github.com/wgois/OIS")
1499 (license license:zlib)))
1501 (define-public mygui
1509 (url "https://github.com/MyGUI/mygui")
1510 (commit (string-append "MyGUI" version))))
1511 (file-name (git-file-name name version))
1514 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
1515 (build-system cmake-build-system)
1517 '(#:tests? #f ; No test target
1519 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1520 (string-append "-DOGRE_INCLUDE_DIR="
1521 (assoc-ref %build-inputs "ogre")
1523 ;; Demos and tools are Windows-specific:
1524 ;; https://github.com/MyGUI/mygui/issues/24.
1525 "-DMYGUI_BUILD_DEMOS=FALSE"
1526 "-DMYGUI_BUILD_TOOLS=FALSE")))
1529 ("doxygen" ,doxygen)
1530 ("pkg-config" ,pkg-config)))
1532 `(("font-dejavu" ,font-dejavu)
1533 ("freetype" ,freetype)
1534 ("graphviz" ,graphviz)
1538 (synopsis "Fast, flexible and simple GUI")
1540 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1541 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1543 (home-page "http://mygui.info/")
1544 (license license:expat)))
1546 (define-public mygui-gl
1547 ;; Closure size is reduced by some 800 MiB.
1553 (substitute-keyword-arguments (package-arguments mygui)
1554 ((#:configure-flags _)
1555 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1556 ;; We can't reuse the flags because of the mention to Ogre.
1557 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1558 ;; Demos and tools are Windows-specific:
1559 ;; https://github.com/MyGUI/mygui/issues/24.
1560 "-DMYGUI_BUILD_DEMOS=FALSE"
1561 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1565 ,@(fold alist-delete (package-inputs mygui)
1567 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1569 (define-public openmw
1577 (url "https://github.com/OpenMW/openmw")
1578 (commit (string-append "openmw-" version))))
1579 (file-name (git-file-name name version))
1582 "0rm32zsmxvr6b0jjihfj543skhicbw5kg6shjx312clhlm035w2x"))))
1583 (build-system cmake-build-system)
1585 `(#:tests? #f ; No test target
1587 (list "-DDESIRED_QT_VERSION=5")))
1590 ("doxygen" ,doxygen)
1591 ("pkg-config" ,pkg-config)))
1593 `(("bullet" ,bullet)
1596 ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
1598 ("openscenegraph" ,openmw-openscenegraph)
1601 ("unshield" ,unshield)))
1602 (synopsis "Re-implementation of the RPG Morrowind engine")
1604 "OpenMW is a game engine which reimplements and extends the one that runs
1605 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1606 called OpenMW-CS which allows the user to edit or create their own original
1608 (home-page "https://openmw.org")
1609 (license license:gpl3)))
1611 (define-public godot
1618 (url "https://github.com/godotengine/godot")
1619 (commit (string-append version "-stable"))))
1620 (file-name (git-file-name name version))
1623 "19vrp5lhyvxbm6wjxzn28sn3i0s8j08ca7nani8l1nrhvlc8wi0v"))
1624 (modules '((guix build utils)
1629 ;; Keep only those bundled files we have not (yet) replaced
1630 ;; with Guix versions. Note that some of these may be
1631 ;; modified; see "thirdparty/README.md".
1632 (with-directory-excursion "thirdparty"
1633 (let* ((preserved-files
1654 (for-each delete-file-recursively
1655 (lset-difference string=?
1657 (cons* "." ".." preserved-files)))))
1659 (build-system scons-build-system)
1661 `(#:scons ,scons-python2
1662 #:scons-flags (list "platform=x11" "target=release_debug"
1663 ;; Avoid using many of the bundled libs.
1664 ;; Note: These options can be found in the SConstruct file.
1666 "builtin_freetype=no"
1668 "builtin_libmpdec=no"
1671 "builtin_libtheora=no"
1672 "builtin_libvorbis=no"
1674 "builtin_libwebp=no"
1675 "builtin_mbedtls=no"
1681 #:tests? #f ; There are no tests
1683 (modify-phases %standard-phases
1684 (add-after 'unpack 'scons-use-env
1686 ;; Scons does not use the environment variables by default,
1687 ;; but this substitution makes it do so.
1688 (substitute* "SConstruct"
1689 (("env_base = Environment\\(tools=custom_tools\\)")
1691 "env_base = Environment(tools=custom_tools)\n"
1692 "env_base = Environment(ENV=os.environ)")))
1694 ;; Build headless tools, used for packaging games without depending on X.
1695 (add-after 'build 'build-headless
1696 (lambda* (#:key scons-flags #:allow-other-keys)
1697 (apply invoke "scons"
1698 `(,(string-append "-j" (number->string (parallel-job-count)))
1699 "platform=server" ,@(delete "platform=x11" scons-flags)))))
1701 (lambda* (#:key inputs outputs #:allow-other-keys)
1702 (let* ((out (assoc-ref outputs "out"))
1703 (headless (assoc-ref outputs "headless"))
1704 (zenity (assoc-ref inputs "zenity")))
1705 ;; Strip build info from filenames.
1706 (with-directory-excursion "bin"
1709 (let ((dest (car (string-split (basename file) #\.))))
1710 (rename-file file dest)))
1711 (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
1712 (install-file "godot" (string-append out "/bin"))
1713 (install-file "godot_server" (string-append headless "/bin")))
1714 ;; Tell the editor where to find zenity for OS.alert().
1715 (wrap-program (string-append out "/bin/godot")
1716 `("PATH" ":" prefix (,(string-append zenity "/bin")))))
1718 (add-after 'install 'install-godot-desktop
1719 (lambda* (#:key outputs #:allow-other-keys)
1720 (let* ((out (assoc-ref outputs "out"))
1721 (applications (string-append out "/share/applications"))
1722 (icons (string-append out "/share/icons/hicolor")))
1723 (mkdir-p applications)
1724 (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
1725 (string-append applications "/godot.desktop"))
1726 (for-each (lambda (icon dest)
1727 (mkdir-p (dirname dest))
1728 (copy-file icon dest))
1729 '("icon.png" "icon.svg")
1730 `(,(string-append icons "/256x256/apps/godot.png")
1731 ,(string-append icons "/scalable/apps/godot.svg"))))
1733 (outputs '("out" "headless"))
1734 (native-inputs `(("pkg-config" ,pkg-config)))
1735 (inputs `(("alsa-lib" ,alsa-lib)
1737 ("freetype" ,freetype)
1740 ("libtheora" ,libtheora)
1741 ("libvorbis" ,libvorbis)
1743 ("libwebp" ,libwebp)
1745 ("libxcursor" ,libxcursor)
1747 ("libxinerama" ,libxinerama)
1748 ("libxrandr" ,libxrandr)
1749 ("mbedtls" ,mbedtls-apache)
1751 ("opusfile" ,opusfile)
1753 ("pulseaudio" ,pulseaudio)
1756 ("zstd" ,zstd "lib")))
1757 (home-page "https://godotengine.org/")
1758 (synopsis "Advanced 2D and 3D game engine")
1760 "Godot is an advanced multi-platform game engine written in C++. If
1761 features design tools such as a visual editor, can import 3D models and
1762 provide high-quality 3D rendering, it contains an animation editor, and can be
1763 scripted in a Python-like language.")
1764 (license license:expat)))
1773 (url "https://github.com/skypjack/entt")
1774 (commit (string-append "v" version))))
1775 (file-name (git-file-name name version))
1778 "151jg3m262xwaywl2rqnc90yr6p48rhmgi5mxyv6bwqvmfli2m5p"))))
1779 (build-system cmake-build-system)
1781 `(#:configure-flags (list "-DENTT_BUILD_TESTING=ON"
1782 "-DENTT_FIND_GTEST_PACKAGE=ON"
1783 "-DENTT_BUILD_DOCS=ON")
1784 ;; Only tests are compiled, and they need assertions to work correctly.
1785 #:build-type "Debug"))
1788 ("googletest" ,googletest)
1789 ;; for documentation
1790 ("doxygen" ,doxygen)
1791 ("graphviz" ,graphviz)))
1792 (synopsis "Entity component system")
1793 (description "EnTT is a header-only library, containing (among other things)
1795 @item an entity component system based on sparse sets,
1796 @item a configuration system using the monostate pattern,
1797 @item a static reflection system,
1798 @item and a cooperative scheduler.
1800 (home-page "https://github.com/skypjack/entt")
1801 (license (list license:expat ; code
1802 license:cc-by4.0)))) ; documentation
1804 (define-public eureka
1810 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1812 ;; version without dots e.g 1.21 => 121
1813 (string-join (string-split version #\.) "")
1817 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1818 (build-system gnu-build-system)
1822 (let ((out (assoc-ref %outputs "out")))
1823 (list (string-append "PREFIX=" out)))
1825 (modify-phases %standard-phases
1827 (add-before 'build 'prepare-install-directories
1828 (lambda* (#:key outputs #:allow-other-keys)
1829 (let ((out (assoc-ref outputs "out")))
1830 (mkdir-p (string-append out "/bin"))
1831 (mkdir-p (string-append out "/share"))
1833 (with-fluids ((%default-port-encoding #f))
1834 (substitute* "./src/main.cc"
1835 (("/usr/local") out)))
1837 (substitute* "Makefile"
1838 (("-o root") ""))))))))
1839 (inputs `(("mesa" ,mesa)
1841 ("libxinerama" ,libxinerama)
1842 ("libfontconfig" ,fontconfig)
1843 ("libjpeg" ,libjpeg-turbo)
1847 (native-inputs `(("pkg-config" ,pkg-config)
1848 ("xdg-utils" ,xdg-utils)))
1849 (synopsis "Doom map editor")
1850 (description "Eureka is a map editor for the classic DOOM games, and a few
1851 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1853 (home-page "http://eureka-editor.sourceforge.net/")
1854 (license license:gpl2+)))
1856 (define-public guile-chickadee
1858 (name "guile-chickadee")
1862 (uri (string-append "https://files.dthompson.us/chickadee/"
1863 "chickadee-" version ".tar.gz"))
1866 "1jv4jkc35b7rizz8iflh74hhk9qy665isn1xa6gqz0qp9grwb019"))))
1867 (build-system gnu-build-system)
1869 '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
1871 `(("guile-opengl" ,guile3.0-opengl)
1872 ("guile-sdl2" ,guile3.0-sdl2)))
1874 `(("freetype" ,freetype)
1875 ("guile" ,guile-3.0)
1876 ("libvorbis" ,libvorbis)
1878 ("openal" ,openal)))
1880 `(("pkg-config" ,pkg-config)
1881 ("texinfo" ,texinfo)))
1882 (home-page "https://dthompson.us/projects/chickadee.html")
1883 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1884 (description "Chickadee is a game development toolkit for Guile Scheme
1885 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1886 that parenthetically inclined game developers need to make 2D (and eventually
1887 3D) games in Scheme, such as:
1890 @item extensible, fixed-timestep game loop
1891 @item OpenGL-based rendering engine
1892 @item keyboard, mouse, controller input
1893 @item REPL-driven development model
1895 (license license:gpl3+)))
1897 (define-public guile3.0-chickadee
1898 (deprecated-package "guile3.0-chickadee" guile-chickadee))
1900 (define-public bennu-game-development
1902 (name "bennu-game-development")
1907 (url "http://svn.code.sf.net/p/bennugd/code")
1908 (revision (string->number version))))
1909 (file-name (string-append name "-" version))
1912 "1iri58ryk9lbqn585cbccnvrfkj8qxlbcsk8rpih40jhvs1j101l"))
1913 (modules '((guix build utils)))
1916 (delete-file-recursively "3rdparty") #t))))
1917 (build-system gnu-build-system)
1920 (modify-phases %standard-phases
1921 (add-after 'unpack 'patch-configure-to-use-openssl
1922 (lambda* (#:key outputs #:allow-other-keys)
1924 (delete-file "configure")
1925 (substitute* "configure.in"
1928 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
1929 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
1936 (inputs `(("openssl" ,openssl)
1938 (native-inputs `(("pkg-config" ,pkg-config)
1939 ("autoconf" ,autoconf)
1940 ("automake" ,automake)
1941 ("libtool" ,libtool)))
1942 (synopsis "Programming language to create games")
1943 (description "Bennu Game Development, also known as bennudg, is a
1944 programming language tailored at game development. It is the successor of
1946 (home-page "https://sourceforge.net/projects/bennugd/")
1947 (license license:zlib)))
1949 (define-public bennu-game-development-modules
1951 (inherit bennu-game-development)
1952 (name "bennu-game-development-modules")
1955 (modify-phases %standard-phases
1956 (add-after 'unpack 'patch-conflicting-definitions
1958 (with-fluids ((%default-port-encoding #f))
1959 (substitute* "core/include/fmath.h"
1960 (("extern fixed fmul\\( int x, int y \\);") "")
1961 (("extern fixed fdiv\\( int x, int y \\);") "")))
1962 (chdir "modules"))))))
1963 (inputs `(("zlib" ,zlib)
1965 ("openssl" ,openssl)
1966 ("sdl-mixer" ,sdl-mixer)
1967 ("bennu-game-development" ,bennu-game-development)))
1968 (synopsis "Modules for the Bennu Game Development programming language")
1969 (description "This package contains a collection of modules for the Bennu
1970 Game Development programming language, from CD handling through SDL to
1971 joystick support.")))
1979 (uri (string-append "http://plib.sourceforge.net/dist/"
1980 "plib-" version ".tar.gz"))
1983 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
1984 (patches (search-patches "plib-CVE-2011-4620.patch"
1985 "plib-CVE-2012-4552.patch"))))
1986 (build-system gnu-build-system)
1990 ("libxmu" ,libxmu)))
1992 `(("pkg-config" ,pkg-config)))
1993 (home-page "http://plib.sourceforge.net/")
1994 (synopsis "Suite of portable game libraries")
1995 (description "PLIB is a set of libraries that will permit programmers to
1996 write games and other realtime interactive applications that are 100% portable
1997 across a wide range of hardware and operating systems. PLIB includes sound
1998 effects, music, a complete 3D engine, font rendering, a simple Windowing
1999 library, a game scripting language, a GUI, networking, 3D math library and a
2000 collection of handy utility functions. All are 100% portable across nearly
2001 all modern computing platforms. Each library component is fairly independent
2003 (license license:lgpl2.0+)))
2005 (define-public ioquake3
2006 ;; We follow master since it seems that there won't be releases after 1.3.6.
2007 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
2010 (version (git-version "1.3.6" "1" commit))
2015 (url "https://github.com/ioquake/ioq3")
2017 (file-name (git-file-name name version))
2020 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
2021 (build-system gnu-build-system)
2024 ("libjpeg" ,libjpeg-turbo)
2027 ("opusfile" ,opusfile)
2029 ("libvorbis" ,libvorbis)
2030 ("freetype" ,freetype)
2031 ("libogg" ,libogg)))
2033 `(("which" ,which) ; Else SDL_version.h won't be found.
2034 ("pkg-config" ,pkg-config)))
2036 '(#:tests? #f ; No tests.
2037 #:make-flags '("CC=gcc"
2038 "USE_INTERNAL_LIBS=0"
2040 "USE_RENDERER_DLOPEN=0"
2041 "USE_OPENAL_DLOPEN=0"
2042 "USE_CURL_DLOPEN=0")
2044 (modify-phases %standard-phases
2047 (lambda* (#:key outputs #:allow-other-keys)
2048 (invoke "make" "copyfiles" "CC=gcc"
2049 "USE_INTERNAL_LIBS=0"
2050 (string-append "COPYDIR="
2051 (assoc-ref outputs "out")
2053 (home-page "https://ioquake3.org/")
2054 (synopsis "FPS game engine based on Quake 3")
2055 (description "ioquake3 is a free software first person shooter engine
2056 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
2057 the original, ioquake3 has been cleaned up, bugs have been fixed and features
2058 added. The permanent goal is to create the open source Quake 3 distribution
2059 upon which people base their games, ports to new platforms, and other
2061 (license license:gpl2))))
2063 (define-public openvr
2067 (home-page "https://github.com/ValveSoftware/openvr/")
2073 (commit (string-append "v" version))))
2074 (file-name (git-file-name name version))
2076 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
2077 (build-system cmake-build-system)
2081 #:configure-flags (list "-DBUILD_SHARED=1")))
2082 (synopsis "Virtual reality software development kit")
2083 (description "OpenVR is an API and runtime that allows access to VR
2084 hardware from multiple vendors without requiring that applications have
2085 specific knowledge of the hardware they are targeting.")
2086 (license license:bsd-3)))
2088 (define-public flatzebra
2095 (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
2096 "flatzebra-" version ".tar.gz"))
2098 (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
2099 (build-system gnu-build-system)
2102 (modify-phases %standard-phases
2103 (add-after 'unpack 'fix-sdl-config
2104 (lambda* (#:key inputs #:allow-other-keys)
2105 ;; XXX: sdl-config in sdl-union is a link to sdl-config from
2106 ;; plain sdl package. As a consequence, the prefix is wrong.
2107 ;; Force correct one with "--prefix" argument.
2108 (let ((sdl-union (assoc-ref inputs "sdl")))
2109 (setenv "SDL_CONFIG"
2110 (string-append sdl-union
2111 "/bin/sdl-config --prefix="
2115 `(("pkg-config" ,pkg-config)))
2117 `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
2118 (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
2119 (synopsis "Generic game engine for 2D double-buffering animation")
2121 "Flatzebra is a simple, generic C++ game engine library supporting 2D
2123 (license license:gpl2+)))
2128 (version "19.12.01")
2133 (url "https://github.com/FNA-XNA/FNA")
2135 (file-name (git-file-name name version))
2137 (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
2138 (build-system gnu-build-system)
2140 '(#:tests? #f ; No tests.
2142 (modify-phases %standard-phases
2143 (add-after 'unpack 'link-dep-src
2144 (lambda* (#:key inputs #:allow-other-keys)
2145 (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
2146 (mojoshader (assoc-ref inputs "mojoshader-src"))
2147 (faudio (assoc-ref inputs "faudio-src"))
2148 (theorafile (assoc-ref inputs "theorafile-src")))
2149 (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
2150 (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
2151 (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
2152 (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
2156 (invoke "make" "release")))
2158 (lambda* (#:key outputs #:allow-other-keys)
2159 (let ((out (assoc-ref outputs "out")))
2160 (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
2164 (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
2165 ("mojoshader-src" ,(package-source mojoshader-cs))
2166 ("faudio-src" ,(package-source faudio))
2167 ("theorafile-src" ,(package-source theorafile))))
2168 (home-page "https://fna-xna.github.io/")
2169 (synopsis "Accuracy-focused XNA4 reimplementation")
2170 (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
2171 focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
2172 (license (list license:ms-pl ; FNA
2173 license:lgpl2.1 ; LzxDecoder.cs
2177 (define-public libccd
2185 (url "https://github.com/danfis/libccd")
2186 (commit (string-append "v" version))))
2187 (file-name (git-file-name name version))
2189 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2190 (build-system cmake-build-system)
2192 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2193 "-DBUILD_TESTING=ON"
2194 "-DENABLE_DOUBLE_PRECISION=ON")))
2196 `(("python-sphinx" ,python-sphinx)))
2197 (home-page "https://github.com/danfis/libccd")
2198 (synopsis "Library for collision detection between two convex shapes")
2199 (description "@code{libccd} is library for a collision detection
2200 between two convex shapes. @code{libccd} implements variation on
2201 Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2202 and also implements algorithm Minkowski Portal Refinement (MPR,
2203 a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2204 (license license:expat)))
2213 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2214 "ode-" version ".tar.gz"))
2216 (base32 "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj"))
2217 (modules '((guix build utils)))
2220 (delete-file-recursively "libccd")
2222 (build-system cmake-build-system)
2224 `(#:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
2226 (modify-phases %standard-phases
2227 (add-after 'unpack 'unbundle-libccd
2229 (substitute* "CMakeLists.txt"
2230 (("configure_file\\(libccd/.*") ""))
2236 (home-page "https://www.ode.org/")
2237 (synopsis "High performance library for simulating rigid body dynamics")
2238 (description "ODE is a high performance library for simulating
2239 rigid body dynamics. It is fully featured, stable, mature and
2240 platform independent with an easy to use C/C++ API. It has advanced
2241 joint types and integrated collision detection with friction. ODE is
2242 useful for simulating vehicles, objects in virtual reality
2243 environments and virtual creatures. It is currently used in many
2244 computer games, 3D authoring tools and simulation tools.")
2245 ;; Software is dual-licensed.
2246 (license (list license:lgpl2.1+ license:expat))))
2248 (define-public chipmunk
2256 (url "https://github.com/slembcke/Chipmunk2D")
2257 (commit (string-append "Chipmunk-" version))))
2258 (file-name (git-file-name name version))
2260 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2261 (build-system cmake-build-system)
2263 `(#:tests? #f ;no test
2264 #:configure-flags '("-DBUILD_STATIC=OFF"
2265 "-DBUILD_DEMOS=OFF")))
2267 `(("freeglut" ,freeglut)
2269 ("libxrandr" ,libxrandr)))
2270 (home-page "https://chipmunk-physics.net/")
2271 (synopsis "Fast and lightweight 2D game physics library")
2272 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2273 rigid body physics library written in C.")
2274 (license license:expat)))
2276 (define-public libtcod
2283 (url "https://github.com/libtcod/libtcod")
2285 (file-name (git-file-name name version))
2288 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
2289 (modules '((guix build utils)))
2291 (delete-file-recursively "src/vendor/utf8proc")
2292 (delete-file-recursively "src/vendor/zlib")
2293 (delete-file "src/vendor/stb_truetype.h")
2294 (delete-file "src/vendor/stb_sprintf.h")
2295 (delete-file "src/vendor/lodepng.cpp")
2296 (delete-file "src/vendor/lodepng.h")
2298 (substitute* "buildsys/autotools/sources.am"
2299 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
2300 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
2301 "../../src/vendor/stb.c")
2302 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
2304 (substitute* "src/libtcod/sys_sdl_img_png.cpp"
2305 (("\\.\\./vendor/") ""))
2307 (substitute* '("src/libtcod/color/canvas.cpp"
2308 "src/libtcod/sys_sdl_img_png.cpp"
2309 "src/libtcod/tileset/truetype.cpp"
2310 "src/libtcod/tileset/tilesheet.cpp")
2311 (("\\.\\./\\.\\./vendor/") ""))
2313 (substitute* "src/libtcod/console/printing.cpp"
2314 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
2316 (build-system gnu-build-system)
2318 `(#:configure-flags '("--with-gnu-ld"
2319 "LIBS=-lutf8proc -llodepng")
2321 (modify-phases %standard-phases
2322 (add-after 'unpack 'change-to-build-dir
2324 (chdir "buildsys/autotools")
2325 (patch-shebang "get_version.py")
2328 `(("autoconf" ,autoconf)
2329 ("automake" ,automake)
2330 ("libtool" ,libtool)
2332 ("pkg-config" ,pkg-config)
2333 ("stb-sprintf" ,stb-sprintf)
2334 ("stb-truetype" ,stb-truetype)))
2336 `(("lodepng" ,lodepng)
2338 ("utf8proc" ,utf8proc)
2340 (home-page "https://github.com/libtcod/libtcod")
2341 (synopsis "Library specifically designed for writing roguelikes")
2343 "libtcod is a fast, portable and uncomplicated API for roguelike
2344 developers providing an advanced true color console, input, and lots of other
2345 utilities frequently used in roguelikes.")
2346 (license license:bsd-3)))
2348 (define-public warsow-qfusion
2349 ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
2350 ;; The 2.5 beta as published on the homepage is commit
2351 ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
2352 (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
2354 (name "warsow-qfusion")
2355 (version (git-version "2.5" "1" commit)) ; 2.5-beta
2359 (url "https://github.com/Warsow/qfusion/")
2362 (file-name (git-file-name name version))
2365 "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
2366 ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
2367 (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
2368 (modules '((guix build utils)))
2370 (delete-file-recursively "platforms")
2371 (delete-file-recursively "debian")
2372 (delete-file-recursively "libsrcs")
2374 (build-system cmake-build-system)
2376 `(#:tests? #f ; No tests.
2377 #:configure-flags '("-DQFUSION_GAME=Warsow")
2380 (guix build cmake-build-system)
2383 (modify-phases %standard-phases
2384 (add-after 'unpack 'change-to-build-dir
2388 (add-after 'install 'really-install
2389 (lambda* (#:key outputs system #:allow-other-keys)
2390 (let ((arch (match system
2391 ("x86_64-linux" "x86_64")
2392 ("i686-linux" "i386")))
2393 (out (assoc-ref outputs "out")))
2394 (install-file (string-append "../source/build/basewsw/libgame_"
2396 (string-append out "/lib/"))
2397 (install-file (string-append "../source/build/libui_" arch ".so")
2398 (string-append out "/lib/"))
2401 (install-file file (string-append out "/bin/")))
2402 (append (find-files "../source/build" "warsow")
2403 (find-files "../source/build" "wsw_server."))))
2406 `(("alsa-lib" ,alsa-lib)
2408 ("freetype" ,freetype)
2410 ("libjpeg" ,libjpeg-turbo)
2413 ("libtheora" ,libtheora)
2414 ("libvorbis" ,libvorbis)
2417 ("pulseaudio" ,pulseaudio)
2419 ("qtdeclarative" ,qtdeclarative)
2421 ("uuid.h" ,util-linux "lib")
2424 `(("pkg-config" ,pkg-config)))
2425 (home-page "https://github.com/Warsow/qfusion")
2426 (supported-systems '("i686-linux" "x86_64-linux"))
2427 (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
2429 "This package contains the game engine of Warsow, a first-person
2430 shooter video game. The engine is based on qfusion, the id Tech 2 derived
2431 game engine. id Tech 2 is the engine originally behind Quake 2.")
2432 (license license:gpl2+))))
2434 (define-public dhewm3
2441 "https://github.com/dhewm/dhewm3/releases/download/"
2442 version "/dhewm3-" version "-src.tar.xz"))
2445 "0s2brx6wyljhjbpli97iy4lc4fqqsvdc09raz8njg0vgzcsiyrri"))))
2446 (build-system cmake-build-system)
2448 `(#:tests? #f ; No tests.
2450 (modify-phases %standard-phases
2451 (add-after 'unpack 'change-to-build-dir
2457 ("libjpeg" ,libjpeg-turbo)
2459 ("libvorbis" ,libvorbis)
2464 (home-page "https://dhewm3.org/")
2465 (synopsis "Port of the original Doom 3 engine")
2467 "@command{dhewm3} is a source port of the original Doom 3 engine (not
2468 Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
2469 version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
2470 sound effects on all operating systems and hardware (via OpenAL Softs EFX
2471 support), has much better support for widescreen resolutions and has 64bit
2473 (license license:gpl3)))
2475 (define-public tesseract-engine
2476 (let ((svn-revision 2411))
2478 (name "tesseract-engine")
2479 (version (string-append "20200615-" (number->string svn-revision)))
2484 (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
2485 (revision svn-revision)))
2486 (file-name (git-file-name name version))
2488 (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
2489 (modules '((guix build utils)))
2492 (for-each delete-file-recursively
2494 ;; Remove "media" since some files such as
2495 ;; media/sound/game/soundsnap/info.txt refer to a
2496 ;; non-commercial license.
2503 (build-system gnu-build-system)
2505 `(#:make-flags (list "CC=gcc")
2506 #:tests? #f ; No tests.
2508 (modify-phases %standard-phases
2510 (add-after 'unpack 'cd-src
2511 (lambda _ (chdir "src") #t))
2512 (add-before 'build 'fix-env
2513 (lambda* (#:key inputs #:allow-other-keys)
2515 (string-append (assoc-ref inputs "sdl2-union")
2517 (or (getenv "CPATH") "")))
2519 (add-after 'install 'really-install
2520 (lambda* (#:key outputs #:allow-other-keys)
2521 (let* ((out (assoc-ref outputs "out"))
2522 (share (string-append out "/share/tesseract"))
2523 (bin (string-append out "/bin/tesseract"))
2524 (client (string-append out "/bin/tesseract-client")))
2525 (chdir "..") ; Back to root.
2528 (mkdir-p (string-append share "/" dir))
2529 (copy-recursively dir (string-append share "/" dir)))
2531 (mkdir-p (string-append out "/bin/"))
2532 (copy-file "bin_unix/native_client" client)
2533 (copy-file "bin_unix/native_server"
2534 (string-append out "/bin/tesseract-server"))
2535 (call-with-output-file bin
2540 TESS_OPTIONS=\"-u$HOME/.tesseract\"
2542 exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
2547 (install-file "src/readme_tesseract.txt"
2548 (string-append out "/share/licenses/tesseract/LICENSE")))
2551 `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
2555 (home-page "http://tesseract.gg/")
2556 (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
2557 (description "This package contains the game engine of Tesseract, a
2558 first-person shooter focused on cooperative in-game map editing.
2560 The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
2561 upgraded modern rendering techniques. The new rendering features include
2562 fully dynamic omnidirectional shadows, global illumination, HDR lighting,
2563 deferred shading, morphological / temporal / multisample anti-aliasing, and
2565 (license license:zlib))))