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