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 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)
176 (native-inputs `(("asciidoc" ,asciidoc)))
177 (home-page "https://github.com/Doom-Utils/deutex")
178 (synopsis "WAD file composer for Doom and related games")
180 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
181 used to extract the lumps of a wad and save them as individual files.
182 Conversely, it can also build a wad from separate files. When extracting a
183 lump to a file, it does not just copy the raw data, it converts it to an
184 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
185 Conversely, when it reads files for inclusion in pwads, it does the necessary
186 conversions (for example, from PPM to Doom picture format). In addition,
187 DeuTex has functions such as merging wads, etc.")
188 (license license:gpl2+)))
190 (define-public grfcodec
197 (uri (string-append "https://binaries.openttd.org/extra/"
198 name "/" version "/" name "-" version
201 (base32 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
202 (build-system gnu-build-system)
204 '(#:tests? #f ;no check target
206 (modify-phases %standard-phases
207 (delete 'configure) ;no configure script
208 (replace 'install ;no install target
209 (lambda* (#:key outputs #:allow-other-keys)
210 (let* ((out (assoc-ref outputs "out"))
211 (bin (string-append out "/bin"))
212 (doc (string-append out "/share/doc"))
213 (man (string-append out "/share/man/man1")))
214 (for-each (lambda (file)
215 (install-file file bin))
216 '("grfcodec" "grfid" "grfstrip" "nforenum"))
217 (install-file "COPYING" doc)
218 (with-directory-excursion "docs"
219 (for-each (lambda (file)
220 (install-file (string-append file ".txt") doc))
221 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
222 "readme" "readme.rpn"))
223 (for-each (lambda (file)
224 (install-file file man))
225 (find-files "." "\\.1"))))
231 (synopsis "GRF development tools")
233 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
234 tools for developing (New)GRFs. It includes a number of smaller programs, each
235 with a specific task:
237 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
238 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
239 @item @code{grfstrip} strips all sprites from a GRF.
240 @item @code{nforenum} checks NFO code for errors, making corrections when
243 (home-page "https://dev.openttdcoop.org/projects/grfcodec")
244 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
245 ;; NFORenum is under the GPL2+.
246 ;; The MD5 implementation contained in GRFID is under the zlib license.
247 (license (list license:gpl2 license:gpl2+ license:zlib))))
249 (define-public catcodec
256 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
257 version "/catcodec-" version "-source.tar.xz"))
259 (base32 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
260 (build-system gnu-build-system)
262 `(#:tests? #f ; no tests
263 #:make-flags (list (string-append "prefix=" %output))
264 #:phases (modify-phases %standard-phases
265 (delete 'configure))))
266 (home-page "https://dev.openttdcoop.org/projects/catcodec")
267 (synopsis "Encode/decode OpenTTD sounds")
268 (description "catcodec encodes and decodes sounds for OpenTTD. These
269 sounds are not much more than some metadata (description and filename) and raw
271 (license license:gpl2)))
273 (define-public gzochi
279 (uri (string-append "mirror://savannah/gzochi/gzochi-"
283 "0h8yvk7154kd8zdfa9nqy73blrjq2x19kv305jcnwlmm09vvss59"))))
284 (build-system gnu-build-system)
286 '(#:phases (modify-phases %standard-phases
287 (add-before 'build 'no-Werror
289 ;; Don't abort builds due to things like GLib
290 ;; deprecation warnings.
291 (substitute* (find-files "." "^Makefile\\.in$")
294 (native-inputs `(("pkgconfig" ,pkg-config)))
295 (inputs `(("bdb" ,bdb)
298 ("libmicrohttpd" ,libmicrohttpd)
302 (home-page "https://www.nongnu.org/gzochi/")
303 (synopsis "Scalable middleware for multiplayer games")
305 "gzochi is a framework for developing massively multiplayer online games.
306 A server container provides services to deployed games, which are written in
307 Guile Scheme, that abstract and simplify some of the most challenging and
308 error-prone aspects of online game development: Concurrency, data persistence,
309 and network communications. A very thin client library can be embedded to
310 provide connectivity for client applications written in any language.")
311 (license license:gpl3+)))
320 (uri (pypi-uri "nml" version))
323 "1lwf5sc5qqzrkxfx5wkkj3yh2j2nzh5r599ly5psy8yw92km24hy"))))
324 (build-system python-build-system)
325 ;; TODO: Fix test that fails with
326 ;; "AttributeError: partially initialized module 'nml.nmlop' has no
327 ;; attribute 'ADD' (most likely due to a circular import)"
331 `(("python-pillow" ,python-pillow)
332 ("python-ply" ,python-ply)))
333 (home-page "https://github.com/OpenTTD/nml")
334 (synopsis "NML compiler")
336 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
337 compiling NML files (along with their associated language, sound and graphic
338 files) into @file{.grf} and/or @file{.nfo} files.")
339 (license license:gpl2+)))
341 (define-public python-sge-pygame
343 (name "python-sge-pygame")
348 (uri (string-append "mirror://savannah/stellarengine/"
349 (version-major+minor version) "/sge-pygame-"
351 (file-name (string-append name "-" version ".tar.gz"))
354 "1rl3xjzh78sl0sq3xl8rl7cgp9v9v3h7s2pfwn7nj1vrmffzkcpd"))))
355 (build-system python-build-system)
357 `(("python-pygame" ,python-pygame)
358 ("python-six" ,python-six)
359 ("python-uniseg" ,python-uniseg)))
360 (home-page "http://stellarengine.nongnu.org")
361 (synopsis "2D game engine for Python")
363 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
364 general-purpose 2D game engine. It takes care of several details for you so
365 you can focus on the game itself. This makes more rapid game development
366 possible, and it also makes the SGE easy to learn.")
367 (license license:lgpl3+)))
369 (define-public python2-sge-pygame
370 (package-with-python2 python-sge-pygame))
372 (define-public python-tmx
379 (uri (string-append "mirror://savannah/python-tmx/"
380 (version-major+minor version) "/tmx-"
384 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
385 (build-system python-build-system)
387 `(("python-six" ,python-six)))
388 (home-page "http://python-tmx.nongnu.org")
389 (synopsis "Python library for the @code{Tiled} TMX format")
391 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
392 This is useful for map editors or generic level editors, and it's also useful
393 for using a map editor or generic level editor like Tiled to edit your game's
395 (license (list license:asl2.0
396 ;; Documentation (only available in the source tarball) is
397 ;; under the CC0 license.
400 (define-public python2-tmx
401 (let ((python2-tmx (package-with-python2 python-tmx)))
403 (inherit python2-tmx)
405 `(("python2-pathlib" ,python2-pathlib)
406 ,@(package-propagated-inputs python2-tmx))))))
408 (define-public python-xsge
411 (version "2018.02.26")
414 (uri (string-append "mirror://savannah/xsge/xsge/xsge-"
418 "0bx93hgf7cgdw2gsygbh59y8vpw37pgsa279rajw3fkdpl8vrc40"))))
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
432 `(("python-sge-pygame" ,python-sge-pygame)
433 ("python-pygame" ,python-pygame)
434 ("python-six" ,python-six)
435 ("python-tmx" ,python-tmx)))
436 (home-page "http://xsge.nongnu.org")
437 (synopsis "Extensions for the SGE Game Engine")
439 "xSGE is a collection of modules that make doing certain tasks with the SGE
440 Game Engine easier. In addition to SGE's conveniences, the user has access to a
441 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
443 (license license:gpl3+)))
445 (define-public python2-xsge
446 (package-with-python2 python-xsge))
455 (url "https://github.com/bjorn/tiled.git")
456 (commit (string-append "v" version))))
457 (file-name (git-file-name name version))
460 "14v2zfka2y3h0r0biw1rl59585lji5074x958s4xnb352jm5h9b9"))))
461 (build-system gnu-build-system)
467 `(("qttools" ,qttools)))
470 (modify-phases %standard-phases
472 (lambda* (#:key inputs outputs #:allow-other-keys)
473 (substitute* "translations/translations.pro"
475 (string-append "LRELEASE = "
476 (assoc-ref inputs "qttools")
478 (let ((out (assoc-ref outputs "out")))
480 (string-append "PREFIX=" out))))))))
481 (home-page "https://www.mapeditor.org/")
482 (synopsis "Tile map editor")
484 "Tiled is a general purpose tile map editor. It is meant to be used for
485 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
488 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
490 (license license:gpl2+)))
498 ;; Do not fetch the archives from
499 ;; http://mirror0.sfml-dev.org/files/ because files there seem
500 ;; to be changed in place.
502 (url "https://github.com/SFML/SFML.git")
504 (file-name (git-file-name name version))
507 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
508 (modules '((guix build utils)))
511 ;; Ensure system libraries are used.
512 (delete-file-recursively "extlibs")
514 (build-system cmake-build-system)
517 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
518 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
519 #:tests? #f)) ; no tests
521 `(("pkg-config" ,pkg-config)))
526 ("xcb-util-image" ,xcb-util-image)
527 ("libxrandr" ,libxrandr)
529 ("libjpeg" ,libjpeg-turbo)
530 ("libsndfile" ,libsndfile)
531 ("stb-image" ,stb-image)
532 ("stb-image-write" ,stb-image-write)))
534 ;; In Requires.private of pkg-config files.
536 ("freetype" ,freetype)
537 ("libvorbis" ,libvorbis)
539 (home-page "https://www.sfml-dev.org")
540 (synopsis "Simple and Fast Multimedia Library")
542 "SFML provides a simple interface to the various computer components,
543 to ease the development of games and multimedia applications. It is composed
544 of five modules: system, window, graphics, audio and network.")
545 (license license:zlib)))
553 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
556 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
557 (build-system gnu-build-system)
559 `(#:phases (modify-phases %standard-phases
560 (delete 'configure) ; no configure script
561 (add-before 'build 'patch-makefile
562 (lambda* (#:key outputs #:allow-other-keys)
563 (let ((out (assoc-ref outputs "out")))
564 (substitute* "Makefile"
565 (("\\$\\(DESTDIR\\)/usr") out))
566 (substitute* "main.cpp"
568 (string-append out "/share")))
570 #:tests? #f)) ; no tests
572 `(("pkg-config" ,pkg-config)
573 ("desktop-file-utils" ,desktop-file-utils)))
577 (synopsis "Simple sound effect generator")
578 (description "Sfxr is a tool for quickly generating simple sound effects.
579 Originally created for use in video game prototypes, it can generate random
580 sounds from presets such as \"explosion\" or \"powerup\".")
581 (home-page "http://www.drpetter.se/project_sfxr.html")
582 (license license:expat)))
584 (define-public surgescript
592 (url "https://github.com/alemart/surgescript.git")
593 (commit (string-append "v" version))))
594 (file-name (git-file-name name version))
596 (base32 "13q81439zg1bn7gskligskjgcfq0rdapp6f3llmrlk48vnyq49s0"))))
597 (build-system cmake-build-system)
600 (let ((share (string-append (assoc-ref %outputs "out") "/share")))
601 (list (string-append "-DICON_PATH=" share "/pixmaps")
602 (string-append "-DMETAINFO_PATH=" share "/metainfo")))
604 (home-page "https://docs.opensurge2d.org")
605 (synopsis "Scripting language for games")
606 (description "@code{SurgeScript} is a dynamically typed object-oriented
607 scripting language designed for games. Each object is a state machine that
608 can be customized by attaching other objects. The language supports automatic
609 garbage collection and can be extended with plugins.")
610 (license license:asl2.0)))
612 (define-public physfs
619 "https://icculus.org/physfs/downloads/physfs-"
621 (file-name (string-append name "-" version ".tar.gz"))
624 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
625 (build-system cmake-build-system)
627 '(#:tests? #f ; no check target
628 #:configure-flags '("-DPHYSFS_BUILD_STATIC=OFF")
629 #:phases (modify-phases %standard-phases
630 (add-after 'unpack 'patch-CMakeLists.txt
632 (substitute* "CMakeLists.txt"
633 ;; XXX: For some reason CMakeLists.txt disables
634 ;; RUNPATH manipulation when the compiler is GCC.
635 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
640 `(("doxygen" ,doxygen)))
641 (home-page "https://icculus.org/physfs")
642 (synopsis "File system abstraction library")
644 "PhysicsFS is a library to provide abstract access to various archives.
645 It is intended for use in video games. For security, no file writing done
646 through the PhysicsFS API can leave a defined @emph{write directory}. For
647 file reading, a @emph{search path} with archives and directories is defined,
648 and it becomes a single, transparent hierarchical file system. So archive
649 files can be accessed in the same way as you access files directly on a disk,
650 and it makes it easy to ship a new archive that will override a previous
651 archive on a per-file basis.")
652 (license license:zlib)))
660 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
661 "love-" version "-linux-src.tar.gz"))
664 "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
665 (build-system gnu-build-system)
667 `(("pkg-config" ,pkg-config)))
670 ("freetype" ,freetype)
671 ("libmodplug" ,libmodplug)
672 ("libtheora" ,libtheora)
673 ("libvorbis" ,libvorbis)
680 (synopsis "2D game framework for Lua")
681 (description "LÖVE is a framework for making 2D games in the Lua
682 programming language.")
683 (home-page "https://love2d.org/")
684 (license license:zlib)))
686 (define-public love-nuklear
687 (let ((version "v2.6")
688 (commit "fef4e00a602efb16c57ae962850b6e7a01f7a29a"))
690 (name "love-nuklear")
691 (version (git-version version "1" commit))
695 (url "https://github.com/keharriso/love-nuklear/")
698 ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
699 ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
700 (file-name (git-file-name name version))
703 "15qmy8mfwkxy2x9rmxs6f9cyvjvwwj6yf78bs863xmc56dmjzzbn"))))
704 (build-system cmake-build-system)
706 `(#:build-type "Release"
709 `(("luajit" ,luajit)))
710 (synopsis "Lightweight immediate mode GUI for LÖVE games")
711 (description "LÖVE is a Lua framework for making 2D games. Nuklear
712 is a minimal state immediate mode graphical user interface toolkit. This
713 package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
714 (home-page "https://github.com/keharriso/love-nuklear/")
715 (license license:expat))))
717 (define-public allegro-4
723 (uri (string-append "https://github.com/liballeg/allegro5/"
724 "releases/download/" version "/allegro-"
728 "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
729 (build-system cmake-build-system)
732 (modify-phases %standard-phases
733 (add-after 'unpack 'patch-build-system
735 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
736 ;; via a command line option doesn't work because it is
737 ;; unconditionally clobbered in the build script.
738 (substitute* '("CMakeLists.txt")
739 (("ADDON_LINKAGE STATIC")
740 "ADDON_LINKAGE SHARED"))
745 ("libvorbis" ,libvorbis)
748 (synopsis "Game programming library")
749 (description "Allegro is a library mainly aimed at video game and
750 multimedia programming. It handles common, low-level tasks such as creating
751 windows, accepting user input, loading data, drawing images, playing sounds,
753 (home-page "https://liballeg.org")
754 (license license:giftware)))
756 (define-public allegro
762 (uri (string-append "https://github.com/liballeg/allegro5/releases"
763 "/download/" version "/allegro-"
767 "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
768 (build-system cmake-build-system)
769 (arguments `(#:tests? #f)) ; there are no tests
771 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
773 ("freetype" ,freetype)
776 ("libjpeg" ,libjpeg-turbo)
778 ("libtheora" ,libtheora)
779 ("libvorbis" ,libvorbis)
780 ("libxcursor" ,libxcursor)
781 ("libxinerama" ,libxinerama)
782 ("libxrandr" ,libxrandr)
788 `(("pkg-config" ,pkg-config)))
789 (synopsis "Game programming library")
790 (description "Allegro is a library mainly aimed at video game and
791 multimedia programming. It handles common, low-level tasks such as creating
792 windows, accepting user input, loading data, drawing images, playing sounds,
794 (home-page "https://liballeg.org")
795 (license license:bsd-3)))
797 (define-public allegro-5.0
798 (package (inherit allegro)
803 (uri (string-append "https://github.com/liballeg/allegro5/releases"
804 "/download/" version "/allegro-"
805 (if (equal? "0" (string-take-right version 1))
806 (string-drop-right version 2)
809 (patches (search-patches
810 "allegro-mesa-18.2.5-and-later.patch"))
813 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
815 (define-public aseprite
818 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
819 ;; TODO: Unbundle third party software.
821 (method url-fetch/zipbomb)
822 (uri (string-append "https://github.com/aseprite/aseprite"
823 "/releases/download/v" version
824 "/Aseprite-v" version "-Source.zip"))
827 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
828 (build-system cmake-build-system)
831 ;; Use shared libraries instead of building bundled source.
832 (list "-DWITH_WEBP_SUPPORT=1"
833 "-DUSE_SHARED_CURL=1"
834 "-DUSE_SHARED_GIFLIB=1"
835 "-DUSE_SHARED_JPEGLIB=1"
836 "-DUSE_SHARED_ZLIB=1"
837 "-DUSE_SHARED_LIBPNG=1"
838 "-DUSE_SHARED_LIBLOADPNG=1"
839 "-DUSE_SHARED_LIBWEBP=1"
840 "-DUSE_SHARED_TINYXML=1"
841 "-DUSE_SHARED_PIXMAN=1"
842 "-DUSE_SHARED_FREETYPE=1"
843 "-DUSE_SHARED_ALLEGRO4=1"
844 "-DENABLE_UPDATER=0" ; no auto-updates
845 (string-append "-DFREETYPE_INCLUDE_DIR="
846 (assoc-ref %build-inputs "freetype")
847 "/include/freetype2"))))
849 `(("pkg-config" ,pkg-config)))
850 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
851 ;; patched version is bundled with Aseprite, but the patches should be
852 ;; extracted and applied on top of a standalone Allegro 4 package.
854 `(("allegro" ,allegro-4)
856 ("freetype" ,freetype)
858 ("libjpeg" ,libjpeg-turbo)
863 ("libxxf86vm" ,libxxf86vm)
867 (synopsis "Animated sprite editor and pixel art tool")
868 (description "Aseprite is a tool for creating 2D pixel art for video
869 games. In addition to basic pixel editing features, Aseprite can assist in
870 the creation of animations, tiled graphics, texture atlases, and more.")
871 (home-page "https://www.aseprite.org/")
872 (license license:gpl2+)))
874 (define-public qqwing
881 "https://qqwing.com/"
882 name "-" version ".tar.gz"))
885 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
886 (build-system gnu-build-system)
888 `(("pkg-config" ,pkg-config)))
889 (home-page "https://qqwing.com/")
890 (synopsis "Sudoku puzzle solver and generator")
892 "QQWing is a Sudoku puzzle generator and solver.
893 It offers the following features:
895 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
896 @item Uses logic. Uses as many solve techniques as possible when solving
897 puzzles rather than guessing.
898 @item Rates puzzles. Most generators don't give an indication of the difficulty
899 of a Sudoku puzzle. QQwing does.
900 @item Can print solve instructions for any puzzle.
901 @item Customizable output style, including a CSV style that is easy to
902 import into a database.
904 (license license:gpl2+)))
906 (define-public quesoglc
912 (uri (string-append "mirror://sourceforge/" name "/" version "/"
913 name "-" version "-free.tar.bz2"))
916 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
917 (build-system gnu-build-system)
918 (native-inputs `(("pkg-config" ,pkg-config)))
919 (inputs `(("fontconfig" ,fontconfig)
920 ("freeglute" ,freeglut)
923 (home-page "http://quesoglc.sourceforge.net")
924 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
926 "The OpenGL Character Renderer (GLC) is a state machine that provides
927 OpenGL programs with character rendering services via an application programming
929 (license (list license:expat license:lgpl2.1+))))
931 (define-public python-pygame
933 (name "python-pygame")
937 (uri (pypi-uri "pygame" version))
940 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
941 (build-system python-build-system)
943 `(#:tests? #f ; tests require pygame to be installed first
945 (modify-phases %standard-phases
946 ;; Set the paths to the dependencies manually because
947 ;; the configure script does not allow passing them as
948 ;; parameters. This also means we can skip the configure
950 (add-before 'build 'set-library-paths
951 (lambda* (#:key inputs outputs #:allow-other-keys)
952 (let ((sdl-ref (assoc-ref inputs "sdl"))
953 (font-ref (assoc-ref inputs "sdl-ttf"))
954 (image-ref (assoc-ref inputs "sdl-image"))
955 (mixer-ref (assoc-ref inputs "sdl-mixer"))
956 (smpeg-ref (assoc-ref inputs "libsmpeg"))
957 (png-ref (assoc-ref inputs "libpng"))
958 (jpeg-ref (assoc-ref inputs "libjpeg"))
959 (freetype-ref (assoc-ref inputs "freetype"))
960 (v4l-ref (assoc-ref inputs "v4l-utils"))
961 (out-ref (assoc-ref outputs "out")))
962 (substitute* "Setup.in"
963 (("SDL = -I/usr/include/SDL")
964 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
965 (substitute* "Setup.in"
966 (("FONT = -lSDL_ttf")
967 (string-append "FONT = -I" font-ref "/include/SDL -L"
968 font-ref "/lib -lSDL_ttf")))
969 (substitute* "Setup.in"
970 (("IMAGE = -lSDL_image")
971 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
972 image-ref "/lib -lSDL_image")))
973 (substitute* "Setup.in"
974 (("MIXER = -lSDL_mixer")
975 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
976 mixer-ref "/lib -lSDL_mixer")))
977 (substitute* "Setup.in"
979 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
980 smpeg-ref "/lib -lsmpeg")))
981 (substitute* "Setup.in"
983 (string-append "PNG = -I" png-ref "/include -L"
984 png-ref "/lib -lpng")))
985 (substitute* "Setup.in"
987 (string-append "JPEG = -I" jpeg-ref "/include -L"
988 jpeg-ref "/lib -ljpeg")))
990 (substitute* "Setup.in"
991 (("FREETYPE = -lfreetype")
992 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
993 freetype-ref "/lib -lfreetype")))
995 (substitute* "Setup.in"
997 ;; Create a path to a header file provided by v4l-utils.
998 (system* "mkdir" "linux")
999 (system* "ln" "--symbolic"
1000 (string-append v4l-ref "/include/libv4l1-videodev.h")
1002 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
1004 `(("freetype" ,freetype)
1006 ("sdl-image" ,sdl-image)
1007 ("sdl-mixer" ,sdl-mixer)
1008 ("sdl-ttf" ,sdl-ttf)
1009 ("sdl-gfx" ,sdl-gfx)
1010 ("libjpeg" ,libjpeg-turbo)
1013 ("libsmpeg" ,libsmpeg)
1014 ("portmidi" ,portmidi)
1015 ("v4l-utils" ,v4l-utils)))
1016 (home-page "https://www.pygame.org")
1017 (synopsis "SDL wrapper for Python")
1018 (description "Pygame is a set of Python modules designed for writing games.
1019 Pygame adds functionality on top of the excellent SDL library. This allows you
1020 to create fully featured games and multimedia programs in the python language.")
1021 (license (list license:bsd-2
1022 ;; python numeric license as listed by Debian looks like
1023 ;; an Expat-style license with a warranty disclaimer for
1024 ;; the U.S. government and the University of California.
1030 license:public-domain
1031 license:lgpl2.1+))))
1033 (define-public python2-pygame
1034 (package-with-python2 python-pygame))
1036 (define-public python2-pygame-sdl2
1037 (let ((real-version "2.1.0")
1038 (renpy-version "7.3.5"))
1040 (inherit python2-pygame)
1041 (name "python2-pygame-sdl2")
1042 (version (string-append real-version "-for-renpy-" renpy-version))
1046 (uri (string-append "https://www.renpy.org/dl/" renpy-version
1047 "/pygame_sdl2-" version ".tar.gz"))
1048 (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))))
1049 (build-system python-build-system)
1051 `(#:tests? #f ; tests require pygame to be installed first
1054 (modify-phases %standard-phases
1055 (add-after 'set-paths 'set-sdl-vars
1056 (lambda* (#:key inputs #:allow-other-keys)
1057 (setenv "PYGAME_SDL2_CFLAGS"
1059 (assoc-ref inputs "sdl-union")
1060 "/include/SDL2 -D_REENTRANT"))
1061 (setenv "PYGAME_SDL2_LDFLAGS"
1063 (assoc-ref inputs "sdl-union")
1065 (assoc-ref inputs "sdl-union")
1066 "/lib -Wl,--enable-new-dtags -lSDL2"))
1068 (add-before 'build 'drop-generated-files
1070 (delete-file-recursively "gen")
1071 (delete-file-recursively "gen3")
1075 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1077 `(("python2-cython" ,python2-cython)))
1078 (home-page "http://www.renpy.org/")
1079 (synopsis "Reimplementation of the Pygame API using SDL2")
1080 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1081 staying close to the original, but also adding some SDL2-specific features.
1082 While it aims to be used as a drop-in replacement, it appears to be
1083 developed mainly for Ren'py.")
1084 (license (list license:lgpl2.1 license:zlib)))))
1086 (define-public python2-renpy
1088 (name "python2-renpy")
1093 (uri (string-append "https://www.renpy.org/dl/" version
1094 "/renpy-" version "-source.tar.bz2"))
1095 (sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))))
1096 (build-system python-build-system)
1098 `(#:tests? #f ; Ren'py doesn't seem to package tests
1101 (modify-phases %standard-phases
1102 (add-after 'unpack 'fix-commands
1104 (substitute* "renpy/editor.py"
1106 (which "xdg-open")))
1108 (add-after 'set-paths 'set-build-vars
1109 (lambda* (#:key inputs #:allow-other-keys)
1110 (setenv "RENPY_CYTHON"
1111 (string-append (assoc-ref inputs "python2-cython")
1113 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
1116 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1117 ;; The "module" subdirectory contains a python (really cython)
1118 ;; project, which is built using a script, that is thankfully
1119 ;; named "setup.py".
1120 (with-directory-excursion "module"
1121 (apply (assoc-ref %standard-phases 'build) args))
1122 ;; the above causes renpy.__init__ to be compiled but does not
1123 ;; compile anything else, hence we do that here
1124 (delete-file "renpy/__init__.pyc")
1125 (invoke "python" "-m" "compileall" "renpy")
1128 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1129 ;; Again, we have to wrap the module installation.
1130 ;; Additionally, we want to install the python code
1131 ;; (both source and compiled) in the same directory.
1132 (let* ((out (assoc-ref outputs "out"))
1133 (site (string-append "/lib/python"
1134 ,(version-major+minor
1135 (package-version python-2))
1137 (with-directory-excursion "module"
1138 (apply (assoc-ref %standard-phases 'install) args))
1139 (copy-recursively "renpy"
1140 (string-append out site "/renpy")))
1143 `(("ffmpeg" ,ffmpeg)
1144 ("freetype" ,freetype)
1147 ("python2-pygame" ,python2-pygame-sdl2)
1149 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1151 `(("python2-cython" ,python2-cython)
1152 ("xdg-utils" ,xdg-utils)))
1153 (home-page "https://www.renpy.org/")
1154 (synopsis "Ren'py python module")
1155 (description "This package contains the shared libraries and Python
1156 modules of Ren'py.")
1157 (license license:expat)))
1159 (define-public renpy
1161 (inherit python2-renpy)
1164 (build-system python-build-system)
1166 `(#:tests? #f ; see python2-renpy
1169 (modify-phases %standard-phases
1170 (add-after 'unpack 'fix-commands
1171 (lambda* (#:key outputs #:allow-other-keys)
1172 (substitute* "launcher/game/choose_directory.rpy"
1173 (("/usr/bin/python") (which "python2")))
1174 (substitute* "launcher/game/front_page.rpy"
1176 (which "xdg-open")))
1177 (substitute* "launcher/game/project.rpy"
1178 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1179 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1181 ;; Projects are still created in the usual style, so we need
1182 ;; to adjust the path.
1183 (("cmd.append\\(self.path\\)")
1184 "cmd.append(self.path + \"/game\")"))
1186 (add-after 'unpack 'drop-game-from-paths
1188 (substitute* (list "launcher/game/gui7.rpy"
1189 "launcher/game/gui7/images.py")
1190 ((", \"game\",") ","))
1192 (add-before 'build 'start-xserver
1193 (lambda* (#:key inputs #:allow-other-keys)
1194 (let ((xorg-server (assoc-ref inputs "xorg-server")))
1195 (setenv "HOME" (getcwd))
1196 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
1197 (setenv "DISPLAY" ":1")
1201 (invoke "python" "renpy.py" "launcher" "quit")
1202 (invoke "python" "renpy.py" "the_question" "quit")
1203 (invoke "python" "renpy.py" "tutorial" "quit")
1206 (lambda* (#:key inputs outputs #:allow-other-keys)
1207 ;; Here we install our custom renpy program.
1208 ;; After finishing this step, "out" will have the following:
1210 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1213 ;; Note that common is also a de facto unused directory in
1214 ;; python2-renpy. On other systems, renpy_base would point to
1215 ;; site-packages or even somewhere in /opt.
1216 ;; The former approach is not as straightforward as it seems
1217 ;; -- it causes renpy to load files twice for some weird reason --
1218 ;; and the latter is impossible on Guix. Hence the detour through
1219 ;; share/renpy and the custom renpy program.
1221 ;; As a convention, other games should be installed as
1222 ;; subdirectories of share/renpy in their respective outputs as
1223 ;; well. This differs from the traditional layout, which is
1224 ;; roughly the following:
1225 ;; `-- Super Awesome Game
1226 ;; |-- game ; <- the folder we actually want
1227 ;; |-- lib ; compiled renpy module and dependencies
1228 ;; |-- renpy ; Ren'py python code (source + compiled)
1229 ;; |-- Super Awesome Game.py
1230 ;; `-- Super Awesome Game.sh
1231 (let* ((out (assoc-ref outputs "out"))
1232 (bin/renpy (string-append out "/bin/renpy")))
1233 (mkdir-p (string-append out "/bin"))
1234 (copy-recursively "renpy/common"
1235 (string-append out "/share/renpy/common"))
1236 (copy-recursively "gui"
1237 (string-append out "/share/renpy/gui"))
1239 (call-with-output-file bin/renpy
1241 (format port "#!~a~%" (which "python2"))
1243 from __future__ import print_function
1249 def path_to_common(renpy_base):
1250 return renpy_base + \"/common\"
1252 def path_to_saves(gamedir, save_directory=None):
1253 import renpy # @UnresolvedImport
1255 if save_directory is None:
1256 save_directory = renpy.config.save_directory
1257 save_directory = renpy.exports.fsencode(save_directory)
1259 if not save_directory:
1260 return gamedir + \"/saves\"
1262 return os.path.expanduser(\"~~/.renpy/\" + save_directory)
1264 def path_to_renpy_base():
1268 renpy_base = path_to_renpy_base()
1270 import renpy.bootstrap
1271 import renpy.arguments
1273 print(\"\"\"Could not import renpy.bootstrap.
1274 Please ensure you decompressed Ren'Py correctly, preserving the directory
1275 structure.\"\"\", file=sys.stderr)
1278 args = renpy.arguments.bootstrap()
1279 if not args.basedir:
1280 print(\"\"\"This Ren'py requires a basedir to launch.
1281 The basedir is the directory, in which .rpy files live -- usually the 'game'
1282 subdirectory of a game packaged by Ren'py.
1284 If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
1288 renpy.bootstrap.bootstrap(renpy_base)
1290 if __name__ == \"__main__\":
1293 (string-append out "/share/renpy"))))
1294 (chmod bin/renpy #o755)
1297 (add-after 'install 'install-games
1298 (lambda* (#:key outputs #:allow-other-keys)
1299 (define renpy (assoc-ref outputs "out"))
1300 ;; TODO: We should offer a renpy-build-system to make the
1301 ;; installation of Ren'py games easier.
1302 (define* (install-renpy-game #:key output game name (renpy renpy)
1304 (let* ((name (or name (basename game)))
1305 (launcher (string-append output "/bin/renpy-" name))
1306 (share (string-append output "/share/renpy/" name)))
1307 (copy-recursively (string-append game "/game") share)
1308 (mkdir-p (string-append output "/bin"))
1309 (with-output-to-file launcher
1312 "#!~a~%~a ~a \"$@\""
1314 (string-append renpy "/bin/renpy")
1316 (chmod launcher #o755)))
1318 (install-renpy-game #:output (assoc-ref outputs "out")
1321 (install-renpy-game #:output (assoc-ref outputs "the-question")
1322 #:game "the_question"
1323 #:name "the-question")
1325 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1329 (lambda* (#:key inputs outputs #:allow-other-keys)
1330 (wrap-program (string-append (assoc-ref outputs "out")
1332 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
1335 `(("python2-tkinter" ,python-2 "tk")
1336 ("python2-pygame" ,python2-pygame-sdl2)
1337 ("python2-renpy" ,python2-renpy)
1338 ("xorg-server" ,xorg-server)))
1340 (list "out" "tutorial" "the-question"))
1341 (home-page "https://www.renpy.org/")
1342 (synopsis "Visual Novel Engine")
1343 (description "Ren'Py is a visual novel engine that helps you use words,
1344 images, and sounds to tell interactive stories that run on computers and
1345 mobile devices. These can be both visual novels and life simulation games.
1346 The easy to learn script language allows anyone to efficiently write large
1347 visual novels, while its Python scripting is enough for complex simulation
1349 (license license:expat)))
1351 (define-public grafx2
1357 ;; XXX: There is no URL that contains the version. :(
1358 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1361 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1362 (build-system gnu-build-system)
1365 (modify-phases %standard-phases
1366 (delete 'configure) ; no configure script
1367 (add-before 'build 'change-to-src-directory
1372 ;; SDL header files are referenced without the preceeding "SDL/".
1373 (list (string-append "CFLAGS=-I"
1374 (assoc-ref %build-inputs "sdl-union")
1376 (string-append "prefix="
1377 (assoc-ref %outputs "out")))
1378 #:tests? #f)) ; no check target
1380 `(("pkg-config" ,pkg-config)))
1382 `(("libpng" ,libpng)
1384 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
1385 (synopsis "Bitmap paint program")
1386 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1387 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1388 includes a very large number of tools and effects that make it particularly
1389 suitable for pixel art, game graphics, and generally any detailed graphics
1390 painted with a mouse.")
1391 (home-page "http://pulkomandy.tk/projects/GrafX2")
1392 (license license:gpl2))) ; GPLv2 only
1402 (url "https://github.com/wgois/OIS.git")
1403 (commit (string-append "v" version))))
1404 (file-name (git-file-name name version))
1406 (base32 "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa"))))
1407 (build-system cmake-build-system)
1409 `(#:tests? #f)) ; no test suite
1411 `(("libx11" ,libx11)))
1412 (synopsis "Object Oriented Input System")
1414 "Cross Platform Object Oriented Input Lib System is a cross platform,
1415 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1416 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1417 robust and compatible with many systems and operating systems.")
1418 (home-page "https://github.com/wgois/OIS")
1419 (license license:zlib)))
1421 (define-public mygui
1429 (url "https://github.com/MyGUI/mygui")
1430 (commit (string-append "MyGUI" version))))
1431 (file-name (git-file-name name version))
1434 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
1435 (build-system cmake-build-system)
1437 '(#:tests? #f ; No test target
1439 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1440 (string-append "-DOGRE_INCLUDE_DIR="
1441 (assoc-ref %build-inputs "ogre")
1443 ;; Demos and tools are Windows-specific:
1444 ;; https://github.com/MyGUI/mygui/issues/24.
1445 "-DMYGUI_BUILD_DEMOS=FALSE"
1446 "-DMYGUI_BUILD_TOOLS=FALSE")))
1449 ("doxygen" ,doxygen)
1450 ("pkg-config" ,pkg-config)))
1452 `(("font-dejavu" ,font-dejavu)
1453 ("freetype" ,freetype)
1454 ("graphviz" ,graphviz)
1458 (synopsis "Fast, flexible and simple GUI")
1460 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1461 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1463 (home-page "http://mygui.info/")
1464 (license license:expat)))
1466 (define-public mygui-gl
1467 ;; Closure size is reduced by some 800 MiB.
1473 (substitute-keyword-arguments (package-arguments mygui)
1474 ((#:configure-flags _)
1475 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1476 ;; We can't reuse the flags because of the mention to Ogre.
1477 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1478 ;; Demos and tools are Windows-specific:
1479 ;; https://github.com/MyGUI/mygui/issues/24.
1480 "-DMYGUI_BUILD_DEMOS=FALSE"
1481 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1485 ,@(fold alist-delete (package-inputs mygui)
1487 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1489 (define-public openmw
1497 (url "https://github.com/OpenMW/openmw")
1498 (commit (string-append "openmw-" version))))
1499 (file-name (git-file-name name version))
1502 "0rm32zsmxvr6b0jjihfj543skhicbw5kg6shjx312clhlm035w2x"))))
1503 (build-system cmake-build-system)
1505 `(#:tests? #f ; No test target
1507 (list "-DDESIRED_QT_VERSION=5")))
1510 ("doxygen" ,doxygen)
1511 ("pkg-config" ,pkg-config)))
1513 `(("bullet" ,bullet)
1516 ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
1518 ("openscenegraph" ,openmw-openscenegraph)
1521 ("unshield" ,unshield)))
1522 (synopsis "Re-implementation of the RPG Morrowind engine")
1524 "OpenMW is a game engine which reimplements and extends the one that runs
1525 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1526 called OpenMW-CS which allows the user to edit or create their own original
1528 (home-page "https://openmw.org")
1529 (license license:gpl3)))
1531 (define-public godot
1538 (url "https://github.com/godotengine/godot")
1539 (commit (string-append version "-stable"))))
1540 (file-name (git-file-name name version))
1543 "1kndls0rklha7kz9l4i2ivjxab4jpk3b2j7dcgcg2qc3s81yd0r6"))
1544 (modules '((guix build utils)
1549 ;; Keep only those bundled files we have not (yet) replaced
1550 ;; with Guix versions. Note that some of these may be
1551 ;; modified; see "thirdparty/README.md".
1552 (with-directory-excursion "thirdparty"
1553 (let* ((preserved-files
1574 (for-each delete-file-recursively
1575 (lset-difference string=?
1577 (cons* "." ".." preserved-files)))))
1579 (build-system scons-build-system)
1581 `(#:scons ,scons-python2
1582 #:scons-flags (list "platform=x11" "target=release_debug"
1583 ;; Avoid using many of the bundled libs.
1584 ;; Note: These options can be found in the SConstruct file.
1586 "builtin_freetype=no"
1588 "builtin_libmpdec=no"
1591 "builtin_libtheora=no"
1592 "builtin_libvorbis=no"
1594 "builtin_libwebp=no"
1595 "builtin_mbedtls=no"
1601 #:tests? #f ; There are no tests
1603 (modify-phases %standard-phases
1604 (add-after 'unpack 'scons-use-env
1606 ;; Scons does not use the environment variables by default,
1607 ;; but this substitution makes it do so.
1608 (substitute* "SConstruct"
1609 (("env_base = Environment\\(tools=custom_tools\\)")
1611 "env_base = Environment(tools=custom_tools)\n"
1612 "env_base = Environment(ENV=os.environ)")))
1614 ;; Build headless tools, used for packaging games without depending on X.
1615 (add-after 'build 'build-headless
1616 (lambda* (#:key scons-flags #:allow-other-keys)
1617 (apply invoke "scons"
1618 `(,(string-append "-j" (number->string (parallel-job-count)))
1619 "platform=server" ,@(delete "platform=x11" scons-flags)))))
1621 (lambda* (#:key inputs outputs #:allow-other-keys)
1622 (let* ((out (assoc-ref outputs "out"))
1623 (headless (assoc-ref outputs "headless"))
1624 (zenity (assoc-ref inputs "zenity")))
1625 ;; Strip build info from filenames.
1626 (with-directory-excursion "bin"
1629 (let ((dest (car (string-split (basename file) #\.))))
1630 (rename-file file dest)))
1631 (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
1632 (install-file "godot" (string-append out "/bin"))
1633 (install-file "godot_server" (string-append headless "/bin")))
1634 ;; Tell the editor where to find zenity for OS.alert().
1635 (wrap-program (string-append out "/bin/godot")
1636 `("PATH" ":" prefix (,(string-append zenity "/bin")))))
1638 (add-after 'install 'install-godot-desktop
1639 (lambda* (#:key outputs #:allow-other-keys)
1640 (let* ((out (assoc-ref outputs "out"))
1641 (applications (string-append out "/share/applications"))
1642 (icons (string-append out "/share/icons/hicolor")))
1643 (mkdir-p applications)
1644 (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
1645 (string-append applications "/godot.desktop"))
1646 (for-each (lambda (icon dest)
1647 (mkdir-p (dirname dest))
1648 (copy-file icon dest))
1649 '("icon.png" "icon.svg")
1650 `(,(string-append icons "/256x256/apps/godot.png")
1651 ,(string-append icons "/scalable/apps/godot.svg"))))
1653 (outputs '("out" "headless"))
1654 (native-inputs `(("pkg-config" ,pkg-config)))
1655 (inputs `(("alsa-lib" ,alsa-lib)
1657 ("freetype" ,freetype)
1660 ("libtheora" ,libtheora)
1661 ("libvorbis" ,libvorbis)
1663 ("libwebp" ,libwebp)
1665 ("libxcursor" ,libxcursor)
1667 ("libxinerama" ,libxinerama)
1668 ("libxrandr" ,libxrandr)
1669 ("mbedtls" ,mbedtls-apache)
1671 ("opusfile" ,opusfile)
1673 ("pulseaudio" ,pulseaudio)
1676 ("zstd" ,zstd "lib")))
1677 (home-page "https://godotengine.org/")
1678 (synopsis "Advanced 2D and 3D game engine")
1680 "Godot is an advanced multi-platform game engine written in C++. If
1681 features design tools such as a visual editor, can import 3D models and
1682 provide high-quality 3D rendering, it contains an animation editor, and can be
1683 scripted in a Python-like language.")
1684 (license license:expat)))
1686 (define-public eureka
1692 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1694 ;; version without dots e.g 1.21 => 121
1695 (string-join (string-split version #\.) "")
1699 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1700 (build-system gnu-build-system)
1704 (let ((out (assoc-ref %outputs "out")))
1705 (list (string-append "PREFIX=" out)))
1707 (modify-phases %standard-phases
1709 (add-before 'build 'prepare-install-directories
1710 (lambda* (#:key outputs #:allow-other-keys)
1711 (let ((out (assoc-ref outputs "out")))
1712 (mkdir-p (string-append out "/bin"))
1713 (mkdir-p (string-append out "/share"))
1715 (with-fluids ((%default-port-encoding #f))
1716 (substitute* "./src/main.cc"
1717 (("/usr/local") out)))
1719 (substitute* "Makefile"
1720 (("-o root") ""))))))))
1721 (inputs `(("mesa" ,mesa)
1723 ("libxinerama" ,libxinerama)
1724 ("libfontconfig" ,fontconfig)
1725 ("libjpeg" ,libjpeg-turbo)
1729 (native-inputs `(("pkg-config" ,pkg-config)
1730 ("xdg-utils" ,xdg-utils)))
1731 (synopsis "Doom map editor")
1732 (description "Eureka is a map editor for the classic DOOM games, and a few
1733 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1735 (home-page "http://eureka-editor.sourceforge.net/")
1736 (license license:gpl2+)))
1738 (define-public guile-chickadee
1740 (name "guile-chickadee")
1744 (uri (string-append "https://files.dthompson.us/chickadee/"
1745 "chickadee-" version ".tar.gz"))
1748 "0y3s0p4zyghys48sayfhcbmxmflh8hwawnx5an2jlb3x84yr0dsx"))))
1749 (build-system gnu-build-system)
1751 '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
1753 `(("guile-opengl" ,guile-opengl)
1754 ("guile-sdl2" ,guile-sdl2)))
1756 `(("guile" ,guile-2.2)
1757 ("libvorbis" ,libvorbis)
1759 ("openal" ,openal)))
1761 `(("pkg-config" ,pkg-config)
1762 ("texinfo" ,texinfo)))
1763 (home-page "https://dthompson.us/projects/chickadee.html")
1764 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1765 (description "Chickadee is a game development toolkit for Guile Scheme
1766 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1767 that parenthetically inclined game developers need to make 2D (and eventually
1768 3D) games in Scheme, such as:
1771 @item extensible, fixed-timestep game loop
1772 @item OpenGL-based rendering engine
1773 @item keyboard, mouse, controller input
1774 @item REPL-driven development model
1776 (license license:gpl3+)))
1778 (define-public guile3.0-chickadee
1780 (inherit guile-chickadee)
1781 (name "guile3.0-chickadee")
1785 (uri (string-append "https://files.dthompson.us/chickadee/"
1786 "chickadee-" version ".tar.gz"))
1789 "0y3s0p4zyghys48sayfhcbmxmflh8hwawnx5an2jlb3x84yr0dsx"))))
1790 (build-system gnu-build-system)
1792 `(("guile-opengl" ,guile3.0-opengl)
1793 ("guile-sdl2" ,guile3.0-sdl2)))
1795 `(("guile" ,guile-3.0)
1796 ("libvorbis" ,libvorbis)
1798 ("openal" ,openal)))
1800 `(("pkg-config" ,pkg-config)
1801 ("texinfo" ,texinfo)))
1802 (home-page "https://dthompson.us/projects/chickadee.html")
1803 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1804 (description "Chickadee is a game development toolkit for Guile Scheme
1805 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1806 that parenthetically inclined game developers need to make 2D (and eventually
1807 3D) games in Scheme, such as:
1810 @item extensible, fixed-timestep game loop
1811 @item OpenGL-based rendering engine
1812 @item keyboard, mouse, controller input
1813 @item REPL-driven development model
1815 (license license:gpl3+)))
1817 (define-public bennu-game-development
1819 (name "bennu-game-development")
1824 (url "http://svn.code.sf.net/p/bennugd/code")
1825 (revision (string->number version))))
1826 (file-name (string-append name "-" version))
1829 "0wpzsbh4zi3931493dnyl5ffmh1b7fj2sx3mzrq304z9zs4d6lqq"))
1830 (modules '((guix build utils)))
1833 (delete-file-recursively "3rdparty") #t))))
1834 (build-system gnu-build-system)
1837 (modify-phases %standard-phases
1838 (add-after 'unpack 'patch-configure-to-use-openssl
1839 (lambda* (#:key outputs #:allow-other-keys)
1841 (delete-file "configure")
1842 (substitute* "configure.in"
1845 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
1846 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
1853 (inputs `(("openssl" ,openssl)
1855 (native-inputs `(("pkg-config" ,pkg-config)
1856 ("autoconf" ,autoconf)
1857 ("automake" ,automake)
1858 ("libtool" ,libtool)))
1859 (synopsis "Programming language to create games")
1860 (description "Bennu Game Development, also known as bennudg, is a
1861 programming language tailored at game development. It is the successor of
1863 (home-page "https://sourceforge.net/projects/bennugd/")
1864 (license license:zlib)))
1866 (define-public bennu-game-development-modules
1868 (inherit bennu-game-development)
1869 (name "bennu-game-development-modules")
1872 (modify-phases %standard-phases
1873 (add-after 'unpack 'patch-conflicting-definitions
1875 (with-fluids ((%default-port-encoding #f))
1876 (substitute* "core/include/fmath.h"
1877 (("extern fixed fmul\\( int x, int y \\);") "")
1878 (("extern fixed fdiv\\( int x, int y \\);") "")))
1879 (chdir "modules"))))))
1880 (inputs `(("zlib" ,zlib)
1882 ("openssl" ,openssl)
1883 ("sdl-mixer" ,sdl-mixer)
1884 ("bennu-game-development" ,bennu-game-development)))
1885 (synopsis "Modules for the Bennu Game Development programming language")
1886 (description "This package contains a collection of modules for the Bennu
1887 Game Development programming language, from CD handling through SDL to
1888 joystick support.")))
1896 (uri (string-append "http://plib.sourceforge.net/dist/"
1897 "plib-" version ".tar.gz"))
1900 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
1901 (patches (search-patches "plib-CVE-2011-4620.patch"
1902 "plib-CVE-2012-4552.patch"))))
1903 (build-system gnu-build-system)
1907 ("libxmu" ,libxmu)))
1909 `(("pkg-config" ,pkg-config)))
1910 (home-page "http://plib.sourceforge.net/")
1911 (synopsis "Suite of portable game libraries")
1912 (description "PLIB is a set of libraries that will permit programmers to
1913 write games and other realtime interactive applications that are 100% portable
1914 across a wide range of hardware and operating systems. PLIB includes sound
1915 effects, music, a complete 3D engine, font rendering, a simple Windowing
1916 library, a game scripting language, a GUI, networking, 3D math library and a
1917 collection of handy utility functions. All are 100% portable across nearly
1918 all modern computing platforms. Each library component is fairly independent
1920 (license license:lgpl2.0+)))
1922 (define-public ioquake3
1923 ;; We follow master since it seems that there won't be releases after 1.3.6.
1924 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
1927 (version (git-version "1.3.6" "1" commit))
1932 (url "https://github.com/ioquake/ioq3.git")
1934 (file-name (git-file-name name version))
1937 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
1938 (build-system gnu-build-system)
1941 ("libjpeg" ,libjpeg-turbo)
1944 ("opusfile" ,opusfile)
1946 ("libvorbis" ,libvorbis)
1947 ("freetype" ,freetype)
1948 ("libogg" ,libogg)))
1950 `(("which" ,which) ; Else SDL_version.h won't be found.
1951 ("pkg-config" ,pkg-config)))
1953 '(#:tests? #f ; No tests.
1954 #:make-flags '("CC=gcc"
1955 "USE_INTERNAL_LIBS=0"
1957 "USE_RENDERER_DLOPEN=0"
1958 "USE_OPENAL_DLOPEN=0"
1959 "USE_CURL_DLOPEN=0")
1961 (modify-phases %standard-phases
1964 (lambda* (#:key outputs #:allow-other-keys)
1965 (invoke "make" "copyfiles" "CC=gcc"
1966 "USE_INTERNAL_LIBS=0"
1967 (string-append "COPYDIR="
1968 (assoc-ref outputs "out")
1970 (home-page "https://ioquake3.org/")
1971 (synopsis "FPS game engine based on Quake 3")
1972 (description "ioquake3 is a free software first person shooter engine
1973 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
1974 the original, ioquake3 has been cleaned up, bugs have been fixed and features
1975 added. The permanent goal is to create the open source Quake 3 distribution
1976 upon which people base their games, ports to new platforms, and other
1978 (license license:gpl2))))
1980 (define-public openvr
1984 (home-page "https://github.com/ValveSoftware/openvr/")
1990 (commit (string-append "v" version))))
1991 (file-name (git-file-name name version))
1993 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
1994 (build-system cmake-build-system)
1998 #:configure-flags (list "-DBUILD_SHARED=1")))
1999 (synopsis "Virtual reality software development kit")
2000 (description "OpenVR is an API and runtime that allows access to VR
2001 hardware from multiple vendors without requiring that applications have
2002 specific knowledge of the hardware they are targeting.")
2003 (license license:bsd-3)))
2005 (define-public flatzebra
2012 (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
2013 "flatzebra-" version ".tar.gz"))
2015 (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
2016 (build-system gnu-build-system)
2019 (modify-phases %standard-phases
2020 (add-after 'unpack 'fix-sdl-config
2021 (lambda* (#:key inputs #:allow-other-keys)
2022 ;; XXX: sdl-config in sdl-union is a link to sdl-config from
2023 ;; plain sdl package. As a consequence, the prefix is wrong.
2024 ;; Force correct one with "--prefix" argument.
2025 (let ((sdl-union (assoc-ref inputs "sdl")))
2026 (setenv "SDL_CONFIG"
2027 (string-append sdl-union
2028 "/bin/sdl-config --prefix="
2032 `(("pkg-config" ,pkg-config)))
2034 `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
2035 (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
2036 (synopsis "Generic game engine for 2D double-buffering animation")
2038 "Flatzebra is a simple, generic C++ game engine library supporting 2D
2040 (license license:gpl2+)))
2045 (version "19.12.01")
2050 (url "https://github.com/FNA-XNA/FNA.git")
2052 (file-name (git-file-name name version))
2054 (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
2055 (build-system gnu-build-system)
2057 '(#:tests? #f ; No tests.
2059 (modify-phases %standard-phases
2060 (add-after 'unpack 'link-dep-src
2061 (lambda* (#:key inputs #:allow-other-keys)
2062 (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
2063 (mojoshader (assoc-ref inputs "mojoshader-src"))
2064 (faudio (assoc-ref inputs "faudio-src"))
2065 (theorafile (assoc-ref inputs "theorafile-src")))
2066 (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
2067 (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
2068 (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
2069 (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
2073 (invoke "make" "release")))
2075 (lambda* (#:key outputs #:allow-other-keys)
2076 (let ((out (assoc-ref outputs "out")))
2077 (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
2081 (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
2082 ("mojoshader-src" ,(package-source mojoshader-cs))
2083 ("faudio-src" ,(package-source faudio))
2084 ("theorafile-src" ,(package-source theorafile))))
2085 (home-page "https://fna-xna.github.io/")
2086 (synopsis "Accuracy-focused XNA4 reimplementation")
2087 (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
2088 focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
2089 (license (list license:ms-pl ; FNA
2090 license:lgpl2.1 ; LzxDecoder.cs
2094 (define-public libccd
2102 (url "https://github.com/danfis/libccd.git")
2103 (commit (string-append "v" version))))
2104 (file-name (git-file-name name version))
2106 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2107 (build-system cmake-build-system)
2109 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2110 "-DBUILD_TESTING=ON"
2111 "-DENABLE_DOUBLE_PRECISION=ON")))
2113 `(("python-sphinx" ,python-sphinx)))
2114 (home-page "https://github.com/danfis/libccd")
2115 (synopsis "Library for collision detection between two convex shapes")
2116 (description "@code{libccd} is library for a collision detection
2117 between two convex shapes. @code{libccd} implements variation on
2118 Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2119 and also implements algorithm Minkowski Portal Refinement (MPR,
2120 a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2121 (license license:expat)))
2130 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2131 "ode-" version ".tar.gz"))
2133 (base32 "1flfdqgdbcn1bx8nrrd4qnp6cvsxrhvk8cdg7vaq2dzkh6nsqa5j"))
2134 (modules '((guix build utils)))
2137 (delete-file-recursively "libccd")
2139 (build-system cmake-build-system)
2141 ;; Tests fail on all systems but x86_64. This is fixed upstream and can
2142 ;; be removed in 0.16.2+.
2143 `(#:tests? ,(string-prefix? "x86_64-"
2144 (or (%current-target-system)
2146 #:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
2148 (modify-phases %standard-phases
2149 (add-after 'unpack 'unbundle-libccd
2151 (substitute* "CMakeLists.txt"
2152 (("configure_file\\(libccd/.*") ""))
2158 (home-page "https://www.ode.org/")
2159 (synopsis "High performance library for simulating rigid body dynamics")
2160 (description "ODE is a high performance library for simulating
2161 rigid body dynamics. It is fully featured, stable, mature and
2162 platform independent with an easy to use C/C++ API. It has advanced
2163 joint types and integrated collision detection with friction. ODE is
2164 useful for simulating vehicles, objects in virtual reality
2165 environments and virtual creatures. It is currently used in many
2166 computer games, 3D authoring tools and simulation tools.")
2167 ;; Software is dual-licensed.
2168 (license (list license:lgpl2.1+ license:expat))))
2170 (define-public chipmunk
2178 (url "https://github.com/slembcke/Chipmunk2D.git")
2179 (commit (string-append "Chipmunk-" version))))
2180 (file-name (git-file-name name version))
2182 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2183 (build-system cmake-build-system)
2185 `(#:tests? #f ;no test
2186 #:configure-flags '("-DBUILD_STATIC=OFF"
2187 "-DBUILD_DEMOS=OFF")))
2189 `(("freeglut" ,freeglut)
2191 ("libxrandr" ,libxrandr)))
2192 (home-page "https://chipmunk-physics.net/")
2193 (synopsis "Fast and lightweight 2D game physics library")
2194 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2195 rigid body physics library written in C.")
2196 (license license:expat)))
2198 (define-public libtcod
2205 (url "https://github.com/libtcod/libtcod.git")
2207 (file-name (git-file-name name version))
2210 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
2211 (modules '((guix build utils)))
2213 (delete-file-recursively "src/vendor/utf8proc")
2214 (delete-file-recursively "src/vendor/zlib")
2215 (delete-file "src/vendor/stb_truetype.h")
2216 (delete-file "src/vendor/stb_sprintf.h")
2217 (delete-file "src/vendor/lodepng.cpp")
2218 (delete-file "src/vendor/lodepng.h")
2220 (substitute* "buildsys/autotools/sources.am"
2221 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
2222 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
2223 "../../src/vendor/stb.c")
2224 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
2226 (substitute* "src/libtcod/sys_sdl_img_png.cpp"
2227 (("\\.\\./vendor/") ""))
2229 (substitute* '("src/libtcod/color/canvas.cpp"
2230 "src/libtcod/sys_sdl_img_png.cpp"
2231 "src/libtcod/tileset/truetype.cpp"
2232 "src/libtcod/tileset/tilesheet.cpp")
2233 (("\\.\\./\\.\\./vendor/") ""))
2235 (substitute* "src/libtcod/console/printing.cpp"
2236 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
2238 (build-system gnu-build-system)
2240 `(#:configure-flags '("--with-gnu-ld"
2241 "LIBS=-lutf8proc -llodepng")
2243 (modify-phases %standard-phases
2244 (add-after 'unpack 'change-to-build-dir
2246 (chdir "buildsys/autotools")
2247 (patch-shebang "get_version.py")
2250 `(("autoconf" ,autoconf)
2251 ("automake" ,automake)
2252 ("libtool" ,libtool)
2254 ("pkg-config" ,pkg-config)
2255 ("stb-sprintf" ,stb-sprintf)
2256 ("stb-truetype" ,stb-truetype)))
2258 `(("lodepng" ,lodepng)
2260 ("utf8proc" ,utf8proc)
2262 (home-page "https://github.com/libtcod/libtcod")
2263 (synopsis "Library specifically designed for writing roguelikes")
2265 "libtcod is a fast, portable and uncomplicated API for roguelike
2266 developers providing an advanced true color console, input, and lots of other
2267 utilities frequently used in roguelikes.")
2268 (license license:bsd-3)))
2270 (define-public warsow-qfusion
2271 ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
2272 ;; The 2.5 beta as published on the homepage is commit
2273 ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
2274 (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
2276 (name "warsow-qfusion")
2277 (version (git-version "2.5" "1" commit)) ; 2.5-beta
2281 (url "https://github.com/Warsow/qfusion/")
2284 (file-name (git-file-name name version))
2287 "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
2288 ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
2289 (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
2290 (modules '((guix build utils)))
2292 (delete-file-recursively "platforms")
2293 (delete-file-recursively "debian")
2294 (delete-file-recursively "libsrcs")
2296 (build-system cmake-build-system)
2298 `(#:tests? #f ; No tests.
2299 #:configure-flags '("-DQFUSION_GAME=Warsow")
2302 (guix build cmake-build-system)
2305 (modify-phases %standard-phases
2306 (add-after 'unpack 'change-to-build-dir
2310 (add-after 'install 'really-install
2311 (lambda* (#:key outputs system #:allow-other-keys)
2312 (let ((arch (match system
2313 ("x86_64-linux" "x86_64")
2314 ("i686-linux" "i386")))
2315 (out (assoc-ref outputs "out")))
2316 (install-file (string-append "../source/build/basewsw/libgame_"
2318 (string-append out "/lib/"))
2319 (install-file (string-append "../source/build/libui_" arch ".so")
2320 (string-append out "/lib/"))
2323 (install-file file (string-append out "/bin/")))
2324 (append (find-files "../source/build" "warsow")
2325 (find-files "../source/build" "wsw_server."))))
2328 `(("alsa-lib" ,alsa-lib)
2330 ("freetype" ,freetype)
2332 ("libjpeg" ,libjpeg-turbo)
2335 ("libtheora" ,libtheora)
2336 ("libvorbis" ,libvorbis)
2339 ("pulseaudio" ,pulseaudio)
2341 ("qtdeclarative" ,qtdeclarative)
2343 ("uuid.h" ,util-linux "lib")
2346 `(("pkg-config" ,pkg-config)))
2347 (home-page "https://github.com/Warsow/qfusion")
2348 (supported-systems '("i686-linux" "x86_64-linux"))
2349 (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
2351 "This package contains the game engine of Warsow, a first-person
2352 shooter video game. The engine is based on qfusion, the id Tech 2 derived
2353 game engine. id Tech 2 is the engine originally behind Quake 2.")
2354 (license license:gpl2+))))
2356 (define-public dhewm3
2363 "https://github.com/dhewm/dhewm3/releases/download/"
2364 version "/dhewm3-" version "-src.tar.xz"))
2367 "0dmd1876az5q8gbjrd1jk8zidz11ydj607z3m8m5kvw2yj136jzv"))))
2368 (build-system cmake-build-system)
2370 `(#:tests? #f ; No tests.
2372 (modify-phases %standard-phases
2373 (add-after 'unpack 'change-to-build-dir
2379 ("libjpeg" ,libjpeg-turbo)
2381 ("libvorbis" ,libvorbis)
2386 (home-page "https://dhewm3.org/")
2387 (synopsis "Port of the original Doom 3 engine")
2389 "@command{dhewm3} is a source port of the original Doom 3 engine (not
2390 Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
2391 version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
2392 sound effects on all operating systems and hardware (via OpenAL Softs EFX
2393 support), has much better support for widescreen resolutions and has 64bit
2395 (license license:gpl3)))