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