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