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, 2018, 2019, 2020 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 Leo Prikler <leo.prikler@student.tugraz.at>
19 ;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
20 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
21 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
22 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
24 ;;; This file is part of GNU Guix.
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 ;;; GNU General Public License for more details.
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
39 (define-module (gnu packages game-development)
40 #:use-module (srfi srfi-1)
41 #:use-module (ice-9 match)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix packages)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix svn-download)
47 #:use-module (guix utils)
48 #:use-module (guix build-system cmake)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system python)
51 #:use-module (guix build-system scons)
52 #:use-module (gnu packages)
53 #:use-module (gnu packages audio)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages base)
56 #:use-module (gnu packages boost)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages curl)
59 #:use-module (gnu packages documentation)
60 #:use-module (gnu packages fltk)
61 #:use-module (gnu packages fonts)
62 #:use-module (gnu packages fontutils)
63 #:use-module (gnu packages freedesktop)
64 #:use-module (gnu packages fribidi)
65 #:use-module (gnu packages dbm)
66 #:use-module (gnu packages gl)
67 #:use-module (gnu packages glib)
68 #:use-module (gnu packages gnome)
69 #:use-module (gnu packages gnunet)
70 #:use-module (gnu packages graphics)
71 #:use-module (gnu packages graphviz)
72 #:use-module (gnu packages gtk)
73 #:use-module (gnu packages guile)
74 #:use-module (gnu packages image)
75 #:use-module (gnu packages linux)
76 #:use-module (gnu packages lua)
77 #:use-module (gnu packages m4)
78 #:use-module (gnu packages mono)
79 #:use-module (gnu packages mp3)
80 #:use-module (gnu packages multiprecision)
81 #:use-module (gnu packages music)
82 #:use-module (gnu packages ncurses)
83 #:use-module (gnu packages pcre)
84 #:use-module (gnu packages pkg-config)
85 #:use-module (gnu packages pulseaudio)
86 #:use-module (gnu packages python)
87 #:use-module (gnu packages python-xyz)
88 #:use-module (gnu packages qt)
89 #:use-module (gnu packages sdl)
90 #:use-module (gnu packages sphinx)
91 #:use-module (gnu packages stb)
92 #:use-module (gnu packages texinfo)
93 #:use-module (gnu packages textutils)
94 #:use-module (gnu packages tls)
95 #:use-module (gnu packages video)
96 #:use-module (gnu packages web)
97 #:use-module (gnu packages xdisorg)
98 #:use-module (gnu packages xiph)
99 #:use-module (gnu packages xml)
100 #:use-module (gnu packages xorg))
102 (define-public bullet
109 (url "https://github.com/bulletphysics/bullet3/")
111 (file-name (git-file-name name version))
114 "10ncf2z474jnv7p5lv01ak2mk2hib3rj5rz1zr8v2v5pnciqbijl"))
115 (modules '((guix build utils)))
118 (for-each delete-file (find-files "build3" "premake*"))
119 (with-directory-excursion "examples/ThirdPartyLibs"
120 (for-each delete-file-recursively
121 '("Gwen" "clsocket" "enet" "glad" "imgui"
122 "lua-5.2.3" "midi" "minizip" "openvr"
123 "optionalX11" "serial" "zlib")))
124 ;; These need files from ThirdPartyLibs.
125 (substitute* "Extras/CMakeLists.txt"
126 (("BulletRobotics") ""))
127 ;; Tests fail on linking, cannot find -lBussIK.
128 (substitute* "test/CMakeLists.txt"
129 ((" InverseDynamics")
130 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
131 ; (("SharedMemory") ""))
133 (build-system cmake-build-system)
135 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
136 "-DBUILD_CPU_DEMOS=OFF"
137 "-DBUILD_OPENGL3_DEMOS=OFF"
138 "-DBUILD_BULLET2_DEMOS=OFF"
139 (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
140 (or (getenv "CXXFLAGS") "")))
142 (modify-phases %standard-phases
143 (add-after 'unpack 'remove-failing-tests
144 ;; These tests fail specifically after removing 3rd party code.
146 (substitute* "test/SharedMemory/CMakeLists.txt"
147 (("ADD_TEST") "# ADD_TEST"))
148 (substitute* "test/InverseDynamics/CMakeLists.txt"
149 (("ADD_TEST\\(Test_BulletInverseForward")
150 "# ADD_TEST(Test_BulletInverseForward"))
156 (home-page "https://pybullet.org/wordpress/")
157 (synopsis "3D physics engine library")
159 "Bullet is a physics engine library usable for collision detection. It
160 is used in some video games and movies.")
161 (license license:zlib)))
163 (define-public deutex
169 (uri (string-append "https://github.com/Doom-Utils/deutex"
170 "/releases/download/v" version "/"
171 "deutex-" version ".tar.xz"))
174 "07w3asqxx89wl2wfv1z3cak8v83h3ys3b39mq9qq4gyf3xdhs76n"))))
175 (build-system gnu-build-system)
177 `(("libpng" ,libpng)))
179 `(("asciidoc" ,asciidoc)
180 ("pkg-config" ,pkg-config)))
181 (home-page "https://github.com/Doom-Utils/deutex")
182 (synopsis "WAD file composer for Doom and related games")
184 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
185 used to extract the lumps of a wad and save them as individual files.
186 Conversely, it can also build a wad from separate files. When extracting a
187 lump to a file, it does not just copy the raw data, it converts it to an
188 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
189 Conversely, when it reads files for inclusion in pwads, it does the necessary
190 conversions (for example, from PPM to Doom picture format). In addition,
191 DeuTex has functions such as merging wads, etc.")
192 (license license:gpl2+)))
194 (define-public grfcodec
201 (uri (string-append "https://binaries.openttd.org/extra/"
202 name "/" version "/" name "-" version
205 (base32 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
206 (build-system gnu-build-system)
208 '(#:tests? #f ;no check target
210 (modify-phases %standard-phases
211 (delete 'configure) ;no configure script
212 (replace 'install ;no install target
213 (lambda* (#:key outputs #:allow-other-keys)
214 (let* ((out (assoc-ref outputs "out"))
215 (bin (string-append out "/bin"))
216 (doc (string-append out "/share/doc"))
217 (man (string-append out "/share/man/man1")))
218 (for-each (lambda (file)
219 (install-file file bin))
220 '("grfcodec" "grfid" "grfstrip" "nforenum"))
221 (install-file "COPYING" doc)
222 (with-directory-excursion "docs"
223 (for-each (lambda (file)
224 (install-file (string-append file ".txt") doc))
225 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
226 "readme" "readme.rpn"))
227 (for-each (lambda (file)
228 (install-file file man))
229 (find-files "." "\\.1"))))
235 (synopsis "GRF development tools")
237 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
238 tools for developing (New)GRFs. It includes a number of smaller programs, each
239 with a specific task:
241 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
242 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
243 @item @code{grfstrip} strips all sprites from a GRF.
244 @item @code{nforenum} checks NFO code for errors, making corrections when
247 (home-page "https://dev.openttdcoop.org/projects/grfcodec")
248 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
249 ;; NFORenum is under the GPL2+.
250 ;; The MD5 implementation contained in GRFID is under the zlib license.
251 (license (list license:gpl2 license:gpl2+ license:zlib))))
253 (define-public catcodec
260 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
261 version "/catcodec-" version "-source.tar.xz"))
263 (base32 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
264 (build-system gnu-build-system)
266 `(#:tests? #f ; no tests
267 #:make-flags (list (string-append "prefix=" %output))
268 #:phases (modify-phases %standard-phases
269 (delete 'configure))))
270 (home-page "https://dev.openttdcoop.org/projects/catcodec")
271 (synopsis "Encode/decode OpenTTD sounds")
272 (description "catcodec encodes and decodes sounds for OpenTTD. These
273 sounds are not much more than some metadata (description and filename) and raw
275 (license license:gpl2)))
277 (define-public gzochi
283 (uri (string-append "mirror://savannah/gzochi/gzochi-"
287 "0h8yvk7154kd8zdfa9nqy73blrjq2x19kv305jcnwlmm09vvss59"))))
288 (build-system gnu-build-system)
290 '(#:phases (modify-phases %standard-phases
291 (add-before 'build 'no-Werror
293 ;; Don't abort builds due to things like GLib
294 ;; deprecation warnings.
295 (substitute* (find-files "." "^Makefile\\.in$")
298 (native-inputs `(("pkgconfig" ,pkg-config)))
299 (inputs `(("bdb" ,bdb)
302 ("libmicrohttpd" ,libmicrohttpd)
306 (home-page "https://www.nongnu.org/gzochi/")
307 (synopsis "Scalable middleware for multiplayer games")
309 "gzochi is a framework for developing massively multiplayer online games.
310 A server container provides services to deployed games, which are written in
311 Guile Scheme, that abstract and simplify some of the most challenging and
312 error-prone aspects of online game development: Concurrency, data persistence,
313 and network communications. A very thin client library can be embedded to
314 provide connectivity for client applications written in any language.")
315 (license license:gpl3+)))
324 (uri (pypi-uri "nml" version))
326 (base32 "0l5pfs8q7jrl3xscqq7pnwh5h5d17fsyjy7xspkc73sa0ayjm9jx"))))
327 (build-system python-build-system)
328 ;; TODO: Fix test that fails with
329 ;; "AttributeError: partially initialized module 'nml.nmlop' has no
330 ;; attribute 'ADD' (most likely due to a circular import)"
334 `(("python-pillow" ,python-pillow)
335 ("python-ply" ,python-ply)))
336 (home-page "https://github.com/OpenTTD/nml")
337 (synopsis "NML compiler")
339 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
340 compiling NML files (along with their associated language, sound and graphic
341 files) into @file{.grf} and/or @file{.nfo} files.")
342 (license license:gpl2+)))
344 (define-public python-sge
351 (uri (pypi-uri "sge" version))
354 "02fn6v6bxk3sngwd4kd3mglrp0jlnhx7x6h8nnkik6wdv150a0wv"))))
355 (build-system python-build-system)
357 `(("python-pygame" ,python-pygame)
358 ("python-uniseg" ,python-uniseg)))
359 (home-page "https://python-sge.github.io/")
360 (synopsis "2D game engine for Python")
362 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
363 general-purpose 2D game engine. It takes care of several details for you so
364 you can focus on the game itself. This makes more rapid game development
365 possible, and it also makes the SGE easy to learn.")
366 (license license:lgpl3+)))
368 (define-public python-sge-pygame
369 (deprecated-package "python-sge-pygame" python-sge))
371 (define-public python-tmx
378 (uri (string-append "mirror://savannah/python-tmx/"
379 (version-major+minor version) "/tmx-"
383 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
384 (build-system python-build-system)
386 `(("python-six" ,python-six)))
387 (home-page "http://python-tmx.nongnu.org")
388 (synopsis "Python library for the @code{Tiled} TMX format")
390 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
391 This is useful for map editors or generic level editors, and it's also useful
392 for using a map editor or generic level editor like Tiled to edit your game's
394 (license (list license:asl2.0
395 ;; Documentation (only available in the source tarball) is
396 ;; under the CC0 license.
399 (define-public python2-tmx
400 (let ((python2-tmx (package-with-python2 python-tmx)))
402 (inherit python2-tmx)
404 `(("python2-pathlib" ,python2-pathlib)
405 ,@(package-propagated-inputs python2-tmx))))))
407 (define-public python-xsge
410 (version "2020.09.07")
413 (uri (string-append "https://github.com/python-sge/xsge"
414 "/releases/download/v" version
415 "/xsge-" version ".zip"))
418 "136xgy3f9vw636wxpqbha022avk0wyxw63mm3a2dvwhh90s716f9"))))
419 (build-system python-build-system)
422 (modify-phases %standard-phases
423 ;; xSGE's setup.py script does not support one of the Python build
424 ;; system's default flags, "--single-version-externally-managed".
426 (lambda* (#:key outputs #:allow-other-keys)
427 (invoke "python" "setup.py" "install"
428 (string-append "--prefix=" (assoc-ref outputs "out"))
430 #:tests? #f)) ; no check target
434 `(("python-sge" ,python-sge)))
435 (home-page "https://python-sge.github.io/")
436 (synopsis "Extensions for the SGE Game Engine")
438 "xSGE is a collection of modules that make doing certain tasks with the SGE
439 Game Engine easier. In addition to SGE's conveniences, the user has access to a
440 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
442 (license license:gpl3+)))
451 (url "https://github.com/bjorn/tiled")
452 (commit (string-append "v" version))))
453 (file-name (git-file-name name version))
456 "14bx4gywfzr2f07ldqk3la82g5ag1agj21f7ccrxip12ydmpx0xb"))))
457 (build-system gnu-build-system)
460 ("qtdeclarative" ,qtdeclarative)
464 `(("qttools" ,qttools)))
467 (modify-phases %standard-phases
469 (lambda* (#:key inputs outputs #:allow-other-keys)
470 (substitute* "translations/translations.pro"
472 (string-append "LRELEASE = "
473 (assoc-ref inputs "qttools")
475 (let ((out (assoc-ref outputs "out")))
477 (string-append "PREFIX=" out))))))))
478 (home-page "https://www.mapeditor.org/")
479 (synopsis "Tile map editor")
481 "Tiled is a general purpose tile map editor. It is meant to be used for
482 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
485 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
487 (license license:gpl2+)))
489 (define-public tsukundere
496 (url "https://gitlab.com/leoprikler/tsukundere")
498 (file-name (git-file-name name version))
501 "0qmqch8hh7vsa8qaz853vwbkz0krb106955dnz8dsl7skbm5jpn6"))))
502 (build-system gnu-build-system)
504 `(("autoconf" ,autoconf-wrapper)
505 ("automake" ,automake)
507 ("pkg-config" ,pkg-config)))
509 `(("guile-sdl2" ,guile3.0-sdl2)))
510 (home-page "https://gitlab.com/leoprikler/tsukundere")
511 (synopsis "Visual novel engine")
512 (description "Tsukundere is a game engine geared heavily towards the
513 development of visual novels, written on top of Guile-SDL2. It is still
514 experimental and at the time of writing contains little more than the Guile
515 modules, that make up its runtime.")
516 (license license:lgpl3+)))
524 ;; Do not fetch the archives from
525 ;; http://mirror0.sfml-dev.org/files/ because files there seem
526 ;; to be changed in place.
528 (url "https://github.com/SFML/SFML")
530 (file-name (git-file-name name version))
533 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
534 (modules '((guix build utils)))
537 ;; Ensure system libraries are used.
538 (delete-file-recursively "extlibs")
540 (build-system cmake-build-system)
543 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
544 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
545 #:tests? #f)) ; no tests
547 `(("pkg-config" ,pkg-config)))
552 ("xcb-util-image" ,xcb-util-image)
553 ("libxrandr" ,libxrandr)
555 ("libjpeg" ,libjpeg-turbo)
556 ("libsndfile" ,libsndfile)
557 ("stb-image" ,stb-image)
558 ("stb-image-write" ,stb-image-write)))
560 ;; In Requires.private of pkg-config files.
562 ("freetype" ,freetype)
563 ("libvorbis" ,libvorbis)
565 (home-page "https://www.sfml-dev.org")
566 (synopsis "Simple and Fast Multimedia Library")
568 "SFML provides a simple interface to the various computer components,
569 to ease the development of games and multimedia applications. It is composed
570 of five modules: system, window, graphics, audio and network.")
571 (license license:zlib)))
579 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
582 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
583 (build-system gnu-build-system)
585 `(#:phases (modify-phases %standard-phases
586 (delete 'configure) ; no configure script
587 (add-before 'build 'patch-makefile
588 (lambda* (#:key outputs #:allow-other-keys)
589 (let ((out (assoc-ref outputs "out")))
590 (substitute* "Makefile"
591 (("\\$\\(DESTDIR\\)/usr") out))
592 (substitute* "main.cpp"
594 (string-append out "/share")))
596 #:tests? #f)) ; no tests
598 `(("pkg-config" ,pkg-config)
599 ("desktop-file-utils" ,desktop-file-utils)))
603 (synopsis "Simple sound effect generator")
604 (description "Sfxr is a tool for quickly generating simple sound effects.
605 Originally created for use in video game prototypes, it can generate random
606 sounds from presets such as \"explosion\" or \"powerup\".")
607 (home-page "http://www.drpetter.se/project_sfxr.html")
608 (license license:expat)))
610 (define-public surgescript
618 (url "https://github.com/alemart/surgescript")
619 (commit (string-append "v" version))))
620 (file-name (git-file-name name version))
622 (base32 "1vck1wk6r6jrrw5xzpqldplz601dfgpk5s5p45fam00nfsid0p7p"))))
623 (build-system cmake-build-system)
626 (let ((share (string-append (assoc-ref %outputs "out") "/share")))
627 (list (string-append "-DICON_PATH=" share "/pixmaps")
628 (string-append "-DMETAINFO_PATH=" share "/metainfo")))
630 (home-page "https://docs.opensurge2d.org")
631 (synopsis "Scripting language for games")
632 (description "@code{SurgeScript} is a dynamically typed object-oriented
633 scripting language designed for games. Each object is a state machine that
634 can be customized by attaching other objects. The language supports automatic
635 garbage collection and can be extended with plugins.")
636 (license license:asl2.0)))
638 (define-public physfs
645 "https://icculus.org/physfs/downloads/physfs-"
647 (file-name (string-append name "-" version ".tar.gz"))
650 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
651 (build-system cmake-build-system)
653 '(#:tests? #f ; no check target
654 #:configure-flags '("-DPHYSFS_BUILD_STATIC=OFF")
655 #:phases (modify-phases %standard-phases
656 (add-after 'unpack 'patch-CMakeLists.txt
658 (substitute* "CMakeLists.txt"
659 ;; XXX: For some reason CMakeLists.txt disables
660 ;; RUNPATH manipulation when the compiler is GCC.
661 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
666 `(("doxygen" ,doxygen)))
667 (home-page "https://icculus.org/physfs")
668 (synopsis "File system abstraction library")
670 "PhysicsFS is a library to provide abstract access to various archives.
671 It is intended for use in video games. For security, no file writing done
672 through the PhysicsFS API can leave a defined @emph{write directory}. For
673 file reading, a @emph{search path} with archives and directories is defined,
674 and it becomes a single, transparent hierarchical file system. So archive
675 files can be accessed in the same way as you access files directly on a disk,
676 and it makes it easy to ship a new archive that will override a previous
677 archive on a per-file basis.")
678 (license license:zlib)))
686 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
687 "love-" version "-linux-src.tar.gz"))
690 "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
691 (build-system gnu-build-system)
693 `(("pkg-config" ,pkg-config)))
696 ("freetype" ,freetype)
697 ("libmodplug" ,libmodplug)
698 ("libtheora" ,libtheora)
699 ("libvorbis" ,libvorbis)
706 (synopsis "2D game framework for Lua")
707 (description "LÖVE is a framework for making 2D games in the Lua
708 programming language.")
709 (home-page "https://love2d.org/")
710 (license license:zlib)))
712 (define-public love-nuklear
713 (let ((version "v2.6")
714 (commit "fef4e00a602efb16c57ae962850b6e7a01f7a29a"))
716 (name "love-nuklear")
717 (version (git-version version "1" commit))
721 (url "https://github.com/keharriso/love-nuklear/")
724 ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
725 ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
726 (file-name (git-file-name name version))
729 "15qmy8mfwkxy2x9rmxs6f9cyvjvwwj6yf78bs863xmc56dmjzzbn"))))
730 (build-system cmake-build-system)
732 `(#:build-type "Release"
735 `(("luajit" ,luajit)))
736 (synopsis "Lightweight immediate mode GUI for LÖVE games")
737 (description "LÖVE is a Lua framework for making 2D games. Nuklear
738 is a minimal state immediate mode graphical user interface toolkit. This
739 package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
740 (home-page "https://github.com/keharriso/love-nuklear/")
741 (license license:expat))))
743 (define-public allegro-4
749 (uri (string-append "https://github.com/liballeg/allegro5/"
750 "releases/download/" version "/allegro-"
754 "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
755 (build-system cmake-build-system)
758 (modify-phases %standard-phases
759 (add-after 'unpack 'patch-build-system
761 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
762 ;; via a command line option doesn't work because it is
763 ;; unconditionally clobbered in the build script.
764 (substitute* '("CMakeLists.txt")
765 (("ADDON_LINKAGE STATIC")
766 "ADDON_LINKAGE SHARED"))
771 ("libvorbis" ,libvorbis)
774 (synopsis "Game programming library")
775 (description "Allegro is a library mainly aimed at video game and
776 multimedia programming. It handles common, low-level tasks such as creating
777 windows, accepting user input, loading data, drawing images, playing sounds,
779 (home-page "https://liballeg.org")
780 (license license:giftware)))
782 (define-public allegro
788 (uri (string-append "https://github.com/liballeg/allegro5/releases"
789 "/download/" version "/allegro-"
793 "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
794 (build-system cmake-build-system)
795 (arguments `(#:tests? #f)) ; there are no tests
797 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
799 ("freetype" ,freetype)
802 ("libjpeg" ,libjpeg-turbo)
804 ("libtheora" ,libtheora)
805 ("libvorbis" ,libvorbis)
806 ("libxcursor" ,libxcursor)
807 ("libxinerama" ,libxinerama)
808 ("libxrandr" ,libxrandr)
814 `(("pkg-config" ,pkg-config)))
815 (synopsis "Game programming library")
816 (description "Allegro is a library mainly aimed at video game and
817 multimedia programming. It handles common, low-level tasks such as creating
818 windows, accepting user input, loading data, drawing images, playing sounds,
820 (home-page "https://liballeg.org")
821 (license license:bsd-3)))
823 (define-public allegro-5.0
824 (package (inherit allegro)
829 (uri (string-append "https://github.com/liballeg/allegro5/releases"
830 "/download/" version "/allegro-"
831 (if (equal? "0" (string-take-right version 1))
832 (string-drop-right version 2)
835 (patches (search-patches
836 "allegro-mesa-18.2.5-and-later.patch"))
839 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
841 (define-public aseprite
844 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
845 ;; TODO: Unbundle third party software.
847 (method url-fetch/zipbomb)
848 (uri (string-append "https://github.com/aseprite/aseprite"
849 "/releases/download/v" version
850 "/Aseprite-v" version "-Source.zip"))
853 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
854 (build-system cmake-build-system)
857 ;; Use shared libraries instead of building bundled source.
858 (list "-DWITH_WEBP_SUPPORT=1"
859 "-DUSE_SHARED_CURL=1"
860 "-DUSE_SHARED_GIFLIB=1"
861 "-DUSE_SHARED_JPEGLIB=1"
862 "-DUSE_SHARED_ZLIB=1"
863 "-DUSE_SHARED_LIBPNG=1"
864 "-DUSE_SHARED_LIBLOADPNG=1"
865 "-DUSE_SHARED_LIBWEBP=1"
866 "-DUSE_SHARED_TINYXML=1"
867 "-DUSE_SHARED_PIXMAN=1"
868 "-DUSE_SHARED_FREETYPE=1"
869 "-DUSE_SHARED_ALLEGRO4=1"
870 "-DENABLE_UPDATER=0" ; no auto-updates
871 (string-append "-DFREETYPE_INCLUDE_DIR="
872 (assoc-ref %build-inputs "freetype")
873 "/include/freetype2"))))
875 `(("pkg-config" ,pkg-config)))
876 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
877 ;; patched version is bundled with Aseprite, but the patches should be
878 ;; extracted and applied on top of a standalone Allegro 4 package.
880 `(("allegro" ,allegro-4)
882 ("freetype" ,freetype)
884 ("libjpeg" ,libjpeg-turbo)
889 ("libxxf86vm" ,libxxf86vm)
893 (synopsis "Animated sprite editor and pixel art tool")
894 (description "Aseprite is a tool for creating 2D pixel art for video
895 games. In addition to basic pixel editing features, Aseprite can assist in
896 the creation of animations, tiled graphics, texture atlases, and more.")
897 (home-page "https://www.aseprite.org/")
898 (license license:gpl2+)))
900 (define-public qqwing
907 "https://qqwing.com/"
908 name "-" version ".tar.gz"))
911 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
912 (build-system gnu-build-system)
914 `(("pkg-config" ,pkg-config)))
915 (home-page "https://qqwing.com/")
916 (synopsis "Sudoku puzzle solver and generator")
918 "QQWing is a Sudoku puzzle generator and solver.
919 It offers the following features:
921 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
922 @item Uses logic. Uses as many solve techniques as possible when solving
923 puzzles rather than guessing.
924 @item Rates puzzles. Most generators don't give an indication of the difficulty
925 of a Sudoku puzzle. QQwing does.
926 @item Can print solve instructions for any puzzle.
927 @item Customizable output style, including a CSV style that is easy to
928 import into a database.
930 (license license:gpl2+)))
932 (define-public quesoglc
938 (uri (string-append "mirror://sourceforge/" name "/" version "/"
939 name "-" version "-free.tar.bz2"))
942 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
943 (build-system gnu-build-system)
944 (native-inputs `(("pkg-config" ,pkg-config)))
945 (inputs `(("fontconfig" ,fontconfig)
946 ("freeglute" ,freeglut)
949 (home-page "http://quesoglc.sourceforge.net")
950 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
952 "The OpenGL Character Renderer (GLC) is a state machine that provides
953 OpenGL programs with character rendering services via an application programming
955 (license (list license:expat license:lgpl2.1+))))
957 (define-public python-pygame
959 (name "python-pygame")
963 (uri (pypi-uri "pygame" version))
966 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
967 (build-system python-build-system)
969 `(#:tests? #f ; tests require pygame to be installed first
971 (modify-phases %standard-phases
972 ;; Set the paths to the dependencies manually because
973 ;; the configure script does not allow passing them as
974 ;; parameters. This also means we can skip the configure
976 (add-before 'build 'set-library-paths
977 (lambda* (#:key inputs outputs #:allow-other-keys)
978 (let ((sdl-ref (assoc-ref inputs "sdl"))
979 (font-ref (assoc-ref inputs "sdl-ttf"))
980 (image-ref (assoc-ref inputs "sdl-image"))
981 (mixer-ref (assoc-ref inputs "sdl-mixer"))
982 (smpeg-ref (assoc-ref inputs "libsmpeg"))
983 (png-ref (assoc-ref inputs "libpng"))
984 (jpeg-ref (assoc-ref inputs "libjpeg"))
985 (freetype-ref (assoc-ref inputs "freetype"))
986 (v4l-ref (assoc-ref inputs "v4l-utils"))
987 (out-ref (assoc-ref outputs "out")))
988 (substitute* "Setup.in"
989 (("SDL = -I/usr/include/SDL")
990 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
991 (substitute* "Setup.in"
992 (("FONT = -lSDL_ttf")
993 (string-append "FONT = -I" font-ref "/include/SDL -L"
994 font-ref "/lib -lSDL_ttf")))
995 (substitute* "Setup.in"
996 (("IMAGE = -lSDL_image")
997 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
998 image-ref "/lib -lSDL_image")))
999 (substitute* "Setup.in"
1000 (("MIXER = -lSDL_mixer")
1001 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
1002 mixer-ref "/lib -lSDL_mixer")))
1003 (substitute* "Setup.in"
1004 (("SMPEG = -lsmpeg")
1005 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
1006 smpeg-ref "/lib -lsmpeg")))
1007 (substitute* "Setup.in"
1009 (string-append "PNG = -I" png-ref "/include -L"
1010 png-ref "/lib -lpng")))
1011 (substitute* "Setup.in"
1013 (string-append "JPEG = -I" jpeg-ref "/include -L"
1014 jpeg-ref "/lib -ljpeg")))
1016 (substitute* "Setup.in"
1017 (("FREETYPE = -lfreetype")
1018 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
1019 freetype-ref "/lib -lfreetype")))
1021 (substitute* "Setup.in"
1022 (("^pypm") "#pypm"))
1023 ;; Create a path to a header file provided by v4l-utils.
1024 (system* "mkdir" "linux")
1025 (system* "ln" "--symbolic"
1026 (string-append v4l-ref "/include/libv4l1-videodev.h")
1028 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
1030 `(("freetype" ,freetype)
1032 ("sdl-image" ,sdl-image)
1033 ("sdl-mixer" ,sdl-mixer)
1034 ("sdl-ttf" ,sdl-ttf)
1035 ("sdl-gfx" ,sdl-gfx)
1036 ("libjpeg" ,libjpeg-turbo)
1039 ("libsmpeg" ,libsmpeg)
1040 ("portmidi" ,portmidi)
1041 ("v4l-utils" ,v4l-utils)))
1042 (home-page "https://www.pygame.org")
1043 (synopsis "SDL wrapper for Python")
1044 (description "Pygame is a set of Python modules designed for writing games.
1045 Pygame adds functionality on top of the excellent SDL library. This allows you
1046 to create fully featured games and multimedia programs in the python language.")
1047 (license (list license:bsd-2
1048 ;; python numeric license as listed by Debian looks like
1049 ;; an Expat-style license with a warranty disclaimer for
1050 ;; the U.S. government and the University of California.
1056 license:public-domain
1057 license:lgpl2.1+))))
1059 (define-public python2-pygame
1060 (package-with-python2 python-pygame))
1062 (define-public python2-pygame-sdl2
1063 (let ((real-version "2.1.0")
1064 (renpy-version "7.3.5"))
1066 (inherit python2-pygame)
1067 (name "python2-pygame-sdl2")
1068 (version (string-append real-version "-for-renpy-" renpy-version))
1072 (uri (string-append "https://www.renpy.org/dl/" renpy-version
1073 "/pygame_sdl2-" version ".tar.gz"))
1074 (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))
1075 (modules '((guix build utils)))
1078 ;; drop generated sources
1079 (delete-file-recursively "gen")
1080 (delete-file-recursively "gen3")
1082 (build-system python-build-system)
1084 `(#:tests? #f ; tests require pygame to be installed first
1087 (modify-phases %standard-phases
1088 (add-after 'set-paths 'set-sdl-vars
1089 (lambda* (#:key inputs #:allow-other-keys)
1090 (setenv "PYGAME_SDL2_CFLAGS"
1092 (assoc-ref inputs "sdl-union")
1093 "/include/SDL2 -D_REENTRANT"))
1094 (setenv "PYGAME_SDL2_LDFLAGS"
1096 (assoc-ref inputs "sdl-union")
1098 (assoc-ref inputs "sdl-union")
1099 "/lib -Wl,--enable-new-dtags -lSDL2"))
1103 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1105 `(("python2-cython" ,python2-cython)))
1106 (home-page "http://www.renpy.org/")
1107 (synopsis "Reimplementation of the Pygame API using SDL2")
1108 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1109 staying close to the original, but also adding some SDL2-specific features.
1110 While it aims to be used as a drop-in replacement, it appears to be
1111 developed mainly for Ren'py.")
1112 (license (list license:lgpl2.1 license:zlib)))))
1114 (define-public python2-renpy
1116 (name "python2-renpy")
1121 (uri (string-append "https://www.renpy.org/dl/" version
1122 "/renpy-" version "-source.tar.bz2"))
1123 (sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))
1124 (modules '((guix build utils)))
1127 "renpy-use-system-fribidi.patch"))
1129 '(with-directory-excursion "module"
1130 ;; drop generated sources
1131 (delete-file-recursively "gen")
1132 ;; drop fribidi sources
1133 (delete-file-recursively "fribidi-src")
1135 (build-system python-build-system)
1137 `(#:tests? #f ; Ren'py doesn't seem to package tests
1140 (modify-phases %standard-phases
1141 (add-after 'unpack 'fix-commands
1143 (substitute* "renpy/editor.py"
1145 (which "xdg-open")))
1147 (add-after 'unpack 'fix-include-paths
1148 (lambda* (#:key inputs #:allow-other-keys)
1149 (substitute* "module/setup.py"
1150 (("/usr/include/fribidi")
1151 (string-append (assoc-ref inputs "fribidi")
1152 "/include/fribidi")))
1154 (add-after 'set-paths 'set-build-vars
1155 (lambda* (#:key inputs #:allow-other-keys)
1156 (setenv "RENPY_CYTHON"
1157 (string-append (assoc-ref inputs "python2-cython")
1159 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
1162 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1163 ;; The "module" subdirectory contains a python (really cython)
1164 ;; project, which is built using a script, that is thankfully
1165 ;; named "setup.py".
1166 (with-directory-excursion "module"
1167 (apply (assoc-ref %standard-phases 'build) args))
1168 ;; the above causes renpy.__init__ to be compiled but does not
1169 ;; compile anything else, hence we do that here
1170 (delete-file "renpy/__init__.pyc")
1171 (invoke "python" "-m" "compileall" "renpy")
1174 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1175 ;; Again, we have to wrap the module installation.
1176 ;; Additionally, we want to install the python code
1177 ;; (both source and compiled) in the same directory.
1178 (let* ((out (assoc-ref outputs "out"))
1179 (site (string-append "/lib/python"
1180 ,(version-major+minor
1181 (package-version python-2))
1183 (with-directory-excursion "module"
1184 (apply (assoc-ref %standard-phases 'install) args))
1185 (copy-recursively "renpy"
1186 (string-append out site "/renpy")))
1189 `(("ffmpeg" ,ffmpeg)
1190 ("freetype" ,freetype)
1191 ("fribidi" ,fribidi)
1194 ("python2-pygame" ,python2-pygame-sdl2)
1196 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1198 `(("python2-cython" ,python2-cython)
1199 ("xdg-utils" ,xdg-utils)))
1200 (home-page "https://www.renpy.org/")
1201 (synopsis "Ren'py python module")
1202 (description "This package contains the shared libraries and Python
1203 modules of Ren'py.")
1204 (license license:expat)))
1206 (define-public renpy
1208 (inherit python2-renpy)
1211 (build-system python-build-system)
1213 `(#:tests? #f ; see python2-renpy
1216 (modify-phases %standard-phases
1217 (add-after 'unpack 'fix-commands
1218 (lambda* (#:key outputs #:allow-other-keys)
1219 (substitute* "launcher/game/choose_directory.rpy"
1220 (("/usr/bin/python") (which "python2")))
1221 (substitute* "launcher/game/front_page.rpy"
1223 (which "xdg-open")))
1224 (substitute* "launcher/game/project.rpy"
1225 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1226 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1228 ;; Projects are still created in the usual style, so we need
1229 ;; to adjust the path.
1230 (("cmd.append\\(self.path\\)")
1231 "cmd.append(self.path + \"/game\")"))
1233 (add-after 'unpack 'drop-game-from-paths
1235 (substitute* (list "launcher/game/gui7.rpy"
1236 "launcher/game/gui7/images.py")
1237 ((", \"game\",") ","))
1239 (add-before 'build 'start-xserver
1240 (lambda* (#:key inputs #:allow-other-keys)
1241 (let ((xorg-server (assoc-ref inputs "xorg-server")))
1242 (setenv "HOME" (getcwd))
1243 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
1244 (setenv "DISPLAY" ":1")
1248 (invoke "python" "renpy.py" "launcher" "quit")
1249 (invoke "python" "renpy.py" "the_question" "quit")
1250 (invoke "python" "renpy.py" "tutorial" "quit")
1253 (lambda* (#:key inputs outputs #:allow-other-keys)
1254 ;; Here we install our custom renpy program.
1255 ;; After finishing this step, "out" will have the following:
1257 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1260 ;; Note that common is also a de facto unused directory in
1261 ;; python2-renpy. On other systems, renpy_base would point to
1262 ;; site-packages or even somewhere in /opt.
1263 ;; The former approach is not as straightforward as it seems
1264 ;; -- it causes renpy to load files twice for some weird reason --
1265 ;; and the latter is impossible on Guix. Hence the detour through
1266 ;; share/renpy and the custom renpy program.
1268 ;; As a convention, other games should be installed as
1269 ;; subdirectories of share/renpy in their respective outputs as
1270 ;; well. This differs from the traditional layout, which is
1271 ;; roughly the following:
1272 ;; `-- Super Awesome Game
1273 ;; |-- game ; <- the folder we actually want
1274 ;; |-- lib ; compiled renpy module and dependencies
1275 ;; |-- renpy ; Ren'py python code (source + compiled)
1276 ;; |-- Super Awesome Game.py
1277 ;; `-- Super Awesome Game.sh
1278 (let* ((out (assoc-ref outputs "out"))
1279 (bin/renpy (string-append out "/bin/renpy")))
1280 (mkdir-p (string-append out "/bin"))
1281 (copy-recursively "renpy/common"
1282 (string-append out "/share/renpy/common"))
1283 (copy-recursively "gui"
1284 (string-append out "/share/renpy/gui"))
1286 (call-with-output-file bin/renpy
1288 (format port "#!~a~%" (which "python2"))
1290 from __future__ import print_function
1296 def path_to_common(renpy_base):
1297 return renpy_base + \"/common\"
1299 def path_to_saves(gamedir, save_directory=None):
1300 import renpy # @UnresolvedImport
1302 if save_directory is None:
1303 save_directory = renpy.config.save_directory
1304 save_directory = renpy.exports.fsencode(save_directory)
1306 if not save_directory:
1307 return gamedir + \"/saves\"
1309 return os.path.expanduser(\"~~/.renpy/\" + save_directory)
1311 def path_to_renpy_base():
1315 renpy_base = path_to_renpy_base()
1317 import renpy.bootstrap
1318 import renpy.arguments
1320 print(\"\"\"Could not import renpy.bootstrap.
1321 Please ensure you decompressed Ren'Py correctly, preserving the directory
1322 structure.\"\"\", file=sys.stderr)
1325 args = renpy.arguments.bootstrap()
1326 if not args.basedir:
1327 print(\"\"\"This Ren'py requires a basedir to launch.
1328 The basedir is the directory, in which .rpy files live -- usually the 'game'
1329 subdirectory of a game packaged by Ren'py.
1331 If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
1335 renpy.bootstrap.bootstrap(renpy_base)
1337 if __name__ == \"__main__\":
1340 (string-append out "/share/renpy"))))
1341 (chmod bin/renpy #o755)
1344 (add-after 'install 'install-games
1345 (lambda* (#:key outputs #:allow-other-keys)
1346 (define renpy (assoc-ref outputs "out"))
1347 ;; TODO: We should offer a renpy-build-system to make the
1348 ;; installation of Ren'py games easier.
1349 (define* (install-renpy-game #:key output game name (renpy renpy)
1351 (let* ((name (or name (basename game)))
1352 (launcher (string-append output "/bin/renpy-" name))
1353 (share (string-append output "/share/renpy/" name)))
1354 (copy-recursively (string-append game "/game") share)
1355 (mkdir-p (string-append output "/bin"))
1356 (with-output-to-file launcher
1359 "#!~a~%~a ~a \"$@\""
1361 (string-append renpy "/bin/renpy")
1363 (chmod launcher #o755)))
1365 (install-renpy-game #:output (assoc-ref outputs "out")
1368 (install-renpy-game #:output (assoc-ref outputs "the-question")
1369 #:game "the_question"
1370 #:name "the-question")
1372 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1376 (lambda* (#:key inputs outputs #:allow-other-keys)
1377 (wrap-program (string-append (assoc-ref outputs "out")
1379 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
1382 `(("python2-tkinter" ,python-2 "tk")
1383 ("python2-pygame" ,python2-pygame-sdl2)
1384 ("python2-renpy" ,python2-renpy)
1385 ("xorg-server" ,xorg-server)))
1387 (list "out" "tutorial" "the-question"))
1388 (home-page "https://www.renpy.org/")
1389 (synopsis "Visual Novel Engine")
1390 (description "Ren'Py is a visual novel engine that helps you use words,
1391 images, and sounds to tell interactive stories that run on computers and
1392 mobile devices. These can be both visual novels and life simulation games.
1393 The easy to learn script language allows anyone to efficiently write large
1394 visual novels, while its Python scripting is enough for complex simulation
1396 (license license:expat)))
1398 (define-public grafx2
1404 ;; XXX: There is no URL that contains the version. :(
1405 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1408 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1409 (build-system gnu-build-system)
1412 (modify-phases %standard-phases
1413 (delete 'configure) ; no configure script
1414 (add-before 'build 'change-to-src-directory
1419 ;; SDL header files are referenced without the preceeding "SDL/".
1420 (list (string-append "CFLAGS=-I"
1421 (assoc-ref %build-inputs "sdl-union")
1423 (string-append "prefix="
1424 (assoc-ref %outputs "out")))
1425 #:tests? #f)) ; no check target
1427 `(("pkg-config" ,pkg-config)))
1429 `(("libpng" ,libpng)
1431 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
1432 (synopsis "Bitmap paint program")
1433 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1434 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1435 includes a very large number of tools and effects that make it particularly
1436 suitable for pixel art, game graphics, and generally any detailed graphics
1437 painted with a mouse.")
1438 (home-page "http://pulkomandy.tk/projects/GrafX2")
1439 (license license:gpl2))) ; GPLv2 only
1449 (url "https://github.com/wgois/OIS")
1450 (commit (string-append "v" version))))
1451 (file-name (git-file-name name version))
1453 (base32 "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa"))))
1454 (build-system cmake-build-system)
1456 `(#:tests? #f)) ; no test suite
1458 `(("libx11" ,libx11)))
1459 (synopsis "Object Oriented Input System")
1461 "Cross Platform Object Oriented Input Lib System is a cross platform,
1462 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1463 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1464 robust and compatible with many systems and operating systems.")
1465 (home-page "https://github.com/wgois/OIS")
1466 (license license:zlib)))
1468 (define-public mygui
1476 (url "https://github.com/MyGUI/mygui")
1477 (commit (string-append "MyGUI" version))))
1478 (file-name (git-file-name name version))
1481 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
1482 (build-system cmake-build-system)
1484 '(#:tests? #f ; No test target
1486 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1487 (string-append "-DOGRE_INCLUDE_DIR="
1488 (assoc-ref %build-inputs "ogre")
1490 ;; Demos and tools are Windows-specific:
1491 ;; https://github.com/MyGUI/mygui/issues/24.
1492 "-DMYGUI_BUILD_DEMOS=FALSE"
1493 "-DMYGUI_BUILD_TOOLS=FALSE")))
1496 ("doxygen" ,doxygen)
1497 ("pkg-config" ,pkg-config)))
1499 `(("font-dejavu" ,font-dejavu)
1500 ("freetype" ,freetype)
1501 ("graphviz" ,graphviz)
1505 (synopsis "Fast, flexible and simple GUI")
1507 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1508 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1510 (home-page "http://mygui.info/")
1511 (license license:expat)))
1513 (define-public mygui-gl
1514 ;; Closure size is reduced by some 800 MiB.
1520 (substitute-keyword-arguments (package-arguments mygui)
1521 ((#:configure-flags _)
1522 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1523 ;; We can't reuse the flags because of the mention to Ogre.
1524 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1525 ;; Demos and tools are Windows-specific:
1526 ;; https://github.com/MyGUI/mygui/issues/24.
1527 "-DMYGUI_BUILD_DEMOS=FALSE"
1528 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1532 ,@(fold alist-delete (package-inputs mygui)
1534 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1536 (define-public openmw
1544 (url "https://github.com/OpenMW/openmw")
1545 (commit (string-append "openmw-" version))))
1546 (file-name (git-file-name name version))
1549 "0rm32zsmxvr6b0jjihfj543skhicbw5kg6shjx312clhlm035w2x"))))
1550 (build-system cmake-build-system)
1552 `(#:tests? #f ; No test target
1554 (list "-DDESIRED_QT_VERSION=5")))
1557 ("doxygen" ,doxygen)
1558 ("pkg-config" ,pkg-config)))
1560 `(("bullet" ,bullet)
1563 ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
1565 ("openscenegraph" ,openmw-openscenegraph)
1568 ("unshield" ,unshield)))
1569 (synopsis "Re-implementation of the RPG Morrowind engine")
1571 "OpenMW is a game engine which reimplements and extends the one that runs
1572 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1573 called OpenMW-CS which allows the user to edit or create their own original
1575 (home-page "https://openmw.org")
1576 (license license:gpl3)))
1578 (define-public godot
1585 (url "https://github.com/godotengine/godot")
1586 (commit (string-append version "-stable"))))
1587 (file-name (git-file-name name version))
1590 "19vrp5lhyvxbm6wjxzn28sn3i0s8j08ca7nani8l1nrhvlc8wi0v"))
1591 (modules '((guix build utils)
1596 ;; Keep only those bundled files we have not (yet) replaced
1597 ;; with Guix versions. Note that some of these may be
1598 ;; modified; see "thirdparty/README.md".
1599 (with-directory-excursion "thirdparty"
1600 (let* ((preserved-files
1621 (for-each delete-file-recursively
1622 (lset-difference string=?
1624 (cons* "." ".." preserved-files)))))
1626 (build-system scons-build-system)
1628 `(#:scons ,scons-python2
1629 #:scons-flags (list "platform=x11" "target=release_debug"
1630 ;; Avoid using many of the bundled libs.
1631 ;; Note: These options can be found in the SConstruct file.
1633 "builtin_freetype=no"
1635 "builtin_libmpdec=no"
1638 "builtin_libtheora=no"
1639 "builtin_libvorbis=no"
1641 "builtin_libwebp=no"
1642 "builtin_mbedtls=no"
1648 #:tests? #f ; There are no tests
1650 (modify-phases %standard-phases
1651 (add-after 'unpack 'scons-use-env
1653 ;; Scons does not use the environment variables by default,
1654 ;; but this substitution makes it do so.
1655 (substitute* "SConstruct"
1656 (("env_base = Environment\\(tools=custom_tools\\)")
1658 "env_base = Environment(tools=custom_tools)\n"
1659 "env_base = Environment(ENV=os.environ)")))
1661 ;; Build headless tools, used for packaging games without depending on X.
1662 (add-after 'build 'build-headless
1663 (lambda* (#:key scons-flags #:allow-other-keys)
1664 (apply invoke "scons"
1665 `(,(string-append "-j" (number->string (parallel-job-count)))
1666 "platform=server" ,@(delete "platform=x11" scons-flags)))))
1668 (lambda* (#:key inputs outputs #:allow-other-keys)
1669 (let* ((out (assoc-ref outputs "out"))
1670 (headless (assoc-ref outputs "headless"))
1671 (zenity (assoc-ref inputs "zenity")))
1672 ;; Strip build info from filenames.
1673 (with-directory-excursion "bin"
1676 (let ((dest (car (string-split (basename file) #\.))))
1677 (rename-file file dest)))
1678 (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
1679 (install-file "godot" (string-append out "/bin"))
1680 (install-file "godot_server" (string-append headless "/bin")))
1681 ;; Tell the editor where to find zenity for OS.alert().
1682 (wrap-program (string-append out "/bin/godot")
1683 `("PATH" ":" prefix (,(string-append zenity "/bin")))))
1685 (add-after 'install 'install-godot-desktop
1686 (lambda* (#:key outputs #:allow-other-keys)
1687 (let* ((out (assoc-ref outputs "out"))
1688 (applications (string-append out "/share/applications"))
1689 (icons (string-append out "/share/icons/hicolor")))
1690 (mkdir-p applications)
1691 (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
1692 (string-append applications "/godot.desktop"))
1693 (for-each (lambda (icon dest)
1694 (mkdir-p (dirname dest))
1695 (copy-file icon dest))
1696 '("icon.png" "icon.svg")
1697 `(,(string-append icons "/256x256/apps/godot.png")
1698 ,(string-append icons "/scalable/apps/godot.svg"))))
1700 (outputs '("out" "headless"))
1701 (native-inputs `(("pkg-config" ,pkg-config)))
1702 (inputs `(("alsa-lib" ,alsa-lib)
1704 ("freetype" ,freetype)
1707 ("libtheora" ,libtheora)
1708 ("libvorbis" ,libvorbis)
1710 ("libwebp" ,libwebp)
1712 ("libxcursor" ,libxcursor)
1714 ("libxinerama" ,libxinerama)
1715 ("libxrandr" ,libxrandr)
1716 ("mbedtls" ,mbedtls-apache)
1718 ("opusfile" ,opusfile)
1720 ("pulseaudio" ,pulseaudio)
1723 ("zstd" ,zstd "lib")))
1724 (home-page "https://godotengine.org/")
1725 (synopsis "Advanced 2D and 3D game engine")
1727 "Godot is an advanced multi-platform game engine written in C++. If
1728 features design tools such as a visual editor, can import 3D models and
1729 provide high-quality 3D rendering, it contains an animation editor, and can be
1730 scripted in a Python-like language.")
1731 (license license:expat)))
1733 (define-public eureka
1739 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1741 ;; version without dots e.g 1.21 => 121
1742 (string-join (string-split version #\.) "")
1746 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1747 (build-system gnu-build-system)
1751 (let ((out (assoc-ref %outputs "out")))
1752 (list (string-append "PREFIX=" out)))
1754 (modify-phases %standard-phases
1756 (add-before 'build 'prepare-install-directories
1757 (lambda* (#:key outputs #:allow-other-keys)
1758 (let ((out (assoc-ref outputs "out")))
1759 (mkdir-p (string-append out "/bin"))
1760 (mkdir-p (string-append out "/share"))
1762 (with-fluids ((%default-port-encoding #f))
1763 (substitute* "./src/main.cc"
1764 (("/usr/local") out)))
1766 (substitute* "Makefile"
1767 (("-o root") ""))))))))
1768 (inputs `(("mesa" ,mesa)
1770 ("libxinerama" ,libxinerama)
1771 ("libfontconfig" ,fontconfig)
1772 ("libjpeg" ,libjpeg-turbo)
1776 (native-inputs `(("pkg-config" ,pkg-config)
1777 ("xdg-utils" ,xdg-utils)))
1778 (synopsis "Doom map editor")
1779 (description "Eureka is a map editor for the classic DOOM games, and a few
1780 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1782 (home-page "http://eureka-editor.sourceforge.net/")
1783 (license license:gpl2+)))
1785 (define-public guile-chickadee
1787 (name "guile-chickadee")
1791 (uri (string-append "https://files.dthompson.us/chickadee/"
1792 "chickadee-" version ".tar.gz"))
1795 "1jv4jkc35b7rizz8iflh74hhk9qy665isn1xa6gqz0qp9grwb019"))))
1796 (build-system gnu-build-system)
1798 '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
1800 `(("guile-opengl" ,guile3.0-opengl)
1801 ("guile-sdl2" ,guile3.0-sdl2)))
1803 `(("freetype" ,freetype)
1804 ("guile" ,guile-3.0)
1805 ("libvorbis" ,libvorbis)
1807 ("openal" ,openal)))
1809 `(("pkg-config" ,pkg-config)
1810 ("texinfo" ,texinfo)))
1811 (home-page "https://dthompson.us/projects/chickadee.html")
1812 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1813 (description "Chickadee is a game development toolkit for Guile Scheme
1814 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1815 that parenthetically inclined game developers need to make 2D (and eventually
1816 3D) games in Scheme, such as:
1819 @item extensible, fixed-timestep game loop
1820 @item OpenGL-based rendering engine
1821 @item keyboard, mouse, controller input
1822 @item REPL-driven development model
1824 (license license:gpl3+)))
1826 (define-public guile3.0-chickadee
1827 (deprecated-package "guile3.0-chickadee" guile-chickadee))
1829 (define-public bennu-game-development
1831 (name "bennu-game-development")
1836 (url "http://svn.code.sf.net/p/bennugd/code")
1837 (revision (string->number version))))
1838 (file-name (string-append name "-" version))
1841 "1iri58ryk9lbqn585cbccnvrfkj8qxlbcsk8rpih40jhvs1j101l"))
1842 (modules '((guix build utils)))
1845 (delete-file-recursively "3rdparty") #t))))
1846 (build-system gnu-build-system)
1849 (modify-phases %standard-phases
1850 (add-after 'unpack 'patch-configure-to-use-openssl
1851 (lambda* (#:key outputs #:allow-other-keys)
1853 (delete-file "configure")
1854 (substitute* "configure.in"
1857 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
1858 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
1865 (inputs `(("openssl" ,openssl)
1867 (native-inputs `(("pkg-config" ,pkg-config)
1868 ("autoconf" ,autoconf)
1869 ("automake" ,automake)
1870 ("libtool" ,libtool)))
1871 (synopsis "Programming language to create games")
1872 (description "Bennu Game Development, also known as bennudg, is a
1873 programming language tailored at game development. It is the successor of
1875 (home-page "https://sourceforge.net/projects/bennugd/")
1876 (license license:zlib)))
1878 (define-public bennu-game-development-modules
1880 (inherit bennu-game-development)
1881 (name "bennu-game-development-modules")
1884 (modify-phases %standard-phases
1885 (add-after 'unpack 'patch-conflicting-definitions
1887 (with-fluids ((%default-port-encoding #f))
1888 (substitute* "core/include/fmath.h"
1889 (("extern fixed fmul\\( int x, int y \\);") "")
1890 (("extern fixed fdiv\\( int x, int y \\);") "")))
1891 (chdir "modules"))))))
1892 (inputs `(("zlib" ,zlib)
1894 ("openssl" ,openssl)
1895 ("sdl-mixer" ,sdl-mixer)
1896 ("bennu-game-development" ,bennu-game-development)))
1897 (synopsis "Modules for the Bennu Game Development programming language")
1898 (description "This package contains a collection of modules for the Bennu
1899 Game Development programming language, from CD handling through SDL to
1900 joystick support.")))
1908 (uri (string-append "http://plib.sourceforge.net/dist/"
1909 "plib-" version ".tar.gz"))
1912 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
1913 (patches (search-patches "plib-CVE-2011-4620.patch"
1914 "plib-CVE-2012-4552.patch"))))
1915 (build-system gnu-build-system)
1919 ("libxmu" ,libxmu)))
1921 `(("pkg-config" ,pkg-config)))
1922 (home-page "http://plib.sourceforge.net/")
1923 (synopsis "Suite of portable game libraries")
1924 (description "PLIB is a set of libraries that will permit programmers to
1925 write games and other realtime interactive applications that are 100% portable
1926 across a wide range of hardware and operating systems. PLIB includes sound
1927 effects, music, a complete 3D engine, font rendering, a simple Windowing
1928 library, a game scripting language, a GUI, networking, 3D math library and a
1929 collection of handy utility functions. All are 100% portable across nearly
1930 all modern computing platforms. Each library component is fairly independent
1932 (license license:lgpl2.0+)))
1934 (define-public ioquake3
1935 ;; We follow master since it seems that there won't be releases after 1.3.6.
1936 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
1939 (version (git-version "1.3.6" "1" commit))
1944 (url "https://github.com/ioquake/ioq3")
1946 (file-name (git-file-name name version))
1949 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
1950 (build-system gnu-build-system)
1953 ("libjpeg" ,libjpeg-turbo)
1956 ("opusfile" ,opusfile)
1958 ("libvorbis" ,libvorbis)
1959 ("freetype" ,freetype)
1960 ("libogg" ,libogg)))
1962 `(("which" ,which) ; Else SDL_version.h won't be found.
1963 ("pkg-config" ,pkg-config)))
1965 '(#:tests? #f ; No tests.
1966 #:make-flags '("CC=gcc"
1967 "USE_INTERNAL_LIBS=0"
1969 "USE_RENDERER_DLOPEN=0"
1970 "USE_OPENAL_DLOPEN=0"
1971 "USE_CURL_DLOPEN=0")
1973 (modify-phases %standard-phases
1976 (lambda* (#:key outputs #:allow-other-keys)
1977 (invoke "make" "copyfiles" "CC=gcc"
1978 "USE_INTERNAL_LIBS=0"
1979 (string-append "COPYDIR="
1980 (assoc-ref outputs "out")
1982 (home-page "https://ioquake3.org/")
1983 (synopsis "FPS game engine based on Quake 3")
1984 (description "ioquake3 is a free software first person shooter engine
1985 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
1986 the original, ioquake3 has been cleaned up, bugs have been fixed and features
1987 added. The permanent goal is to create the open source Quake 3 distribution
1988 upon which people base their games, ports to new platforms, and other
1990 (license license:gpl2))))
1992 (define-public openvr
1996 (home-page "https://github.com/ValveSoftware/openvr/")
2002 (commit (string-append "v" version))))
2003 (file-name (git-file-name name version))
2005 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
2006 (build-system cmake-build-system)
2010 #:configure-flags (list "-DBUILD_SHARED=1")))
2011 (synopsis "Virtual reality software development kit")
2012 (description "OpenVR is an API and runtime that allows access to VR
2013 hardware from multiple vendors without requiring that applications have
2014 specific knowledge of the hardware they are targeting.")
2015 (license license:bsd-3)))
2017 (define-public flatzebra
2024 (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
2025 "flatzebra-" version ".tar.gz"))
2027 (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
2028 (build-system gnu-build-system)
2031 (modify-phases %standard-phases
2032 (add-after 'unpack 'fix-sdl-config
2033 (lambda* (#:key inputs #:allow-other-keys)
2034 ;; XXX: sdl-config in sdl-union is a link to sdl-config from
2035 ;; plain sdl package. As a consequence, the prefix is wrong.
2036 ;; Force correct one with "--prefix" argument.
2037 (let ((sdl-union (assoc-ref inputs "sdl")))
2038 (setenv "SDL_CONFIG"
2039 (string-append sdl-union
2040 "/bin/sdl-config --prefix="
2044 `(("pkg-config" ,pkg-config)))
2046 `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
2047 (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
2048 (synopsis "Generic game engine for 2D double-buffering animation")
2050 "Flatzebra is a simple, generic C++ game engine library supporting 2D
2052 (license license:gpl2+)))
2057 (version "19.12.01")
2062 (url "https://github.com/FNA-XNA/FNA")
2064 (file-name (git-file-name name version))
2066 (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
2067 (build-system gnu-build-system)
2069 '(#:tests? #f ; No tests.
2071 (modify-phases %standard-phases
2072 (add-after 'unpack 'link-dep-src
2073 (lambda* (#:key inputs #:allow-other-keys)
2074 (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
2075 (mojoshader (assoc-ref inputs "mojoshader-src"))
2076 (faudio (assoc-ref inputs "faudio-src"))
2077 (theorafile (assoc-ref inputs "theorafile-src")))
2078 (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
2079 (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
2080 (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
2081 (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
2085 (invoke "make" "release")))
2087 (lambda* (#:key outputs #:allow-other-keys)
2088 (let ((out (assoc-ref outputs "out")))
2089 (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
2093 (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
2094 ("mojoshader-src" ,(package-source mojoshader-cs))
2095 ("faudio-src" ,(package-source faudio))
2096 ("theorafile-src" ,(package-source theorafile))))
2097 (home-page "https://fna-xna.github.io/")
2098 (synopsis "Accuracy-focused XNA4 reimplementation")
2099 (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
2100 focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
2101 (license (list license:ms-pl ; FNA
2102 license:lgpl2.1 ; LzxDecoder.cs
2106 (define-public libccd
2114 (url "https://github.com/danfis/libccd")
2115 (commit (string-append "v" version))))
2116 (file-name (git-file-name name version))
2118 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2119 (build-system cmake-build-system)
2121 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2122 "-DBUILD_TESTING=ON"
2123 "-DENABLE_DOUBLE_PRECISION=ON")))
2125 `(("python-sphinx" ,python-sphinx)))
2126 (home-page "https://github.com/danfis/libccd")
2127 (synopsis "Library for collision detection between two convex shapes")
2128 (description "@code{libccd} is library for a collision detection
2129 between two convex shapes. @code{libccd} implements variation on
2130 Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2131 and also implements algorithm Minkowski Portal Refinement (MPR,
2132 a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2133 (license license:expat)))
2142 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2143 "ode-" version ".tar.gz"))
2145 (base32 "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj"))
2146 (modules '((guix build utils)))
2149 (delete-file-recursively "libccd")
2151 (build-system cmake-build-system)
2153 `(#:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
2155 (modify-phases %standard-phases
2156 (add-after 'unpack 'unbundle-libccd
2158 (substitute* "CMakeLists.txt"
2159 (("configure_file\\(libccd/.*") ""))
2165 (home-page "https://www.ode.org/")
2166 (synopsis "High performance library for simulating rigid body dynamics")
2167 (description "ODE is a high performance library for simulating
2168 rigid body dynamics. It is fully featured, stable, mature and
2169 platform independent with an easy to use C/C++ API. It has advanced
2170 joint types and integrated collision detection with friction. ODE is
2171 useful for simulating vehicles, objects in virtual reality
2172 environments and virtual creatures. It is currently used in many
2173 computer games, 3D authoring tools and simulation tools.")
2174 ;; Software is dual-licensed.
2175 (license (list license:lgpl2.1+ license:expat))))
2177 (define-public chipmunk
2185 (url "https://github.com/slembcke/Chipmunk2D")
2186 (commit (string-append "Chipmunk-" version))))
2187 (file-name (git-file-name name version))
2189 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2190 (build-system cmake-build-system)
2192 `(#:tests? #f ;no test
2193 #:configure-flags '("-DBUILD_STATIC=OFF"
2194 "-DBUILD_DEMOS=OFF")))
2196 `(("freeglut" ,freeglut)
2198 ("libxrandr" ,libxrandr)))
2199 (home-page "https://chipmunk-physics.net/")
2200 (synopsis "Fast and lightweight 2D game physics library")
2201 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2202 rigid body physics library written in C.")
2203 (license license:expat)))
2205 (define-public libtcod
2212 (url "https://github.com/libtcod/libtcod")
2214 (file-name (git-file-name name version))
2217 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
2218 (modules '((guix build utils)))
2220 (delete-file-recursively "src/vendor/utf8proc")
2221 (delete-file-recursively "src/vendor/zlib")
2222 (delete-file "src/vendor/stb_truetype.h")
2223 (delete-file "src/vendor/stb_sprintf.h")
2224 (delete-file "src/vendor/lodepng.cpp")
2225 (delete-file "src/vendor/lodepng.h")
2227 (substitute* "buildsys/autotools/sources.am"
2228 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
2229 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
2230 "../../src/vendor/stb.c")
2231 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
2233 (substitute* "src/libtcod/sys_sdl_img_png.cpp"
2234 (("\\.\\./vendor/") ""))
2236 (substitute* '("src/libtcod/color/canvas.cpp"
2237 "src/libtcod/sys_sdl_img_png.cpp"
2238 "src/libtcod/tileset/truetype.cpp"
2239 "src/libtcod/tileset/tilesheet.cpp")
2240 (("\\.\\./\\.\\./vendor/") ""))
2242 (substitute* "src/libtcod/console/printing.cpp"
2243 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
2245 (build-system gnu-build-system)
2247 `(#:configure-flags '("--with-gnu-ld"
2248 "LIBS=-lutf8proc -llodepng")
2250 (modify-phases %standard-phases
2251 (add-after 'unpack 'change-to-build-dir
2253 (chdir "buildsys/autotools")
2254 (patch-shebang "get_version.py")
2257 `(("autoconf" ,autoconf)
2258 ("automake" ,automake)
2259 ("libtool" ,libtool)
2261 ("pkg-config" ,pkg-config)
2262 ("stb-sprintf" ,stb-sprintf)
2263 ("stb-truetype" ,stb-truetype)))
2265 `(("lodepng" ,lodepng)
2267 ("utf8proc" ,utf8proc)
2269 (home-page "https://github.com/libtcod/libtcod")
2270 (synopsis "Library specifically designed for writing roguelikes")
2272 "libtcod is a fast, portable and uncomplicated API for roguelike
2273 developers providing an advanced true color console, input, and lots of other
2274 utilities frequently used in roguelikes.")
2275 (license license:bsd-3)))
2277 (define-public warsow-qfusion
2278 ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
2279 ;; The 2.5 beta as published on the homepage is commit
2280 ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
2281 (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
2283 (name "warsow-qfusion")
2284 (version (git-version "2.5" "1" commit)) ; 2.5-beta
2288 (url "https://github.com/Warsow/qfusion/")
2291 (file-name (git-file-name name version))
2294 "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
2295 ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
2296 (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
2297 (modules '((guix build utils)))
2299 (delete-file-recursively "platforms")
2300 (delete-file-recursively "debian")
2301 (delete-file-recursively "libsrcs")
2303 (build-system cmake-build-system)
2305 `(#:tests? #f ; No tests.
2306 #:configure-flags '("-DQFUSION_GAME=Warsow")
2309 (guix build cmake-build-system)
2312 (modify-phases %standard-phases
2313 (add-after 'unpack 'change-to-build-dir
2317 (add-after 'install 'really-install
2318 (lambda* (#:key outputs system #:allow-other-keys)
2319 (let ((arch (match system
2320 ("x86_64-linux" "x86_64")
2321 ("i686-linux" "i386")))
2322 (out (assoc-ref outputs "out")))
2323 (install-file (string-append "../source/build/basewsw/libgame_"
2325 (string-append out "/lib/"))
2326 (install-file (string-append "../source/build/libui_" arch ".so")
2327 (string-append out "/lib/"))
2330 (install-file file (string-append out "/bin/")))
2331 (append (find-files "../source/build" "warsow")
2332 (find-files "../source/build" "wsw_server."))))
2335 `(("alsa-lib" ,alsa-lib)
2337 ("freetype" ,freetype)
2339 ("libjpeg" ,libjpeg-turbo)
2342 ("libtheora" ,libtheora)
2343 ("libvorbis" ,libvorbis)
2346 ("pulseaudio" ,pulseaudio)
2348 ("qtdeclarative" ,qtdeclarative)
2350 ("uuid.h" ,util-linux "lib")
2353 `(("pkg-config" ,pkg-config)))
2354 (home-page "https://github.com/Warsow/qfusion")
2355 (supported-systems '("i686-linux" "x86_64-linux"))
2356 (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
2358 "This package contains the game engine of Warsow, a first-person
2359 shooter video game. The engine is based on qfusion, the id Tech 2 derived
2360 game engine. id Tech 2 is the engine originally behind Quake 2.")
2361 (license license:gpl2+))))
2363 (define-public dhewm3
2370 "https://github.com/dhewm/dhewm3/releases/download/"
2371 version "/dhewm3-" version "-src.tar.xz"))
2374 "0dmd1876az5q8gbjrd1jk8zidz11ydj607z3m8m5kvw2yj136jzv"))))
2375 (build-system cmake-build-system)
2377 `(#:tests? #f ; No tests.
2379 (modify-phases %standard-phases
2380 (add-after 'unpack 'change-to-build-dir
2386 ("libjpeg" ,libjpeg-turbo)
2388 ("libvorbis" ,libvorbis)
2393 (home-page "https://dhewm3.org/")
2394 (synopsis "Port of the original Doom 3 engine")
2396 "@command{dhewm3} is a source port of the original Doom 3 engine (not
2397 Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
2398 version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
2399 sound effects on all operating systems and hardware (via OpenAL Softs EFX
2400 support), has much better support for widescreen resolutions and has 64bit
2402 (license license:gpl3)))
2404 (define-public tesseract-engine
2405 (let ((svn-revision 2411))
2407 (name "tesseract-engine")
2408 (version (string-append "20200615-" (number->string svn-revision)))
2413 (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
2414 (revision svn-revision)))
2415 (file-name (git-file-name name version))
2417 (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
2418 (modules '((guix build utils)))
2421 (for-each delete-file-recursively
2423 ;; Remove "media" since some files such as
2424 ;; media/sound/game/soundsnap/info.txt refer to a
2425 ;; non-commercial license.
2432 (build-system gnu-build-system)
2434 `(#:make-flags (list "CC=gcc")
2435 #:tests? #f ; No tests.
2437 (modify-phases %standard-phases
2439 (add-after 'unpack 'cd-src
2440 (lambda _ (chdir "src") #t))
2441 (add-before 'build 'fix-env
2442 (lambda* (#:key inputs #:allow-other-keys)
2444 (string-append (assoc-ref inputs "sdl2-union")
2446 (or (getenv "CPATH") "")))
2448 (add-after 'install 'really-install
2449 (lambda* (#:key outputs #:allow-other-keys)
2450 (let* ((out (assoc-ref outputs "out"))
2451 (share (string-append out "/share/tesseract"))
2452 (bin (string-append out "/bin/tesseract"))
2453 (client (string-append out "/bin/tesseract-client")))
2454 (chdir "..") ; Back to root.
2457 (mkdir-p (string-append share "/" dir))
2458 (copy-recursively dir (string-append share "/" dir)))
2460 (mkdir-p (string-append out "/bin/"))
2461 (copy-file "bin_unix/native_client" client)
2462 (copy-file "bin_unix/native_server"
2463 (string-append out "/bin/tesseract-server"))
2464 (call-with-output-file bin
2469 TESS_OPTIONS=\"-u$HOME/.tesseract\"
2471 exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
2476 (install-file "src/readme_tesseract.txt"
2477 (string-append out "/share/licenses/tesseract/LICENSE")))
2480 `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
2484 (home-page "http://tesseract.gg/")
2485 (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
2486 (description "This package contains the game engine of Tesseract, a
2487 first-person shooter focused on cooperative in-game map editing.
2489 The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
2490 upgraded modern rendering techniques. The new rendering features include
2491 fully dynamic omnidirectional shadows, global illumination, HDR lighting,
2492 deferred shading, morphological / temporal / multisample anti-aliasing, and
2494 (license license:zlib))))