gnu: emacs-scratch-el: Update source and homepage.
[jackhill/guix/guix.git] / gnu / packages / game-development.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Tomáš Čech <sleep_walker@suse.cz>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015, 2018 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
7 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2016, 2017, 2020 Kei Kebreau <kkebreau@posteo.net>
9 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2016, 2017, 2018 Julian Graham <joolean@gmail.com>
11 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
13 ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
14 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2018, 2022 Marius Bakke <marius@gnu.org>
17 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
18 ;;; Copyright © 2019, 2020, 2021 Liliana Marie Prikler <liliana.prikler@gmail.com>
19 ;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
20 ;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
21 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
22 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
23 ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
24 ;;; Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
25 ;;; Copyright © 2020-2021 James Smith <jsubuntuxp@disroot.org>
26 ;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
27 ;;; Copyright © 2021 Andy Tai <atai@atai.org>
28 ;;; Copyright © 2022 Felix Gruber <felgru@posteo.net>
29 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
30 ;;;
31 ;;; This file is part of GNU Guix.
32 ;;;
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
37 ;;;
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
42 ;;;
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
45
46 (define-module (gnu packages game-development)
47 #:use-module ((srfi srfi-1) #:hide (zip))
48 #:use-module (ice-9 match)
49 #:use-module ((guix licenses) #:prefix license:)
50 #:use-module (guix packages)
51 #:use-module (guix gexp)
52 #:use-module (guix download)
53 #:use-module (guix git-download)
54 #:use-module (guix svn-download)
55 #:use-module (guix utils)
56 #:use-module (guix build-system cmake)
57 #:use-module (guix build-system gnu)
58 #:use-module (guix build-system python)
59 #:use-module (guix build-system scons)
60 #:use-module (gnu packages)
61 #:use-module (gnu packages audio)
62 #:use-module (gnu packages autotools)
63 #:use-module (gnu packages base)
64 #:use-module (gnu packages bash)
65 #:use-module (gnu packages boost)
66 #:use-module (gnu packages build-tools)
67 #:use-module (gnu packages compression)
68 #:use-module (gnu packages check)
69 #:use-module (gnu packages curl)
70 #:use-module (gnu packages documentation)
71 #:use-module (gnu packages fltk)
72 #:use-module (gnu packages fonts)
73 #:use-module (gnu packages fontutils)
74 #:use-module (gnu packages freedesktop)
75 #:use-module (gnu packages fribidi)
76 #:use-module (gnu packages dbm)
77 #:use-module (gnu packages gettext)
78 #:use-module (gnu packages gl)
79 #:use-module (gnu packages glib)
80 #:use-module (gnu packages gnome)
81 #:use-module (gnu packages gnunet)
82 #:use-module (gnu packages graphics)
83 #:use-module (gnu packages graphviz)
84 #:use-module (gnu packages gtk)
85 #:use-module (gnu packages guile)
86 #:use-module (gnu packages image)
87 #:use-module (gnu packages linux)
88 #:use-module (gnu packages lua)
89 #:use-module (gnu packages m4)
90 #:use-module (gnu packages mp3)
91 #:use-module (gnu packages multiprecision)
92 #:use-module (gnu packages music)
93 #:use-module (gnu packages ncurses)
94 #:use-module (gnu packages pcre)
95 #:use-module (gnu packages pkg-config)
96 #:use-module (gnu packages pulseaudio)
97 #:use-module (gnu packages python)
98 #:use-module (gnu packages python-web)
99 #:use-module (gnu packages python-xyz)
100 #:use-module (gnu packages readline)
101 #:use-module (gnu packages qt)
102 #:use-module (gnu packages sdl)
103 #:use-module (gnu packages sphinx)
104 #:use-module (gnu packages stb)
105 #:use-module (gnu packages texinfo)
106 #:use-module (gnu packages textutils)
107 #:use-module (gnu packages tls)
108 #:use-module (gnu packages video)
109 #:use-module (gnu packages web)
110 #:use-module (gnu packages wxwidgets)
111 #:use-module (gnu packages xdisorg)
112 #:use-module (gnu packages xiph)
113 #:use-module (gnu packages xml)
114 #:use-module (gnu packages xorg))
115
116 (define-public bullet
117 (package
118 (name "bullet")
119 (version "3.17")
120 (source (origin
121 (method git-fetch)
122 (uri (git-reference
123 (url "https://github.com/bulletphysics/bullet3/")
124 (commit version)))
125 (file-name (git-file-name name version))
126 (sha256
127 (base32
128 "0x1ghxbkvqr910sp01sjf4hlfy4sdgn2jx2qf0dsi697bzq1f3mr"))
129 (modules '((guix build utils)))
130 (snippet
131 '(begin
132 (for-each delete-file (find-files "build3" "premake*"))
133 (with-directory-excursion "examples/ThirdPartyLibs"
134 (for-each delete-file-recursively
135 '("Gwen" "clsocket" "enet" "glad" "imgui"
136 "lua-5.2.3" "midi" "minizip" "openvr"
137 "optionalX11" "serial" "zlib")))
138
139 ;; Tests fail on linking, cannot find -lBussIK.
140 (substitute* "test/CMakeLists.txt"
141 ((" InverseDynamics")
142 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
143 ; (("SharedMemory") ""))
144 #t))))
145 (build-system cmake-build-system)
146 (arguments
147 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
148 "-DBUILD_CPU_DEMOS=OFF"
149 "-DBUILD_OPENGL3_DEMOS=OFF"
150 "-DBUILD_BULLET2_DEMOS=OFF"
151 ;; openmw 0.47.0 requires bullet to be built with
152 ;; double precision.
153 ;; See <https://issues.guix.gnu.org/52953> for
154 ;; more information.
155 "-DUSE_DOUBLE_PRECISION=ON"
156 ;; Extras/BulletRoboticsGUI needs files from
157 ;; ThirdPartyLibs
158 "-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF"
159 ;; Extras/BulletRobotics needs files from
160 ;; ThirdPartyLibs
161 "-DBUILD_BULLET_ROBOTICS_EXTRA=OFF"
162 (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
163 (or (getenv "CXXFLAGS") "")))
164 #:phases
165 (modify-phases %standard-phases
166 (add-after 'unpack 'remove-failing-tests
167 ;; These tests fail specifically after removing 3rd party code.
168 (lambda _
169 (substitute* "test/SharedMemory/CMakeLists.txt"
170 (("ADD_TEST") "# ADD_TEST"))
171 (substitute* "test/InverseDynamics/CMakeLists.txt"
172 (("ADD_TEST\\(Test_BulletInverseForward")
173 "# ADD_TEST(Test_BulletInverseForward"))
174 #t)))))
175 (inputs
176 (list glu libx11 mesa))
177 (home-page "https://pybullet.org/wordpress/")
178 (synopsis "3D physics engine library")
179 (description
180 "Bullet is a physics engine library usable for collision detection. It
181 is used in some video games and movies.")
182 (license license:zlib)))
183
184 (define-public deutex
185 (package
186 (name "deutex")
187 (version "5.2.2")
188 (source
189 (origin
190 (method url-fetch)
191 (uri (string-append "https://github.com/Doom-Utils/deutex"
192 "/releases/download/v" version "/"
193 "deutex-" version ".tar.zst"))
194 (sha256
195 (base32 "0psb2za6ldrlak7s8pjvli98ij5yiwjx8j1ms2v7rj9yadx0xv8h"))))
196 (build-system gnu-build-system)
197 (inputs
198 (list libpng))
199 (native-inputs
200 (list asciidoc pkg-config zstd))
201 (home-page "https://github.com/Doom-Utils/deutex")
202 (synopsis "WAD file composer for Doom and related games")
203 (description
204 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
205 used to extract the lumps of a wad and save them as individual files.
206 Conversely, it can also build a wad from separate files. When extracting a
207 lump to a file, it does not just copy the raw data, it converts it to an
208 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
209 Conversely, when it reads files for inclusion in pwads, it does the necessary
210 conversions (for example, from PPM to Doom picture format). In addition,
211 DeuTex has functions such as merging wads, etc.")
212 (license license:gpl2+)))
213
214 (define-public grfcodec
215 (package
216 (name "grfcodec")
217 (version "6.0.6")
218 (source
219 (origin
220 (method url-fetch)
221 (uri (string-append "https://binaries.openttd.org/extra/"
222 name "/" version "/" name "-" version
223 "-source.tar.xz"))
224 (patches (search-patches "grfcodec-gcc-compat.patch"))
225 (sha256
226 (base32 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
227 (build-system gnu-build-system)
228 (arguments
229 '(#:tests? #f ;no check target
230 #:phases
231 (modify-phases %standard-phases
232 (delete 'configure) ;no configure script
233 (replace 'install ;no install target
234 (lambda* (#:key outputs #:allow-other-keys)
235 (let* ((out (assoc-ref outputs "out"))
236 (bin (string-append out "/bin"))
237 (doc (string-append out "/share/doc"))
238 (man (string-append out "/share/man/man1")))
239 (for-each (lambda (file)
240 (install-file file bin))
241 '("grfcodec" "grfid" "grfstrip" "nforenum"))
242 (install-file "COPYING" doc)
243 (with-directory-excursion "docs"
244 (for-each (lambda (file)
245 (install-file (string-append file ".txt") doc))
246 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
247 "readme" "readme.rpn"))
248 (for-each (lambda (file)
249 (install-file file man))
250 (find-files "." "\\.1")))))))))
251 (inputs
252 (list boost libpng zlib))
253 (synopsis "GRF development tools")
254 (description
255 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
256 tools for developing (New)GRFs. It includes a number of smaller programs, each
257 with a specific task:
258 @enumerate
259 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
260 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
261 @item @code{grfstrip} strips all sprites from a GRF.
262 @item @code{nforenum} checks NFO code for errors, making corrections when
263 necessary.
264 @end enumerate")
265 (home-page "https://dev.openttdcoop.org/projects/grfcodec")
266 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
267 ;; NFORenum is under the GPL2+.
268 ;; The MD5 implementation contained in GRFID is under the zlib license.
269 (license (list license:gpl2 license:gpl2+ license:zlib))))
270
271 (define-public catcodec
272 (package
273 (name "catcodec")
274 (version "1.0.5")
275 (source
276 (origin
277 (method url-fetch)
278 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
279 version "/catcodec-" version "-source.tar.xz"))
280 (sha256
281 (base32 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
282 (build-system gnu-build-system)
283 (arguments
284 `(#:tests? #f ; no tests
285 #:make-flags (list (string-append "prefix=" %output))
286 #:phases (modify-phases %standard-phases
287 (delete 'configure))))
288 (home-page "https://dev.openttdcoop.org/projects/catcodec")
289 (synopsis "Encode/decode OpenTTD sounds")
290 (description "catcodec encodes and decodes sounds for OpenTTD. These
291 sounds are not much more than some metadata (description and filename) and raw
292 PCM data.")
293 (license license:gpl2)))
294
295 (define-public gzochi
296 (package
297 (name "gzochi")
298 (version "0.13")
299 (source (origin
300 (method url-fetch)
301 (uri (string-append "mirror://savannah/gzochi/gzochi-"
302 version ".tar.gz"))
303 (sha256
304 (base32
305 "1vcvf04qqzs3q8kaild2x7qvkwc6bwzfsisb78147b8z747j7hj0"))))
306 (build-system gnu-build-system)
307 (arguments
308 '(#:phases (modify-phases %standard-phases
309 (add-before 'build 'no-Werror
310 (lambda _
311 ;; Don't abort builds due to things like GLib
312 ;; deprecation warnings.
313 (substitute* (find-files "." "^Makefile\\.in$")
314 (("-Werror") ""))
315 #t)))))
316 (native-inputs `(("pkgconfig" ,pkg-config)))
317 (inputs (list bdb
318 glib
319 guile-3.0
320 libmicrohttpd
321 ncurses
322 sdl
323 zlib))
324 (home-page "https://www.nongnu.org/gzochi/")
325 (synopsis "Scalable middleware for multiplayer games")
326 (description
327 "gzochi is a framework for developing massively multiplayer online games.
328 A server container provides services to deployed games, which are written in
329 Guile Scheme, that abstract and simplify some of the most challenging and
330 error-prone aspects of online game development: Concurrency, data persistence,
331 and network communications. A very thin client library can be embedded to
332 provide connectivity for client applications written in any language.")
333 (license license:gpl3+)))
334
335 (define-public nml
336 (package
337 (name "nml")
338 (version "0.5.3")
339 (source
340 (origin
341 (method url-fetch)
342 (uri (pypi-uri "nml" version))
343 (sha256
344 (base32 "0l5pfs8q7jrl3xscqq7pnwh5h5d17fsyjy7xspkc73sa0ayjm9jx"))))
345 (build-system python-build-system)
346 ;; TODO: Fix test that fails with
347 ;; "AttributeError: partially initialized module 'nml.nmlop' has no
348 ;; attribute 'ADD' (most likely due to a circular import)"
349 (arguments
350 '(#:tests? #f))
351 (propagated-inputs
352 (list python-pillow python-ply))
353 (home-page "https://github.com/OpenTTD/nml")
354 (synopsis "NML compiler")
355 (description
356 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
357 compiling NML files (along with their associated language, sound and graphic
358 files) into @file{.grf} and/or @file{.nfo} files.")
359 (license license:gpl2+)))
360
361 (define-public python-sge
362 (package
363 (name "python-sge")
364 (version "2.0.post0")
365 (source
366 (origin
367 (method url-fetch)
368 (uri (pypi-uri "sge" version))
369 (sha256
370 (base32
371 "0s5d5qzlzfmqb10iyrqi62n36ll94d99xjaznp5ca6dz1b91qkvr"))))
372 (build-system python-build-system)
373 (propagated-inputs
374 (list python-pygame python-uniseg))
375 (home-page "https://python-sge.github.io/")
376 (synopsis "2D game engine for Python")
377 (description
378 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
379 general-purpose 2D game engine. It takes care of several details for you so
380 you can focus on the game itself. This makes more rapid game development
381 possible, and it also makes the SGE easy to learn.")
382 (license license:lgpl3+)))
383
384 (define-public python-tmx
385 (package
386 (name "python-tmx")
387 (version "1.10")
388 (source
389 (origin
390 (method url-fetch)
391 (uri (string-append "mirror://savannah/python-tmx/"
392 (version-major+minor version) "/tmx-"
393 version ".tar.gz"))
394 (sha256
395 (base32
396 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
397 (build-system python-build-system)
398 (propagated-inputs
399 (list python-six))
400 (home-page "http://python-tmx.nongnu.org")
401 (synopsis "Python library for the @code{Tiled} TMX format")
402 (description
403 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
404 This is useful for map editors or generic level editors, and it's also useful
405 for using a map editor or generic level editor like Tiled to edit your game's
406 levels.")
407 (license (list license:asl2.0
408 ;; Documentation (only available in the source tarball) is
409 ;; under the CC0 license.
410 license:cc0))))
411
412 (define-public python-xsge
413 (package
414 (name "python-xsge")
415 (version "2020.09.07")
416 (source (origin
417 (method url-fetch)
418 (uri (string-append "https://github.com/python-sge/xsge"
419 "/releases/download/v" version
420 "/xsge-" version ".zip"))
421 (sha256
422 (base32
423 "136xgy3f9vw636wxpqbha022avk0wyxw63mm3a2dvwhh90s716f9"))))
424 (build-system python-build-system)
425 (arguments
426 '(#:phases
427 (modify-phases %standard-phases
428 ;; xSGE's setup.py script does not support one of the Python build
429 ;; system's default flags, "--single-version-externally-managed".
430 (replace 'install
431 (lambda* (#:key outputs #:allow-other-keys)
432 (invoke "python" "setup.py" "install"
433 (string-append "--prefix=" (assoc-ref outputs "out"))
434 "--root=/"))))
435 #:tests? #f)) ; no check target
436 (native-inputs
437 (list unzip))
438 (propagated-inputs
439 (list python-sge))
440 (home-page "https://python-sge.github.io/")
441 (synopsis "Extensions for the SGE Game Engine")
442 (description
443 "xSGE is a collection of modules that make doing certain tasks with the SGE
444 Game Engine easier. In addition to SGE's conveniences, the user has access to a
445 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
446 support.")
447 (license license:gpl3+)))
448
449 (define-public slade
450 (package
451 (name "slade")
452 (version "3.1.13")
453 (source
454 (origin
455 (method git-fetch)
456 (uri (git-reference
457 (url "https://github.com/sirjuddington/SLADE")
458 (commit version)))
459 (sha256 (base32 "009yc5m6y074wfalvwbrnv2zsmaf9yhbi8hzgs973di0zqnqv011"))
460 (file-name (git-file-name name version))))
461 (build-system cmake-build-system)
462 (arguments
463 '(#:configure-flags
464 (list "-DWX_GTK3=ON" "-DNO_WEBVIEW=ON"
465 (string-append "-DWITH_WXPATH="
466 (assoc-ref %build-inputs "wxwidgets") "/bin")
467 (string-append "-DwxWidgets_LIBRARIES="
468 (assoc-ref %build-inputs "wxwidgets") "/lib"))
469 #:phases
470 (modify-phases %standard-phases
471 (add-before 'build 'reset-slade.pk3-timestamps
472 ;; This is neccessary to make slade reproducible due to
473 ;; <https://bugs.gnu.org/44741>. TODO: Remove on next core update
474 ;; cycle.
475 (lambda _
476 (invoke "find" "../source/dist/res" "-exec" "touch"
477 "--no-dereference" "-t" "197001010000.00" "{}"
478 "+")))
479 (add-after 'install 'wrap-with-x11-gdk-backend
480 ;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
481 ;; See https://github.com/sirjuddington/SLADE/issues/1097 for details.
482 (lambda* (#:key outputs #:allow-other-keys)
483 (wrap-program
484 (string-append (assoc-ref outputs "out")
485 "/bin/slade")
486 '("GDK_BACKEND" = ("x11"))))))
487 #:tests? #f)) ;; No test suite.
488 (inputs
489 `(("bash" ,bash-minimal)
490 ("curl" ,curl)
491 ("fluidsynth" ,fluidsynth)
492 ("freeimage" ,freeimage)
493 ("ftgl" ,ftgl)
494 ("glew" ,glew)
495 ("gtk+" ,gtk+)
496 ("sfml" ,sfml)
497 ("wxwidgets" ,wxwidgets-3.1)))
498 (native-inputs
499 (list pkg-config which zip))
500 (home-page "https://slade.mancubus.net")
501 (synopsis "Doom game data editor")
502 (description "SLADE3 is a modern editor for Doom-engine based games and
503 source ports. It has the ability to view, modify, and write many different game-
504 specific formats, and even convert between some of them, or from/to other generic
505 formats such as PNG.")
506 (license license:gpl2+)))
507
508 (define-public tiled
509 (package
510 (name "tiled")
511 (version "1.8.6")
512 (source (origin
513 (method git-fetch)
514 (uri (git-reference
515 (url "https://github.com/mapeditor/tiled")
516 (commit (string-append "v" version))))
517 (file-name (git-file-name name version))
518 (sha256
519 (base32
520 "0iimfj4kbhmjk94586fqz11bk4i7v0zsxby8agx7450cqlh2y3zi"))))
521 (build-system gnu-build-system)
522 (inputs
523 (list qtbase-5 qtdeclarative-5 qtsvg-5 zlib))
524 (native-inputs
525 (list qttools-5))
526 (arguments
527 '(#:phases
528 (modify-phases %standard-phases
529 (replace 'configure
530 (lambda* (#:key inputs outputs #:allow-other-keys)
531 (substitute* "translations/translations.pro"
532 (("LRELEASE =.*")
533 (string-append "LRELEASE = "
534 (search-input-file inputs "/bin/lrelease")
535 "\n")))
536 (let ((out (assoc-ref outputs "out")))
537 (invoke "qmake"
538 (string-append "PREFIX=" out))))))))
539 (home-page "https://www.mapeditor.org/")
540 (synopsis "Tile map editor")
541 (description
542 "Tiled is a general purpose tile map editor. It is meant to be used for
543 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
544 clone.")
545
546 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
547 ;; under BSD-2.
548 (license license:gpl2+)))
549
550 (define-public tsukundere
551 (package
552 (name "tsukundere")
553 (version "0.4.1")
554 (source (origin
555 (method git-fetch)
556 (uri (git-reference
557 (url "https://gitlab.com/lilyp/tsukundere")
558 (commit version)))
559 (file-name (git-file-name name version))
560 (sha256
561 (base32
562 "11glghnff27rqh2s34g51afg93g3f5ryfz9mkyb7qj35ngl8vw5f"))))
563 (build-system gnu-build-system)
564 (arguments
565 `(#:modules ((ice-9 match)
566 (srfi srfi-1)
567 ((guix build guile-build-system)
568 #:select (target-guile-effective-version))
569 ,@%gnu-build-system-modules)
570 #:imported-modules ((guix build guile-build-system)
571 ,@%gnu-build-system-modules)
572 #:phases
573 (modify-phases %standard-phases
574 (add-after 'unpack 'patch-command
575 (lambda* (#:key inputs outputs #:allow-other-keys)
576 (let* ((scm (lambda (in)
577 (string-append in "/share/guile/site/"
578 (target-guile-effective-version))))
579 (ccache (lambda (in)
580 (string-append in "/lib/guile/"
581 (target-guile-effective-version)
582 "/site-ccache")))
583 (pkgs
584 (cons
585 (assoc-ref outputs "out")
586 (filter-map
587 (match-lambda
588 (("guile" . pkg) pkg)
589 ((label . pkg)
590 (and (string-prefix? "guile-" label) pkg)))
591 inputs))))
592 (substitute* "tsukundere.scm"
593 (("exec guile (.*)" _ args)
594 (string-append
595 ;; XXX: Prevent Guile-SDL2 from blowing up by not knowing
596 ;; where the SDL2 libaries are.
597 "unset LD_LIBRARY_PATH\n"
598 (format #f "export GUILE_LOAD_PATH=\"~@?\"~%"
599 "~{~a~^:~}" (map scm pkgs))
600 (format #f "export GUILE_LOAD_COMPILED_PATH=\"~@?\"~%"
601 "~{~a~^:~}" (map ccache pkgs))
602 "exec "
603 (assoc-ref inputs "guile")
604 "/bin/guile " args)))
605 #t))))))
606 (native-inputs
607 `(("autoconf" ,autoconf)
608 ("automake" ,automake)
609 ("gettext" ,gettext-minimal)
610 ("guile" ,guile-3.0)
611 ("libtool" ,libtool)
612 ("pkg-config" ,pkg-config)
613 ("texinfo" ,texinfo)))
614 (inputs
615 `(("guile-sdl2" ,guile3.0-sdl2)
616 ("guile" ,guile-3.0)
617 ("pango" ,pango)
618 ("sdl2" ,sdl2)))
619 (home-page "https://gitlab.com/lilyp/tsukundere")
620 (synopsis "Visual novel engine")
621 (description "Tsukundere is a game engine geared heavily towards the
622 development of visual novels, written on top of Guile-SDL2. It is still
623 experimental.")
624 (license license:lgpl3+)))
625
626 (define-public sfml
627 (package
628 (name "sfml")
629 (version "2.5.1")
630 (source (origin
631 (method git-fetch)
632 ;; Do not fetch the archives from
633 ;; http://mirror0.sfml-dev.org/files/ because files there seem
634 ;; to be changed in place.
635 (uri (git-reference
636 (url "https://github.com/SFML/SFML")
637 (commit version)))
638 (file-name (git-file-name name version))
639 (sha256
640 (base32
641 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
642 (modules '((guix build utils)))
643 (snippet
644 '(begin
645 ;; Ensure system libraries are used.
646 (delete-file-recursively "extlibs")
647 #t))))
648 (build-system cmake-build-system)
649 (arguments
650 '(#:configure-flags
651 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
652 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
653 #:tests? #f)) ; no tests
654 (native-inputs
655 (list pkg-config))
656 (inputs
657 `(("mesa" ,mesa)
658 ("glew" ,glew)
659 ("libx11" ,libx11)
660 ("xcb-util-image" ,xcb-util-image)
661 ("libxrandr" ,libxrandr)
662 ("eudev" ,eudev)
663 ("libjpeg" ,libjpeg-turbo)
664 ("libsndfile" ,libsndfile)
665 ("stb-image" ,stb-image)
666 ("stb-image-write" ,stb-image-write)))
667 (propagated-inputs
668 ;; In Requires.private of pkg-config files.
669 (list flac freetype libvorbis openal))
670 (home-page "https://www.sfml-dev.org")
671 (synopsis "Simple and Fast Multimedia Library")
672 (description
673 "SFML provides a simple interface to the various computer components,
674 to ease the development of games and multimedia applications. It is composed
675 of five modules: system, window, graphics, audio and network.")
676 (license license:zlib)))
677
678 (define-public sfxr
679 (package
680 (name "sfxr")
681 (version "1.2.1")
682 (source (origin
683 (method url-fetch)
684 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
685 (sha256
686 (base32
687 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
688 (build-system gnu-build-system)
689 (arguments
690 `(#:phases (modify-phases %standard-phases
691 (delete 'configure) ; no configure script
692 (add-before 'build 'patch-makefile
693 (lambda* (#:key outputs #:allow-other-keys)
694 (let ((out (assoc-ref outputs "out")))
695 (substitute* "Makefile"
696 (("\\$\\(DESTDIR\\)/usr") out))
697 (substitute* "main.cpp"
698 (("/usr/share")
699 (string-append out "/share")))
700 #t))))
701 #:tests? #f)) ; no tests
702 (native-inputs
703 (list pkg-config desktop-file-utils))
704 (inputs
705 (list sdl gtk+))
706 (synopsis "Simple sound effect generator")
707 (description "Sfxr is a tool for quickly generating simple sound effects.
708 Originally created for use in video game prototypes, it can generate random
709 sounds from presets such as \"explosion\" or \"powerup\".")
710 (home-page "http://www.drpetter.se/project_sfxr.html")
711 (license license:expat)))
712
713 (define-public surgescript
714 (package
715 (name "surgescript")
716 (version "0.5.5")
717 (source
718 (origin
719 (method git-fetch)
720 (uri (git-reference
721 (url "https://github.com/alemart/surgescript")
722 (commit (string-append "v" version))))
723 (file-name (git-file-name name version))
724 (sha256
725 (base32 "0xwd4g7n0b0rxkpbyshkzyl472h1y606ghyvf8gv034n3jz2g4jk"))))
726 (build-system cmake-build-system)
727 (arguments
728 '(#:configure-flags
729 (let ((share (string-append (assoc-ref %outputs "out") "/share")))
730 (list "-DWANT_STATIC=NO"
731 (string-append "-DICON_PATH=" share "/pixmaps")
732 (string-append "-DMETAINFO_PATH=" share "/metainfo")))
733 #:tests? #f))
734 (home-page "https://docs.opensurge2d.org")
735 (synopsis "Scripting language for games")
736 (description "@code{SurgeScript} is a dynamically typed object-oriented
737 scripting language designed for games. Each object is a state machine that
738 can be customized by attaching other objects. The language supports automatic
739 garbage collection and can be extended with plugins.")
740 (license license:asl2.0)))
741
742 (define-public physfs
743 (package
744 (name "physfs")
745 (version "3.0.2")
746 (source (origin
747 (method url-fetch)
748 (uri (string-append
749 "https://icculus.org/physfs/downloads/physfs-"
750 version ".tar.bz2"))
751 (file-name (string-append name "-" version ".tar.gz"))
752 (sha256
753 (base32
754 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
755 (build-system cmake-build-system)
756 (arguments
757 '(#:tests? #f ; no check target
758 #:configure-flags '("-DPHYSFS_BUILD_STATIC=OFF")
759 #:phases (modify-phases %standard-phases
760 (add-after 'unpack 'patch-CMakeLists.txt
761 (lambda _
762 (substitute* "CMakeLists.txt"
763 ;; XXX: For some reason CMakeLists.txt disables
764 ;; RUNPATH manipulation when the compiler is GCC.
765 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
766 #t)))))
767 (inputs
768 (list zlib))
769 (native-inputs
770 (list doxygen))
771 (home-page "https://icculus.org/physfs")
772 (synopsis "File system abstraction library")
773 (description
774 "PhysicsFS is a library to provide abstract access to various archives.
775 It is intended for use in video games. For security, no file writing done
776 through the PhysicsFS API can leave a defined @emph{write directory}. For
777 file reading, a @emph{search path} with archives and directories is defined,
778 and it becomes a single, transparent hierarchical file system. So archive
779 files can be accessed in the same way as you access files directly on a disk,
780 and it makes it easy to ship a new archive that will override a previous
781 archive on a per-file basis.")
782 (license license:zlib)))
783
784 (define-public love
785 (package
786 (name "love")
787 (version "11.4")
788 (source
789 (origin
790 (method url-fetch)
791 (uri (string-append "https://github.com/love2d/love/releases/download/"
792 version "/love-" version "-linux-src.tar.gz"))
793 (sha256
794 (base32 "0sak3zjpzfs3ys315m8qvszi946fz76jcpsb58j11wplyp5fwbz3"))))
795 (build-system gnu-build-system)
796 (native-inputs
797 (list pkg-config))
798 (inputs
799 (list devil
800 freetype
801 libmodplug
802 libtheora
803 libvorbis
804 luajit
805 mesa
806 mpg123
807 openal
808 sdl2
809 zlib))
810 (synopsis "2D game framework for Lua")
811 (description "LÖVE is a framework for making 2D games in the Lua
812 programming language.")
813 (home-page "https://love2d.org/")
814 (license license:zlib)))
815
816 (define-public love-nuklear
817 (package
818 (name "love-nuklear")
819 (version "2.6.1")
820 (source (origin
821 (method git-fetch)
822 (uri (git-reference
823 (url "https://github.com/keharriso/love-nuklear/")
824 (commit (string-append "v" version))
825 (recursive? #t)))
826 ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
827 ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
828 (file-name (git-file-name name version))
829 (sha256
830 (base32
831 "090xp5c975155hd1pa7bdssdlawvygs5s6icdkwbyc8il5kg5kgv"))))
832 (build-system cmake-build-system)
833 (arguments
834 `(#:build-type "Release"
835 #:tests? #f
836 #:phases
837 (modify-phases %standard-phases
838 (add-after 'unpack 'patch-cmake
839 (lambda _
840 (substitute* "CMakeLists.txt"
841 (("DESTINATION .") "DESTINATION lib/love")))))))
842 (inputs
843 (list luajit))
844 (synopsis "Lightweight immediate mode GUI for LÖVE games")
845 (description "LÖVE is a Lua framework for making 2D games. Nuklear
846 is a minimal state immediate mode graphical user interface toolkit. This
847 package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
848 (home-page "https://github.com/keharriso/love-nuklear/")
849 (license license:expat)))
850
851 (define-public allegro-4
852 (package
853 (name "allegro")
854 (version "4.4.3.1")
855 (source (origin
856 (method url-fetch)
857 (uri (string-append "https://github.com/liballeg/allegro5/"
858 "releases/download/" version "/allegro-"
859 version ".tar.gz"))
860 (sha256
861 (base32
862 "1m6lz35nk07dli26kkwz3wa50jsrxs1kb6w1nj14a911l34xn6gc"))))
863 (build-system cmake-build-system)
864 (arguments
865 '(#:phases
866 (modify-phases %standard-phases
867 (add-after 'unpack 'patch-build-system
868 (lambda _
869 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
870 ;; via a command line option doesn't work because it is
871 ;; unconditionally clobbered in the build script.
872 (substitute* '("CMakeLists.txt")
873 (("ADDON_LINKAGE STATIC")
874 "ADDON_LINKAGE SHARED")))))))
875 (inputs
876 (list glu libpng libvorbis mesa zlib))
877 (synopsis "Game programming library")
878 (description "Allegro is a library mainly aimed at video game and
879 multimedia programming. It handles common, low-level tasks such as creating
880 windows, accepting user input, loading data, drawing images, playing sounds,
881 etc.")
882 (home-page "https://liballeg.org")
883 (license license:giftware)))
884
885 (define-public allegro
886 (package
887 (name "allegro")
888 (version "5.2.7.0")
889 (source (origin
890 (method url-fetch)
891 (uri (string-append "https://github.com/liballeg/allegro5/releases"
892 "/download/" version "/allegro-"
893 version ".tar.gz"))
894 (sha256
895 (base32
896 "034pmbmbq6jagpp4lhnyjqmf8gcz5fx74d9rknrm7d4wv4cv7qy1"))))
897 (build-system cmake-build-system)
898 (arguments `(#:tests? #f)) ; there are no tests
899 (inputs
900 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
901 `(("flac" ,flac)
902 ("freetype" ,freetype)
903 ("glu" ,glu)
904 ("gtk" ,gtk+)
905 ("libjpeg" ,libjpeg-turbo)
906 ("libpng" ,libpng)
907 ("libtheora" ,libtheora)
908 ("libvorbis" ,libvorbis)
909 ("libxcursor" ,libxcursor)
910 ("libxinerama" ,libxinerama)
911 ("libxrandr" ,libxrandr)
912 ("mesa" ,mesa)
913 ("openal" ,openal)
914 ("physfs" ,physfs)
915 ("zlib" ,zlib)))
916 (native-inputs
917 (list pkg-config))
918 (synopsis "Game programming library")
919 (description "Allegro is a library mainly aimed at video game and
920 multimedia programming. It handles common, low-level tasks such as creating
921 windows, accepting user input, loading data, drawing images, playing sounds,
922 etc.")
923 (home-page "https://liballeg.org")
924 (license license:bsd-3)))
925
926 (define-public allegro-5.0
927 (package (inherit allegro)
928 (name "allegro")
929 (version "5.0.11")
930 (source (origin
931 (method url-fetch)
932 (uri (string-append "https://github.com/liballeg/allegro5/releases"
933 "/download/" version "/allegro-"
934 (if (equal? "0" (string-take-right version 1))
935 (string-drop-right version 2)
936 version)
937 ".tar.gz"))
938 (patches (search-patches
939 "allegro-mesa-18.2.5-and-later.patch"))
940 (sha256
941 (base32
942 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
943
944 (define-public aseprite
945 (package
946 (name "aseprite")
947 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
948 ;; TODO: Unbundle third party software.
949 (source (origin
950 (method url-fetch/zipbomb)
951 (uri (string-append "https://github.com/aseprite/aseprite"
952 "/releases/download/v" version
953 "/Aseprite-v" version "-Source.zip"))
954 (sha256
955 (base32
956 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
957 (build-system cmake-build-system)
958 (arguments
959 '(#:configure-flags
960 ;; Use shared libraries instead of building bundled source.
961 (list "-DWITH_WEBP_SUPPORT=1"
962 "-DUSE_SHARED_CURL=1"
963 "-DUSE_SHARED_GIFLIB=1"
964 "-DUSE_SHARED_JPEGLIB=1"
965 "-DUSE_SHARED_ZLIB=1"
966 "-DUSE_SHARED_LIBPNG=1"
967 "-DUSE_SHARED_LIBLOADPNG=1"
968 "-DUSE_SHARED_LIBWEBP=1"
969 "-DUSE_SHARED_TINYXML=1"
970 "-DUSE_SHARED_PIXMAN=1"
971 "-DUSE_SHARED_FREETYPE=1"
972 "-DUSE_SHARED_ALLEGRO4=1"
973 "-DENABLE_UPDATER=0" ; no auto-updates
974 (string-append "-DFREETYPE_INCLUDE_DIR="
975 (assoc-ref %build-inputs "freetype")
976 "/include/freetype2"))))
977 (native-inputs
978 (list pkg-config))
979 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
980 ;; patched version is bundled with Aseprite, but the patches should be
981 ;; extracted and applied on top of a standalone Allegro 4 package.
982 (inputs
983 `(("allegro" ,allegro-4)
984 ("curl" ,curl)
985 ("freetype" ,freetype)
986 ("giflib" ,giflib)
987 ("libjpeg" ,libjpeg-turbo)
988 ("libpng" ,libpng)
989 ("libwebp" ,libwebp)
990 ("libx11" ,libx11)
991 ("libxext" ,libxext)
992 ("libxxf86vm" ,libxxf86vm)
993 ("pixman" ,pixman)
994 ("tinyxml" ,tinyxml)
995 ("zlib" ,zlib)))
996 (synopsis "Animated sprite editor and pixel art tool")
997 (description "Aseprite is a tool for creating 2D pixel art for video
998 games. In addition to basic pixel editing features, Aseprite can assist in
999 the creation of animations, tiled graphics, texture atlases, and more.")
1000 (home-page "https://www.aseprite.org/")
1001 (license license:gpl2+)))
1002
1003 (define-public libresprite
1004 (package
1005 (name "libresprite")
1006 (version "1.0")
1007 ;; TODO: Unbundle third party software.
1008 ;; - duktape is bundled inside the project but it's hard to unbundle:
1009 ;; there are many differences from a version to the next and it is not
1010 ;; really designed to work as a shared lib.
1011 (source (origin
1012 (method git-fetch)
1013 (uri (git-reference
1014 (url "https://github.com/LibreSprite/LibreSprite")
1015 (commit (string-append "v" version))
1016 (recursive? #t)))
1017 (file-name (git-file-name name version))
1018 (sha256
1019 (base32
1020 "0djbjjh21ahlxzh0b0jp4mpfycam8h9157i4wbxkd618fraadhbp"))))
1021 (build-system cmake-build-system)
1022 (arguments
1023 '(#:configure-flags
1024 (list "-DWITH_WEBP_SUPPORT=1")
1025 ;; Tests are unmaintained
1026 #:tests? #f))
1027 (native-inputs
1028 `(("pkg-config" ,pkg-config)))
1029 (inputs
1030 `(("curl" ,curl)
1031 ("freetype" ,freetype)
1032 ("giflib" ,giflib)
1033 ("googletest" ,googletest)
1034 ("libjpeg" ,libjpeg-turbo)
1035 ("libpng" ,libpng)
1036 ("libwebp" ,libwebp)
1037 ("libx11" ,libx11)
1038 ("libxext" ,libxext)
1039 ("libxxf86dga" ,libxxf86dga)
1040 ("libxxf86vm" ,libxxf86vm)
1041 ("lua" ,lua) ; Optional
1042 ("pixman" ,pixman)
1043 ("sdl2" ,sdl2)
1044 ("sdl2-image" ,sdl2-image)
1045 ("tinyxml" ,tinyxml)
1046 ("zlib" ,zlib)))
1047 (synopsis "Animated sprite editor and pixel art tool")
1048 (description "LibreSprite is a tool for creating 2D pixel art for video
1049 games. In addition to basic pixel editing features, it can assist in the
1050 creation of animations, tiled graphics, texture atlases, and more.
1051 LibreSprite is a fork of the latest GPLv2 commit of Aseprite.")
1052 (home-page "https://libresprite.github.io/")
1053 (license license:gpl2+)))
1054
1055 (define-public qqwing
1056 (package
1057 (name "qqwing")
1058 (version "1.3.4")
1059 (source (origin
1060 (method url-fetch)
1061 (uri (string-append
1062 "https://qqwing.com/"
1063 name "-" version ".tar.gz"))
1064 (sha256
1065 (base32
1066 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
1067 (build-system gnu-build-system)
1068 (native-inputs
1069 (list pkg-config))
1070 (home-page "https://qqwing.com/")
1071 (synopsis "Sudoku puzzle solver and generator")
1072 (description
1073 "QQWing is a Sudoku puzzle generator and solver.
1074 It offers the following features:
1075 @enumerate
1076 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
1077 @item Uses logic. Uses as many solve techniques as possible when solving
1078 puzzles rather than guessing.
1079 @item Rates puzzles. Most generators don't give an indication of the difficulty
1080 of a Sudoku puzzle. QQwing does.
1081 @item Can print solve instructions for any puzzle.
1082 @item Customizable output style, including a CSV style that is easy to
1083 import into a database.
1084 @end enumerate")
1085 (license license:gpl2+)))
1086
1087 (define-public quesoglc
1088 (package
1089 (name "quesoglc")
1090 (version "0.7.2")
1091 (source (origin
1092 (method url-fetch)
1093 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1094 name "-" version "-free.tar.bz2"))
1095 (sha256
1096 (base32
1097 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
1098 (build-system gnu-build-system)
1099 (native-inputs (list pkg-config))
1100 (inputs (list fontconfig freeglut fribidi glew))
1101 (home-page "http://quesoglc.sourceforge.net")
1102 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
1103 (description
1104 "The OpenGL Character Renderer (GLC) is a state machine that provides
1105 OpenGL programs with character rendering services via an application programming
1106 interface (API).")
1107 (license (list license:expat license:lgpl2.1+))))
1108
1109 (define-public python-pygame
1110 (package
1111 (name "python-pygame")
1112 (version "1.9.4")
1113 (source (origin
1114 (method url-fetch)
1115 (uri (pypi-uri "pygame" version))
1116 (sha256
1117 (base32
1118 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
1119 (build-system python-build-system)
1120 (arguments
1121 `(#:tests? #f ; tests require pygame to be installed first
1122 #:phases
1123 (modify-phases %standard-phases
1124 ;; Set the paths to the dependencies manually because
1125 ;; the configure script does not allow passing them as
1126 ;; parameters. This also means we can skip the configure
1127 ;; phase.
1128 (add-before 'build 'set-library-paths
1129 (lambda* (#:key inputs outputs #:allow-other-keys)
1130 (let ((sdl-ref (assoc-ref inputs "sdl"))
1131 (font-ref (assoc-ref inputs "sdl-ttf"))
1132 (image-ref (assoc-ref inputs "sdl-image"))
1133 (mixer-ref (assoc-ref inputs "sdl-mixer"))
1134 (smpeg-ref (assoc-ref inputs "libsmpeg"))
1135 (png-ref (assoc-ref inputs "libpng"))
1136 (jpeg-ref (assoc-ref inputs "libjpeg"))
1137 (freetype-ref (assoc-ref inputs "freetype"))
1138 (v4l-ref (assoc-ref inputs "v4l-utils"))
1139 (out-ref (assoc-ref outputs "out")))
1140 (substitute* "Setup.in"
1141 (("SDL = -I/usr/include/SDL")
1142 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
1143 (substitute* "Setup.in"
1144 (("FONT = -lSDL_ttf")
1145 (string-append "FONT = -I" font-ref "/include/SDL -L"
1146 font-ref "/lib -lSDL_ttf")))
1147 (substitute* "Setup.in"
1148 (("IMAGE = -lSDL_image")
1149 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
1150 image-ref "/lib -lSDL_image")))
1151 (substitute* "Setup.in"
1152 (("MIXER = -lSDL_mixer")
1153 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
1154 mixer-ref "/lib -lSDL_mixer")))
1155 (substitute* "Setup.in"
1156 (("SMPEG = -lsmpeg")
1157 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
1158 smpeg-ref "/lib -lsmpeg")))
1159 (substitute* "Setup.in"
1160 (("PNG = -lpng")
1161 (string-append "PNG = -I" png-ref "/include -L"
1162 png-ref "/lib -lpng")))
1163 (substitute* "Setup.in"
1164 (("JPEG = -ljpeg")
1165 (string-append "JPEG = -I" jpeg-ref "/include -L"
1166 jpeg-ref "/lib -ljpeg")))
1167
1168 (substitute* "Setup.in"
1169 (("FREETYPE = -lfreetype")
1170 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
1171 freetype-ref "/lib -lfreetype")))
1172
1173 (substitute* "Setup.in"
1174 (("^pypm") "#pypm"))
1175 ;; Create a path to a header file provided by v4l-utils.
1176 (system* "mkdir" "linux")
1177 (system* "ln" "--symbolic"
1178 (string-append v4l-ref "/include/libv4l1-videodev.h")
1179 "linux/videodev.h")
1180 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
1181 (inputs
1182 `(("freetype" ,freetype)
1183 ("sdl" ,sdl)
1184 ("sdl-image" ,sdl-image)
1185 ("sdl-mixer" ,sdl-mixer)
1186 ("sdl-ttf" ,sdl-ttf)
1187 ("sdl-gfx" ,sdl-gfx)
1188 ("libjpeg" ,libjpeg-turbo)
1189 ("libpng" ,libpng)
1190 ("libX11" ,libx11)
1191 ("libsmpeg" ,libsmpeg)
1192 ("portmidi" ,portmidi)
1193 ("v4l-utils" ,v4l-utils)))
1194 (home-page "https://www.pygame.org")
1195 (synopsis "SDL wrapper for Python")
1196 (description "Pygame is a set of Python modules designed for writing games.
1197 Pygame adds functionality on top of the excellent SDL library. This allows you
1198 to create fully featured games and multimedia programs in the python language.")
1199 (license (list license:bsd-2
1200 ;; python numeric license as listed by Debian looks like
1201 ;; an Expat-style license with a warranty disclaimer for
1202 ;; the U.S. government and the University of California.
1203 license:expat
1204 license:lgpl2.0+
1205 license:lgpl2.1+
1206 license:gpl3+
1207 license:psfl
1208 license:public-domain
1209 license:lgpl2.1+))))
1210
1211 (define-public python-pygame-sdl2
1212 (let ((real-version "2.1.0")
1213 (renpy-version "8.0.0"))
1214 (package
1215 (inherit python-pygame)
1216 (name "python-pygame-sdl2")
1217 (version (string-append real-version "-for-renpy-" renpy-version))
1218 (source
1219 (origin
1220 (method url-fetch)
1221 (uri (string-append "https://www.renpy.org/dl/" renpy-version
1222 "/pygame_sdl2-" version ".tar.gz"))
1223 (sha256 (base32 "0majf64pdfba5byjlv41pgsdmwvy09hw3m7143jz3kc1wjd2gaw8"))
1224 (modules '((guix build utils)))
1225 (snippet
1226 '(begin
1227 ;; drop generated sources
1228 (delete-file-recursively "gen")
1229 (delete-file-recursively "gen3")
1230 (delete-file-recursively "gen-static")))))
1231 (build-system python-build-system)
1232 (arguments
1233 `(#:tests? #f ; tests require pygame to be installed first
1234 #:phases
1235 (modify-phases %standard-phases
1236 (add-after 'set-paths 'set-sdl-vars
1237 (lambda* (#:key inputs #:allow-other-keys)
1238 (setenv "PYGAME_SDL2_CFLAGS"
1239 (string-append "-I"
1240 (assoc-ref inputs "sdl-union")
1241 "/include/SDL2 -D_REENTRANT"))
1242 (setenv "PYGAME_SDL2_LDFLAGS"
1243 (string-append "-L"
1244 (assoc-ref inputs "sdl-union")
1245 "/lib -Wl,-rpath,"
1246 (assoc-ref inputs "sdl-union")
1247 "/lib -Wl,--enable-new-dtags -lSDL2"))
1248 #t)))))
1249 (inputs
1250 (list (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))))
1251 (native-inputs
1252 (list python-cython))
1253 (home-page "https://www.renpy.org/")
1254 (synopsis "Reimplementation of the Pygame API using SDL2")
1255 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1256 staying close to the original, but also adding some SDL2-specific features.
1257 While it aims to be used as a drop-in replacement, it appears to be
1258 developed mainly for Ren'py.")
1259 (license (list license:lgpl2.1 license:zlib)))))
1260
1261 (define-public python-renpy
1262 (package
1263 (name "python-renpy")
1264 (version "8.0.0")
1265 (source
1266 (origin
1267 (method url-fetch)
1268 (uri (string-append "https://www.renpy.org/dl/" version
1269 "/renpy-" version "-source.tar.bz2"))
1270 (sha256 (base32 "09z3r16j4cxddkb50ghmi4xp0s05s15q4pzdmfajy85ignwqhjdi"))
1271 (modules '((guix build utils)))
1272 (patches
1273 (search-patches
1274 "renpy-use-system-fribidi.patch"))
1275 (snippet
1276 '(with-directory-excursion "module"
1277 ;; drop fribidi sources
1278 (delete-file-recursively "fribidi-src")
1279 ;; drop _renpytfd, as there are missing sources
1280 (substitute* "setup.py"
1281 (("cython\\(\"_renpytfd\"" all)
1282 (string-append "pass # " all)))))))
1283 (build-system python-build-system)
1284 (arguments
1285 `(#:tests? #f ; Ren'py doesn't seem to package tests
1286 #:phases
1287 (modify-phases %standard-phases
1288 (add-after 'unpack 'fix-commands
1289 (lambda* (#:key inputs #:allow-other-keys)
1290 (substitute* "renpy/editor.py"
1291 (("xdg-open")
1292 (string-append (assoc-ref inputs "xdg-utils")
1293 "/bin/xdg-open")))))
1294 (add-after 'unpack 'fix-include-paths
1295 (lambda* (#:key inputs #:allow-other-keys)
1296 (substitute* "module/setup.py"
1297 (("/usr/include/fribidi")
1298 (search-input-directory inputs "include/fribidi")))))
1299 (add-after 'set-paths 'set-build-vars
1300 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1301 (setenv "RENPY_CYTHON"
1302 (search-input-file (or native-inputs inputs)
1303 "/bin/cython"))
1304 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))))
1305 (replace 'build
1306 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1307 ;; The "module" subdirectory contains a python (really cython)
1308 ;; project, which is built using a script, that is thankfully
1309 ;; named "setup.py".
1310 (with-directory-excursion "module"
1311 (apply (assoc-ref %standard-phases 'build) args))
1312 ;; The above only builds the cython modules, but nothing else,
1313 ;; so we do that here.
1314 (invoke "python" "-m" "compileall" "renpy")))
1315 (replace 'install
1316 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1317 ;; Again, we have to wrap the module installation.
1318 ;; Additionally, we want to install the python code
1319 ;; (both source and compiled) in the same directory.
1320 (let* ((out (assoc-ref outputs "out"))
1321 (site (string-append "/lib/python"
1322 (python-version
1323 (assoc-ref inputs "python"))
1324 "/site-packages")))
1325 (with-directory-excursion "module"
1326 (apply (assoc-ref %standard-phases 'install) args))
1327 (copy-recursively "renpy"
1328 (string-append out site "/renpy"))
1329 (delete-file-recursively (string-append out site
1330 "/renpy/common"))))))))
1331 (native-inputs (list python-cython))
1332 (inputs
1333 (list ffmpeg
1334 freetype
1335 fribidi
1336 glew
1337 libpng
1338 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))
1339 xdg-utils))
1340 (propagated-inputs (list python-future python-pygame-sdl2))
1341 (home-page "https://www.renpy.org/")
1342 (synopsis "Ren'py python module")
1343 (description "This package contains the shared libraries and Python modules
1344 of Ren'py. While functional, they are not meaningful on their own without
1345 the launcher and common Ren'py code provided by the @code{renpy} package and
1346 are only used to bootstrap it.")
1347 (license license:expat)))
1348
1349 (define-public renpy
1350 (package
1351 (inherit python-renpy)
1352 (name "renpy")
1353 (build-system python-build-system)
1354 (arguments
1355 (list
1356 #:tests? #f ; see python-renpy
1357 #:modules '((srfi srfi-1)
1358 (guix build python-build-system)
1359 (guix build utils))
1360 #:imported-modules `((srfi srfi-1) ,@%python-build-system-modules)
1361 #:phases
1362 #~(modify-phases %standard-phases
1363 (add-after 'unpack 'fix-commands
1364 (lambda* (#:key inputs outputs #:allow-other-keys)
1365 (substitute* "launcher/game/choose_directory.rpy"
1366 (("/usr/bin/python")
1367 (search-input-file inputs "/bin/python3")))
1368 (substitute* "launcher/game/front_page.rpy"
1369 (("xdg-open")
1370 (search-input-file inputs "/bin/xdg-open")))
1371 (substitute* "launcher/game/project.rpy"
1372 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1373 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1374 "/bin/renpy\" ]"))
1375 ;; Projects are still created in the usual style, so we need
1376 ;; to adjust the path.
1377 (("cmd.append\\(self.path\\)")
1378 "cmd.append(self.path + \"/game\")"))))
1379 (add-after 'unpack 'drop-game-from-paths
1380 (lambda _
1381 (substitute* (list "launcher/game/gui7.rpy"
1382 "launcher/game/gui7/images.py")
1383 ((", \"game\",") ","))
1384 #t))
1385 (add-before 'build 'start-xserver
1386 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1387 (let ((Xvfb (search-input-file (or native-inputs inputs)
1388 "/bin/Xvfb")))
1389 (setenv "HOME" (getcwd))
1390 (system (format #f "~a :1 &" Xvfb))
1391 (setenv "DISPLAY" ":1"))))
1392 (replace 'build
1393 (lambda _
1394 (invoke "python" "renpy.py" "launcher" "quit")
1395 (invoke "python" "renpy.py" "the_question" "quit")
1396 (invoke "python" "renpy.py" "tutorial" "quit")))
1397 (replace 'install
1398 (lambda* (#:key inputs outputs #:allow-other-keys)
1399 ;; Here we install our custom renpy program.
1400 ;; After finishing this step, "out" will have the following:
1401 ;; |-- bin/renpy
1402 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1403 ;; |-- common
1404 ;; `-- gui
1405 ;;
1406 ;; Note that common shares the source files that would be installed
1407 ;; by python2-renpy (which are instead deleted from that package),
1408 ;; but also contains their byte-compiled versions.
1409 ;; On other systems, renpy_base would point to site-packages or
1410 ;; even somewhere in /opt.
1411 ;; The former approach is not as straightforward as it seems
1412 ;; -- it causes renpy to load files twice for some weird reason --
1413 ;; and the latter is impossible on Guix. Hence the detour through
1414 ;; share/renpy and the custom renpy program.
1415 ;;
1416 ;; As a convention, other games should be installed as
1417 ;; subdirectories of share/renpy in their respective outputs as
1418 ;; well. This differs from the traditional layout, which is
1419 ;; roughly the following:
1420 ;; `-- Super Awesome Game
1421 ;; |-- game ; <- the folder we actually want
1422 ;; |-- lib ; compiled renpy module and dependencies
1423 ;; |-- renpy ; yet another copy of Ren'py's code
1424 ;; | |-- common ; the common folder from above
1425 ;; | `-- ... ; Python code (source + compiled)
1426 ;; |-- Super Awesome Game.py
1427 ;; `-- Super Awesome Game.sh
1428 (let* ((out (assoc-ref outputs "out"))
1429 (bin/renpy (string-append out "/bin/renpy")))
1430 (copy-recursively "renpy/common"
1431 (string-append out "/share/renpy/common"))
1432 (copy-recursively "gui"
1433 (string-append out "/share/renpy/gui"))
1434 (copy-recursively "sdk-fonts"
1435 (string-append out "/share/renpy/sdk-fonts"))
1436
1437 (mkdir-p (string-append out "/bin"))
1438 (copy-file #$(local-file (search-auxiliary-file "renpy/renpy.in"))
1439 bin/renpy)
1440 (substitute* bin/renpy
1441 (("@PYTHON@") (search-input-file inputs "bin/python3"))
1442 (("@RENPY_BASE@") (string-append out "/share/renpy")))
1443 (chmod bin/renpy #o755))))
1444
1445 (add-after 'install 'install-games
1446 (lambda* (#:key inputs outputs #:allow-other-keys)
1447 (define renpy (assoc-ref outputs "out"))
1448 ;; TODO: We should offer a renpy-build-system to make the
1449 ;; installation of Ren'py games easier.
1450 (define* (install-renpy-game #:key output game name (renpy renpy)
1451 #:allow-other-keys)
1452 (let* ((name (or name (basename game)))
1453 (launcher (string-append output "/bin/renpy-" name))
1454 (share (string-append output "/share/renpy/" name)))
1455 (copy-recursively (string-append game "/game") share)
1456 (mkdir-p (string-append output "/bin"))
1457 (with-output-to-file launcher
1458 (lambda ()
1459 (format #t
1460 "#!~a~%~a ~a \"$@\""
1461 (search-input-file inputs "/bin/bash")
1462 (string-append renpy "/bin/renpy")
1463 share)))
1464 (chmod launcher #o755)))
1465
1466 (install-renpy-game #:output (assoc-ref outputs "out")
1467 #:game "launcher")
1468
1469 (install-renpy-game #:output (assoc-ref outputs "the-question")
1470 #:game "the_question"
1471 #:name "the-question")
1472
1473 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1474 #:game "tutorial")))
1475 (replace 'wrap
1476 (lambda* (#:key inputs outputs #:allow-other-keys)
1477 (let ((out (assoc-ref outputs "out"))
1478 (site (string-append "/lib/python"
1479 (python-version
1480 (assoc-ref inputs "python"))
1481 "/site-packages")))
1482 (wrap-program (string-append out "/bin/renpy")
1483 `("GUIX_PYTHONPATH" =
1484 (,@(delete-duplicates
1485 (map
1486 (lambda (store-path)
1487 (string-append store-path site))
1488 (cons (assoc-ref outputs "out")
1489 (map cdr
1490 (filter
1491 (lambda (input)
1492 (string-prefix? "python" (car input)))
1493 inputs))))))))))))))
1494 (inputs (list bash-minimal
1495 python
1496 python-pefile
1497 python-requests
1498 python-renpy
1499 python-six
1500 `(,python "tk")
1501 xdg-utils))
1502 (propagated-inputs '())
1503 (native-inputs (list xorg-server-for-tests))
1504 (outputs (list "out" "tutorial" "the-question"))
1505 (home-page "https://www.renpy.org/")
1506 (synopsis "Visual Novel Engine")
1507 (description "Ren'Py is a visual novel engine that helps you use words,
1508 images, and sounds to tell interactive stories that run on computers and
1509 mobile devices. These can be both visual novels and life simulation games.
1510 The easy to learn script language allows anyone to efficiently write large
1511 visual novels, while its Python scripting is enough for complex simulation
1512 games.")
1513 (license license:expat)))
1514
1515 (define-public python-pyxel
1516 (package
1517 (name "python-pyxel")
1518 (version "1.4.3")
1519 (source
1520 (origin
1521 (method git-fetch)
1522 (uri
1523 (git-reference
1524 (url "https://github.com/kitao/pyxel")
1525 (commit (string-append "v" version))))
1526 (file-name (git-file-name name version))
1527 (sha256
1528 (base32
1529 "0bwsgb5yq5s479cnf046v379zsn5ybp5195kbfvzr9l11qbaicm9"))
1530 (modules '((guix build utils)))
1531 (snippet
1532 '(begin
1533 (delete-file-recursively "pyxel/core/bin")))))
1534 (build-system python-build-system)
1535 (arguments
1536 `(#:tests? #f ; "Tests" are actually example programs that never halt.
1537 #:phases
1538 (modify-phases %standard-phases
1539 (add-after 'unpack 'patch-build-files
1540 (lambda* (#:key inputs #:allow-other-keys)
1541 (substitute* "setup.py"
1542 (("\"pyxel\\.core\\.bin\\.(.*)\"," all arch)
1543 (if (string=? arch "linux")
1544 all
1545 "")))
1546 (substitute* "pyxel/core/Makefile"
1547 (("`sdl2-config")
1548 (string-append "`sdl2-config --prefix="
1549 (assoc-ref inputs "sdl2"))))))
1550 (add-before 'build 'prebuild
1551 (lambda _
1552 (invoke "make" "-C" "pyxel/core"))))))
1553 (inputs
1554 `(("gifsicle" ,gifsicle)
1555 ("sdl2" ,(sdl-union (list sdl2 sdl2-image)))))
1556 (home-page "https://github.com/kitao/pyxel")
1557 (synopsis "Retro game engine for Python")
1558 (description "Pyxel is a game engine inspired by retro gaming consoles.
1559 It has a fixed 16-color palette, can hold up to 3 image banks and 8 tilemaps
1560 (256x256 pixels each) and 4 sound channels with 64 definable sounds. It
1561 also comes with a built-in image and sound editor.")
1562 (license license:expat)))
1563
1564 (define-public grafx2
1565 (package
1566 (name "grafx2")
1567 (version "2.4")
1568 (source (origin
1569 (method url-fetch)
1570 ;; XXX: There is no URL that contains the version. :(
1571 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1572 (file-name (string-append "grafx2-" version ".tgz"))
1573 (sha256
1574 (base32
1575 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1576 (build-system gnu-build-system)
1577 (arguments
1578 '(#:phases
1579 (modify-phases %standard-phases
1580 (delete 'configure) ; no configure script
1581 (add-before 'build 'change-to-src-directory
1582 (lambda _
1583 (chdir "src")
1584 #t)))
1585 #:make-flags
1586 ;; SDL header files are referenced without the preceeding "SDL/".
1587 (list (string-append "CFLAGS=-I"
1588 (assoc-ref %build-inputs "sdl-union")
1589 "/include/SDL"
1590 " -fcommon")
1591 (string-append "prefix="
1592 (assoc-ref %outputs "out")))
1593 #:tests? #f)) ; no check target
1594 (native-inputs
1595 (list pkg-config))
1596 (inputs
1597 (list libpng lua-5.1
1598 (sdl-union (list sdl sdl-image sdl-ttf))))
1599 (synopsis "Bitmap paint program")
1600 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1601 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1602 includes a very large number of tools and effects that make it particularly
1603 suitable for pixel art, game graphics, and generally any detailed graphics
1604 painted with a mouse.")
1605 (home-page "http://pulkomandy.tk/projects/GrafX2")
1606 (license license:gpl2))) ; GPLv2 only
1607
1608 (define-public ois
1609 (package
1610 (name "ois")
1611 (version "1.5.1")
1612 (source
1613 (origin
1614 (method git-fetch)
1615 (uri (git-reference
1616 (url "https://github.com/wgois/OIS")
1617 (commit (string-append "v" version))))
1618 (file-name (git-file-name name version))
1619 (sha256
1620 (base32 "0nkh0zrsbyv47c0i0vhdna3jsnvs69pb1svg75avxw6z7kwskgla"))))
1621 (build-system cmake-build-system)
1622 (arguments
1623 `(#:tests? #f)) ; no test suite
1624 (inputs
1625 (list libx11))
1626 (synopsis "Object Oriented Input System")
1627 (description
1628 "Cross Platform Object Oriented Input Lib System is a cross platform,
1629 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1630 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1631 robust and compatible with many systems and operating systems.")
1632 (home-page "https://github.com/wgois/OIS")
1633 (license license:zlib)))
1634
1635 (define-public mygui
1636 (package
1637 (name "mygui")
1638 (version "3.2.2")
1639 (source
1640 (origin
1641 (method git-fetch)
1642 (uri (git-reference
1643 (url "https://github.com/MyGUI/mygui")
1644 (commit (string-append "MyGUI" version))))
1645 (file-name (git-file-name name version))
1646 (sha256
1647 (base32
1648 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
1649 (build-system cmake-build-system)
1650 (arguments
1651 '(#:tests? #f ; No test target
1652 #:configure-flags
1653 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1654 (string-append "-DOGRE_INCLUDE_DIR="
1655 (assoc-ref %build-inputs "ogre")
1656 "/include/OGRE")
1657 ;; Demos and tools are Windows-specific:
1658 ;; https://github.com/MyGUI/mygui/issues/24.
1659 "-DMYGUI_BUILD_DEMOS=FALSE"
1660 "-DMYGUI_BUILD_TOOLS=FALSE")))
1661 (native-inputs
1662 (list boost doxygen pkg-config))
1663 (inputs
1664 (list font-dejavu
1665 freetype
1666 graphviz
1667 libx11
1668 ogre
1669 ois))
1670 (synopsis "Fast, flexible and simple GUI")
1671 (description
1672 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1673 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1674 of use.")
1675 (home-page "http://mygui.info/")
1676 (license license:expat)))
1677
1678 (define-public mygui-gl
1679 ;; Closure size is reduced by some 800 MiB.
1680 (package
1681 (inherit mygui)
1682 (name "mygui-gl")
1683 (version "3.2.2")
1684 (arguments
1685 (substitute-keyword-arguments (package-arguments mygui)
1686 ((#:configure-flags _)
1687 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1688 ;; We can't reuse the flags because of the mention to Ogre.
1689 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1690 ;; Demos and tools are Windows-specific:
1691 ;; https://github.com/MyGUI/mygui/issues/24.
1692 "-DMYGUI_BUILD_DEMOS=FALSE"
1693 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1694 (inputs
1695 (modify-inputs (package-inputs mygui)
1696 (delete "ogre")
1697 (prepend mesa glu)))
1698 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1699
1700 (define-public openmw
1701 (package
1702 (name "openmw")
1703 (version "0.47.0")
1704 (source
1705 (origin
1706 (method git-fetch)
1707 (uri (git-reference
1708 (url "https://github.com/OpenMW/openmw")
1709 (commit (string-append "openmw-" version))))
1710 (file-name (git-file-name name version))
1711 (sha256
1712 (base32
1713 "19mcbnjl4279qalb97msf965bjax48mx1r1qczyvwhn28h6n3bsy"))))
1714 (build-system cmake-build-system)
1715 (arguments
1716 `(#:tests? #f ; No test target
1717 #:configure-flags
1718 (list "-DDESIRED_QT_VERSION=5"
1719 "-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=ON")))
1720 (native-inputs
1721 (list boost doxygen pkg-config))
1722 (inputs
1723 (list bullet
1724 ffmpeg
1725 libxt
1726 lz4
1727 mygui-gl ; OpenMW does not need Ogre.
1728 openal
1729 openmw-openscenegraph
1730 qtbase-5
1731 recastnavigation
1732 sdl2
1733 unshield))
1734 (synopsis "Re-implementation of the RPG Morrowind engine")
1735 (description
1736 "OpenMW is a game engine which reimplements and extends the one that runs
1737 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1738 called OpenMW-CS which allows the user to edit or create their own original
1739 games.")
1740 (home-page "https://openmw.org")
1741 (license license:gpl3)))
1742
1743 (define-public godot
1744 (package
1745 (name "godot")
1746 (version "3.4.2")
1747 (source (origin
1748 (method git-fetch)
1749 (uri (git-reference
1750 (url "https://github.com/godotengine/godot")
1751 (commit (string-append version "-stable"))))
1752 (file-name (git-file-name name version))
1753 (sha256
1754 (base32
1755 "1bm9yl995chvx6jwkdia12yjrgwcpzb1r9bmj606q8z264aw2ma5"))
1756 (modules '((guix build utils)
1757 (ice-9 ftw)
1758 (srfi srfi-1)))
1759 (snippet
1760 '(begin
1761 ;; Keep only those bundled files we have not (yet) replaced
1762 ;; with Guix versions. Note that some of these may be
1763 ;; modified; see "thirdparty/README.md".
1764 (with-directory-excursion "thirdparty"
1765 (let* ((preserved-files
1766 '("README.md"
1767 "assimp"
1768 "certs"
1769 "cvtt"
1770 "embree"
1771 "enet"
1772 "etc2comp"
1773 "fonts"
1774 "glad"
1775 "jpeg-compressor"
1776 "libsimplewebm"
1777 "minimp3"
1778 "miniupnpc"
1779 "minizip"
1780 "misc"
1781 "nanosvg"
1782 "oidn"
1783 "pvrtccompressor"
1784 "recastnavigation"
1785 "squish"
1786 "stb_rect_pack"
1787 "tinyexr"
1788 "vhacd"
1789 "xatlas")))
1790 (for-each delete-file-recursively
1791 (lset-difference string=?
1792 (scandir ".")
1793 (cons* "." ".." preserved-files)))))))))
1794 (build-system scons-build-system)
1795 (arguments
1796 `(#:scons ,scons-python2
1797 #:scons-flags (list "platform=x11" "target=release_debug"
1798 ;; Avoid using many of the bundled libs.
1799 ;; Note: These options can be found in the SConstruct file.
1800 "builtin_bullet=no"
1801 "builtin_freetype=no"
1802 "builtin_glew=no"
1803 "builtin_libmpdec=no"
1804 "builtin_libogg=no"
1805 "builtin_libpng=no"
1806 "builtin_libtheora=no"
1807 "builtin_libvorbis=no"
1808 "builtin_libvpx=no"
1809 "builtin_libwebp=no"
1810 "builtin_mbedtls=no"
1811 "builtin_opus=no"
1812 "builtin_pcre2=no"
1813 "builtin_wslay=no"
1814 "builtin_zlib=no"
1815 "builtin_zstd=no")
1816 #:tests? #f ; There are no tests
1817 #:phases
1818 (modify-phases %standard-phases
1819 (add-after 'unpack 'scons-use-env
1820 (lambda _
1821 ;; Scons does not use the environment variables by default,
1822 ;; but this substitution makes it do so.
1823 (substitute* "SConstruct"
1824 (("env_base = Environment\\(tools=custom_tools\\)")
1825 (string-append
1826 "env_base = Environment(tools=custom_tools)\n"
1827 "env_base = Environment(ENV=os.environ)")))))
1828 ;; Build headless tools, used for packaging games without depending on X.
1829 (add-after 'build 'build-headless
1830 (lambda* (#:key scons-flags #:allow-other-keys)
1831 (apply invoke "scons"
1832 `(,(string-append "-j" (number->string (parallel-job-count)))
1833 "platform=server" ,@(delete "platform=x11" scons-flags)))))
1834 (replace 'install
1835 (lambda* (#:key inputs outputs #:allow-other-keys)
1836 (let* ((out (assoc-ref outputs "out"))
1837 (headless (assoc-ref outputs "headless"))
1838 (zenity (assoc-ref inputs "zenity")))
1839 ;; Strip build info from filenames.
1840 (with-directory-excursion "bin"
1841 (for-each
1842 (lambda (file)
1843 (let ((dest (car (string-split (basename file) #\.))))
1844 (rename-file file dest)))
1845 (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
1846 (install-file "godot" (string-append out "/bin"))
1847 (install-file "godot_server" (string-append headless "/bin")))
1848 ;; Tell the editor where to find zenity for OS.alert().
1849 (wrap-program (string-append out "/bin/godot")
1850 `("PATH" ":" prefix (,(string-append zenity "/bin")))))))
1851 (add-after 'install 'wrap
1852 (lambda* (#:key inputs outputs #:allow-other-keys)
1853 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
1854 ;; fix of the mesa package we wrap the pcb executable such that
1855 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
1856 ;; also append ld path for pulseaudio and alsa-lib
1857 (let* ((out (assoc-ref outputs "out"))
1858 (udev_path (string-append (assoc-ref inputs "eudev") "/lib"))
1859 (pulseaudio_path (string-append (assoc-ref inputs "pulseaudio") "/lib"))
1860 (alas_lib_path (string-append (assoc-ref inputs "alsa-lib") "/lib")))
1861 (wrap-program (string-append out "/bin/godot")
1862 `("LD_LIBRARY_PATH" ":" prefix (,udev_path ,pulseaudio_path ,alas_lib_path))))))
1863 (add-after 'install 'install-godot-desktop
1864 (lambda* (#:key outputs #:allow-other-keys)
1865 (let* ((out (assoc-ref outputs "out"))
1866 (applications (string-append out "/share/applications"))
1867 (icons (string-append out "/share/icons/hicolor")))
1868 (mkdir-p applications)
1869 (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
1870 (string-append applications "/godot.desktop"))
1871 (for-each (lambda (icon dest)
1872 (mkdir-p (dirname dest))
1873 (copy-file icon dest))
1874 '("icon.png" "icon.svg")
1875 `(,(string-append icons "/256x256/apps/godot.png")
1876 ,(string-append icons "/scalable/apps/godot.svg")))))))))
1877 (outputs '("out" "headless"))
1878 (native-inputs
1879 (list pkg-config))
1880 (inputs
1881 (list alsa-lib
1882 bullet
1883 freetype
1884 glew
1885 glu
1886 libtheora
1887 libvorbis
1888 libvpx
1889 libwebp
1890 libx11
1891 libxcursor
1892 libxi
1893 libxinerama
1894 libxrandr
1895 mbedtls-apache
1896 mesa
1897 opusfile
1898 pcre2
1899 pulseaudio
1900 eudev ; FIXME: required by mesa
1901 wslay
1902 zenity
1903 `(,zstd "lib")))
1904 (home-page "https://godotengine.org/")
1905 (synopsis "Advanced 2D and 3D game engine")
1906 (description
1907 "Godot is an advanced multi-platform game engine written in C++. If
1908 features design tools such as a visual editor, can import 3D models and
1909 provide high-quality 3D rendering, it contains an animation editor, and can be
1910 scripted in a Python-like language.")
1911 (license license:expat)))
1912
1913 (define-public entt
1914 (package
1915 (name "entt")
1916 (version "3.7.1")
1917 (source (origin
1918 (method git-fetch)
1919 (uri (git-reference
1920 (url "https://github.com/skypjack/entt")
1921 (commit (string-append "v" version))))
1922 (file-name (git-file-name name version))
1923 (sha256
1924 (base32
1925 "151jg3m262xwaywl2rqnc90yr6p48rhmgi5mxyv6bwqvmfli2m5p"))))
1926 (build-system cmake-build-system)
1927 (arguments
1928 `(#:configure-flags (list "-DENTT_BUILD_TESTING=ON"
1929 "-DENTT_FIND_GTEST_PACKAGE=ON"
1930 "-DENTT_BUILD_DOCS=ON")
1931 ;; Only tests are compiled, and they need assertions to work correctly.
1932 #:build-type "Debug"))
1933 (native-inputs
1934 (list ;; for testing
1935 googletest
1936 ;; for documentation
1937 doxygen graphviz))
1938 (synopsis "Entity component system")
1939 (description "EnTT is a header-only library, containing (among other things)
1940 @itemize
1941 @item an entity component system based on sparse sets,
1942 @item a configuration system using the monostate pattern,
1943 @item a static reflection system,
1944 @item and a cooperative scheduler.
1945 @end itemize")
1946 (home-page "https://github.com/skypjack/entt")
1947 (license (list license:expat ; code
1948 license:cc-by4.0)))) ; documentation
1949
1950 (define-public eureka
1951 (package
1952 (name "eureka")
1953 (version "1.24")
1954 (source (origin
1955 (method url-fetch)
1956 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1957 version "/eureka-"
1958 ;; version without dots e.g 1.21 => 121
1959 (string-join (string-split version #\.) "")
1960 "-source.tar.gz"))
1961 (sha256
1962 (base32
1963 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1964 (build-system gnu-build-system)
1965 (arguments
1966 '(#:tests? #f
1967 #:make-flags
1968 (let ((out (assoc-ref %outputs "out")))
1969 (list (string-append "PREFIX=" out)))
1970 #:phases
1971 (modify-phases %standard-phases
1972 (delete 'configure)
1973 (add-before 'build 'prepare-install-directories
1974 (lambda* (#:key outputs #:allow-other-keys)
1975 (let ((out (assoc-ref outputs "out")))
1976 (mkdir-p (string-append out "/bin"))
1977 (mkdir-p (string-append out "/share"))
1978
1979 (with-fluids ((%default-port-encoding #f))
1980 (substitute* "./src/main.cc"
1981 (("/usr/local") out)))
1982
1983 (substitute* "Makefile"
1984 (("-o root") ""))))))))
1985 (inputs `(("mesa" ,mesa)
1986 ("libxft" ,libxft)
1987 ("libxinerama" ,libxinerama)
1988 ("libfontconfig" ,fontconfig)
1989 ("libjpeg" ,libjpeg-turbo)
1990 ("libpng" ,libpng)
1991 ("fltk" ,fltk)
1992 ("zlib" ,zlib)))
1993 (native-inputs (list pkg-config xdg-utils))
1994 (synopsis "Doom map editor")
1995 (description "Eureka is a map editor for the classic DOOM games, and a few
1996 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1997 a 2D editor view.")
1998 (home-page "http://eureka-editor.sourceforge.net/")
1999 (license license:gpl2+)))
2000
2001 (define-public guile-chickadee
2002 (package
2003 (name "guile-chickadee")
2004 (version "0.8.0")
2005 (source (origin
2006 (method url-fetch)
2007 (uri (string-append "https://files.dthompson.us/chickadee/"
2008 "chickadee-" version ".tar.gz"))
2009 (sha256
2010 (base32
2011 "1k2dml2z57lnc36wrmwhh7avnpczxgxnshlfhpbk174vg6v609n0"))))
2012 (build-system gnu-build-system)
2013 (arguments
2014 '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
2015 (propagated-inputs
2016 `(("guile-opengl" ,guile3.0-opengl)
2017 ("guile-sdl2" ,guile-sdl2)))
2018 (inputs
2019 (list freetype
2020 guile-3.0-latest
2021 libvorbis
2022 mpg123
2023 openal
2024 readline))
2025 (native-inputs
2026 (list guile-3.0-latest pkg-config texinfo))
2027 (home-page "https://dthompson.us/projects/chickadee.html")
2028 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
2029 (description "Chickadee is a game development toolkit for Guile Scheme
2030 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
2031 that parenthetically inclined game developers need to make 2D (and eventually
2032 3D) games in Scheme, such as:
2033
2034 @enumerate
2035 @item extensible, fixed-timestep game loop
2036 @item OpenGL-based rendering engine
2037 @item keyboard, mouse, controller input
2038 @item REPL-driven development model
2039 @end enumerate\n")
2040 (license license:gpl3+)))
2041
2042 (define-public bennu-game-development
2043 (package
2044 (name "bennu-game-development")
2045 (version "353")
2046 (source (origin
2047 (method svn-fetch)
2048 (uri (svn-reference
2049 (url "http://svn.code.sf.net/p/bennugd/code")
2050 (revision (string->number version))))
2051 (file-name (string-append name "-" version))
2052 (sha256
2053 (base32
2054 "1iri58ryk9lbqn585cbccnvrfkj8qxlbcsk8rpih40jhvs1j101l"))
2055 (modules '((guix build utils)))
2056 (snippet
2057 '(begin
2058 (delete-file-recursively "3rdparty") #t))))
2059 (build-system gnu-build-system)
2060 (arguments
2061 '(#:phases
2062 (modify-phases %standard-phases
2063 (add-after 'unpack 'patch-configure-to-use-openssl
2064 (lambda* (#:key outputs #:allow-other-keys)
2065 (chdir "core")
2066 (delete-file "configure")
2067 (substitute* "configure.in"
2068 (("i\\*86\\)")
2069 "*)
2070 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
2071 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
2072 LIBSSL=\"crypto\"
2073 USE_OPENSSL=yes
2074 ;;
2075
2076 i*86)"))
2077 #t)))))
2078 (inputs (list openssl zlib))
2079 (native-inputs (list pkg-config autoconf automake libtool))
2080 (synopsis "Programming language to create games")
2081 (description "Bennu Game Development, also known as bennudg, is a
2082 programming language tailored at game development. It is the successor of
2083 Fenix.")
2084 (home-page "https://sourceforge.net/projects/bennugd/")
2085 (license license:zlib)))
2086
2087 (define-public bennu-game-development-modules
2088 (package
2089 (inherit bennu-game-development)
2090 (name "bennu-game-development-modules")
2091 (arguments
2092 '(#:phases
2093 (modify-phases %standard-phases
2094 (add-after 'unpack 'patch-conflicting-definitions
2095 (lambda _
2096 (with-fluids ((%default-port-encoding #f))
2097 (substitute* "core/include/fmath.h"
2098 (("extern fixed fmul\\( int x, int y \\);") "")
2099 (("extern fixed fdiv\\( int x, int y \\);") "")))
2100 (chdir "modules"))))))
2101 (inputs (list zlib libpng openssl sdl-mixer bennu-game-development))
2102 (synopsis "Modules for the Bennu Game Development programming language")
2103 (description "This package contains a collection of modules for the Bennu
2104 Game Development programming language, from CD handling through SDL to
2105 joystick support.")))
2106
2107 (define-public plib
2108 (package
2109 (name "plib")
2110 (version "1.8.5")
2111 (source (origin
2112 (method url-fetch)
2113 (uri (string-append "http://plib.sourceforge.net/dist/"
2114 "plib-" version ".tar.gz"))
2115 (sha256
2116 (base32
2117 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
2118 (patches (search-patches "plib-CVE-2011-4620.patch"
2119 "plib-CVE-2012-4552.patch"))))
2120 (build-system gnu-build-system)
2121 (inputs
2122 (list mesa libxi libxmu))
2123 (native-inputs
2124 (list pkg-config))
2125 (home-page "http://plib.sourceforge.net/")
2126 (synopsis "Suite of portable game libraries")
2127 (description "PLIB is a set of libraries that will permit programmers to
2128 write games and other realtime interactive applications that are 100% portable
2129 across a wide range of hardware and operating systems. PLIB includes sound
2130 effects, music, a complete 3D engine, font rendering, a simple Windowing
2131 library, a game scripting language, a GUI, networking, 3D math library and a
2132 collection of handy utility functions. All are 100% portable across nearly
2133 all modern computing platforms. Each library component is fairly independent
2134 of the others")
2135 (license license:lgpl2.0+)))
2136
2137 (define-public ioquake3
2138 ;; We follow master since it seems that there won't be releases after 1.3.6.
2139 (let ((revision "2")
2140 (commit "29b0cc3a4d037046eb3247fc04f4b703f6a33452"))
2141 (package
2142 (name "ioquake3")
2143 (version (git-version "1.3.6" revision commit))
2144 (source
2145 (origin
2146 (method git-fetch)
2147 (uri (git-reference
2148 (url "https://github.com/ioquake/ioq3")
2149 (commit commit)))
2150 (file-name (git-file-name name version))
2151 (sha256
2152 (base32 "0fqq2qpnrgpgf3gs71wvxlkcihxcrvhvllh88ii4ip134c1qbs9q"))))
2153 (build-system gnu-build-system)
2154 (inputs
2155 (list curl
2156 freetype
2157 libjpeg-turbo
2158 libogg
2159 libvorbis
2160 openal
2161 opus
2162 opusfile
2163 sdl2))
2164 (native-inputs
2165 (list which ; else SDL_version.h won't be found.
2166 pkg-config))
2167 (arguments
2168 (list
2169 #:tests? #f ; no tests
2170 #:make-flags
2171 #~(list (string-append "CC=" #$(cc-for-target))
2172 "USE_INTERNAL_LIBS=0"
2173 "USE_FREETYPE=1"
2174 "USE_RENDERER_DLOPEN=0"
2175 "USE_OPENAL_DLOPEN=0"
2176 "USE_CURL_DLOPEN=0")
2177 #:phases
2178 #~(modify-phases %standard-phases
2179 (delete 'configure) ; no configure-script
2180 (replace 'install
2181 (lambda* (#:key make-flags outputs #:allow-other-keys)
2182 (apply invoke "make" "copyfiles"
2183 (string-append "COPYDIR="
2184 (assoc-ref outputs "out")
2185 "/bin")
2186 make-flags))))))
2187 (home-page "https://ioquake3.org/")
2188 (synopsis "FPS game engine based on Quake 3")
2189 (description "ioquake3 is a free software first person shooter engine
2190 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
2191 the original, ioquake3 has been cleaned up, bugs have been fixed and features
2192 added. The permanent goal is to create a Quake 3 distribution upon which
2193 people base their games, ports to new platforms, and other projects.")
2194 (license license:gpl2))))
2195
2196 (define-public instead
2197 (package
2198 (name "instead")
2199 (version "3.3.5")
2200 (build-system cmake-build-system)
2201 (source
2202 (origin
2203 (method git-fetch)
2204 (uri (git-reference
2205 (url "https://github.com/instead-hub/instead")
2206 (commit version)))
2207 (file-name (git-file-name name version))
2208 (sha256
2209 (base32 "02j8cw623j51qmr4991i5hsbrzmnp0qfzds8m6nwwr15sjv3hv1g"))
2210 (patches
2211 (search-patches
2212 "instead-use-games-path.patch"))
2213 (modules '((guix build utils)))
2214 (snippet
2215 '(begin
2216 (delete-file-recursively "src/zlib")))))
2217 (arguments
2218 '(#:configure-flags
2219 (list (string-append
2220 "-DLUA_INCLUDE_DIR="
2221 (assoc-ref %build-inputs "luajit") "/include/luajit-2.1/")
2222 "-DWITH_LUAJIT=1"
2223 "-DWITH_GTK3=1")
2224 #:tests? #f))
2225 (inputs
2226 `(("gtk+",gtk+)
2227 ("lua" ,lua)
2228 ("luajit" ,luajit)
2229 ("pkg-config" ,pkg-config)
2230 ("sdl2-images" ,sdl2-image)
2231 ("sdl2-ttf" ,sdl2-ttf)
2232 ("sdl2-mixer" ,sdl2-mixer)
2233 ("zlib" ,zlib)))
2234 (home-page "https://instead3.syscall.ru/")
2235 (synopsis "Text adventure interpreter")
2236 (description "The STEAD (Simple TExt ADventures) interpreter provides
2237 functionality to play games that mix elements of visual novels, interactive
2238 fiction and classic point-and-click adventures.")
2239 (native-search-paths
2240 (list (search-path-specification
2241 (variable "INSTEAD_GAMES_PATH")
2242 (separator #f) ;single entry
2243 (files '("share/instead/games")))))
2244 (license license:expat)))
2245
2246 (define-public openvr
2247 (package
2248 (name "openvr")
2249 (version "1.8.19")
2250 (home-page "https://github.com/ValveSoftware/openvr/")
2251 (source
2252 (origin
2253 (method git-fetch)
2254 (uri (git-reference
2255 (url home-page)
2256 (commit (string-append "v" version))))
2257 (file-name (git-file-name name version))
2258 (sha256
2259 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
2260 (build-system cmake-build-system)
2261 (arguments
2262 ;; No tests.
2263 '(#:tests? #f
2264 #:configure-flags (list "-DBUILD_SHARED=1")))
2265 (synopsis "Virtual reality software development kit")
2266 (description "OpenVR is an API and runtime that allows access to VR
2267 hardware from multiple vendors without requiring that applications have
2268 specific knowledge of the hardware they are targeting.")
2269 (license license:bsd-3)))
2270
2271 (define-public flatzebra
2272 (package
2273 (name "flatzebra")
2274 (version "0.1.7")
2275 (source
2276 (origin
2277 (method url-fetch)
2278 (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
2279 "flatzebra-" version ".tar.gz"))
2280 (sha256
2281 (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
2282 (build-system gnu-build-system)
2283 (arguments
2284 `(#:phases
2285 (modify-phases %standard-phases
2286 (add-after 'unpack 'fix-sdl-config
2287 (lambda* (#:key inputs #:allow-other-keys)
2288 ;; XXX: sdl-config in sdl-union is a link to sdl-config from
2289 ;; plain sdl package. As a consequence, the prefix is wrong.
2290 ;; Force correct one with "--prefix" argument.
2291 (let ((sdl-union (assoc-ref inputs "sdl")))
2292 (setenv "SDL_CONFIG"
2293 (string-append sdl-union
2294 "/bin/sdl-config --prefix="
2295 sdl-union)))
2296 #t)))))
2297 (native-inputs
2298 (list pkg-config))
2299 (inputs
2300 `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
2301 (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
2302 (synopsis "Generic game engine for 2D double-buffering animation")
2303 (description
2304 "Flatzebra is a simple, generic C++ game engine library supporting 2D
2305 double-buffering.")
2306 (license license:gpl2+)))
2307
2308 (define-public libccd
2309 (package
2310 (name "libccd")
2311 (version "2.1")
2312 (source
2313 (origin
2314 (method git-fetch)
2315 (uri (git-reference
2316 (url "https://github.com/danfis/libccd")
2317 (commit (string-append "v" version))))
2318 (file-name (git-file-name name version))
2319 (sha256
2320 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2321 (build-system cmake-build-system)
2322 (arguments
2323 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2324 "-DBUILD_TESTING=ON"
2325 "-DENABLE_DOUBLE_PRECISION=ON")))
2326 (native-inputs
2327 (list python-sphinx))
2328 (home-page "https://github.com/danfis/libccd")
2329 (synopsis "Library for collision detection between two convex shapes")
2330 (description "@code{libccd} is library for a collision detection
2331 between two convex shapes. @code{libccd} implements variation on
2332 Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2333 and also implements algorithm Minkowski Portal Refinement (MPR,
2334 a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2335 (license license:expat)))
2336
2337 (define-public ode
2338 (package
2339 (name "ode")
2340 (version "0.16.2")
2341 (source
2342 (origin
2343 (method url-fetch)
2344 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2345 "ode-" version ".tar.gz"))
2346 (sha256
2347 (base32 "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj"))
2348 (modules '((guix build utils)))
2349 (snippet
2350 '(begin
2351 (delete-file-recursively "libccd")
2352 #t))))
2353 (build-system cmake-build-system)
2354 (arguments
2355 `(#:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
2356 #:phases
2357 (modify-phases %standard-phases
2358 (add-after 'unpack 'unbundle-libccd
2359 (lambda _
2360 (substitute* "CMakeLists.txt"
2361 (("configure_file\\(libccd/.*") ""))
2362 #t)))))
2363 (inputs
2364 (list glu libccd mesa))
2365 (home-page "https://www.ode.org/")
2366 (synopsis "High performance library for simulating rigid body dynamics")
2367 (description "ODE is a high performance library for simulating
2368 rigid body dynamics. It is fully featured, stable, mature and
2369 platform independent with an easy to use C/C++ API. It has advanced
2370 joint types and integrated collision detection with friction. ODE is
2371 useful for simulating vehicles, objects in virtual reality
2372 environments and virtual creatures. It is currently used in many
2373 computer games, 3D authoring tools and simulation tools.")
2374 ;; Software is dual-licensed.
2375 (license (list license:lgpl2.1+ license:expat))))
2376
2377 (define-public chipmunk
2378 (package
2379 (name "chipmunk")
2380 (version "7.0.3")
2381 (source
2382 (origin
2383 (method git-fetch)
2384 (uri (git-reference
2385 (url "https://github.com/slembcke/Chipmunk2D")
2386 (commit (string-append "Chipmunk-" version))))
2387 (file-name (git-file-name name version))
2388 (sha256
2389 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2390 (build-system cmake-build-system)
2391 (arguments
2392 `(#:tests? #f ;no test
2393 #:configure-flags '("-DBUILD_STATIC=OFF"
2394 "-DBUILD_DEMOS=OFF")))
2395 (inputs
2396 (list freeglut libxmu libxrandr))
2397 (home-page "https://chipmunk-physics.net/")
2398 (synopsis "Fast and lightweight 2D game physics library")
2399 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2400 rigid body physics library written in C.")
2401 (license license:expat)))
2402
2403 (define-public box2d
2404 (package
2405 (name "box2d")
2406 (version "2.4.1")
2407 (source
2408 (origin
2409 (method git-fetch)
2410 (uri (git-reference
2411 (url "https://github.com/erincatto/box2d")
2412 (commit (string-append "v" version))))
2413 (file-name (git-file-name name version))
2414 (sha256
2415 (base32 "1ja9cahf3z9zzrdaqcw44lpjmqf2ir2g4chwz0iwqwlkckwhpgvh"))
2416 (modules '((guix build utils)))
2417 (snippet
2418 '(begin
2419 ;; Remove bundled code only used for the testbed.
2420 (delete-file-recursively "extern")
2421 ;; Remove bundled copy of doctest, and adjust tests accordingly.
2422 (delete-file "unit-test/doctest.h")
2423 (substitute* "unit-test/CMakeLists.txt"
2424 (("doctest\\.h")
2425 ""))
2426 (substitute* (find-files "unit-test" "\\.cpp$")
2427 (("include \"doctest\\.h\"")
2428 "include <doctest/doctest.h>"))))))
2429 (build-system cmake-build-system)
2430 (arguments
2431 `(#:test-target "unit_test"
2432 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
2433 "-DBOX2D_BUILD_TESTBED=OFF")))
2434 (native-inputs
2435 (list doctest)) ;for tests
2436 (inputs
2437 (list libx11))
2438 (home-page "https://box2d.org/")
2439 (synopsis "2D physics engine for games")
2440 (description "Box2D is a 2D rigid body simulation library for games.
2441 Programmers can use it in their games to make objects move in realistic ways and
2442 make the game world more interactive. From the game engine's point of view, a
2443 physics engine is just a system for procedural animation.")
2444 (license license:expat)))
2445
2446 (define-public libtcod
2447 (package
2448 (name "libtcod")
2449 (version "1.15.1")
2450 (source (origin
2451 (method git-fetch)
2452 (uri (git-reference
2453 (url "https://github.com/libtcod/libtcod")
2454 (commit version)))
2455 (file-name (git-file-name name version))
2456 (sha256
2457 (base32
2458 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
2459 (modules '((guix build utils)))
2460 (snippet '(begin
2461 (delete-file-recursively "src/vendor/utf8proc")
2462 (delete-file-recursively "src/vendor/zlib")
2463 (delete-file "src/vendor/stb_truetype.h")
2464 (delete-file "src/vendor/stb_sprintf.h")
2465 (delete-file "src/vendor/lodepng.cpp")
2466 (delete-file "src/vendor/lodepng.h")
2467
2468 (substitute* "buildsys/autotools/sources.am"
2469 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
2470 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
2471 "../../src/vendor/stb.c")
2472 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
2473
2474 (substitute* "src/libtcod/sys_sdl_img_png.cpp"
2475 (("\\.\\./vendor/") ""))
2476
2477 (substitute* '("src/libtcod/color/canvas.cpp"
2478 "src/libtcod/sys_sdl_img_png.cpp"
2479 "src/libtcod/tileset/truetype.cpp"
2480 "src/libtcod/tileset/tilesheet.cpp")
2481 (("\\.\\./\\.\\./vendor/") ""))
2482
2483 (substitute* "src/libtcod/console/printing.cpp"
2484 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
2485 #t))))
2486 (build-system gnu-build-system)
2487 (arguments
2488 `(#:configure-flags '("--with-gnu-ld"
2489 "LIBS=-lutf8proc -llodepng")
2490 #:phases
2491 (modify-phases %standard-phases
2492 (add-after 'unpack 'change-to-build-dir
2493 (lambda _
2494 (chdir "buildsys/autotools")
2495 (patch-shebang "get_version.py"))))))
2496 (native-inputs
2497 (list autoconf
2498 automake
2499 libtool
2500 python
2501 pkg-config
2502 stb-sprintf
2503 stb-truetype))
2504 (inputs
2505 (list lodepng sdl2 utf8proc zlib))
2506 (home-page "https://github.com/libtcod/libtcod")
2507 (synopsis "Library specifically designed for writing roguelikes")
2508 (description
2509 "libtcod is a fast, portable and uncomplicated API for roguelike
2510 developers providing an advanced true color console, input, and lots of other
2511 utilities frequently used in roguelikes.")
2512 (license license:bsd-3)))
2513
2514 (define-public warsow-qfusion
2515 ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
2516 ;; The 2.5 beta as published on the homepage is commit
2517 ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
2518 (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
2519 (package
2520 (name "warsow-qfusion")
2521 (version (git-version "2.5" "1" commit)) ; 2.5-beta
2522 (source (origin
2523 (method git-fetch)
2524 (uri (git-reference
2525 (url "https://github.com/Warsow/qfusion/")
2526 (commit commit)
2527 (recursive? #t)))
2528 (file-name (git-file-name name version))
2529 (sha256
2530 (base32
2531 "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
2532 ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
2533 (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
2534 (modules '((guix build utils)))
2535 (snippet '(begin
2536 (delete-file-recursively "platforms")
2537 (delete-file-recursively "debian")
2538 (delete-file-recursively "libsrcs")
2539 #t))))
2540 (build-system cmake-build-system)
2541 (arguments
2542 `(#:tests? #f ; No tests.
2543 #:configure-flags '("-DQFUSION_GAME=Warsow")
2544 #:modules
2545 ((guix build utils)
2546 (guix build cmake-build-system)
2547 (ice-9 match))
2548 #:phases
2549 (modify-phases %standard-phases
2550 (add-after 'unpack 'change-to-build-dir
2551 (lambda _
2552 (chdir "source")
2553 #t))
2554 (add-after 'install 'really-install
2555 (lambda* (#:key outputs system #:allow-other-keys)
2556 (let ((arch (match system
2557 ("x86_64-linux" "x86_64")
2558 ("i686-linux" "i386")))
2559 (out (assoc-ref outputs "out")))
2560 (install-file (string-append "../source/build/basewsw/libgame_"
2561 arch ".so")
2562 (string-append out "/lib/"))
2563 (install-file (string-append "../source/build/libui_" arch ".so")
2564 (string-append out "/lib/"))
2565 (for-each
2566 (lambda (file)
2567 (install-file file (string-append out "/bin/")))
2568 (append (find-files "../source/build" "warsow")
2569 (find-files "../source/build" "wsw_server."))))
2570 #t)))))
2571 (inputs
2572 `(("alsa-lib" ,alsa-lib)
2573 ("curl" ,curl)
2574 ("freetype" ,freetype)
2575 ("ffmpeg" ,ffmpeg)
2576 ("libjpeg" ,libjpeg-turbo)
2577 ("libogg" ,libogg)
2578 ("libpng" ,libpng)
2579 ("libtheora" ,libtheora)
2580 ("libvorbis" ,libvorbis)
2581 ("mesa" ,mesa)
2582 ("openal" ,openal)
2583 ("pulseaudio" ,pulseaudio)
2584 ("qtbase" ,qtbase-5)
2585 ("qtdeclarative-5" ,qtdeclarative-5)
2586 ("sdl2" ,sdl2)
2587 ("uuid.h" ,util-linux "lib")
2588 ("zlib" ,zlib)))
2589 (native-inputs
2590 (list pkg-config))
2591 (home-page "https://github.com/Warsow/qfusion")
2592 (supported-systems '("i686-linux" "x86_64-linux"))
2593 (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
2594 (description
2595 "This package contains the game engine of Warsow, a first-person
2596 shooter video game. The engine is based on qfusion, the id Tech 2 derived
2597 game engine. id Tech 2 is the engine originally behind Quake 2.")
2598 (license license:gpl2+))))
2599
2600 (define-public dhewm3
2601 (package
2602 (name "dhewm3")
2603 (version "1.5.2")
2604 (source (origin
2605 (method url-fetch)
2606 (uri (string-append
2607 "https://github.com/dhewm/dhewm3/releases/download/"
2608 version "/dhewm3-" version "-src.tar.xz"))
2609 (sha256
2610 (base32
2611 "10p0w1x5wx9b7d8mzvb6yqjia9prhkjwz04vbvphy8p383r33am6"))))
2612 (build-system cmake-build-system)
2613 (arguments
2614 `(#:tests? #f ; No tests.
2615 #:phases
2616 (modify-phases %standard-phases
2617 (add-after 'unpack 'change-to-build-dir
2618 (lambda _
2619 (chdir "neo"))))))
2620 (inputs
2621 (list curl
2622 libx11
2623 openal
2624 sdl2
2625 zlib))
2626 (home-page "https://dhewm3.org/")
2627 (synopsis "Port of the original Doom 3 engine")
2628 (description
2629 "@command{dhewm3} is a source port of the original Doom 3 engine (not
2630 Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
2631 version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
2632 sound effects on all operating systems and hardware (via OpenAL Softs EFX
2633 support), has much better support for widescreen resolutions and has 64bit
2634 support.")
2635 (license license:gpl3)))
2636
2637 (define-public tesseract-engine
2638 (let ((svn-revision 2411))
2639 (package
2640 (name "tesseract-engine")
2641 (version (string-append "20200615-" (number->string svn-revision)))
2642 (source
2643 (origin
2644 (method svn-fetch)
2645 (uri (svn-reference
2646 (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
2647 (revision svn-revision)))
2648 (file-name (git-file-name name version))
2649 (sha256
2650 (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
2651 (modules '((guix build utils)))
2652 (snippet
2653 '(begin
2654 (for-each delete-file-recursively
2655 '("bin" "bin64"
2656 ;; Remove "media" since some files such as
2657 ;; media/sound/game/soundsnap/info.txt refer to a
2658 ;; non-commercial license.
2659 "media"
2660 "server.bat"
2661 "tesseract.bat"
2662 "src/lib"
2663 "src/lib64"))
2664 #t))))
2665 (build-system gnu-build-system)
2666 (arguments
2667 `(#:make-flags (list "CC=gcc")
2668 #:tests? #f ; No tests.
2669 #:phases
2670 (modify-phases %standard-phases
2671 (delete 'configure)
2672 (add-after 'unpack 'cd-src
2673 (lambda _ (chdir "src") #t))
2674 (add-before 'build 'fix-env
2675 (lambda* (#:key inputs #:allow-other-keys)
2676 (setenv "CPATH"
2677 (string-append
2678 (search-input-directory inputs "include/SDL2")
2679 ":" (or (getenv "CPATH") "")))))
2680 (add-after 'install 'really-install
2681 (lambda* (#:key outputs #:allow-other-keys)
2682 (let* ((out (assoc-ref outputs "out"))
2683 (share (string-append out "/share/tesseract"))
2684 (bin (string-append out "/bin/tesseract"))
2685 (client (string-append out "/bin/tesseract-client")))
2686 (chdir "..") ; Back to root.
2687 (for-each
2688 (lambda (dir)
2689 (mkdir-p (string-append share "/" dir))
2690 (copy-recursively dir (string-append share "/" dir)))
2691 '("config"))
2692 (mkdir-p (string-append out "/bin/"))
2693 (copy-file "bin_unix/native_client" client)
2694 (copy-file "bin_unix/native_server"
2695 (string-append out "/bin/tesseract-server"))
2696 (call-with-output-file bin
2697 (lambda (p)
2698 (format p "#!~a
2699 TESS_DATA=~a
2700 TESS_BIN=~a
2701 TESS_OPTIONS=\"-u$HOME/.tesseract\"
2702 cd \"$TESS_DATA\"
2703 exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
2704 (which "bash")
2705 share
2706 client)))
2707 (chmod bin #o755)
2708 (install-file "src/readme_tesseract.txt"
2709 (string-append out "/share/licenses/tesseract/LICENSE")))
2710 #t)))))
2711 (inputs
2712 `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
2713 ("zlib" ,zlib)
2714 ("libpng" ,libpng)
2715 ("libgl" ,mesa)))
2716 (home-page "http://tesseract.gg/")
2717 (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
2718 (description "This package contains the game engine of Tesseract, a
2719 first-person shooter focused on cooperative in-game map editing.
2720
2721 The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
2722 upgraded modern rendering techniques. The new rendering features include
2723 fully dynamic omnidirectional shadows, global illumination, HDR lighting,
2724 deferred shading, morphological / temporal / multisample anti-aliasing, and
2725 much more.")
2726 (license license:zlib))))
2727
2728 (define-public recastnavigation
2729 ;; We follow master since there hasn't been a release since 1.5.1 in 2016.
2730 (let ((commit "c5cbd53024c8a9d8d097a4371215e3342d2fdc87")
2731 (revision "1"))
2732 (package
2733 (name "recastnavigation")
2734 (version (git-version "1.5.1" revision commit))
2735 (source (origin
2736 (method git-fetch)
2737 (uri (git-reference
2738 (url "https://github.com/recastnavigation/recastnavigation")
2739 (commit commit)))
2740 (file-name (git-file-name name version))
2741 (sha256
2742 (base32
2743 "034bm47gc3r285w1pnvkhmm74zz99d204b1r865gisaiq4qfbza0"))))
2744 (build-system cmake-build-system)
2745 (arguments
2746 `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
2747 "-DRECASTNAVIGATION_DEMO=OFF"
2748 "-DRECASTNAVIGATION_TESTS=ON"
2749 "-DRECASTNAVIGATION_EXAMPLES=OFF")))
2750 (synopsis "Navigation system for games")
2751 (description "Recast is state of the art navigation mesh
2752 construction toolset for games.
2753
2754 @itemize
2755 @item It is automatic, which means that you can throw any level geometry
2756 at it and you will get robust mesh out.
2757 @item It is fast which means swift turnaround times for level designers.
2758 @end itemize
2759
2760 The Recast process starts with constructing a voxel mold from a level
2761 geometry and then casting a navigation mesh over it. The process
2762 consists of three steps, building the voxel mold, partitioning the mold
2763 into simple regions, peeling off the regions as simple polygons.
2764
2765 Recast is accompanied with Detour, path-finding and spatial reasoning
2766 toolkit. You can use any navigation mesh with Detour, but of course the
2767 data generated with Recast fits perfectly.
2768
2769 Detour offers simple static navigation mesh which is suitable for many
2770 simple cases, as well as tiled navigation mesh which allows you to plug
2771 in and out pieces of the mesh. The tiled mesh allows you to create
2772 systems where you stream new navigation data in and out as the player
2773 progresses the level, or you may regenerate tiles as the world changes.")
2774 (home-page "https://github.com/recastnavigation/recastnavigation")
2775 (license license:zlib))))