1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Tomáš Čech <sleep_walker@suse.cz>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015, 2018 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
7 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2016, 2017, 2020 Kei Kebreau <kkebreau@posteo.net>
9 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2016, 2017, 2018 Julian Graham <joolean@gmail.com>
11 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
13 ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
14 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
18 ;;; Copyright © 2019, 2020, 2021 Liliana Marie Prikler <liliana.prikler@gmail.com>
19 ;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
20 ;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
21 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
22 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
23 ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
24 ;;; Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
25 ;;; Copyright © 2020-2021 James Smith <jsubuntuxp@disroot.org>
26 ;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
27 ;;; Copyright © 2021 Andy Tai <atai@atai.org>
29 ;;; This file is part of GNU Guix.
31 ;;; GNU Guix is free software; you can redistribute it and/or modify it
32 ;;; under the terms of the GNU General Public License as published by
33 ;;; the Free Software Foundation; either version 3 of the License, or (at
34 ;;; your option) any later version.
36 ;;; GNU Guix is distributed in the hope that it will be useful, but
37 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39 ;;; GNU General Public License for more details.
41 ;;; You should have received a copy of the GNU General Public License
42 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44 (define-module (gnu packages game-development)
45 #:use-module ((srfi srfi-1) #:hide (zip))
46 #:use-module (ice-9 match)
47 #:use-module ((guix licenses) #:prefix license:)
48 #:use-module (guix packages)
49 #:use-module (guix download)
50 #:use-module (guix git-download)
51 #:use-module (guix svn-download)
52 #:use-module (guix utils)
53 #:use-module (guix build-system cmake)
54 #:use-module (guix build-system gnu)
55 #:use-module (guix build-system python)
56 #:use-module (guix build-system scons)
57 #:use-module (gnu packages)
58 #:use-module (gnu packages audio)
59 #:use-module (gnu packages autotools)
60 #:use-module (gnu packages base)
61 #:use-module (gnu packages bash)
62 #:use-module (gnu packages boost)
63 #:use-module (gnu packages compression)
64 #:use-module (gnu packages check)
65 #:use-module (gnu packages curl)
66 #:use-module (gnu packages documentation)
67 #:use-module (gnu packages fltk)
68 #:use-module (gnu packages fonts)
69 #:use-module (gnu packages fontutils)
70 #:use-module (gnu packages freedesktop)
71 #:use-module (gnu packages fribidi)
72 #:use-module (gnu packages dbm)
73 #:use-module (gnu packages gettext)
74 #:use-module (gnu packages gl)
75 #:use-module (gnu packages glib)
76 #:use-module (gnu packages gnome)
77 #:use-module (gnu packages gnunet)
78 #:use-module (gnu packages graphics)
79 #:use-module (gnu packages graphviz)
80 #:use-module (gnu packages gtk)
81 #:use-module (gnu packages guile)
82 #:use-module (gnu packages image)
83 #:use-module (gnu packages linux)
84 #:use-module (gnu packages lua)
85 #:use-module (gnu packages m4)
86 #:use-module (gnu packages mono)
87 #:use-module (gnu packages mp3)
88 #:use-module (gnu packages multiprecision)
89 #:use-module (gnu packages music)
90 #:use-module (gnu packages ncurses)
91 #:use-module (gnu packages pcre)
92 #:use-module (gnu packages pkg-config)
93 #:use-module (gnu packages pulseaudio)
94 #:use-module (gnu packages python)
95 #:use-module (gnu packages python-xyz)
96 #:use-module (gnu packages readline)
97 #:use-module (gnu packages qt)
98 #:use-module (gnu packages sdl)
99 #:use-module (gnu packages sphinx)
100 #:use-module (gnu packages stb)
101 #:use-module (gnu packages texinfo)
102 #:use-module (gnu packages textutils)
103 #:use-module (gnu packages tls)
104 #:use-module (gnu packages video)
105 #:use-module (gnu packages web)
106 #:use-module (gnu packages wxwidgets)
107 #:use-module (gnu packages xdisorg)
108 #:use-module (gnu packages xiph)
109 #:use-module (gnu packages xml)
110 #:use-module (gnu packages xorg))
112 (define-public bullet
119 (url "https://github.com/bulletphysics/bullet3/")
121 (file-name (git-file-name name version))
124 "0x1ghxbkvqr910sp01sjf4hlfy4sdgn2jx2qf0dsi697bzq1f3mr"))
125 (modules '((guix build utils)))
128 (for-each delete-file (find-files "build3" "premake*"))
129 (with-directory-excursion "examples/ThirdPartyLibs"
130 (for-each delete-file-recursively
131 '("Gwen" "clsocket" "enet" "glad" "imgui"
132 "lua-5.2.3" "midi" "minizip" "openvr"
133 "optionalX11" "serial" "zlib")))
135 ;; Tests fail on linking, cannot find -lBussIK.
136 (substitute* "test/CMakeLists.txt"
137 ((" InverseDynamics")
138 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
139 ; (("SharedMemory") ""))
141 (build-system cmake-build-system)
143 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
144 "-DBUILD_CPU_DEMOS=OFF"
145 "-DBUILD_OPENGL3_DEMOS=OFF"
146 "-DBUILD_BULLET2_DEMOS=OFF"
147 ;; Extras/BulletRoboticsGUI needs files from
149 "-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF"
150 ;; Extras/BulletRobotics needs files from
152 "-DBUILD_BULLET_ROBOTICS_EXTRA=OFF"
153 (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
154 (or (getenv "CXXFLAGS") "")))
156 (modify-phases %standard-phases
157 (add-after 'unpack 'remove-failing-tests
158 ;; These tests fail specifically after removing 3rd party code.
160 (substitute* "test/SharedMemory/CMakeLists.txt"
161 (("ADD_TEST") "# ADD_TEST"))
162 (substitute* "test/InverseDynamics/CMakeLists.txt"
163 (("ADD_TEST\\(Test_BulletInverseForward")
164 "# ADD_TEST(Test_BulletInverseForward"))
167 (list glu libx11 mesa))
168 (home-page "https://pybullet.org/wordpress/")
169 (synopsis "3D physics engine library")
171 "Bullet is a physics engine library usable for collision detection. It
172 is used in some video games and movies.")
173 (license license:zlib)))
175 (define-public deutex
182 (uri (string-append "https://github.com/Doom-Utils/deutex"
183 "/releases/download/v" version "/"
184 "deutex-" version ".tar.zst"))
186 (base32 "0psb2za6ldrlak7s8pjvli98ij5yiwjx8j1ms2v7rj9yadx0xv8h"))))
187 (build-system gnu-build-system)
191 (list asciidoc pkg-config zstd))
192 (home-page "https://github.com/Doom-Utils/deutex")
193 (synopsis "WAD file composer for Doom and related games")
195 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
196 used to extract the lumps of a wad and save them as individual files.
197 Conversely, it can also build a wad from separate files. When extracting a
198 lump to a file, it does not just copy the raw data, it converts it to an
199 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
200 Conversely, when it reads files for inclusion in pwads, it does the necessary
201 conversions (for example, from PPM to Doom picture format). In addition,
202 DeuTex has functions such as merging wads, etc.")
203 (license license:gpl2+)))
205 (define-public grfcodec
212 (uri (string-append "https://binaries.openttd.org/extra/"
213 name "/" version "/" name "-" version
215 (patches (search-patches "grfcodec-gcc-compat.patch"))
217 (base32 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
218 (build-system gnu-build-system)
220 '(#:tests? #f ;no check target
222 (modify-phases %standard-phases
223 (delete 'configure) ;no configure script
224 (replace 'install ;no install target
225 (lambda* (#:key outputs #:allow-other-keys)
226 (let* ((out (assoc-ref outputs "out"))
227 (bin (string-append out "/bin"))
228 (doc (string-append out "/share/doc"))
229 (man (string-append out "/share/man/man1")))
230 (for-each (lambda (file)
231 (install-file file bin))
232 '("grfcodec" "grfid" "grfstrip" "nforenum"))
233 (install-file "COPYING" doc)
234 (with-directory-excursion "docs"
235 (for-each (lambda (file)
236 (install-file (string-append file ".txt") doc))
237 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
238 "readme" "readme.rpn"))
239 (for-each (lambda (file)
240 (install-file file man))
241 (find-files "." "\\.1")))))))))
243 (list boost libpng zlib))
244 (synopsis "GRF development tools")
246 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
247 tools for developing (New)GRFs. It includes a number of smaller programs, each
248 with a specific task:
250 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
251 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
252 @item @code{grfstrip} strips all sprites from a GRF.
253 @item @code{nforenum} checks NFO code for errors, making corrections when
256 (home-page "https://dev.openttdcoop.org/projects/grfcodec")
257 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
258 ;; NFORenum is under the GPL2+.
259 ;; The MD5 implementation contained in GRFID is under the zlib license.
260 (license (list license:gpl2 license:gpl2+ license:zlib))))
262 (define-public catcodec
269 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
270 version "/catcodec-" version "-source.tar.xz"))
272 (base32 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
273 (build-system gnu-build-system)
275 `(#:tests? #f ; no tests
276 #:make-flags (list (string-append "prefix=" %output))
277 #:phases (modify-phases %standard-phases
278 (delete 'configure))))
279 (home-page "https://dev.openttdcoop.org/projects/catcodec")
280 (synopsis "Encode/decode OpenTTD sounds")
281 (description "catcodec encodes and decodes sounds for OpenTTD. These
282 sounds are not much more than some metadata (description and filename) and raw
284 (license license:gpl2)))
286 (define-public gzochi
292 (uri (string-append "mirror://savannah/gzochi/gzochi-"
296 "1vcvf04qqzs3q8kaild2x7qvkwc6bwzfsisb78147b8z747j7hj0"))))
297 (build-system gnu-build-system)
299 '(#:phases (modify-phases %standard-phases
300 (add-before 'build 'no-Werror
302 ;; Don't abort builds due to things like GLib
303 ;; deprecation warnings.
304 (substitute* (find-files "." "^Makefile\\.in$")
307 (native-inputs `(("pkgconfig" ,pkg-config)))
315 (home-page "https://www.nongnu.org/gzochi/")
316 (synopsis "Scalable middleware for multiplayer games")
318 "gzochi is a framework for developing massively multiplayer online games.
319 A server container provides services to deployed games, which are written in
320 Guile Scheme, that abstract and simplify some of the most challenging and
321 error-prone aspects of online game development: Concurrency, data persistence,
322 and network communications. A very thin client library can be embedded to
323 provide connectivity for client applications written in any language.")
324 (license license:gpl3+)))
333 (uri (pypi-uri "nml" version))
335 (base32 "0l5pfs8q7jrl3xscqq7pnwh5h5d17fsyjy7xspkc73sa0ayjm9jx"))))
336 (build-system python-build-system)
337 ;; TODO: Fix test that fails with
338 ;; "AttributeError: partially initialized module 'nml.nmlop' has no
339 ;; attribute 'ADD' (most likely due to a circular import)"
343 (list python-pillow python-ply))
344 (home-page "https://github.com/OpenTTD/nml")
345 (synopsis "NML compiler")
347 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
348 compiling NML files (along with their associated language, sound and graphic
349 files) into @file{.grf} and/or @file{.nfo} files.")
350 (license license:gpl2+)))
352 (define-public python-sge
355 (version "2.0.post0")
359 (uri (pypi-uri "sge" version))
362 "0s5d5qzlzfmqb10iyrqi62n36ll94d99xjaznp5ca6dz1b91qkvr"))))
363 (build-system python-build-system)
365 (list python-pygame python-uniseg))
366 (home-page "https://python-sge.github.io/")
367 (synopsis "2D game engine for Python")
369 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
370 general-purpose 2D game engine. It takes care of several details for you so
371 you can focus on the game itself. This makes more rapid game development
372 possible, and it also makes the SGE easy to learn.")
373 (license license:lgpl3+)))
375 (define-public python-tmx
382 (uri (string-append "mirror://savannah/python-tmx/"
383 (version-major+minor version) "/tmx-"
387 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
388 (build-system python-build-system)
391 (home-page "http://python-tmx.nongnu.org")
392 (synopsis "Python library for the @code{Tiled} TMX format")
394 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
395 This is useful for map editors or generic level editors, and it's also useful
396 for using a map editor or generic level editor like Tiled to edit your game's
398 (license (list license:asl2.0
399 ;; Documentation (only available in the source tarball) is
400 ;; under the CC0 license.
403 (define-public python2-tmx
404 (let ((python2-tmx (package-with-python2 python-tmx)))
406 (inherit python2-tmx)
408 (modify-inputs (package-propagated-inputs python2-tmx)
409 (prepend python2-pathlib))))))
411 (define-public python-xsge
414 (version "2020.09.07")
417 (uri (string-append "https://github.com/python-sge/xsge"
418 "/releases/download/v" version
419 "/xsge-" version ".zip"))
422 "136xgy3f9vw636wxpqbha022avk0wyxw63mm3a2dvwhh90s716f9"))))
423 (build-system python-build-system)
426 (modify-phases %standard-phases
427 ;; xSGE's setup.py script does not support one of the Python build
428 ;; system's default flags, "--single-version-externally-managed".
430 (lambda* (#:key outputs #:allow-other-keys)
431 (invoke "python" "setup.py" "install"
432 (string-append "--prefix=" (assoc-ref outputs "out"))
434 #:tests? #f)) ; no check target
439 (home-page "https://python-sge.github.io/")
440 (synopsis "Extensions for the SGE Game Engine")
442 "xSGE is a collection of modules that make doing certain tasks with the SGE
443 Game Engine easier. In addition to SGE's conveniences, the user has access to a
444 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
446 (license license:gpl3+)))
456 (url "https://github.com/sirjuddington/SLADE")
458 (sha256 (base32 "009yc5m6y074wfalvwbrnv2zsmaf9yhbi8hzgs973di0zqnqv011"))
459 (file-name (git-file-name name version))))
460 (build-system cmake-build-system)
463 (list "-DWX_GTK3=ON" "-DNO_WEBVIEW=ON"
464 (string-append "-DWITH_WXPATH="
465 (assoc-ref %build-inputs "wxwidgets") "/bin")
466 (string-append "-DwxWidgets_LIBRARIES="
467 (assoc-ref %build-inputs "wxwidgets") "/lib"))
469 (modify-phases %standard-phases
470 (add-before 'build 'reset-slade.pk3-timestamps
471 ;; This is neccessary to make slade reproducible due to
472 ;; <https://bugs.gnu.org/44741>. TODO: Remove on next core update
475 (invoke "find" "../source/dist/res" "-exec" "touch"
476 "--no-dereference" "-t" "197001010000.00" "{}"
478 (add-after 'install 'wrap-with-x11-gdk-backend
479 ;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
480 ;; See https://github.com/sirjuddington/SLADE/issues/1097 for details.
481 (lambda* (#:key outputs #:allow-other-keys)
483 (string-append (assoc-ref outputs "out")
485 '("GDK_BACKEND" = ("x11"))))))
486 #:tests? #f)) ;; No test suite.
488 `(("bash" ,bash-minimal)
490 ("fluidsynth" ,fluidsynth)
491 ("freeimage" ,freeimage)
496 ("wxwidgets" ,wxwidgets-3.1)))
498 (list pkg-config which zip))
499 (home-page "https://slade.mancubus.net")
500 (synopsis "Doom game data editor")
501 (description "SLADE3 is a modern editor for Doom-engine based games and
502 source ports. It has the ability to view, modify, and write many different game-
503 specific formats, and even convert between some of them, or from/to other generic
504 formats such as PNG.")
505 (license license:gpl2+)))
514 (url "https://github.com/bjorn/tiled")
515 (commit (string-append "v" version))))
516 (file-name (git-file-name name version))
519 "1ifxh3sv6gz32gahgi7ba0ivcw5mfgwnrw6iycpav150w9xla43i"))))
520 (build-system gnu-build-system)
522 (list qtbase-5 qtdeclarative qtsvg zlib))
527 (modify-phases %standard-phases
529 (lambda* (#:key inputs outputs #:allow-other-keys)
530 (substitute* "translations/translations.pro"
532 (string-append "LRELEASE = "
533 (assoc-ref inputs "qttools")
535 (let ((out (assoc-ref outputs "out")))
537 (string-append "PREFIX=" out))))))))
538 (home-page "https://www.mapeditor.org/")
539 (synopsis "Tile map editor")
541 "Tiled is a general purpose tile map editor. It is meant to be used for
542 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
545 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
547 (license license:gpl2+)))
549 (define-public tsukundere
556 (url "https://gitlab.com/lilyp/tsukundere")
558 (file-name (git-file-name name version))
561 "11glghnff27rqh2s34g51afg93g3f5ryfz9mkyb7qj35ngl8vw5f"))))
562 (build-system gnu-build-system)
564 `(#:modules ((ice-9 match)
566 ((guix build guile-build-system)
567 #:select (target-guile-effective-version))
568 ,@%gnu-build-system-modules)
569 #:imported-modules ((guix build guile-build-system)
570 ,@%gnu-build-system-modules)
572 (modify-phases %standard-phases
573 (add-after 'unpack 'patch-command
574 (lambda* (#:key inputs outputs #:allow-other-keys)
575 (let* ((scm (lambda (in)
576 (string-append in "/share/guile/site/"
577 (target-guile-effective-version))))
579 (string-append in "/lib/guile/"
580 (target-guile-effective-version)
584 (assoc-ref outputs "out")
587 (("guile" . pkg) pkg)
589 (and (string-prefix? "guile-" label) pkg)))
591 (substitute* "tsukundere.scm"
592 (("exec guile (.*)" _ args)
594 ;; XXX: Prevent Guile-SDL2 from blowing up by not knowing
595 ;; where the SDL2 libaries are.
596 "unset LD_LIBRARY_PATH\n"
597 (format #f "export GUILE_LOAD_PATH=\"~@?\"~%"
598 "~{~a~^:~}" (map scm pkgs))
599 (format #f "export GUILE_LOAD_COMPILED_PATH=\"~@?\"~%"
600 "~{~a~^:~}" (map ccache pkgs))
602 (assoc-ref inputs "guile")
603 "/bin/guile " args)))
606 `(("autoconf" ,autoconf)
607 ("automake" ,automake)
608 ("gettext" ,gettext-minimal)
611 ("pkg-config" ,pkg-config)
612 ("texinfo" ,texinfo)))
614 `(("guile-sdl2" ,guile3.0-sdl2)
618 (home-page "https://gitlab.com/lilyp/tsukundere")
619 (synopsis "Visual novel engine")
620 (description "Tsukundere is a game engine geared heavily towards the
621 development of visual novels, written on top of Guile-SDL2. It is still
623 (license license:lgpl3+)))
631 ;; Do not fetch the archives from
632 ;; http://mirror0.sfml-dev.org/files/ because files there seem
633 ;; to be changed in place.
635 (url "https://github.com/SFML/SFML")
637 (file-name (git-file-name name version))
640 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
641 (modules '((guix build utils)))
644 ;; Ensure system libraries are used.
645 (delete-file-recursively "extlibs")
647 (build-system cmake-build-system)
650 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
651 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
652 #:tests? #f)) ; no tests
659 ("xcb-util-image" ,xcb-util-image)
660 ("libxrandr" ,libxrandr)
662 ("libjpeg" ,libjpeg-turbo)
663 ("libsndfile" ,libsndfile)
664 ("stb-image" ,stb-image)
665 ("stb-image-write" ,stb-image-write)))
667 ;; In Requires.private of pkg-config files.
668 (list flac freetype libvorbis openal))
669 (home-page "https://www.sfml-dev.org")
670 (synopsis "Simple and Fast Multimedia Library")
672 "SFML provides a simple interface to the various computer components,
673 to ease the development of games and multimedia applications. It is composed
674 of five modules: system, window, graphics, audio and network.")
675 (license license:zlib)))
683 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
686 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
687 (build-system gnu-build-system)
689 `(#:phases (modify-phases %standard-phases
690 (delete 'configure) ; no configure script
691 (add-before 'build 'patch-makefile
692 (lambda* (#:key outputs #:allow-other-keys)
693 (let ((out (assoc-ref outputs "out")))
694 (substitute* "Makefile"
695 (("\\$\\(DESTDIR\\)/usr") out))
696 (substitute* "main.cpp"
698 (string-append out "/share")))
700 #:tests? #f)) ; no tests
702 (list pkg-config desktop-file-utils))
705 (synopsis "Simple sound effect generator")
706 (description "Sfxr is a tool for quickly generating simple sound effects.
707 Originally created for use in video game prototypes, it can generate random
708 sounds from presets such as \"explosion\" or \"powerup\".")
709 (home-page "http://www.drpetter.se/project_sfxr.html")
710 (license license:expat)))
712 (define-public surgescript
720 (url "https://github.com/alemart/surgescript")
721 (commit (string-append "v" version))))
722 (file-name (git-file-name name version))
724 (base32 "0xwd4g7n0b0rxkpbyshkzyl472h1y606ghyvf8gv034n3jz2g4jk"))))
725 (build-system cmake-build-system)
728 (let ((share (string-append (assoc-ref %outputs "out") "/share")))
729 (list "-DWANT_STATIC=NO"
730 (string-append "-DICON_PATH=" share "/pixmaps")
731 (string-append "-DMETAINFO_PATH=" share "/metainfo")))
733 (home-page "https://docs.opensurge2d.org")
734 (synopsis "Scripting language for games")
735 (description "@code{SurgeScript} is a dynamically typed object-oriented
736 scripting language designed for games. Each object is a state machine that
737 can be customized by attaching other objects. The language supports automatic
738 garbage collection and can be extended with plugins.")
739 (license license:asl2.0)))
741 (define-public physfs
748 "https://icculus.org/physfs/downloads/physfs-"
750 (file-name (string-append name "-" version ".tar.gz"))
753 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
754 (build-system cmake-build-system)
756 '(#:tests? #f ; no check target
757 #:configure-flags '("-DPHYSFS_BUILD_STATIC=OFF")
758 #:phases (modify-phases %standard-phases
759 (add-after 'unpack 'patch-CMakeLists.txt
761 (substitute* "CMakeLists.txt"
762 ;; XXX: For some reason CMakeLists.txt disables
763 ;; RUNPATH manipulation when the compiler is GCC.
764 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
770 (home-page "https://icculus.org/physfs")
771 (synopsis "File system abstraction library")
773 "PhysicsFS is a library to provide abstract access to various archives.
774 It is intended for use in video games. For security, no file writing done
775 through the PhysicsFS API can leave a defined @emph{write directory}. For
776 file reading, a @emph{search path} with archives and directories is defined,
777 and it becomes a single, transparent hierarchical file system. So archive
778 files can be accessed in the same way as you access files directly on a disk,
779 and it makes it easy to ship a new archive that will override a previous
780 archive on a per-file basis.")
781 (license license:zlib)))
789 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
790 "love-" version "-linux-src.tar.gz"))
793 "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
794 (build-system gnu-build-system)
809 (synopsis "2D game framework for Lua")
810 (description "LÖVE is a framework for making 2D games in the Lua
811 programming language.")
812 (home-page "https://love2d.org/")
813 (license license:zlib)))
815 (define-public love-nuklear
817 (name "love-nuklear")
822 (url "https://github.com/keharriso/love-nuklear/")
823 (commit (string-append "v" version))
825 ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
826 ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
827 (file-name (git-file-name name version))
830 "090xp5c975155hd1pa7bdssdlawvygs5s6icdkwbyc8il5kg5kgv"))))
831 (build-system cmake-build-system)
833 `(#:build-type "Release"
836 (modify-phases %standard-phases
837 (add-after 'unpack 'patch-cmake
839 (substitute* "CMakeLists.txt"
840 (("DESTINATION .") "DESTINATION lib/love")))))))
843 (synopsis "Lightweight immediate mode GUI for LÖVE games")
844 (description "LÖVE is a Lua framework for making 2D games. Nuklear
845 is a minimal state immediate mode graphical user interface toolkit. This
846 package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
847 (home-page "https://github.com/keharriso/love-nuklear/")
848 (license license:expat)))
850 (define-public allegro-4
856 (uri (string-append "https://github.com/liballeg/allegro5/"
857 "releases/download/" version "/allegro-"
861 "1m6lz35nk07dli26kkwz3wa50jsrxs1kb6w1nj14a911l34xn6gc"))))
862 (build-system cmake-build-system)
865 (modify-phases %standard-phases
866 (add-after 'unpack 'patch-build-system
868 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
869 ;; via a command line option doesn't work because it is
870 ;; unconditionally clobbered in the build script.
871 (substitute* '("CMakeLists.txt")
872 (("ADDON_LINKAGE STATIC")
873 "ADDON_LINKAGE SHARED")))))))
875 (list glu libpng libvorbis mesa zlib))
876 (synopsis "Game programming library")
877 (description "Allegro is a library mainly aimed at video game and
878 multimedia programming. It handles common, low-level tasks such as creating
879 windows, accepting user input, loading data, drawing images, playing sounds,
881 (home-page "https://liballeg.org")
882 (license license:giftware)))
884 (define-public allegro
890 (uri (string-append "https://github.com/liballeg/allegro5/releases"
891 "/download/" version "/allegro-"
895 "034pmbmbq6jagpp4lhnyjqmf8gcz5fx74d9rknrm7d4wv4cv7qy1"))))
896 (build-system cmake-build-system)
897 (arguments `(#:tests? #f)) ; there are no tests
899 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
901 ("freetype" ,freetype)
904 ("libjpeg" ,libjpeg-turbo)
906 ("libtheora" ,libtheora)
907 ("libvorbis" ,libvorbis)
908 ("libxcursor" ,libxcursor)
909 ("libxinerama" ,libxinerama)
910 ("libxrandr" ,libxrandr)
917 (synopsis "Game programming library")
918 (description "Allegro is a library mainly aimed at video game and
919 multimedia programming. It handles common, low-level tasks such as creating
920 windows, accepting user input, loading data, drawing images, playing sounds,
922 (home-page "https://liballeg.org")
923 (license license:bsd-3)))
925 (define-public allegro-5.0
926 (package (inherit allegro)
931 (uri (string-append "https://github.com/liballeg/allegro5/releases"
932 "/download/" version "/allegro-"
933 (if (equal? "0" (string-take-right version 1))
934 (string-drop-right version 2)
937 (patches (search-patches
938 "allegro-mesa-18.2.5-and-later.patch"))
941 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
943 (define-public aseprite
946 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
947 ;; TODO: Unbundle third party software.
949 (method url-fetch/zipbomb)
950 (uri (string-append "https://github.com/aseprite/aseprite"
951 "/releases/download/v" version
952 "/Aseprite-v" version "-Source.zip"))
955 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
956 (build-system cmake-build-system)
959 ;; Use shared libraries instead of building bundled source.
960 (list "-DWITH_WEBP_SUPPORT=1"
961 "-DUSE_SHARED_CURL=1"
962 "-DUSE_SHARED_GIFLIB=1"
963 "-DUSE_SHARED_JPEGLIB=1"
964 "-DUSE_SHARED_ZLIB=1"
965 "-DUSE_SHARED_LIBPNG=1"
966 "-DUSE_SHARED_LIBLOADPNG=1"
967 "-DUSE_SHARED_LIBWEBP=1"
968 "-DUSE_SHARED_TINYXML=1"
969 "-DUSE_SHARED_PIXMAN=1"
970 "-DUSE_SHARED_FREETYPE=1"
971 "-DUSE_SHARED_ALLEGRO4=1"
972 "-DENABLE_UPDATER=0" ; no auto-updates
973 (string-append "-DFREETYPE_INCLUDE_DIR="
974 (assoc-ref %build-inputs "freetype")
975 "/include/freetype2"))))
978 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
979 ;; patched version is bundled with Aseprite, but the patches should be
980 ;; extracted and applied on top of a standalone Allegro 4 package.
982 `(("allegro" ,allegro-4)
984 ("freetype" ,freetype)
986 ("libjpeg" ,libjpeg-turbo)
991 ("libxxf86vm" ,libxxf86vm)
995 (synopsis "Animated sprite editor and pixel art tool")
996 (description "Aseprite is a tool for creating 2D pixel art for video
997 games. In addition to basic pixel editing features, Aseprite can assist in
998 the creation of animations, tiled graphics, texture atlases, and more.")
999 (home-page "https://www.aseprite.org/")
1000 (license license:gpl2+)))
1002 (define-public libresprite
1004 (name "libresprite")
1006 ;; TODO: Unbundle third party software.
1007 ;; - duktape is bundled inside the project but it's hard to unbundle:
1008 ;; there are many differences from a version to the next and it is not
1009 ;; really designed to work as a shared lib.
1013 (url "https://github.com/LibreSprite/LibreSprite")
1014 (commit (string-append "v" version))
1016 (file-name (git-file-name name version))
1019 "0djbjjh21ahlxzh0b0jp4mpfycam8h9157i4wbxkd618fraadhbp"))))
1020 (build-system cmake-build-system)
1023 (list "-DWITH_WEBP_SUPPORT=1")
1024 ;; Tests are unmaintained
1027 `(("pkg-config" ,pkg-config)))
1030 ("freetype" ,freetype)
1032 ("googletest" ,googletest)
1033 ("libjpeg" ,libjpeg-turbo)
1035 ("libwebp" ,libwebp)
1037 ("libxext" ,libxext)
1038 ("libxxf86dga" ,libxxf86dga)
1039 ("libxxf86vm" ,libxxf86vm)
1040 ("lua" ,lua) ; Optional
1043 ("sdl2-image" ,sdl2-image)
1044 ("tinyxml" ,tinyxml)
1046 (synopsis "Animated sprite editor and pixel art tool")
1047 (description "LibreSprite is a tool for creating 2D pixel art for video
1048 games. In addition to basic pixel editing features, it can assist in the
1049 creation of animations, tiled graphics, texture atlases, and more.
1050 LibreSprite is a fork of the latest GPLv2 commit of Aseprite.")
1051 (home-page "https://libresprite.github.io/")
1052 (license license:gpl2+)))
1054 (define-public qqwing
1061 "https://qqwing.com/"
1062 name "-" version ".tar.gz"))
1065 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
1066 (build-system gnu-build-system)
1069 (home-page "https://qqwing.com/")
1070 (synopsis "Sudoku puzzle solver and generator")
1072 "QQWing is a Sudoku puzzle generator and solver.
1073 It offers the following features:
1075 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
1076 @item Uses logic. Uses as many solve techniques as possible when solving
1077 puzzles rather than guessing.
1078 @item Rates puzzles. Most generators don't give an indication of the difficulty
1079 of a Sudoku puzzle. QQwing does.
1080 @item Can print solve instructions for any puzzle.
1081 @item Customizable output style, including a CSV style that is easy to
1082 import into a database.
1084 (license license:gpl2+)))
1086 (define-public quesoglc
1092 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1093 name "-" version "-free.tar.bz2"))
1096 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
1097 (build-system gnu-build-system)
1098 (native-inputs (list pkg-config))
1099 (inputs (list fontconfig freeglut fribidi glew))
1100 (home-page "http://quesoglc.sourceforge.net")
1101 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
1103 "The OpenGL Character Renderer (GLC) is a state machine that provides
1104 OpenGL programs with character rendering services via an application programming
1106 (license (list license:expat license:lgpl2.1+))))
1108 (define-public python-pygame
1110 (name "python-pygame")
1114 (uri (pypi-uri "pygame" version))
1117 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
1118 (build-system python-build-system)
1120 `(#:tests? #f ; tests require pygame to be installed first
1122 (modify-phases %standard-phases
1123 ;; Set the paths to the dependencies manually because
1124 ;; the configure script does not allow passing them as
1125 ;; parameters. This also means we can skip the configure
1127 (add-before 'build 'set-library-paths
1128 (lambda* (#:key inputs outputs #:allow-other-keys)
1129 (let ((sdl-ref (assoc-ref inputs "sdl"))
1130 (font-ref (assoc-ref inputs "sdl-ttf"))
1131 (image-ref (assoc-ref inputs "sdl-image"))
1132 (mixer-ref (assoc-ref inputs "sdl-mixer"))
1133 (smpeg-ref (assoc-ref inputs "libsmpeg"))
1134 (png-ref (assoc-ref inputs "libpng"))
1135 (jpeg-ref (assoc-ref inputs "libjpeg"))
1136 (freetype-ref (assoc-ref inputs "freetype"))
1137 (v4l-ref (assoc-ref inputs "v4l-utils"))
1138 (out-ref (assoc-ref outputs "out")))
1139 (substitute* "Setup.in"
1140 (("SDL = -I/usr/include/SDL")
1141 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
1142 (substitute* "Setup.in"
1143 (("FONT = -lSDL_ttf")
1144 (string-append "FONT = -I" font-ref "/include/SDL -L"
1145 font-ref "/lib -lSDL_ttf")))
1146 (substitute* "Setup.in"
1147 (("IMAGE = -lSDL_image")
1148 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
1149 image-ref "/lib -lSDL_image")))
1150 (substitute* "Setup.in"
1151 (("MIXER = -lSDL_mixer")
1152 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
1153 mixer-ref "/lib -lSDL_mixer")))
1154 (substitute* "Setup.in"
1155 (("SMPEG = -lsmpeg")
1156 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
1157 smpeg-ref "/lib -lsmpeg")))
1158 (substitute* "Setup.in"
1160 (string-append "PNG = -I" png-ref "/include -L"
1161 png-ref "/lib -lpng")))
1162 (substitute* "Setup.in"
1164 (string-append "JPEG = -I" jpeg-ref "/include -L"
1165 jpeg-ref "/lib -ljpeg")))
1167 (substitute* "Setup.in"
1168 (("FREETYPE = -lfreetype")
1169 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
1170 freetype-ref "/lib -lfreetype")))
1172 (substitute* "Setup.in"
1173 (("^pypm") "#pypm"))
1174 ;; Create a path to a header file provided by v4l-utils.
1175 (system* "mkdir" "linux")
1176 (system* "ln" "--symbolic"
1177 (string-append v4l-ref "/include/libv4l1-videodev.h")
1179 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
1181 `(("freetype" ,freetype)
1183 ("sdl-image" ,sdl-image)
1184 ("sdl-mixer" ,sdl-mixer)
1185 ("sdl-ttf" ,sdl-ttf)
1186 ("sdl-gfx" ,sdl-gfx)
1187 ("libjpeg" ,libjpeg-turbo)
1190 ("libsmpeg" ,libsmpeg)
1191 ("portmidi" ,portmidi)
1192 ("v4l-utils" ,v4l-utils)))
1193 (home-page "https://www.pygame.org")
1194 (synopsis "SDL wrapper for Python")
1195 (description "Pygame is a set of Python modules designed for writing games.
1196 Pygame adds functionality on top of the excellent SDL library. This allows you
1197 to create fully featured games and multimedia programs in the python language.")
1198 (license (list license:bsd-2
1199 ;; python numeric license as listed by Debian looks like
1200 ;; an Expat-style license with a warranty disclaimer for
1201 ;; the U.S. government and the University of California.
1207 license:public-domain
1208 license:lgpl2.1+))))
1210 (define-public python2-pygame
1211 (package-with-python2 python-pygame))
1213 (define-public python-pygame-sdl2
1214 (let ((real-version "2.1.0")
1215 (renpy-version "7.4.10"))
1217 (inherit python-pygame)
1218 (name "python-pygame-sdl2")
1219 (version (string-append real-version "-for-renpy-" renpy-version))
1223 (uri (string-append "https://www.renpy.org/dl/" renpy-version
1224 "/pygame_sdl2-" version ".tar.gz"))
1225 (sha256 (base32 "0m0asrr722a4v24fm8199b0c53igagylay8bn9bz9rmc0r4v8si4"))
1226 (modules '((guix build utils)))
1229 ;; drop generated sources
1230 (delete-file-recursively "gen")
1231 (delete-file-recursively "gen3")
1232 (delete-file-recursively "gen-static")
1234 (build-system python-build-system)
1236 `(#:tests? #f ; tests require pygame to be installed first
1238 (modify-phases %standard-phases
1239 (add-after 'set-paths 'set-sdl-vars
1240 (lambda* (#:key inputs #:allow-other-keys)
1241 (setenv "PYGAME_SDL2_CFLAGS"
1243 (assoc-ref inputs "sdl-union")
1244 "/include/SDL2 -D_REENTRANT"))
1245 (setenv "PYGAME_SDL2_LDFLAGS"
1247 (assoc-ref inputs "sdl-union")
1249 (assoc-ref inputs "sdl-union")
1250 "/lib -Wl,--enable-new-dtags -lSDL2"))
1253 (list (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))))
1255 (list python-cython))
1256 (home-page "https://www.renpy.org/")
1257 (synopsis "Reimplementation of the Pygame API using SDL2")
1258 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1259 staying close to the original, but also adding some SDL2-specific features.
1260 While it aims to be used as a drop-in replacement, it appears to be
1261 developed mainly for Ren'py.")
1262 (license (list license:lgpl2.1 license:zlib)))))
1264 (define-public python2-pygame-sdl2
1265 (package-with-python2 python-pygame-sdl2))
1267 (define-public python2-renpy
1269 (name "python2-renpy")
1274 (uri (string-append "https://www.renpy.org/dl/" version
1275 "/renpy-" version "-source.tar.bz2"))
1276 (sha256 (base32 "1yngs2kh1l8micg28mcp9580qsvgq3aa8bkhv2xqfkg9qqrbr8y4"))
1277 (modules '((guix build utils)))
1280 "renpy-use-system-fribidi.patch"))
1282 '(with-directory-excursion "module"
1283 ;; drop fribidi sources
1284 (delete-file-recursively "fribidi-src")
1286 (build-system python-build-system)
1288 `(#:tests? #f ; Ren'py doesn't seem to package tests
1291 (modify-phases %standard-phases
1292 (add-after 'unpack 'fix-commands
1293 (lambda* (#:key inputs #:allow-other-keys)
1294 (substitute* "renpy/editor.py"
1296 (string-append (assoc-ref inputs "xdg-utils")
1299 (add-after 'unpack 'fix-include-paths
1300 (lambda* (#:key inputs #:allow-other-keys)
1301 (substitute* "module/setup.py"
1302 (("/usr/include/fribidi")
1303 (search-input-directory inputs "include/fribidi")))))
1304 (add-after 'set-paths 'set-build-vars
1305 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1306 (setenv "RENPY_CYTHON"
1307 (search-input-file (or native-inputs inputs)
1309 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
1312 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1313 ;; The "module" subdirectory contains a python (really cython)
1314 ;; project, which is built using a script, that is thankfully
1315 ;; named "setup.py".
1316 (with-directory-excursion "module"
1317 (apply (assoc-ref %standard-phases 'build) args))
1318 ;; the above causes renpy.__init__ to be compiled but does not
1319 ;; compile anything else, hence we do that here
1320 (delete-file "renpy/__init__.pyc")
1321 (invoke "python" "-m" "compileall" "renpy")
1324 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1325 ;; Again, we have to wrap the module installation.
1326 ;; Additionally, we want to install the python code
1327 ;; (both source and compiled) in the same directory.
1328 (let* ((out (assoc-ref outputs "out"))
1329 (site (string-append "/lib/python"
1331 (assoc-ref inputs "python"))
1333 (with-directory-excursion "module"
1334 (apply (assoc-ref %standard-phases 'install) args))
1335 (copy-recursively "renpy"
1336 (string-append out site "/renpy"))
1337 (delete-file-recursively (string-append out site "/renpy/common")))
1345 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))
1348 `(("python2-future" ,python2-future)
1349 ("python2-pygame" ,python2-pygame-sdl2)))
1351 (list python2-cython))
1352 (home-page "https://www.renpy.org/")
1353 (synopsis "Ren'py python module")
1354 (description "This package contains the shared libraries and Python modules
1355 of Ren'py. While functional, they are not meaningful on their own without
1356 the launcher and common Ren'py code provided by the @code{renpy} package and
1357 are only used to bootstrap it.")
1358 (license license:expat)))
1360 (define-public renpy
1362 (inherit python2-renpy)
1364 (build-system python-build-system)
1366 `(#:tests? #f ; see python2-renpy
1368 #:modules ((srfi srfi-1)
1369 (guix build python-build-system)
1371 #:imported-modules ((srfi srfi-1) ,@%python-build-system-modules)
1373 (modify-phases %standard-phases
1374 (add-after 'unpack 'fix-commands
1375 (lambda* (#:key inputs outputs #:allow-other-keys)
1376 (substitute* "launcher/game/choose_directory.rpy"
1377 (("/usr/bin/python")
1378 (string-append (assoc-ref inputs "python2")
1380 (substitute* "launcher/game/front_page.rpy"
1382 (string-append (assoc-ref inputs "xdg-utils")
1384 (substitute* "launcher/game/project.rpy"
1385 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1386 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1388 ;; Projects are still created in the usual style, so we need
1389 ;; to adjust the path.
1390 (("cmd.append\\(self.path\\)")
1391 "cmd.append(self.path + \"/game\")"))
1393 (add-after 'unpack 'drop-game-from-paths
1395 (substitute* (list "launcher/game/gui7.rpy"
1396 "launcher/game/gui7/images.py")
1397 ((", \"game\",") ","))
1399 (add-before 'build 'start-xserver
1400 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1401 (let ((xorg-server (assoc-ref (or native-inputs inputs)
1403 (setenv "HOME" (getcwd))
1404 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
1405 (setenv "DISPLAY" ":1")
1409 (invoke "python" "renpy.py" "launcher" "quit")
1410 (invoke "python" "renpy.py" "the_question" "quit")
1411 (invoke "python" "renpy.py" "tutorial" "quit")
1414 (lambda* (#:key inputs outputs #:allow-other-keys)
1415 ;; Here we install our custom renpy program.
1416 ;; After finishing this step, "out" will have the following:
1418 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1422 ;; Note that common shares the source files that would be installed
1423 ;; by python2-renpy (which are instead deleted from that package),
1424 ;; but also contains their byte-compiled versions.
1425 ;; On other systems, renpy_base would point to site-packages or
1426 ;; even somewhere in /opt.
1427 ;; The former approach is not as straightforward as it seems
1428 ;; -- it causes renpy to load files twice for some weird reason --
1429 ;; and the latter is impossible on Guix. Hence the detour through
1430 ;; share/renpy and the custom renpy program.
1432 ;; As a convention, other games should be installed as
1433 ;; subdirectories of share/renpy in their respective outputs as
1434 ;; well. This differs from the traditional layout, which is
1435 ;; roughly the following:
1436 ;; `-- Super Awesome Game
1437 ;; |-- game ; <- the folder we actually want
1438 ;; |-- lib ; compiled renpy module and dependencies
1439 ;; |-- renpy ; yet another copy of Ren'py's code
1440 ;; | |-- common ; the common folder from above
1441 ;; | `-- ... ; Python code (source + compiled)
1442 ;; |-- Super Awesome Game.py
1443 ;; `-- Super Awesome Game.sh
1444 (let* ((out (assoc-ref outputs "out"))
1445 (bin/renpy (string-append out "/bin/renpy")))
1446 (mkdir-p (string-append out "/bin"))
1447 (copy-recursively "renpy/common"
1448 (string-append out "/share/renpy/common"))
1449 (copy-recursively "gui"
1450 (string-append out "/share/renpy/gui"))
1452 (call-with-output-file bin/renpy
1454 (format port "#!~a/bin/python2~%"
1455 (assoc-ref inputs "python2"))
1457 from __future__ import print_function
1463 def path_to_common(renpy_base):
1464 return renpy_base + \"/common\"
1466 def path_to_saves(gamedir, save_directory=None):
1467 import renpy # @UnresolvedImport
1469 if save_directory is None:
1470 save_directory = renpy.config.save_directory
1471 save_directory = renpy.exports.fsencode(save_directory)
1473 if not save_directory:
1474 return gamedir + \"/saves\"
1476 return os.path.expanduser(\"~~/.renpy/\" + save_directory)
1478 def path_to_renpy_base():
1482 renpy_base = path_to_renpy_base()
1484 import renpy.bootstrap
1485 import renpy.arguments
1487 print(\"\"\"Could not import renpy.bootstrap.
1488 Please ensure you decompressed Ren'Py correctly, preserving the directory
1489 structure.\"\"\", file=sys.stderr)
1492 args = renpy.arguments.bootstrap()
1493 if not args.basedir:
1494 print(\"\"\"This Ren'py requires a basedir to launch.
1495 The basedir is the directory, in which .rpy files live -- usually the 'game'
1496 subdirectory of a game packaged by Ren'py.
1498 If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
1502 renpy.bootstrap.bootstrap(renpy_base)
1504 if __name__ == \"__main__\":
1507 (string-append out "/share/renpy"))))
1508 (chmod bin/renpy #o755)
1511 (add-after 'install 'install-games
1512 (lambda* (#:key outputs #:allow-other-keys)
1513 (define renpy (assoc-ref outputs "out"))
1514 ;; TODO: We should offer a renpy-build-system to make the
1515 ;; installation of Ren'py games easier.
1516 (define* (install-renpy-game #:key output game name (renpy renpy)
1518 (let* ((name (or name (basename game)))
1519 (launcher (string-append output "/bin/renpy-" name))
1520 (share (string-append output "/share/renpy/" name)))
1521 (copy-recursively (string-append game "/game") share)
1522 (mkdir-p (string-append output "/bin"))
1523 (with-output-to-file launcher
1526 "#!~a~%~a ~a \"$@\""
1528 (string-append renpy "/bin/renpy")
1530 (chmod launcher #o755)))
1532 (install-renpy-game #:output (assoc-ref outputs "out")
1535 (install-renpy-game #:output (assoc-ref outputs "the-question")
1536 #:game "the_question"
1537 #:name "the-question")
1539 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1543 (lambda* (#:key inputs outputs #:allow-other-keys)
1544 (let ((out (assoc-ref outputs "out"))
1545 (site (string-append "/lib/python"
1547 (assoc-ref inputs "python"))
1549 (wrap-program (string-append out "/bin/renpy")
1550 `("GUIX_PYTHONPATH" =
1551 (,@(delete-duplicates
1553 (lambda (store-path)
1554 (string-append store-path site))
1555 (cons (assoc-ref outputs "out")
1559 (string-prefix? "python2" (car input)))
1563 `(("python2-renpy" ,python2-renpy)
1564 ("python2-tkinter" ,python-2 "tk")
1565 ("python2" ,python-2) ; for ‘fix-commands’ and ‘wrap’
1566 ("xdg-utils" ,xdg-utils)))
1567 (propagated-inputs '())
1569 (list xorg-server-for-tests))
1571 (list "out" "tutorial" "the-question"))
1572 (home-page "https://www.renpy.org/")
1573 (synopsis "Visual Novel Engine")
1574 (description "Ren'Py is a visual novel engine that helps you use words,
1575 images, and sounds to tell interactive stories that run on computers and
1576 mobile devices. These can be both visual novels and life simulation games.
1577 The easy to learn script language allows anyone to efficiently write large
1578 visual novels, while its Python scripting is enough for complex simulation
1580 (license license:expat)))
1582 (define-public python-pyxel
1584 (name "python-pyxel")
1591 (url "https://github.com/kitao/pyxel")
1592 (commit (string-append "v" version))))
1593 (file-name (git-file-name name version))
1596 "0bwsgb5yq5s479cnf046v379zsn5ybp5195kbfvzr9l11qbaicm9"))
1597 (modules '((guix build utils)))
1600 (delete-file-recursively "pyxel/core/bin")))))
1601 (build-system python-build-system)
1603 `(#:tests? #f ; "Tests" are actually example programs that never halt.
1605 (modify-phases %standard-phases
1606 (add-after 'unpack 'patch-build-files
1607 (lambda* (#:key inputs #:allow-other-keys)
1608 (substitute* "setup.py"
1609 (("\"pyxel\\.core\\.bin\\.(.*)\"," all arch)
1610 (if (string=? arch "linux")
1613 (substitute* "pyxel/core/Makefile"
1615 (string-append "`sdl2-config --prefix="
1616 (assoc-ref inputs "sdl2"))))))
1617 (add-before 'build 'prebuild
1619 (invoke "make" "-C" "pyxel/core"))))))
1621 `(("gifsicle" ,gifsicle)
1622 ("sdl2" ,(sdl-union (list sdl2 sdl2-image)))))
1623 (home-page "https://github.com/kitao/pyxel")
1624 (synopsis "Retro game engine for Python")
1625 (description "Pyxel is a game engine inspired by retro gaming consoles.
1626 It has a fixed 16-color palette, can hold up to 3 image banks and 8 tilemaps
1627 (256x256 pixels each) and 4 sound channels with 64 definable sounds. It
1628 also comes with a built-in image and sound editor.")
1629 (license license:expat)))
1631 (define-public grafx2
1637 ;; XXX: There is no URL that contains the version. :(
1638 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1639 (file-name (string-append "grafx2-" version ".tgz"))
1642 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1643 (build-system gnu-build-system)
1646 (modify-phases %standard-phases
1647 (delete 'configure) ; no configure script
1648 (add-before 'build 'change-to-src-directory
1653 ;; SDL header files are referenced without the preceeding "SDL/".
1654 (list (string-append "CFLAGS=-I"
1655 (assoc-ref %build-inputs "sdl-union")
1658 (string-append "prefix="
1659 (assoc-ref %outputs "out")))
1660 #:tests? #f)) ; no check target
1664 (list libpng lua-5.1
1665 (sdl-union (list sdl sdl-image sdl-ttf))))
1666 (synopsis "Bitmap paint program")
1667 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1668 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1669 includes a very large number of tools and effects that make it particularly
1670 suitable for pixel art, game graphics, and generally any detailed graphics
1671 painted with a mouse.")
1672 (home-page "http://pulkomandy.tk/projects/GrafX2")
1673 (license license:gpl2))) ; GPLv2 only
1683 (url "https://github.com/wgois/OIS")
1684 (commit (string-append "v" version))))
1685 (file-name (git-file-name name version))
1687 (base32 "0nkh0zrsbyv47c0i0vhdna3jsnvs69pb1svg75avxw6z7kwskgla"))))
1688 (build-system cmake-build-system)
1690 `(#:tests? #f)) ; no test suite
1693 (synopsis "Object Oriented Input System")
1695 "Cross Platform Object Oriented Input Lib System is a cross platform,
1696 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1697 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1698 robust and compatible with many systems and operating systems.")
1699 (home-page "https://github.com/wgois/OIS")
1700 (license license:zlib)))
1702 (define-public mygui
1710 (url "https://github.com/MyGUI/mygui")
1711 (commit (string-append "MyGUI" version))))
1712 (file-name (git-file-name name version))
1715 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
1716 (build-system cmake-build-system)
1718 '(#:tests? #f ; No test target
1720 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1721 (string-append "-DOGRE_INCLUDE_DIR="
1722 (assoc-ref %build-inputs "ogre")
1724 ;; Demos and tools are Windows-specific:
1725 ;; https://github.com/MyGUI/mygui/issues/24.
1726 "-DMYGUI_BUILD_DEMOS=FALSE"
1727 "-DMYGUI_BUILD_TOOLS=FALSE")))
1729 (list boost doxygen pkg-config))
1737 (synopsis "Fast, flexible and simple GUI")
1739 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1740 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1742 (home-page "http://mygui.info/")
1743 (license license:expat)))
1745 (define-public mygui-gl
1746 ;; Closure size is reduced by some 800 MiB.
1752 (substitute-keyword-arguments (package-arguments mygui)
1753 ((#:configure-flags _)
1754 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1755 ;; We can't reuse the flags because of the mention to Ogre.
1756 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1757 ;; Demos and tools are Windows-specific:
1758 ;; https://github.com/MyGUI/mygui/issues/24.
1759 "-DMYGUI_BUILD_DEMOS=FALSE"
1760 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1762 (modify-inputs (package-inputs mygui)
1764 (prepend mesa glu)))
1765 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1767 (define-public openmw
1775 (url "https://github.com/OpenMW/openmw")
1776 (commit (string-append "openmw-" version))))
1777 (file-name (git-file-name name version))
1780 "0rm32zsmxvr6b0jjihfj543skhicbw5kg6shjx312clhlm035w2x"))))
1781 (build-system cmake-build-system)
1783 `(#:tests? #f ; No test target
1785 (list "-DDESIRED_QT_VERSION=5")))
1787 (list boost doxygen pkg-config))
1789 `(("bullet" ,bullet)
1792 ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
1794 ("openscenegraph" ,openmw-openscenegraph)
1795 ("qtbase" ,qtbase-5)
1797 ("unshield" ,unshield)))
1798 (synopsis "Re-implementation of the RPG Morrowind engine")
1800 "OpenMW is a game engine which reimplements and extends the one that runs
1801 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1802 called OpenMW-CS which allows the user to edit or create their own original
1804 (home-page "https://openmw.org")
1805 (license license:gpl3)))
1807 (define-public godot
1814 (url "https://github.com/godotengine/godot")
1815 (commit (string-append version "-stable"))))
1816 (file-name (git-file-name name version))
1819 "0y542zla6msgxf31rd0349d9j3ya7f3njnwmmrh8lmzfgxx86qbx"))
1820 (modules '((guix build utils)
1825 ;; Keep only those bundled files we have not (yet) replaced
1826 ;; with Guix versions. Note that some of these may be
1827 ;; modified; see "thirdparty/README.md".
1828 (with-directory-excursion "thirdparty"
1829 (let* ((preserved-files
1854 (for-each delete-file-recursively
1855 (lset-difference string=?
1857 (cons* "." ".." preserved-files)))))
1859 (build-system scons-build-system)
1861 `(#:scons ,scons-python2
1862 #:scons-flags (list "platform=x11" "target=release_debug"
1863 ;; Avoid using many of the bundled libs.
1864 ;; Note: These options can be found in the SConstruct file.
1866 "builtin_freetype=no"
1868 "builtin_libmpdec=no"
1871 "builtin_libtheora=no"
1872 "builtin_libvorbis=no"
1874 "builtin_libwebp=no"
1875 "builtin_mbedtls=no"
1881 #:tests? #f ; There are no tests
1883 (modify-phases %standard-phases
1884 (add-after 'unpack 'scons-use-env
1886 ;; Scons does not use the environment variables by default,
1887 ;; but this substitution makes it do so.
1888 (substitute* "SConstruct"
1889 (("env_base = Environment\\(tools=custom_tools\\)")
1891 "env_base = Environment(tools=custom_tools)\n"
1892 "env_base = Environment(ENV=os.environ)")))
1894 ;; Build headless tools, used for packaging games without depending on X.
1895 (add-after 'build 'build-headless
1896 (lambda* (#:key scons-flags #:allow-other-keys)
1897 (apply invoke "scons"
1898 `(,(string-append "-j" (number->string (parallel-job-count)))
1899 "platform=server" ,@(delete "platform=x11" scons-flags)))))
1901 (lambda* (#:key inputs outputs #:allow-other-keys)
1902 (let* ((out (assoc-ref outputs "out"))
1903 (headless (assoc-ref outputs "headless"))
1904 (zenity (assoc-ref inputs "zenity")))
1905 ;; Strip build info from filenames.
1906 (with-directory-excursion "bin"
1909 (let ((dest (car (string-split (basename file) #\.))))
1910 (rename-file file dest)))
1911 (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
1912 (install-file "godot" (string-append out "/bin"))
1913 (install-file "godot_server" (string-append headless "/bin")))
1914 ;; Tell the editor where to find zenity for OS.alert().
1915 (wrap-program (string-append out "/bin/godot")
1916 `("PATH" ":" prefix (,(string-append zenity "/bin")))))
1918 (add-after 'install 'wrap
1919 (lambda* (#:key inputs outputs #:allow-other-keys)
1920 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
1921 ;; fix of the mesa package we wrap the pcb executable such that
1922 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
1923 ;; also append ld path for pulseaudio and alsa-lib
1924 (let* ((out (assoc-ref outputs "out"))
1925 (udev_path (string-append (assoc-ref inputs "udev") "/lib"))
1926 (pulseaudio_path (string-append (assoc-ref inputs "pulseaudio") "/lib"))
1927 (alas_lib_path (string-append (assoc-ref inputs "alsa-lib") "/lib")))
1928 (wrap-program (string-append out "/bin/godot")
1929 `("LD_LIBRARY_PATH" ":" prefix (,udev_path ,pulseaudio_path ,alas_lib_path))))
1931 (add-after 'install 'install-godot-desktop
1932 (lambda* (#:key outputs #:allow-other-keys)
1933 (let* ((out (assoc-ref outputs "out"))
1934 (applications (string-append out "/share/applications"))
1935 (icons (string-append out "/share/icons/hicolor")))
1936 (mkdir-p applications)
1937 (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
1938 (string-append applications "/godot.desktop"))
1939 (for-each (lambda (icon dest)
1940 (mkdir-p (dirname dest))
1941 (copy-file icon dest))
1942 '("icon.png" "icon.svg")
1943 `(,(string-append icons "/256x256/apps/godot.png")
1944 ,(string-append icons "/scalable/apps/godot.svg"))))
1946 (outputs '("out" "headless"))
1947 (native-inputs (list pkg-config))
1948 (inputs `(("alsa-lib" ,alsa-lib)
1950 ("freetype" ,freetype)
1953 ("libtheora" ,libtheora)
1954 ("libvorbis" ,libvorbis)
1956 ("libwebp" ,libwebp)
1958 ("libxcursor" ,libxcursor)
1960 ("libxinerama" ,libxinerama)
1961 ("libxrandr" ,libxrandr)
1962 ("mbedtls" ,mbedtls-apache)
1964 ("opusfile" ,opusfile)
1966 ("pulseaudio" ,pulseaudio)
1967 ("udev" ,eudev) ;FIXME: required by mesa
1970 ("zstd" ,zstd "lib")))
1971 (home-page "https://godotengine.org/")
1972 (synopsis "Advanced 2D and 3D game engine")
1974 "Godot is an advanced multi-platform game engine written in C++. If
1975 features design tools such as a visual editor, can import 3D models and
1976 provide high-quality 3D rendering, it contains an animation editor, and can be
1977 scripted in a Python-like language.")
1978 (license license:expat)))
1987 (url "https://github.com/skypjack/entt")
1988 (commit (string-append "v" version))))
1989 (file-name (git-file-name name version))
1992 "151jg3m262xwaywl2rqnc90yr6p48rhmgi5mxyv6bwqvmfli2m5p"))))
1993 (build-system cmake-build-system)
1995 `(#:configure-flags (list "-DENTT_BUILD_TESTING=ON"
1996 "-DENTT_FIND_GTEST_PACKAGE=ON"
1997 "-DENTT_BUILD_DOCS=ON")
1998 ;; Only tests are compiled, and they need assertions to work correctly.
1999 #:build-type "Debug"))
2001 (list ;; for testing
2003 ;; for documentation
2005 (synopsis "Entity component system")
2006 (description "EnTT is a header-only library, containing (among other things)
2008 @item an entity component system based on sparse sets,
2009 @item a configuration system using the monostate pattern,
2010 @item a static reflection system,
2011 @item and a cooperative scheduler.
2013 (home-page "https://github.com/skypjack/entt")
2014 (license (list license:expat ; code
2015 license:cc-by4.0)))) ; documentation
2017 (define-public eureka
2023 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
2025 ;; version without dots e.g 1.21 => 121
2026 (string-join (string-split version #\.) "")
2030 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
2031 (build-system gnu-build-system)
2035 (let ((out (assoc-ref %outputs "out")))
2036 (list (string-append "PREFIX=" out)))
2038 (modify-phases %standard-phases
2040 (add-before 'build 'prepare-install-directories
2041 (lambda* (#:key outputs #:allow-other-keys)
2042 (let ((out (assoc-ref outputs "out")))
2043 (mkdir-p (string-append out "/bin"))
2044 (mkdir-p (string-append out "/share"))
2046 (with-fluids ((%default-port-encoding #f))
2047 (substitute* "./src/main.cc"
2048 (("/usr/local") out)))
2050 (substitute* "Makefile"
2051 (("-o root") ""))))))))
2052 (inputs `(("mesa" ,mesa)
2054 ("libxinerama" ,libxinerama)
2055 ("libfontconfig" ,fontconfig)
2056 ("libjpeg" ,libjpeg-turbo)
2060 (native-inputs (list pkg-config xdg-utils))
2061 (synopsis "Doom map editor")
2062 (description "Eureka is a map editor for the classic DOOM games, and a few
2063 related games such as Heretic and Hexen. It comes with a 3d preview mode and
2065 (home-page "http://eureka-editor.sourceforge.net/")
2066 (license license:gpl2+)))
2068 (define-public guile-chickadee
2070 (name "guile-chickadee")
2074 (uri (string-append "https://files.dthompson.us/chickadee/"
2075 "chickadee-" version ".tar.gz"))
2078 "1k2dml2z57lnc36wrmwhh7avnpczxgxnshlfhpbk174vg6v609n0"))))
2079 (build-system gnu-build-system)
2081 '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
2083 `(("guile-opengl" ,guile3.0-opengl)
2084 ("guile-sdl2" ,guile-sdl2)))
2093 (list guile-3.0-latest pkg-config texinfo))
2094 (home-page "https://dthompson.us/projects/chickadee.html")
2095 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
2096 (description "Chickadee is a game development toolkit for Guile Scheme
2097 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
2098 that parenthetically inclined game developers need to make 2D (and eventually
2099 3D) games in Scheme, such as:
2102 @item extensible, fixed-timestep game loop
2103 @item OpenGL-based rendering engine
2104 @item keyboard, mouse, controller input
2105 @item REPL-driven development model
2107 (license license:gpl3+)))
2109 (define-public bennu-game-development
2111 (name "bennu-game-development")
2116 (url "http://svn.code.sf.net/p/bennugd/code")
2117 (revision (string->number version))))
2118 (file-name (string-append name "-" version))
2121 "1iri58ryk9lbqn585cbccnvrfkj8qxlbcsk8rpih40jhvs1j101l"))
2122 (modules '((guix build utils)))
2125 (delete-file-recursively "3rdparty") #t))))
2126 (build-system gnu-build-system)
2129 (modify-phases %standard-phases
2130 (add-after 'unpack 'patch-configure-to-use-openssl
2131 (lambda* (#:key outputs #:allow-other-keys)
2133 (delete-file "configure")
2134 (substitute* "configure.in"
2137 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
2138 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
2145 (inputs (list openssl zlib))
2146 (native-inputs (list pkg-config autoconf automake libtool))
2147 (synopsis "Programming language to create games")
2148 (description "Bennu Game Development, also known as bennudg, is a
2149 programming language tailored at game development. It is the successor of
2151 (home-page "https://sourceforge.net/projects/bennugd/")
2152 (license license:zlib)))
2154 (define-public bennu-game-development-modules
2156 (inherit bennu-game-development)
2157 (name "bennu-game-development-modules")
2160 (modify-phases %standard-phases
2161 (add-after 'unpack 'patch-conflicting-definitions
2163 (with-fluids ((%default-port-encoding #f))
2164 (substitute* "core/include/fmath.h"
2165 (("extern fixed fmul\\( int x, int y \\);") "")
2166 (("extern fixed fdiv\\( int x, int y \\);") "")))
2167 (chdir "modules"))))))
2168 (inputs (list zlib libpng openssl sdl-mixer bennu-game-development))
2169 (synopsis "Modules for the Bennu Game Development programming language")
2170 (description "This package contains a collection of modules for the Bennu
2171 Game Development programming language, from CD handling through SDL to
2172 joystick support.")))
2180 (uri (string-append "http://plib.sourceforge.net/dist/"
2181 "plib-" version ".tar.gz"))
2184 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
2185 (patches (search-patches "plib-CVE-2011-4620.patch"
2186 "plib-CVE-2012-4552.patch"))))
2187 (build-system gnu-build-system)
2189 (list mesa libxi libxmu))
2192 (home-page "http://plib.sourceforge.net/")
2193 (synopsis "Suite of portable game libraries")
2194 (description "PLIB is a set of libraries that will permit programmers to
2195 write games and other realtime interactive applications that are 100% portable
2196 across a wide range of hardware and operating systems. PLIB includes sound
2197 effects, music, a complete 3D engine, font rendering, a simple Windowing
2198 library, a game scripting language, a GUI, networking, 3D math library and a
2199 collection of handy utility functions. All are 100% portable across nearly
2200 all modern computing platforms. Each library component is fairly independent
2202 (license license:lgpl2.0+)))
2204 (define-public ioquake3
2205 ;; We follow master since it seems that there won't be releases after 1.3.6.
2206 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
2209 (version (git-version "1.3.6" "1" commit))
2214 (url "https://github.com/ioquake/ioq3")
2216 (file-name (git-file-name name version))
2219 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
2220 (build-system gnu-build-system)
2223 ("libjpeg" ,libjpeg-turbo)
2226 ("opusfile" ,opusfile)
2228 ("libvorbis" ,libvorbis)
2229 ("freetype" ,freetype)
2230 ("libogg" ,libogg)))
2232 (list which ; Else SDL_version.h won't be found.
2235 '(#:tests? #f ; No tests.
2236 #:make-flags '("CC=gcc"
2237 "USE_INTERNAL_LIBS=0"
2239 "USE_RENDERER_DLOPEN=0"
2240 "USE_OPENAL_DLOPEN=0"
2241 "USE_CURL_DLOPEN=0")
2243 (modify-phases %standard-phases
2246 (lambda* (#:key outputs #:allow-other-keys)
2247 (invoke "make" "copyfiles" "CC=gcc"
2248 "USE_INTERNAL_LIBS=0"
2249 (string-append "COPYDIR="
2250 (assoc-ref outputs "out")
2252 (home-page "https://ioquake3.org/")
2253 (synopsis "FPS game engine based on Quake 3")
2254 (description "ioquake3 is a free software first person shooter engine
2255 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
2256 the original, ioquake3 has been cleaned up, bugs have been fixed and features
2257 added. The permanent goal is to create the open source Quake 3 distribution
2258 upon which people base their games, ports to new platforms, and other
2260 (license license:gpl2))))
2262 (define-public instead
2266 (build-system cmake-build-system)
2271 (url "https://github.com/instead-hub/instead")
2273 (file-name (git-file-name name version))
2275 (base32 "02j8cw623j51qmr4991i5hsbrzmnp0qfzds8m6nwwr15sjv3hv1g"))
2278 "instead-use-games-path.patch"))
2279 (modules '((guix build utils)))
2282 (delete-file-recursively "src/zlib")))))
2285 (list (string-append
2286 "-DLUA_INCLUDE_DIR="
2287 (assoc-ref %build-inputs "luajit") "/include/luajit-2.1/")
2295 ("pkg-config" ,pkg-config)
2296 ("sdl2-images" ,sdl2-image)
2297 ("sdl2-ttf" ,sdl2-ttf)
2298 ("sdl2-mixer" ,sdl2-mixer)
2300 (home-page "https://instead3.syscall.ru/")
2301 (synopsis "Text adventure interpreter")
2302 (description "The STEAD (Simple TExt ADventures) interpreter provides
2303 functionality to play games that mix elements of visual novels, interactive
2304 fiction and classic point-and-click adventures.")
2305 (native-search-paths
2306 (list (search-path-specification
2307 (variable "INSTEAD_GAMES_PATH")
2308 (separator #f) ;single entry
2309 (files '("share/instead/games")))))
2310 (license license:expat)))
2312 (define-public openvr
2316 (home-page "https://github.com/ValveSoftware/openvr/")
2322 (commit (string-append "v" version))))
2323 (file-name (git-file-name name version))
2325 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
2326 (build-system cmake-build-system)
2330 #:configure-flags (list "-DBUILD_SHARED=1")))
2331 (synopsis "Virtual reality software development kit")
2332 (description "OpenVR is an API and runtime that allows access to VR
2333 hardware from multiple vendors without requiring that applications have
2334 specific knowledge of the hardware they are targeting.")
2335 (license license:bsd-3)))
2337 (define-public flatzebra
2344 (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
2345 "flatzebra-" version ".tar.gz"))
2347 (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
2348 (build-system gnu-build-system)
2351 (modify-phases %standard-phases
2352 (add-after 'unpack 'fix-sdl-config
2353 (lambda* (#:key inputs #:allow-other-keys)
2354 ;; XXX: sdl-config in sdl-union is a link to sdl-config from
2355 ;; plain sdl package. As a consequence, the prefix is wrong.
2356 ;; Force correct one with "--prefix" argument.
2357 (let ((sdl-union (assoc-ref inputs "sdl")))
2358 (setenv "SDL_CONFIG"
2359 (string-append sdl-union
2360 "/bin/sdl-config --prefix="
2366 `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
2367 (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
2368 (synopsis "Generic game engine for 2D double-buffering animation")
2370 "Flatzebra is a simple, generic C++ game engine library supporting 2D
2372 (license license:gpl2+)))
2377 (version "19.12.01")
2382 (url "https://github.com/FNA-XNA/FNA")
2384 (file-name (git-file-name name version))
2386 (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
2387 (build-system gnu-build-system)
2389 '(#:tests? #f ; No tests.
2391 (modify-phases %standard-phases
2392 (add-after 'unpack 'link-dep-src
2393 (lambda* (#:key inputs #:allow-other-keys)
2394 (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
2395 (mojoshader (assoc-ref inputs "mojoshader-src"))
2396 (faudio (assoc-ref inputs "faudio-src"))
2397 (theorafile (assoc-ref inputs "theorafile-src")))
2398 (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
2399 (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
2400 (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
2401 (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
2405 (invoke "make" "release")))
2407 (lambda* (#:key outputs #:allow-other-keys)
2408 (let ((out (assoc-ref outputs "out")))
2409 (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
2413 (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
2414 ("mojoshader-src" ,(package-source mojoshader-cs))
2415 ("faudio-src" ,(package-source faudio))
2416 ("theorafile-src" ,(package-source theorafile))))
2417 (home-page "https://fna-xna.github.io/")
2418 (synopsis "Accuracy-focused XNA4 reimplementation")
2419 (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
2420 focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
2421 (license (list license:ms-pl ; FNA
2422 license:lgpl2.1 ; LzxDecoder.cs
2426 (define-public libccd
2434 (url "https://github.com/danfis/libccd")
2435 (commit (string-append "v" version))))
2436 (file-name (git-file-name name version))
2438 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2439 (build-system cmake-build-system)
2441 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2442 "-DBUILD_TESTING=ON"
2443 "-DENABLE_DOUBLE_PRECISION=ON")))
2445 (list python-sphinx))
2446 (home-page "https://github.com/danfis/libccd")
2447 (synopsis "Library for collision detection between two convex shapes")
2448 (description "@code{libccd} is library for a collision detection
2449 between two convex shapes. @code{libccd} implements variation on
2450 Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2451 and also implements algorithm Minkowski Portal Refinement (MPR,
2452 a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2453 (license license:expat)))
2462 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2463 "ode-" version ".tar.gz"))
2465 (base32 "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj"))
2466 (modules '((guix build utils)))
2469 (delete-file-recursively "libccd")
2471 (build-system cmake-build-system)
2473 `(#:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
2475 (modify-phases %standard-phases
2476 (add-after 'unpack 'unbundle-libccd
2478 (substitute* "CMakeLists.txt"
2479 (("configure_file\\(libccd/.*") ""))
2482 (list glu libccd mesa))
2483 (home-page "https://www.ode.org/")
2484 (synopsis "High performance library for simulating rigid body dynamics")
2485 (description "ODE is a high performance library for simulating
2486 rigid body dynamics. It is fully featured, stable, mature and
2487 platform independent with an easy to use C/C++ API. It has advanced
2488 joint types and integrated collision detection with friction. ODE is
2489 useful for simulating vehicles, objects in virtual reality
2490 environments and virtual creatures. It is currently used in many
2491 computer games, 3D authoring tools and simulation tools.")
2492 ;; Software is dual-licensed.
2493 (license (list license:lgpl2.1+ license:expat))))
2495 (define-public chipmunk
2503 (url "https://github.com/slembcke/Chipmunk2D")
2504 (commit (string-append "Chipmunk-" version))))
2505 (file-name (git-file-name name version))
2507 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2508 (build-system cmake-build-system)
2510 `(#:tests? #f ;no test
2511 #:configure-flags '("-DBUILD_STATIC=OFF"
2512 "-DBUILD_DEMOS=OFF")))
2514 (list freeglut libxmu libxrandr))
2515 (home-page "https://chipmunk-physics.net/")
2516 (synopsis "Fast and lightweight 2D game physics library")
2517 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2518 rigid body physics library written in C.")
2519 (license license:expat)))
2521 (define-public box2d
2529 (url "https://github.com/erincatto/box2d")
2530 (commit (string-append "v" version))))
2531 (file-name (git-file-name name version))
2533 (base32 "1ja9cahf3z9zzrdaqcw44lpjmqf2ir2g4chwz0iwqwlkckwhpgvh"))
2534 (modules '((guix build utils)))
2537 ;; Bundled code only used for the testbed.
2538 (delete-file-recursively "extern")))))
2539 (build-system cmake-build-system)
2541 `(#:test-target "unit_test"
2542 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
2543 "-DBOX2D_BUILD_TESTBED=OFF")))
2546 (home-page "https://box2d.org/")
2547 (synopsis "2D physics engine for games")
2548 (description "Box2D is a 2D rigid body simulation library for games.
2549 Programmers can use it in their games to make objects move in realistic ways and
2550 make the game world more interactive. From the game engine's point of view, a
2551 physics engine is just a system for procedural animation.")
2552 (license license:expat)))
2554 (define-public libtcod
2561 (url "https://github.com/libtcod/libtcod")
2563 (file-name (git-file-name name version))
2566 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
2567 (modules '((guix build utils)))
2569 (delete-file-recursively "src/vendor/utf8proc")
2570 (delete-file-recursively "src/vendor/zlib")
2571 (delete-file "src/vendor/stb_truetype.h")
2572 (delete-file "src/vendor/stb_sprintf.h")
2573 (delete-file "src/vendor/lodepng.cpp")
2574 (delete-file "src/vendor/lodepng.h")
2576 (substitute* "buildsys/autotools/sources.am"
2577 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
2578 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
2579 "../../src/vendor/stb.c")
2580 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
2582 (substitute* "src/libtcod/sys_sdl_img_png.cpp"
2583 (("\\.\\./vendor/") ""))
2585 (substitute* '("src/libtcod/color/canvas.cpp"
2586 "src/libtcod/sys_sdl_img_png.cpp"
2587 "src/libtcod/tileset/truetype.cpp"
2588 "src/libtcod/tileset/tilesheet.cpp")
2589 (("\\.\\./\\.\\./vendor/") ""))
2591 (substitute* "src/libtcod/console/printing.cpp"
2592 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
2594 (build-system gnu-build-system)
2596 `(#:configure-flags '("--with-gnu-ld"
2597 "LIBS=-lutf8proc -llodepng")
2599 (modify-phases %standard-phases
2600 (add-after 'unpack 'change-to-build-dir
2602 (chdir "buildsys/autotools")
2603 (patch-shebang "get_version.py")
2614 (list lodepng sdl2 utf8proc zlib))
2615 (home-page "https://github.com/libtcod/libtcod")
2616 (synopsis "Library specifically designed for writing roguelikes")
2618 "libtcod is a fast, portable and uncomplicated API for roguelike
2619 developers providing an advanced true color console, input, and lots of other
2620 utilities frequently used in roguelikes.")
2621 (license license:bsd-3)))
2623 (define-public warsow-qfusion
2624 ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
2625 ;; The 2.5 beta as published on the homepage is commit
2626 ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
2627 (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
2629 (name "warsow-qfusion")
2630 (version (git-version "2.5" "1" commit)) ; 2.5-beta
2634 (url "https://github.com/Warsow/qfusion/")
2637 (file-name (git-file-name name version))
2640 "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
2641 ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
2642 (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
2643 (modules '((guix build utils)))
2645 (delete-file-recursively "platforms")
2646 (delete-file-recursively "debian")
2647 (delete-file-recursively "libsrcs")
2649 (build-system cmake-build-system)
2651 `(#:tests? #f ; No tests.
2652 #:configure-flags '("-DQFUSION_GAME=Warsow")
2655 (guix build cmake-build-system)
2658 (modify-phases %standard-phases
2659 (add-after 'unpack 'change-to-build-dir
2663 (add-after 'install 'really-install
2664 (lambda* (#:key outputs system #:allow-other-keys)
2665 (let ((arch (match system
2666 ("x86_64-linux" "x86_64")
2667 ("i686-linux" "i386")))
2668 (out (assoc-ref outputs "out")))
2669 (install-file (string-append "../source/build/basewsw/libgame_"
2671 (string-append out "/lib/"))
2672 (install-file (string-append "../source/build/libui_" arch ".so")
2673 (string-append out "/lib/"))
2676 (install-file file (string-append out "/bin/")))
2677 (append (find-files "../source/build" "warsow")
2678 (find-files "../source/build" "wsw_server."))))
2681 `(("alsa-lib" ,alsa-lib)
2683 ("freetype" ,freetype)
2685 ("libjpeg" ,libjpeg-turbo)
2688 ("libtheora" ,libtheora)
2689 ("libvorbis" ,libvorbis)
2692 ("pulseaudio" ,pulseaudio)
2693 ("qtbase" ,qtbase-5)
2694 ("qtdeclarative" ,qtdeclarative)
2696 ("uuid.h" ,util-linux "lib")
2700 (home-page "https://github.com/Warsow/qfusion")
2701 (supported-systems '("i686-linux" "x86_64-linux"))
2702 (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
2704 "This package contains the game engine of Warsow, a first-person
2705 shooter video game. The engine is based on qfusion, the id Tech 2 derived
2706 game engine. id Tech 2 is the engine originally behind Quake 2.")
2707 (license license:gpl2+))))
2709 (define-public dhewm3
2716 "https://github.com/dhewm/dhewm3/releases/download/"
2717 version "/dhewm3-" version "-src.tar.xz"))
2720 "0s2brx6wyljhjbpli97iy4lc4fqqsvdc09raz8njg0vgzcsiyrri"))))
2721 (build-system cmake-build-system)
2723 `(#:tests? #f ; No tests.
2725 (modify-phases %standard-phases
2726 (add-after 'unpack 'change-to-build-dir
2732 ("libjpeg" ,libjpeg-turbo)
2734 ("libvorbis" ,libvorbis)
2739 (home-page "https://dhewm3.org/")
2740 (synopsis "Port of the original Doom 3 engine")
2742 "@command{dhewm3} is a source port of the original Doom 3 engine (not
2743 Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
2744 version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
2745 sound effects on all operating systems and hardware (via OpenAL Softs EFX
2746 support), has much better support for widescreen resolutions and has 64bit
2748 (license license:gpl3)))
2750 (define-public tesseract-engine
2751 (let ((svn-revision 2411))
2753 (name "tesseract-engine")
2754 (version (string-append "20200615-" (number->string svn-revision)))
2759 (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
2760 (revision svn-revision)))
2761 (file-name (git-file-name name version))
2763 (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
2764 (modules '((guix build utils)))
2767 (for-each delete-file-recursively
2769 ;; Remove "media" since some files such as
2770 ;; media/sound/game/soundsnap/info.txt refer to a
2771 ;; non-commercial license.
2778 (build-system gnu-build-system)
2780 `(#:make-flags (list "CC=gcc")
2781 #:tests? #f ; No tests.
2783 (modify-phases %standard-phases
2785 (add-after 'unpack 'cd-src
2786 (lambda _ (chdir "src") #t))
2787 (add-before 'build 'fix-env
2788 (lambda* (#:key inputs #:allow-other-keys)
2791 (search-input-directory inputs "include/SDL2")
2792 ":" (or (getenv "CPATH") "")))))
2793 (add-after 'install 'really-install
2794 (lambda* (#:key outputs #:allow-other-keys)
2795 (let* ((out (assoc-ref outputs "out"))
2796 (share (string-append out "/share/tesseract"))
2797 (bin (string-append out "/bin/tesseract"))
2798 (client (string-append out "/bin/tesseract-client")))
2799 (chdir "..") ; Back to root.
2802 (mkdir-p (string-append share "/" dir))
2803 (copy-recursively dir (string-append share "/" dir)))
2805 (mkdir-p (string-append out "/bin/"))
2806 (copy-file "bin_unix/native_client" client)
2807 (copy-file "bin_unix/native_server"
2808 (string-append out "/bin/tesseract-server"))
2809 (call-with-output-file bin
2814 TESS_OPTIONS=\"-u$HOME/.tesseract\"
2816 exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
2821 (install-file "src/readme_tesseract.txt"
2822 (string-append out "/share/licenses/tesseract/LICENSE")))
2825 `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
2829 (home-page "http://tesseract.gg/")
2830 (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
2831 (description "This package contains the game engine of Tesseract, a
2832 first-person shooter focused on cooperative in-game map editing.
2834 The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
2835 upgraded modern rendering techniques. The new rendering features include
2836 fully dynamic omnidirectional shadows, global illumination, HDR lighting,
2837 deferred shading, morphological / temporal / multisample anti-aliasing, and
2839 (license license:zlib))))