gnu: surgescript: Do not want static libraries.
[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, 2021 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.5")
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 "0xwd4g7n0b0rxkpbyshkzyl472h1y606ghyvf8gv034n3jz2g4jk"))))
651 (build-system cmake-build-system)
652 (arguments
653 '(#:configure-flags
654 (let ((share (string-append (assoc-ref %outputs "out") "/share")))
655 (list "-DWANT_STATIC=NO"
656 (string-append "-DICON_PATH=" share "/pixmaps")
657 (string-append "-DMETAINFO_PATH=" share "/metainfo")))
658 #:tests? #f))
659 (home-page "https://docs.opensurge2d.org")
660 (synopsis "Scripting language for games")
661 (description "@code{SurgeScript} is a dynamically typed object-oriented
662 scripting language designed for games. Each object is a state machine that
663 can be customized by attaching other objects. The language supports automatic
664 garbage collection and can be extended with plugins.")
665 (license license:asl2.0)))
666
667 (define-public physfs
668 (package
669 (name "physfs")
670 (version "3.0.2")
671 (source (origin
672 (method url-fetch)
673 (uri (string-append
674 "https://icculus.org/physfs/downloads/physfs-"
675 version ".tar.bz2"))
676 (file-name (string-append name "-" version ".tar.gz"))
677 (sha256
678 (base32
679 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
680 (build-system cmake-build-system)
681 (arguments
682 '(#:tests? #f ; no check target
683 #:configure-flags '("-DPHYSFS_BUILD_STATIC=OFF")
684 #:phases (modify-phases %standard-phases
685 (add-after 'unpack 'patch-CMakeLists.txt
686 (lambda _
687 (substitute* "CMakeLists.txt"
688 ;; XXX: For some reason CMakeLists.txt disables
689 ;; RUNPATH manipulation when the compiler is GCC.
690 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
691 #t)))))
692 (inputs
693 `(("zlib" ,zlib)))
694 (native-inputs
695 `(("doxygen" ,doxygen)))
696 (home-page "https://icculus.org/physfs")
697 (synopsis "File system abstraction library")
698 (description
699 "PhysicsFS is a library to provide abstract access to various archives.
700 It is intended for use in video games. For security, no file writing done
701 through the PhysicsFS API can leave a defined @emph{write directory}. For
702 file reading, a @emph{search path} with archives and directories is defined,
703 and it becomes a single, transparent hierarchical file system. So archive
704 files can be accessed in the same way as you access files directly on a disk,
705 and it makes it easy to ship a new archive that will override a previous
706 archive on a per-file basis.")
707 (license license:zlib)))
708
709 (define-public love
710 (package
711 (name "love")
712 (version "11.3")
713 (source (origin
714 (method url-fetch)
715 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
716 "love-" version "-linux-src.tar.gz"))
717 (sha256
718 (base32
719 "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
720 (build-system gnu-build-system)
721 (native-inputs
722 `(("pkg-config" ,pkg-config)))
723 (inputs
724 `(("devil" ,devil)
725 ("freetype" ,freetype)
726 ("libmodplug" ,libmodplug)
727 ("libtheora" ,libtheora)
728 ("libvorbis" ,libvorbis)
729 ("luajit" ,luajit)
730 ("mesa" ,mesa)
731 ("mpg123" ,mpg123)
732 ("openal" ,openal)
733 ("sdl2" ,sdl2)
734 ("zlib" ,zlib)))
735 (synopsis "2D game framework for Lua")
736 (description "LÖVE is a framework for making 2D games in the Lua
737 programming language.")
738 (home-page "https://love2d.org/")
739 (license license:zlib)))
740
741 (define-public love-nuklear
742 (let ((version "v2.6")
743 (commit "fef4e00a602efb16c57ae962850b6e7a01f7a29a"))
744 (package
745 (name "love-nuklear")
746 (version (git-version version "1" commit))
747 (source (origin
748 (method git-fetch)
749 (uri (git-reference
750 (url "https://github.com/keharriso/love-nuklear/")
751 (commit commit)
752 (recursive? #t)))
753 ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
754 ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
755 (file-name (git-file-name name version))
756 (sha256
757 (base32
758 "15qmy8mfwkxy2x9rmxs6f9cyvjvwwj6yf78bs863xmc56dmjzzbn"))))
759 (build-system cmake-build-system)
760 (arguments
761 `(#:build-type "Release"
762 #:tests? #f))
763 (inputs
764 `(("luajit" ,luajit)))
765 (synopsis "Lightweight immediate mode GUI for LÖVE games")
766 (description "LÖVE is a Lua framework for making 2D games. Nuklear
767 is a minimal state immediate mode graphical user interface toolkit. This
768 package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
769 (home-page "https://github.com/keharriso/love-nuklear/")
770 (license license:expat))))
771
772 (define-public allegro-4
773 (package
774 (name "allegro")
775 (version "4.4.3")
776 (source (origin
777 (method url-fetch)
778 (uri (string-append "https://github.com/liballeg/allegro5/"
779 "releases/download/" version "/allegro-"
780 version ".tar.gz"))
781 (sha256
782 (base32
783 "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
784 (build-system cmake-build-system)
785 (arguments
786 '(#:phases
787 (modify-phases %standard-phases
788 (add-after 'unpack 'patch-build-system
789 (lambda _
790 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
791 ;; via a command line option doesn't work because it is
792 ;; unconditionally clobbered in the build script.
793 (substitute* '("CMakeLists.txt")
794 (("ADDON_LINKAGE STATIC")
795 "ADDON_LINKAGE SHARED"))
796 #t)))))
797 (inputs
798 `(("glu" ,glu)
799 ("libpng" ,libpng)
800 ("libvorbis" ,libvorbis)
801 ("mesa" ,mesa)
802 ("zlib" ,zlib)))
803 (synopsis "Game programming library")
804 (description "Allegro is a library mainly aimed at video game and
805 multimedia programming. It handles common, low-level tasks such as creating
806 windows, accepting user input, loading data, drawing images, playing sounds,
807 etc.")
808 (home-page "https://liballeg.org")
809 (license license:giftware)))
810
811 (define-public allegro
812 (package
813 (name "allegro")
814 (version "5.2.5.0")
815 (source (origin
816 (method url-fetch)
817 (uri (string-append "https://github.com/liballeg/allegro5/releases"
818 "/download/" version "/allegro-"
819 version ".tar.gz"))
820 (sha256
821 (base32
822 "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
823 (build-system cmake-build-system)
824 (arguments `(#:tests? #f)) ; there are no tests
825 (inputs
826 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
827 `(("flac" ,flac)
828 ("freetype" ,freetype)
829 ("glu" ,glu)
830 ("gtk" ,gtk+-2)
831 ("libjpeg" ,libjpeg-turbo)
832 ("libpng" ,libpng)
833 ("libtheora" ,libtheora)
834 ("libvorbis" ,libvorbis)
835 ("libxcursor" ,libxcursor)
836 ("libxinerama" ,libxinerama)
837 ("libxrandr" ,libxrandr)
838 ("mesa" ,mesa)
839 ("openal" ,openal)
840 ("physfs" ,physfs)
841 ("zlib" ,zlib)))
842 (native-inputs
843 `(("pkg-config" ,pkg-config)))
844 (synopsis "Game programming library")
845 (description "Allegro is a library mainly aimed at video game and
846 multimedia programming. It handles common, low-level tasks such as creating
847 windows, accepting user input, loading data, drawing images, playing sounds,
848 etc.")
849 (home-page "https://liballeg.org")
850 (license license:bsd-3)))
851
852 (define-public allegro-5.0
853 (package (inherit allegro)
854 (name "allegro")
855 (version "5.0.11")
856 (source (origin
857 (method url-fetch)
858 (uri (string-append "https://github.com/liballeg/allegro5/releases"
859 "/download/" version "/allegro-"
860 (if (equal? "0" (string-take-right version 1))
861 (string-drop-right version 2)
862 version)
863 ".tar.gz"))
864 (patches (search-patches
865 "allegro-mesa-18.2.5-and-later.patch"))
866 (sha256
867 (base32
868 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
869
870 (define-public aseprite
871 (package
872 (name "aseprite")
873 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
874 ;; TODO: Unbundle third party software.
875 (source (origin
876 (method url-fetch/zipbomb)
877 (uri (string-append "https://github.com/aseprite/aseprite"
878 "/releases/download/v" version
879 "/Aseprite-v" version "-Source.zip"))
880 (sha256
881 (base32
882 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
883 (build-system cmake-build-system)
884 (arguments
885 '(#:configure-flags
886 ;; Use shared libraries instead of building bundled source.
887 (list "-DWITH_WEBP_SUPPORT=1"
888 "-DUSE_SHARED_CURL=1"
889 "-DUSE_SHARED_GIFLIB=1"
890 "-DUSE_SHARED_JPEGLIB=1"
891 "-DUSE_SHARED_ZLIB=1"
892 "-DUSE_SHARED_LIBPNG=1"
893 "-DUSE_SHARED_LIBLOADPNG=1"
894 "-DUSE_SHARED_LIBWEBP=1"
895 "-DUSE_SHARED_TINYXML=1"
896 "-DUSE_SHARED_PIXMAN=1"
897 "-DUSE_SHARED_FREETYPE=1"
898 "-DUSE_SHARED_ALLEGRO4=1"
899 "-DENABLE_UPDATER=0" ; no auto-updates
900 (string-append "-DFREETYPE_INCLUDE_DIR="
901 (assoc-ref %build-inputs "freetype")
902 "/include/freetype2"))))
903 (native-inputs
904 `(("pkg-config" ,pkg-config)))
905 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
906 ;; patched version is bundled with Aseprite, but the patches should be
907 ;; extracted and applied on top of a standalone Allegro 4 package.
908 (inputs
909 `(("allegro" ,allegro-4)
910 ("curl" ,curl)
911 ("freetype" ,freetype)
912 ("giflib" ,giflib)
913 ("libjpeg" ,libjpeg-turbo)
914 ("libpng" ,libpng)
915 ("libwebp" ,libwebp)
916 ("libx11" ,libx11)
917 ("libxext" ,libxext)
918 ("libxxf86vm" ,libxxf86vm)
919 ("pixman" ,pixman)
920 ("tinyxml" ,tinyxml)
921 ("zlib" ,zlib)))
922 (synopsis "Animated sprite editor and pixel art tool")
923 (description "Aseprite is a tool for creating 2D pixel art for video
924 games. In addition to basic pixel editing features, Aseprite can assist in
925 the creation of animations, tiled graphics, texture atlases, and more.")
926 (home-page "https://www.aseprite.org/")
927 (license license:gpl2+)))
928
929 (define-public qqwing
930 (package
931 (name "qqwing")
932 (version "1.3.4")
933 (source (origin
934 (method url-fetch)
935 (uri (string-append
936 "https://qqwing.com/"
937 name "-" version ".tar.gz"))
938 (sha256
939 (base32
940 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
941 (build-system gnu-build-system)
942 (native-inputs
943 `(("pkg-config" ,pkg-config)))
944 (home-page "https://qqwing.com/")
945 (synopsis "Sudoku puzzle solver and generator")
946 (description
947 "QQWing is a Sudoku puzzle generator and solver.
948 It offers the following features:
949 @enumerate
950 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
951 @item Uses logic. Uses as many solve techniques as possible when solving
952 puzzles rather than guessing.
953 @item Rates puzzles. Most generators don't give an indication of the difficulty
954 of a Sudoku puzzle. QQwing does.
955 @item Can print solve instructions for any puzzle.
956 @item Customizable output style, including a CSV style that is easy to
957 import into a database.
958 @end enumerate")
959 (license license:gpl2+)))
960
961 (define-public quesoglc
962 (package
963 (name "quesoglc")
964 (version "0.7.2")
965 (source (origin
966 (method url-fetch)
967 (uri (string-append "mirror://sourceforge/" name "/" version "/"
968 name "-" version "-free.tar.bz2"))
969 (sha256
970 (base32
971 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
972 (build-system gnu-build-system)
973 (native-inputs `(("pkg-config" ,pkg-config)))
974 (inputs `(("fontconfig" ,fontconfig)
975 ("freeglute" ,freeglut)
976 ("fribidi" ,fribidi)
977 ("glew" ,glew)))
978 (home-page "http://quesoglc.sourceforge.net")
979 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
980 (description
981 "The OpenGL Character Renderer (GLC) is a state machine that provides
982 OpenGL programs with character rendering services via an application programming
983 interface (API).")
984 (license (list license:expat license:lgpl2.1+))))
985
986 (define-public python-pygame
987 (package
988 (name "python-pygame")
989 (version "1.9.4")
990 (source (origin
991 (method url-fetch)
992 (uri (pypi-uri "pygame" version))
993 (sha256
994 (base32
995 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
996 (build-system python-build-system)
997 (arguments
998 `(#:tests? #f ; tests require pygame to be installed first
999 #:phases
1000 (modify-phases %standard-phases
1001 ;; Set the paths to the dependencies manually because
1002 ;; the configure script does not allow passing them as
1003 ;; parameters. This also means we can skip the configure
1004 ;; phase.
1005 (add-before 'build 'set-library-paths
1006 (lambda* (#:key inputs outputs #:allow-other-keys)
1007 (let ((sdl-ref (assoc-ref inputs "sdl"))
1008 (font-ref (assoc-ref inputs "sdl-ttf"))
1009 (image-ref (assoc-ref inputs "sdl-image"))
1010 (mixer-ref (assoc-ref inputs "sdl-mixer"))
1011 (smpeg-ref (assoc-ref inputs "libsmpeg"))
1012 (png-ref (assoc-ref inputs "libpng"))
1013 (jpeg-ref (assoc-ref inputs "libjpeg"))
1014 (freetype-ref (assoc-ref inputs "freetype"))
1015 (v4l-ref (assoc-ref inputs "v4l-utils"))
1016 (out-ref (assoc-ref outputs "out")))
1017 (substitute* "Setup.in"
1018 (("SDL = -I/usr/include/SDL")
1019 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
1020 (substitute* "Setup.in"
1021 (("FONT = -lSDL_ttf")
1022 (string-append "FONT = -I" font-ref "/include/SDL -L"
1023 font-ref "/lib -lSDL_ttf")))
1024 (substitute* "Setup.in"
1025 (("IMAGE = -lSDL_image")
1026 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
1027 image-ref "/lib -lSDL_image")))
1028 (substitute* "Setup.in"
1029 (("MIXER = -lSDL_mixer")
1030 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
1031 mixer-ref "/lib -lSDL_mixer")))
1032 (substitute* "Setup.in"
1033 (("SMPEG = -lsmpeg")
1034 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
1035 smpeg-ref "/lib -lsmpeg")))
1036 (substitute* "Setup.in"
1037 (("PNG = -lpng")
1038 (string-append "PNG = -I" png-ref "/include -L"
1039 png-ref "/lib -lpng")))
1040 (substitute* "Setup.in"
1041 (("JPEG = -ljpeg")
1042 (string-append "JPEG = -I" jpeg-ref "/include -L"
1043 jpeg-ref "/lib -ljpeg")))
1044
1045 (substitute* "Setup.in"
1046 (("FREETYPE = -lfreetype")
1047 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
1048 freetype-ref "/lib -lfreetype")))
1049
1050 (substitute* "Setup.in"
1051 (("^pypm") "#pypm"))
1052 ;; Create a path to a header file provided by v4l-utils.
1053 (system* "mkdir" "linux")
1054 (system* "ln" "--symbolic"
1055 (string-append v4l-ref "/include/libv4l1-videodev.h")
1056 "linux/videodev.h")
1057 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
1058 (inputs
1059 `(("freetype" ,freetype)
1060 ("sdl" ,sdl)
1061 ("sdl-image" ,sdl-image)
1062 ("sdl-mixer" ,sdl-mixer)
1063 ("sdl-ttf" ,sdl-ttf)
1064 ("sdl-gfx" ,sdl-gfx)
1065 ("libjpeg" ,libjpeg-turbo)
1066 ("libpng" ,libpng)
1067 ("libX11" ,libx11)
1068 ("libsmpeg" ,libsmpeg)
1069 ("portmidi" ,portmidi)
1070 ("v4l-utils" ,v4l-utils)))
1071 (home-page "https://www.pygame.org")
1072 (synopsis "SDL wrapper for Python")
1073 (description "Pygame is a set of Python modules designed for writing games.
1074 Pygame adds functionality on top of the excellent SDL library. This allows you
1075 to create fully featured games and multimedia programs in the python language.")
1076 (license (list license:bsd-2
1077 ;; python numeric license as listed by Debian looks like
1078 ;; an Expat-style license with a warranty disclaimer for
1079 ;; the U.S. government and the University of California.
1080 license:expat
1081 license:lgpl2.0+
1082 license:lgpl2.1+
1083 license:gpl3+
1084 license:psfl
1085 license:public-domain
1086 license:lgpl2.1+))))
1087
1088 (define-public python2-pygame
1089 (package-with-python2 python-pygame))
1090
1091 (define-public python2-pygame-sdl2
1092 (let ((real-version "2.1.0")
1093 (renpy-version "7.4.2"))
1094 (package
1095 (inherit python2-pygame)
1096 (name "python2-pygame-sdl2")
1097 (version (string-append real-version "-for-renpy-" renpy-version))
1098 (source
1099 (origin
1100 (method url-fetch)
1101 (uri (string-append "https://www.renpy.org/dl/" renpy-version
1102 "/pygame_sdl2-" version ".tar.gz"))
1103 (sha256 (base32 "1lpk69nh379x5pdlr838x5b49spzksn9hyqiq2g0q28k0xk4lm67"))
1104 (modules '((guix build utils)))
1105 (snippet
1106 '(begin
1107 ;; drop generated sources
1108 (delete-file-recursively "gen")
1109 (delete-file-recursively "gen-static")
1110 #t))))
1111 (build-system python-build-system)
1112 (arguments
1113 `(#:tests? #f ; tests require pygame to be installed first
1114 #:python ,python-2
1115 #:phases
1116 (modify-phases %standard-phases
1117 (add-after 'set-paths 'set-sdl-vars
1118 (lambda* (#:key inputs #:allow-other-keys)
1119 (setenv "PYGAME_SDL2_CFLAGS"
1120 (string-append "-I"
1121 (assoc-ref inputs "sdl-union")
1122 "/include/SDL2 -D_REENTRANT"))
1123 (setenv "PYGAME_SDL2_LDFLAGS"
1124 (string-append "-L"
1125 (assoc-ref inputs "sdl-union")
1126 "/lib -Wl,-rpath,"
1127 (assoc-ref inputs "sdl-union")
1128 "/lib -Wl,--enable-new-dtags -lSDL2"))
1129 #t)))))
1130 (inputs
1131 `(("sdl-union"
1132 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1133 (native-inputs
1134 `(("python2-cython" ,python2-cython)))
1135 (home-page "https://www.renpy.org/")
1136 (synopsis "Reimplementation of the Pygame API using SDL2")
1137 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1138 staying close to the original, but also adding some SDL2-specific features.
1139 While it aims to be used as a drop-in replacement, it appears to be
1140 developed mainly for Ren'py.")
1141 (license (list license:lgpl2.1 license:zlib)))))
1142
1143 (define-public python2-renpy
1144 (package
1145 (name "python2-renpy")
1146 (version "7.4.2")
1147 (source
1148 (origin
1149 (method url-fetch)
1150 (uri (string-append "https://www.renpy.org/dl/" version
1151 "/renpy-" version "-source.tar.bz2"))
1152 (sha256 (base32 "1mlrq9q3r36izyskq674qhp8s32iirvvfb4r8z6hi26189aaydsw"))
1153 (modules '((guix build utils)))
1154 (patches
1155 (search-patches
1156 "renpy-use-system-fribidi.patch"))
1157 (snippet
1158 '(with-directory-excursion "module"
1159 ;; drop generated sources
1160 (delete-file-recursively "gen")
1161 ;; drop fribidi sources
1162 (delete-file-recursively "fribidi-src")
1163 #t))))
1164 (build-system python-build-system)
1165 (arguments
1166 `(#:tests? #f ; Ren'py doesn't seem to package tests
1167 #:python ,python-2
1168 #:phases
1169 (modify-phases %standard-phases
1170 (add-after 'unpack 'fix-commands
1171 (lambda _
1172 (substitute* "renpy/editor.py"
1173 (("xdg-open")
1174 (which "xdg-open")))
1175 #t))
1176 (add-after 'unpack 'fix-include-paths
1177 (lambda* (#:key inputs #:allow-other-keys)
1178 (substitute* "module/setup.py"
1179 (("/usr/include/fribidi")
1180 (string-append (assoc-ref inputs "fribidi")
1181 "/include/fribidi")))
1182 #t))
1183 (add-after 'set-paths 'set-build-vars
1184 (lambda* (#:key inputs #:allow-other-keys)
1185 (setenv "RENPY_CYTHON"
1186 (string-append (assoc-ref inputs "python2-cython")
1187 "/bin/cython"))
1188 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
1189 #t))
1190 (replace 'build
1191 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1192 ;; The "module" subdirectory contains a python (really cython)
1193 ;; project, which is built using a script, that is thankfully
1194 ;; named "setup.py".
1195 (with-directory-excursion "module"
1196 (apply (assoc-ref %standard-phases 'build) args))
1197 ;; the above causes renpy.__init__ to be compiled but does not
1198 ;; compile anything else, hence we do that here
1199 (delete-file "renpy/__init__.pyc")
1200 (invoke "python" "-m" "compileall" "renpy")
1201 #t))
1202 (replace 'install
1203 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1204 ;; Again, we have to wrap the module installation.
1205 ;; Additionally, we want to install the python code
1206 ;; (both source and compiled) in the same directory.
1207 (let* ((out (assoc-ref outputs "out"))
1208 (site (string-append "/lib/python"
1209 (python-version
1210 (assoc-ref inputs "python"))
1211 "/site-packages")))
1212 (with-directory-excursion "module"
1213 (apply (assoc-ref %standard-phases 'install) args))
1214 (copy-recursively "renpy"
1215 (string-append out site "/renpy")))
1216 #t)))))
1217 (inputs
1218 `(("ffmpeg" ,ffmpeg)
1219 ("freetype" ,freetype)
1220 ("fribidi" ,fribidi)
1221 ("glew" ,glew)
1222 ("libpng" ,libpng)
1223 ("sdl-union"
1224 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1225 (propagated-inputs
1226 `(("python2-future" ,python2-future)
1227 ("python2-pygame" ,python2-pygame-sdl2)))
1228 (native-inputs
1229 `(("gcc" ,gcc-8) ; for const variables as initializer elements
1230 ("python2-cython" ,python2-cython)
1231 ("xdg-utils" ,xdg-utils)))
1232 (home-page "https://www.renpy.org/")
1233 (synopsis "Ren'py python module")
1234 (description "This package contains the shared libraries and Python
1235 modules of Ren'py.")
1236 (license license:expat)))
1237
1238 (define-public renpy
1239 (package
1240 (inherit python2-renpy)
1241 (name "renpy")
1242 (build-system python-build-system)
1243 (arguments
1244 `(#:tests? #f ; see python2-renpy
1245 #:python ,python-2
1246 #:phases
1247 (modify-phases %standard-phases
1248 (add-after 'unpack 'fix-commands
1249 (lambda* (#:key outputs #:allow-other-keys)
1250 (substitute* "launcher/game/choose_directory.rpy"
1251 (("/usr/bin/python") (which "python2")))
1252 (substitute* "launcher/game/front_page.rpy"
1253 (("xdg-open")
1254 (which "xdg-open")))
1255 (substitute* "launcher/game/project.rpy"
1256 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1257 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1258 "/bin/renpy\" ]"))
1259 ;; Projects are still created in the usual style, so we need
1260 ;; to adjust the path.
1261 (("cmd.append\\(self.path\\)")
1262 "cmd.append(self.path + \"/game\")"))
1263 #t))
1264 (add-after 'unpack 'drop-game-from-paths
1265 (lambda _
1266 (substitute* (list "launcher/game/gui7.rpy"
1267 "launcher/game/gui7/images.py")
1268 ((", \"game\",") ","))
1269 #t))
1270 (add-before 'build 'start-xserver
1271 (lambda* (#:key inputs #:allow-other-keys)
1272 (let ((xorg-server (assoc-ref inputs "xorg-server")))
1273 (setenv "HOME" (getcwd))
1274 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
1275 (setenv "DISPLAY" ":1")
1276 #t)))
1277 (replace 'build
1278 (lambda _
1279 (invoke "python" "renpy.py" "launcher" "quit")
1280 (invoke "python" "renpy.py" "the_question" "quit")
1281 (invoke "python" "renpy.py" "tutorial" "quit")
1282 #t))
1283 (replace 'install
1284 (lambda* (#:key inputs outputs #:allow-other-keys)
1285 ;; Here we install our custom renpy program.
1286 ;; After finishing this step, "out" will have the following:
1287 ;; |-- bin/renpy
1288 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1289 ;; `-- common
1290 ;;
1291 ;; Note that common is also a de facto unused directory in
1292 ;; python2-renpy. On other systems, renpy_base would point to
1293 ;; site-packages or even somewhere in /opt.
1294 ;; The former approach is not as straightforward as it seems
1295 ;; -- it causes renpy to load files twice for some weird reason --
1296 ;; and the latter is impossible on Guix. Hence the detour through
1297 ;; share/renpy and the custom renpy program.
1298 ;;
1299 ;; As a convention, other games should be installed as
1300 ;; subdirectories of share/renpy in their respective outputs as
1301 ;; well. This differs from the traditional layout, which is
1302 ;; roughly the following:
1303 ;; `-- Super Awesome Game
1304 ;; |-- game ; <- the folder we actually want
1305 ;; |-- lib ; compiled renpy module and dependencies
1306 ;; |-- renpy ; Ren'py python code (source + compiled)
1307 ;; |-- Super Awesome Game.py
1308 ;; `-- Super Awesome Game.sh
1309 (let* ((out (assoc-ref outputs "out"))
1310 (bin/renpy (string-append out "/bin/renpy")))
1311 (mkdir-p (string-append out "/bin"))
1312 (copy-recursively "renpy/common"
1313 (string-append out "/share/renpy/common"))
1314 (copy-recursively "gui"
1315 (string-append out "/share/renpy/gui"))
1316
1317 (call-with-output-file bin/renpy
1318 (lambda (port)
1319 (format port "#!~a~%" (which "python2"))
1320 (format port "
1321 from __future__ import print_function
1322
1323 import os
1324 import sys
1325 import warnings
1326
1327 def path_to_common(renpy_base):
1328 return renpy_base + \"/common\"
1329
1330 def path_to_saves(gamedir, save_directory=None):
1331 import renpy # @UnresolvedImport
1332
1333 if save_directory is None:
1334 save_directory = renpy.config.save_directory
1335 save_directory = renpy.exports.fsencode(save_directory)
1336
1337 if not save_directory:
1338 return gamedir + \"/saves\"
1339
1340 return os.path.expanduser(\"~~/.renpy/\" + save_directory)
1341
1342 def path_to_renpy_base():
1343 return \"~a\"
1344
1345 def main():
1346 renpy_base = path_to_renpy_base()
1347 try:
1348 import renpy.bootstrap
1349 import renpy.arguments
1350 except ImportError:
1351 print(\"\"\"Could not import renpy.bootstrap.
1352 Please ensure you decompressed Ren'Py correctly, preserving the directory
1353 structure.\"\"\", file=sys.stderr)
1354 raise
1355
1356 args = renpy.arguments.bootstrap()
1357 if not args.basedir:
1358 print(\"\"\"This Ren'py requires a basedir to launch.
1359 The basedir is the directory, in which .rpy files live -- usually the 'game'
1360 subdirectory of a game packaged by Ren'py.
1361
1362 If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
1363 file=sys.stderr)
1364 sys.exit()
1365
1366 renpy.bootstrap.bootstrap(renpy_base)
1367
1368 if __name__ == \"__main__\":
1369 main()
1370 "
1371 (string-append out "/share/renpy"))))
1372 (chmod bin/renpy #o755)
1373 #t)))
1374
1375 (add-after 'install 'install-games
1376 (lambda* (#:key outputs #:allow-other-keys)
1377 (define renpy (assoc-ref outputs "out"))
1378 ;; TODO: We should offer a renpy-build-system to make the
1379 ;; installation of Ren'py games easier.
1380 (define* (install-renpy-game #:key output game name (renpy renpy)
1381 #:allow-other-keys)
1382 (let* ((name (or name (basename game)))
1383 (launcher (string-append output "/bin/renpy-" name))
1384 (share (string-append output "/share/renpy/" name)))
1385 (copy-recursively (string-append game "/game") share)
1386 (mkdir-p (string-append output "/bin"))
1387 (with-output-to-file launcher
1388 (lambda ()
1389 (format #t
1390 "#!~a~%~a ~a \"$@\""
1391 (which "bash")
1392 (string-append renpy "/bin/renpy")
1393 share)))
1394 (chmod launcher #o755)))
1395
1396 (install-renpy-game #:output (assoc-ref outputs "out")
1397 #:game "launcher")
1398
1399 (install-renpy-game #:output (assoc-ref outputs "the-question")
1400 #:game "the_question"
1401 #:name "the-question")
1402
1403 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1404 #:game "tutorial")
1405 #t))
1406 (replace 'wrap
1407 (lambda* (#:key inputs outputs #:allow-other-keys)
1408 (wrap-program (string-append (assoc-ref outputs "out")
1409 "/bin/renpy")
1410 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
1411 #t)))))
1412 (inputs
1413 `(("python2-tkinter" ,python-2 "tk")
1414 ("python2-pygame" ,python2-pygame-sdl2)
1415 ("python2-renpy" ,python2-renpy)
1416 ("xorg-server" ,xorg-server)))
1417 (outputs
1418 (list "out" "tutorial" "the-question"))
1419 (home-page "https://www.renpy.org/")
1420 (synopsis "Visual Novel Engine")
1421 (description "Ren'Py is a visual novel engine that helps you use words,
1422 images, and sounds to tell interactive stories that run on computers and
1423 mobile devices. These can be both visual novels and life simulation games.
1424 The easy to learn script language allows anyone to efficiently write large
1425 visual novels, while its Python scripting is enough for complex simulation
1426 games.")
1427 (license license:expat)))
1428
1429 (define-public grafx2
1430 (package
1431 (name "grafx2")
1432 (version "2.4")
1433 (source (origin
1434 (method url-fetch)
1435 ;; XXX: There is no URL that contains the version. :(
1436 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1437 (sha256
1438 (base32
1439 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1440 (build-system gnu-build-system)
1441 (arguments
1442 '(#:phases
1443 (modify-phases %standard-phases
1444 (delete 'configure) ; no configure script
1445 (add-before 'build 'change-to-src-directory
1446 (lambda _
1447 (chdir "src")
1448 #t)))
1449 #:make-flags
1450 ;; SDL header files are referenced without the preceeding "SDL/".
1451 (list (string-append "CFLAGS=-I"
1452 (assoc-ref %build-inputs "sdl-union")
1453 "/include/SDL")
1454 (string-append "prefix="
1455 (assoc-ref %outputs "out")))
1456 #:tests? #f)) ; no check target
1457 (native-inputs
1458 `(("pkg-config" ,pkg-config)))
1459 (inputs
1460 `(("libpng" ,libpng)
1461 ("lua" ,lua-5.1)
1462 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
1463 (synopsis "Bitmap paint program")
1464 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1465 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1466 includes a very large number of tools and effects that make it particularly
1467 suitable for pixel art, game graphics, and generally any detailed graphics
1468 painted with a mouse.")
1469 (home-page "http://pulkomandy.tk/projects/GrafX2")
1470 (license license:gpl2))) ; GPLv2 only
1471
1472 (define-public ois
1473 (package
1474 (name "ois")
1475 (version "1.5")
1476 (source
1477 (origin
1478 (method git-fetch)
1479 (uri (git-reference
1480 (url "https://github.com/wgois/OIS")
1481 (commit (string-append "v" version))))
1482 (file-name (git-file-name name version))
1483 (sha256
1484 (base32 "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa"))))
1485 (build-system cmake-build-system)
1486 (arguments
1487 `(#:tests? #f)) ; no test suite
1488 (inputs
1489 `(("libx11" ,libx11)))
1490 (synopsis "Object Oriented Input System")
1491 (description
1492 "Cross Platform Object Oriented Input Lib System is a cross platform,
1493 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1494 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1495 robust and compatible with many systems and operating systems.")
1496 (home-page "https://github.com/wgois/OIS")
1497 (license license:zlib)))
1498
1499 (define-public mygui
1500 (package
1501 (name "mygui")
1502 (version "3.2.2")
1503 (source
1504 (origin
1505 (method git-fetch)
1506 (uri (git-reference
1507 (url "https://github.com/MyGUI/mygui")
1508 (commit (string-append "MyGUI" version))))
1509 (file-name (git-file-name name version))
1510 (sha256
1511 (base32
1512 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
1513 (build-system cmake-build-system)
1514 (arguments
1515 '(#:tests? #f ; No test target
1516 #:configure-flags
1517 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1518 (string-append "-DOGRE_INCLUDE_DIR="
1519 (assoc-ref %build-inputs "ogre")
1520 "/include/OGRE")
1521 ;; Demos and tools are Windows-specific:
1522 ;; https://github.com/MyGUI/mygui/issues/24.
1523 "-DMYGUI_BUILD_DEMOS=FALSE"
1524 "-DMYGUI_BUILD_TOOLS=FALSE")))
1525 (native-inputs
1526 `(("boost" ,boost)
1527 ("doxygen" ,doxygen)
1528 ("pkg-config" ,pkg-config)))
1529 (inputs
1530 `(("font-dejavu" ,font-dejavu)
1531 ("freetype" ,freetype)
1532 ("graphviz" ,graphviz)
1533 ("libx11" ,libx11)
1534 ("ogre" ,ogre)
1535 ("ois" ,ois)))
1536 (synopsis "Fast, flexible and simple GUI")
1537 (description
1538 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1539 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1540 of use.")
1541 (home-page "http://mygui.info/")
1542 (license license:expat)))
1543
1544 (define-public mygui-gl
1545 ;; Closure size is reduced by some 800 MiB.
1546 (package
1547 (inherit mygui)
1548 (name "mygui-gl")
1549 (version "3.2.2")
1550 (arguments
1551 (substitute-keyword-arguments (package-arguments mygui)
1552 ((#:configure-flags _)
1553 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1554 ;; We can't reuse the flags because of the mention to Ogre.
1555 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1556 ;; Demos and tools are Windows-specific:
1557 ;; https://github.com/MyGUI/mygui/issues/24.
1558 "-DMYGUI_BUILD_DEMOS=FALSE"
1559 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1560 (inputs
1561 `(("mesa" ,mesa)
1562 ("glu" ,glu)
1563 ,@(fold alist-delete (package-inputs mygui)
1564 '("ogre"))))
1565 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1566
1567 (define-public openmw
1568 (package
1569 (name "openmw")
1570 (version "0.46.0")
1571 (source
1572 (origin
1573 (method git-fetch)
1574 (uri (git-reference
1575 (url "https://github.com/OpenMW/openmw")
1576 (commit (string-append "openmw-" version))))
1577 (file-name (git-file-name name version))
1578 (sha256
1579 (base32
1580 "0rm32zsmxvr6b0jjihfj543skhicbw5kg6shjx312clhlm035w2x"))))
1581 (build-system cmake-build-system)
1582 (arguments
1583 `(#:tests? #f ; No test target
1584 #:configure-flags
1585 (list "-DDESIRED_QT_VERSION=5")))
1586 (native-inputs
1587 `(("boost" ,boost)
1588 ("doxygen" ,doxygen)
1589 ("pkg-config" ,pkg-config)))
1590 (inputs
1591 `(("bullet" ,bullet)
1592 ("ffmpeg" ,ffmpeg)
1593 ("libxt" ,libxt)
1594 ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
1595 ("openal" ,openal)
1596 ("openscenegraph" ,openmw-openscenegraph)
1597 ("qtbase" ,qtbase)
1598 ("sdl" ,sdl2)
1599 ("unshield" ,unshield)))
1600 (synopsis "Re-implementation of the RPG Morrowind engine")
1601 (description
1602 "OpenMW is a game engine which reimplements and extends the one that runs
1603 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1604 called OpenMW-CS which allows the user to edit or create their own original
1605 games.")
1606 (home-page "https://openmw.org")
1607 (license license:gpl3)))
1608
1609 (define-public godot
1610 (package
1611 (name "godot")
1612 (version "3.2.3")
1613 (source (origin
1614 (method git-fetch)
1615 (uri (git-reference
1616 (url "https://github.com/godotengine/godot")
1617 (commit (string-append version "-stable"))))
1618 (file-name (git-file-name name version))
1619 (sha256
1620 (base32
1621 "19vrp5lhyvxbm6wjxzn28sn3i0s8j08ca7nani8l1nrhvlc8wi0v"))
1622 (modules '((guix build utils)
1623 (ice-9 ftw)
1624 (srfi srfi-1)))
1625 (snippet
1626 '(begin
1627 ;; Keep only those bundled files we have not (yet) replaced
1628 ;; with Guix versions. Note that some of these may be
1629 ;; modified; see "thirdparty/README.md".
1630 (with-directory-excursion "thirdparty"
1631 (let* ((preserved-files
1632 '("README.md"
1633 "assimp"
1634 "certs"
1635 "cvtt"
1636 "enet"
1637 "etc2comp"
1638 "fonts"
1639 "glad"
1640 "jpeg-compressor"
1641 "libsimplewebm"
1642 "miniupnpc"
1643 "minizip"
1644 "misc"
1645 "nanosvg"
1646 "pvrtccompressor"
1647 "recastnavigation"
1648 "squish"
1649 "tinyexr"
1650 "vhacd"
1651 "xatlas")))
1652 (for-each delete-file-recursively
1653 (lset-difference string=?
1654 (scandir ".")
1655 (cons* "." ".." preserved-files)))))
1656 #t))))
1657 (build-system scons-build-system)
1658 (arguments
1659 `(#:scons ,scons-python2
1660 #:scons-flags (list "platform=x11" "target=release_debug"
1661 ;; Avoid using many of the bundled libs.
1662 ;; Note: These options can be found in the SConstruct file.
1663 "builtin_bullet=no"
1664 "builtin_freetype=no"
1665 "builtin_glew=no"
1666 "builtin_libmpdec=no"
1667 "builtin_libogg=no"
1668 "builtin_libpng=no"
1669 "builtin_libtheora=no"
1670 "builtin_libvorbis=no"
1671 "builtin_libvpx=no"
1672 "builtin_libwebp=no"
1673 "builtin_mbedtls=no"
1674 "builtin_opus=no"
1675 "builtin_pcre2=no"
1676 "builtin_wslay=no"
1677 "builtin_zlib=no"
1678 "builtin_zstd=no")
1679 #:tests? #f ; There are no tests
1680 #:phases
1681 (modify-phases %standard-phases
1682 (add-after 'unpack 'scons-use-env
1683 (lambda _
1684 ;; Scons does not use the environment variables by default,
1685 ;; but this substitution makes it do so.
1686 (substitute* "SConstruct"
1687 (("env_base = Environment\\(tools=custom_tools\\)")
1688 (string-append
1689 "env_base = Environment(tools=custom_tools)\n"
1690 "env_base = Environment(ENV=os.environ)")))
1691 #t))
1692 ;; Build headless tools, used for packaging games without depending on X.
1693 (add-after 'build 'build-headless
1694 (lambda* (#:key scons-flags #:allow-other-keys)
1695 (apply invoke "scons"
1696 `(,(string-append "-j" (number->string (parallel-job-count)))
1697 "platform=server" ,@(delete "platform=x11" scons-flags)))))
1698 (replace 'install
1699 (lambda* (#:key inputs outputs #:allow-other-keys)
1700 (let* ((out (assoc-ref outputs "out"))
1701 (headless (assoc-ref outputs "headless"))
1702 (zenity (assoc-ref inputs "zenity")))
1703 ;; Strip build info from filenames.
1704 (with-directory-excursion "bin"
1705 (for-each
1706 (lambda (file)
1707 (let ((dest (car (string-split (basename file) #\.))))
1708 (rename-file file dest)))
1709 (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
1710 (install-file "godot" (string-append out "/bin"))
1711 (install-file "godot_server" (string-append headless "/bin")))
1712 ;; Tell the editor where to find zenity for OS.alert().
1713 (wrap-program (string-append out "/bin/godot")
1714 `("PATH" ":" prefix (,(string-append zenity "/bin")))))
1715 #t))
1716 (add-after 'install 'install-godot-desktop
1717 (lambda* (#:key outputs #:allow-other-keys)
1718 (let* ((out (assoc-ref outputs "out"))
1719 (applications (string-append out "/share/applications"))
1720 (icons (string-append out "/share/icons/hicolor")))
1721 (mkdir-p applications)
1722 (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
1723 (string-append applications "/godot.desktop"))
1724 (for-each (lambda (icon dest)
1725 (mkdir-p (dirname dest))
1726 (copy-file icon dest))
1727 '("icon.png" "icon.svg")
1728 `(,(string-append icons "/256x256/apps/godot.png")
1729 ,(string-append icons "/scalable/apps/godot.svg"))))
1730 #t)))))
1731 (outputs '("out" "headless"))
1732 (native-inputs `(("pkg-config" ,pkg-config)))
1733 (inputs `(("alsa-lib" ,alsa-lib)
1734 ("bullet" ,bullet)
1735 ("freetype" ,freetype)
1736 ("glew" ,glew)
1737 ("glu" ,glu)
1738 ("libtheora" ,libtheora)
1739 ("libvorbis" ,libvorbis)
1740 ("libvpx" ,libvpx)
1741 ("libwebp" ,libwebp)
1742 ("libx11" ,libx11)
1743 ("libxcursor" ,libxcursor)
1744 ("libxi" ,libxi)
1745 ("libxinerama" ,libxinerama)
1746 ("libxrandr" ,libxrandr)
1747 ("mbedtls" ,mbedtls-apache)
1748 ("mesa" ,mesa)
1749 ("opusfile" ,opusfile)
1750 ("pcre2" ,pcre2)
1751 ("pulseaudio" ,pulseaudio)
1752 ("wslay" ,wslay)
1753 ("zenity" ,zenity)
1754 ("zstd" ,zstd "lib")))
1755 (home-page "https://godotengine.org/")
1756 (synopsis "Advanced 2D and 3D game engine")
1757 (description
1758 "Godot is an advanced multi-platform game engine written in C++. If
1759 features design tools such as a visual editor, can import 3D models and
1760 provide high-quality 3D rendering, it contains an animation editor, and can be
1761 scripted in a Python-like language.")
1762 (license license:expat)))
1763
1764 (define-public eureka
1765 (package
1766 (name "eureka")
1767 (version "1.24")
1768 (source (origin
1769 (method url-fetch)
1770 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1771 version "/eureka-"
1772 ;; version without dots e.g 1.21 => 121
1773 (string-join (string-split version #\.) "")
1774 "-source.tar.gz"))
1775 (sha256
1776 (base32
1777 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1778 (build-system gnu-build-system)
1779 (arguments
1780 '(#:tests? #f
1781 #:make-flags
1782 (let ((out (assoc-ref %outputs "out")))
1783 (list (string-append "PREFIX=" out)))
1784 #:phases
1785 (modify-phases %standard-phases
1786 (delete 'configure)
1787 (add-before 'build 'prepare-install-directories
1788 (lambda* (#:key outputs #:allow-other-keys)
1789 (let ((out (assoc-ref outputs "out")))
1790 (mkdir-p (string-append out "/bin"))
1791 (mkdir-p (string-append out "/share"))
1792
1793 (with-fluids ((%default-port-encoding #f))
1794 (substitute* "./src/main.cc"
1795 (("/usr/local") out)))
1796
1797 (substitute* "Makefile"
1798 (("-o root") ""))))))))
1799 (inputs `(("mesa" ,mesa)
1800 ("libxft" ,libxft)
1801 ("libxinerama" ,libxinerama)
1802 ("libfontconfig" ,fontconfig)
1803 ("libjpeg" ,libjpeg-turbo)
1804 ("libpng" ,libpng)
1805 ("fltk" ,fltk)
1806 ("zlib" ,zlib)))
1807 (native-inputs `(("pkg-config" ,pkg-config)
1808 ("xdg-utils" ,xdg-utils)))
1809 (synopsis "Doom map editor")
1810 (description "Eureka is a map editor for the classic DOOM games, and a few
1811 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1812 a 2D editor view.")
1813 (home-page "http://eureka-editor.sourceforge.net/")
1814 (license license:gpl2+)))
1815
1816 (define-public guile-chickadee
1817 (package
1818 (name "guile-chickadee")
1819 (version "0.6.0")
1820 (source (origin
1821 (method url-fetch)
1822 (uri (string-append "https://files.dthompson.us/chickadee/"
1823 "chickadee-" version ".tar.gz"))
1824 (sha256
1825 (base32
1826 "1jv4jkc35b7rizz8iflh74hhk9qy665isn1xa6gqz0qp9grwb019"))))
1827 (build-system gnu-build-system)
1828 (arguments
1829 '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
1830 (propagated-inputs
1831 `(("guile-opengl" ,guile3.0-opengl)
1832 ("guile-sdl2" ,guile3.0-sdl2)))
1833 (inputs
1834 `(("freetype" ,freetype)
1835 ("guile" ,guile-3.0)
1836 ("libvorbis" ,libvorbis)
1837 ("mpg123" ,mpg123)
1838 ("openal" ,openal)))
1839 (native-inputs
1840 `(("pkg-config" ,pkg-config)
1841 ("texinfo" ,texinfo)))
1842 (home-page "https://dthompson.us/projects/chickadee.html")
1843 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1844 (description "Chickadee is a game development toolkit for Guile Scheme
1845 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1846 that parenthetically inclined game developers need to make 2D (and eventually
1847 3D) games in Scheme, such as:
1848
1849 @enumerate
1850 @item extensible, fixed-timestep game loop
1851 @item OpenGL-based rendering engine
1852 @item keyboard, mouse, controller input
1853 @item REPL-driven development model
1854 @end enumerate\n")
1855 (license license:gpl3+)))
1856
1857 (define-public guile3.0-chickadee
1858 (deprecated-package "guile3.0-chickadee" guile-chickadee))
1859
1860 (define-public bennu-game-development
1861 (package
1862 (name "bennu-game-development")
1863 (version "353")
1864 (source (origin
1865 (method svn-fetch)
1866 (uri (svn-reference
1867 (url "http://svn.code.sf.net/p/bennugd/code")
1868 (revision (string->number version))))
1869 (file-name (string-append name "-" version))
1870 (sha256
1871 (base32
1872 "1iri58ryk9lbqn585cbccnvrfkj8qxlbcsk8rpih40jhvs1j101l"))
1873 (modules '((guix build utils)))
1874 (snippet
1875 '(begin
1876 (delete-file-recursively "3rdparty") #t))))
1877 (build-system gnu-build-system)
1878 (arguments
1879 '(#:phases
1880 (modify-phases %standard-phases
1881 (add-after 'unpack 'patch-configure-to-use-openssl
1882 (lambda* (#:key outputs #:allow-other-keys)
1883 (chdir "core")
1884 (delete-file "configure")
1885 (substitute* "configure.in"
1886 (("i\\*86\\)")
1887 "*)
1888 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
1889 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
1890 LIBSSL=\"crypto\"
1891 USE_OPENSSL=yes
1892 ;;
1893
1894 i*86)"))
1895 #t)))))
1896 (inputs `(("openssl" ,openssl)
1897 ("zlib" ,zlib)))
1898 (native-inputs `(("pkg-config" ,pkg-config)
1899 ("autoconf" ,autoconf)
1900 ("automake" ,automake)
1901 ("libtool" ,libtool)))
1902 (synopsis "Programming language to create games")
1903 (description "Bennu Game Development, also known as bennudg, is a
1904 programming language tailored at game development. It is the successor of
1905 Fenix.")
1906 (home-page "https://sourceforge.net/projects/bennugd/")
1907 (license license:zlib)))
1908
1909 (define-public bennu-game-development-modules
1910 (package
1911 (inherit bennu-game-development)
1912 (name "bennu-game-development-modules")
1913 (arguments
1914 '(#:phases
1915 (modify-phases %standard-phases
1916 (add-after 'unpack 'patch-conflicting-definitions
1917 (lambda _
1918 (with-fluids ((%default-port-encoding #f))
1919 (substitute* "core/include/fmath.h"
1920 (("extern fixed fmul\\( int x, int y \\);") "")
1921 (("extern fixed fdiv\\( int x, int y \\);") "")))
1922 (chdir "modules"))))))
1923 (inputs `(("zlib" ,zlib)
1924 ("libpng" ,libpng)
1925 ("openssl" ,openssl)
1926 ("sdl-mixer" ,sdl-mixer)
1927 ("bennu-game-development" ,bennu-game-development)))
1928 (synopsis "Modules for the Bennu Game Development programming language")
1929 (description "This package contains a collection of modules for the Bennu
1930 Game Development programming language, from CD handling through SDL to
1931 joystick support.")))
1932
1933 (define-public plib
1934 (package
1935 (name "plib")
1936 (version "1.8.5")
1937 (source (origin
1938 (method url-fetch)
1939 (uri (string-append "http://plib.sourceforge.net/dist/"
1940 "plib-" version ".tar.gz"))
1941 (sha256
1942 (base32
1943 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
1944 (patches (search-patches "plib-CVE-2011-4620.patch"
1945 "plib-CVE-2012-4552.patch"))))
1946 (build-system gnu-build-system)
1947 (inputs
1948 `(("mesa" ,mesa)
1949 ("libxi" ,libxi)
1950 ("libxmu" ,libxmu)))
1951 (native-inputs
1952 `(("pkg-config" ,pkg-config)))
1953 (home-page "http://plib.sourceforge.net/")
1954 (synopsis "Suite of portable game libraries")
1955 (description "PLIB is a set of libraries that will permit programmers to
1956 write games and other realtime interactive applications that are 100% portable
1957 across a wide range of hardware and operating systems. PLIB includes sound
1958 effects, music, a complete 3D engine, font rendering, a simple Windowing
1959 library, a game scripting language, a GUI, networking, 3D math library and a
1960 collection of handy utility functions. All are 100% portable across nearly
1961 all modern computing platforms. Each library component is fairly independent
1962 of the others")
1963 (license license:lgpl2.0+)))
1964
1965 (define-public ioquake3
1966 ;; We follow master since it seems that there won't be releases after 1.3.6.
1967 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
1968 (package
1969 (name "ioquake3")
1970 (version (git-version "1.3.6" "1" commit))
1971 (source
1972 (origin
1973 (method git-fetch)
1974 (uri (git-reference
1975 (url "https://github.com/ioquake/ioq3")
1976 (commit commit)))
1977 (file-name (git-file-name name version))
1978 (sha256
1979 (base32
1980 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
1981 (build-system gnu-build-system)
1982 (inputs
1983 `(("sdl2" ,sdl2)
1984 ("libjpeg" ,libjpeg-turbo)
1985 ("openal" ,openal)
1986 ("curl" ,curl)
1987 ("opusfile" ,opusfile)
1988 ("opus" ,opus)
1989 ("libvorbis" ,libvorbis)
1990 ("freetype" ,freetype)
1991 ("libogg" ,libogg)))
1992 (native-inputs
1993 `(("which" ,which) ; Else SDL_version.h won't be found.
1994 ("pkg-config" ,pkg-config)))
1995 (arguments
1996 '(#:tests? #f ; No tests.
1997 #:make-flags '("CC=gcc"
1998 "USE_INTERNAL_LIBS=0"
1999 "USE_FREETYPE=1"
2000 "USE_RENDERER_DLOPEN=0"
2001 "USE_OPENAL_DLOPEN=0"
2002 "USE_CURL_DLOPEN=0")
2003 #:phases
2004 (modify-phases %standard-phases
2005 (delete 'configure)
2006 (replace 'install
2007 (lambda* (#:key outputs #:allow-other-keys)
2008 (invoke "make" "copyfiles" "CC=gcc"
2009 "USE_INTERNAL_LIBS=0"
2010 (string-append "COPYDIR="
2011 (assoc-ref outputs "out")
2012 "/bin")))))))
2013 (home-page "https://ioquake3.org/")
2014 (synopsis "FPS game engine based on Quake 3")
2015 (description "ioquake3 is a free software first person shooter engine
2016 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
2017 the original, ioquake3 has been cleaned up, bugs have been fixed and features
2018 added. The permanent goal is to create the open source Quake 3 distribution
2019 upon which people base their games, ports to new platforms, and other
2020 projects.")
2021 (license license:gpl2))))
2022
2023 (define-public openvr
2024 (package
2025 (name "openvr")
2026 (version "1.8.19")
2027 (home-page "https://github.com/ValveSoftware/openvr/")
2028 (source
2029 (origin
2030 (method git-fetch)
2031 (uri (git-reference
2032 (url home-page)
2033 (commit (string-append "v" version))))
2034 (file-name (git-file-name name version))
2035 (sha256
2036 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
2037 (build-system cmake-build-system)
2038 (arguments
2039 ;; No tests.
2040 '(#:tests? #f
2041 #:configure-flags (list "-DBUILD_SHARED=1")))
2042 (synopsis "Virtual reality software development kit")
2043 (description "OpenVR is an API and runtime that allows access to VR
2044 hardware from multiple vendors without requiring that applications have
2045 specific knowledge of the hardware they are targeting.")
2046 (license license:bsd-3)))
2047
2048 (define-public flatzebra
2049 (package
2050 (name "flatzebra")
2051 (version "0.1.7")
2052 (source
2053 (origin
2054 (method url-fetch)
2055 (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
2056 "flatzebra-" version ".tar.gz"))
2057 (sha256
2058 (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
2059 (build-system gnu-build-system)
2060 (arguments
2061 `(#:phases
2062 (modify-phases %standard-phases
2063 (add-after 'unpack 'fix-sdl-config
2064 (lambda* (#:key inputs #:allow-other-keys)
2065 ;; XXX: sdl-config in sdl-union is a link to sdl-config from
2066 ;; plain sdl package. As a consequence, the prefix is wrong.
2067 ;; Force correct one with "--prefix" argument.
2068 (let ((sdl-union (assoc-ref inputs "sdl")))
2069 (setenv "SDL_CONFIG"
2070 (string-append sdl-union
2071 "/bin/sdl-config --prefix="
2072 sdl-union)))
2073 #t)))))
2074 (native-inputs
2075 `(("pkg-config" ,pkg-config)))
2076 (inputs
2077 `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
2078 (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
2079 (synopsis "Generic game engine for 2D double-buffering animation")
2080 (description
2081 "Flatzebra is a simple, generic C++ game engine library supporting 2D
2082 double-buffering.")
2083 (license license:gpl2+)))
2084
2085 (define-public fna
2086 (package
2087 (name "fna")
2088 (version "19.12.01")
2089 (source
2090 (origin
2091 (method git-fetch)
2092 (uri (git-reference
2093 (url "https://github.com/FNA-XNA/FNA")
2094 (commit version)))
2095 (file-name (git-file-name name version))
2096 (sha256
2097 (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
2098 (build-system gnu-build-system)
2099 (arguments
2100 '(#:tests? #f ; No tests.
2101 #:phases
2102 (modify-phases %standard-phases
2103 (add-after 'unpack 'link-dep-src
2104 (lambda* (#:key inputs #:allow-other-keys)
2105 (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
2106 (mojoshader (assoc-ref inputs "mojoshader-src"))
2107 (faudio (assoc-ref inputs "faudio-src"))
2108 (theorafile (assoc-ref inputs "theorafile-src")))
2109 (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
2110 (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
2111 (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
2112 (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
2113 (delete 'configure)
2114 (replace 'build
2115 (lambda _
2116 (invoke "make" "release")))
2117 (replace 'install
2118 (lambda* (#:key outputs #:allow-other-keys)
2119 (let ((out (assoc-ref outputs "out")))
2120 (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
2121 #t))))))
2122 (native-inputs
2123 `(("mono" ,mono)))
2124 (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
2125 ("mojoshader-src" ,(package-source mojoshader-cs))
2126 ("faudio-src" ,(package-source faudio))
2127 ("theorafile-src" ,(package-source theorafile))))
2128 (home-page "https://fna-xna.github.io/")
2129 (synopsis "Accuracy-focused XNA4 reimplementation")
2130 (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
2131 focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
2132 (license (list license:ms-pl ; FNA
2133 license:lgpl2.1 ; LzxDecoder.cs
2134 ;; Mono.Xna:
2135 license:expat))))
2136
2137 (define-public libccd
2138 (package
2139 (name "libccd")
2140 (version "2.1")
2141 (source
2142 (origin
2143 (method git-fetch)
2144 (uri (git-reference
2145 (url "https://github.com/danfis/libccd")
2146 (commit (string-append "v" version))))
2147 (file-name (git-file-name name version))
2148 (sha256
2149 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2150 (build-system cmake-build-system)
2151 (arguments
2152 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2153 "-DBUILD_TESTING=ON"
2154 "-DENABLE_DOUBLE_PRECISION=ON")))
2155 (native-inputs
2156 `(("python-sphinx" ,python-sphinx)))
2157 (home-page "https://github.com/danfis/libccd")
2158 (synopsis "Library for collision detection between two convex shapes")
2159 (description "@code{libccd} is library for a collision detection
2160 between two convex shapes. @code{libccd} implements variation on
2161 Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2162 and also implements algorithm Minkowski Portal Refinement (MPR,
2163 a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2164 (license license:expat)))
2165
2166 (define-public ode
2167 (package
2168 (name "ode")
2169 (version "0.16.2")
2170 (source
2171 (origin
2172 (method url-fetch)
2173 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2174 "ode-" version ".tar.gz"))
2175 (sha256
2176 (base32 "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj"))
2177 (modules '((guix build utils)))
2178 (snippet
2179 '(begin
2180 (delete-file-recursively "libccd")
2181 #t))))
2182 (build-system cmake-build-system)
2183 (arguments
2184 `(#:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
2185 #:phases
2186 (modify-phases %standard-phases
2187 (add-after 'unpack 'unbundle-libccd
2188 (lambda _
2189 (substitute* "CMakeLists.txt"
2190 (("configure_file\\(libccd/.*") ""))
2191 #t)))))
2192 (inputs
2193 `(("glu" ,glu)
2194 ("libccd" ,libccd)
2195 ("mesa" ,mesa)))
2196 (home-page "https://www.ode.org/")
2197 (synopsis "High performance library for simulating rigid body dynamics")
2198 (description "ODE is a high performance library for simulating
2199 rigid body dynamics. It is fully featured, stable, mature and
2200 platform independent with an easy to use C/C++ API. It has advanced
2201 joint types and integrated collision detection with friction. ODE is
2202 useful for simulating vehicles, objects in virtual reality
2203 environments and virtual creatures. It is currently used in many
2204 computer games, 3D authoring tools and simulation tools.")
2205 ;; Software is dual-licensed.
2206 (license (list license:lgpl2.1+ license:expat))))
2207
2208 (define-public chipmunk
2209 (package
2210 (name "chipmunk")
2211 (version "7.0.3")
2212 (source
2213 (origin
2214 (method git-fetch)
2215 (uri (git-reference
2216 (url "https://github.com/slembcke/Chipmunk2D")
2217 (commit (string-append "Chipmunk-" version))))
2218 (file-name (git-file-name name version))
2219 (sha256
2220 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2221 (build-system cmake-build-system)
2222 (arguments
2223 `(#:tests? #f ;no test
2224 #:configure-flags '("-DBUILD_STATIC=OFF"
2225 "-DBUILD_DEMOS=OFF")))
2226 (inputs
2227 `(("freeglut" ,freeglut)
2228 ("libxmu" ,libxmu)
2229 ("libxrandr" ,libxrandr)))
2230 (home-page "https://chipmunk-physics.net/")
2231 (synopsis "Fast and lightweight 2D game physics library")
2232 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2233 rigid body physics library written in C.")
2234 (license license:expat)))
2235
2236 (define-public libtcod
2237 (package
2238 (name "libtcod")
2239 (version "1.15.1")
2240 (source (origin
2241 (method git-fetch)
2242 (uri (git-reference
2243 (url "https://github.com/libtcod/libtcod")
2244 (commit version)))
2245 (file-name (git-file-name name version))
2246 (sha256
2247 (base32
2248 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
2249 (modules '((guix build utils)))
2250 (snippet '(begin
2251 (delete-file-recursively "src/vendor/utf8proc")
2252 (delete-file-recursively "src/vendor/zlib")
2253 (delete-file "src/vendor/stb_truetype.h")
2254 (delete-file "src/vendor/stb_sprintf.h")
2255 (delete-file "src/vendor/lodepng.cpp")
2256 (delete-file "src/vendor/lodepng.h")
2257
2258 (substitute* "buildsys/autotools/sources.am"
2259 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
2260 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
2261 "../../src/vendor/stb.c")
2262 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
2263
2264 (substitute* "src/libtcod/sys_sdl_img_png.cpp"
2265 (("\\.\\./vendor/") ""))
2266
2267 (substitute* '("src/libtcod/color/canvas.cpp"
2268 "src/libtcod/sys_sdl_img_png.cpp"
2269 "src/libtcod/tileset/truetype.cpp"
2270 "src/libtcod/tileset/tilesheet.cpp")
2271 (("\\.\\./\\.\\./vendor/") ""))
2272
2273 (substitute* "src/libtcod/console/printing.cpp"
2274 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
2275 #t))))
2276 (build-system gnu-build-system)
2277 (arguments
2278 `(#:configure-flags '("--with-gnu-ld"
2279 "LIBS=-lutf8proc -llodepng")
2280 #:phases
2281 (modify-phases %standard-phases
2282 (add-after 'unpack 'change-to-build-dir
2283 (lambda _
2284 (chdir "buildsys/autotools")
2285 (patch-shebang "get_version.py")
2286 #t)))))
2287 (native-inputs
2288 `(("autoconf" ,autoconf)
2289 ("automake" ,automake)
2290 ("libtool" ,libtool)
2291 ("python" ,python)
2292 ("pkg-config" ,pkg-config)
2293 ("stb-sprintf" ,stb-sprintf)
2294 ("stb-truetype" ,stb-truetype)))
2295 (inputs
2296 `(("lodepng" ,lodepng)
2297 ("sdl2" ,sdl2)
2298 ("utf8proc" ,utf8proc)
2299 ("zlib" ,zlib)))
2300 (home-page "https://github.com/libtcod/libtcod")
2301 (synopsis "Library specifically designed for writing roguelikes")
2302 (description
2303 "libtcod is a fast, portable and uncomplicated API for roguelike
2304 developers providing an advanced true color console, input, and lots of other
2305 utilities frequently used in roguelikes.")
2306 (license license:bsd-3)))
2307
2308 (define-public warsow-qfusion
2309 ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
2310 ;; The 2.5 beta as published on the homepage is commit
2311 ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
2312 (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
2313 (package
2314 (name "warsow-qfusion")
2315 (version (git-version "2.5" "1" commit)) ; 2.5-beta
2316 (source (origin
2317 (method git-fetch)
2318 (uri (git-reference
2319 (url "https://github.com/Warsow/qfusion/")
2320 (commit commit)
2321 (recursive? #t)))
2322 (file-name (git-file-name name version))
2323 (sha256
2324 (base32
2325 "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
2326 ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
2327 (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
2328 (modules '((guix build utils)))
2329 (snippet '(begin
2330 (delete-file-recursively "platforms")
2331 (delete-file-recursively "debian")
2332 (delete-file-recursively "libsrcs")
2333 #t))))
2334 (build-system cmake-build-system)
2335 (arguments
2336 `(#:tests? #f ; No tests.
2337 #:configure-flags '("-DQFUSION_GAME=Warsow")
2338 #:modules
2339 ((guix build utils)
2340 (guix build cmake-build-system)
2341 (ice-9 match))
2342 #:phases
2343 (modify-phases %standard-phases
2344 (add-after 'unpack 'change-to-build-dir
2345 (lambda _
2346 (chdir "source")
2347 #t))
2348 (add-after 'install 'really-install
2349 (lambda* (#:key outputs system #:allow-other-keys)
2350 (let ((arch (match system
2351 ("x86_64-linux" "x86_64")
2352 ("i686-linux" "i386")))
2353 (out (assoc-ref outputs "out")))
2354 (install-file (string-append "../source/build/basewsw/libgame_"
2355 arch ".so")
2356 (string-append out "/lib/"))
2357 (install-file (string-append "../source/build/libui_" arch ".so")
2358 (string-append out "/lib/"))
2359 (for-each
2360 (lambda (file)
2361 (install-file file (string-append out "/bin/")))
2362 (append (find-files "../source/build" "warsow")
2363 (find-files "../source/build" "wsw_server."))))
2364 #t)))))
2365 (inputs
2366 `(("alsa-lib" ,alsa-lib)
2367 ("curl" ,curl)
2368 ("freetype" ,freetype)
2369 ("ffmpeg" ,ffmpeg)
2370 ("libjpeg" ,libjpeg-turbo)
2371 ("libogg" ,libogg)
2372 ("libpng" ,libpng)
2373 ("libtheora" ,libtheora)
2374 ("libvorbis" ,libvorbis)
2375 ("mesa" ,mesa)
2376 ("openal" ,openal)
2377 ("pulseaudio" ,pulseaudio)
2378 ("qtbase" ,qtbase)
2379 ("qtdeclarative" ,qtdeclarative)
2380 ("sdl2" ,sdl2)
2381 ("uuid.h" ,util-linux "lib")
2382 ("zlib" ,zlib)))
2383 (native-inputs
2384 `(("pkg-config" ,pkg-config)))
2385 (home-page "https://github.com/Warsow/qfusion")
2386 (supported-systems '("i686-linux" "x86_64-linux"))
2387 (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
2388 (description
2389 "This package contains the game engine of Warsow, a first-person
2390 shooter video game. The engine is based on qfusion, the id Tech 2 derived
2391 game engine. id Tech 2 is the engine originally behind Quake 2.")
2392 (license license:gpl2+))))
2393
2394 (define-public dhewm3
2395 (package
2396 (name "dhewm3")
2397 (version "1.5.0")
2398 (source (origin
2399 (method url-fetch)
2400 (uri (string-append
2401 "https://github.com/dhewm/dhewm3/releases/download/"
2402 version "/dhewm3-" version "-src.tar.xz"))
2403 (sha256
2404 (base32
2405 "0dmd1876az5q8gbjrd1jk8zidz11ydj607z3m8m5kvw2yj136jzv"))))
2406 (build-system cmake-build-system)
2407 (arguments
2408 `(#:tests? #f ; No tests.
2409 #:phases
2410 (modify-phases %standard-phases
2411 (add-after 'unpack 'change-to-build-dir
2412 (lambda _
2413 (chdir "neo")
2414 #t)))))
2415 (inputs
2416 `(("curl" ,curl)
2417 ("libjpeg" ,libjpeg-turbo)
2418 ("libogg" ,libogg)
2419 ("libvorbis" ,libvorbis)
2420 ("libx11" ,libx11)
2421 ("openal" ,openal)
2422 ("sdl2" ,sdl2)
2423 ("zlib" ,zlib)))
2424 (home-page "https://dhewm3.org/")
2425 (synopsis "Port of the original Doom 3 engine")
2426 (description
2427 "@command{dhewm3} is a source port of the original Doom 3 engine (not
2428 Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
2429 version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
2430 sound effects on all operating systems and hardware (via OpenAL Softs EFX
2431 support), has much better support for widescreen resolutions and has 64bit
2432 support.")
2433 (license license:gpl3)))
2434
2435 (define-public tesseract-engine
2436 (let ((svn-revision 2411))
2437 (package
2438 (name "tesseract-engine")
2439 (version (string-append "20200615-" (number->string svn-revision)))
2440 (source
2441 (origin
2442 (method svn-fetch)
2443 (uri (svn-reference
2444 (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
2445 (revision svn-revision)))
2446 (file-name (git-file-name name version))
2447 (sha256
2448 (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
2449 (modules '((guix build utils)))
2450 (snippet
2451 '(begin
2452 (for-each delete-file-recursively
2453 '("bin" "bin64"
2454 ;; Remove "media" since some files such as
2455 ;; media/sound/game/soundsnap/info.txt refer to a
2456 ;; non-commercial license.
2457 "media"
2458 "server.bat"
2459 "tesseract.bat"
2460 "src/lib"
2461 "src/lib64"))
2462 #t))))
2463 (build-system gnu-build-system)
2464 (arguments
2465 `(#:make-flags (list "CC=gcc")
2466 #:tests? #f ; No tests.
2467 #:phases
2468 (modify-phases %standard-phases
2469 (delete 'configure)
2470 (add-after 'unpack 'cd-src
2471 (lambda _ (chdir "src") #t))
2472 (add-before 'build 'fix-env
2473 (lambda* (#:key inputs #:allow-other-keys)
2474 (setenv "CPATH"
2475 (string-append (assoc-ref inputs "sdl2-union")
2476 "/include/SDL2:"
2477 (or (getenv "CPATH") "")))
2478 #t))
2479 (add-after 'install 'really-install
2480 (lambda* (#:key outputs #:allow-other-keys)
2481 (let* ((out (assoc-ref outputs "out"))
2482 (share (string-append out "/share/tesseract"))
2483 (bin (string-append out "/bin/tesseract"))
2484 (client (string-append out "/bin/tesseract-client")))
2485 (chdir "..") ; Back to root.
2486 (for-each
2487 (lambda (dir)
2488 (mkdir-p (string-append share "/" dir))
2489 (copy-recursively dir (string-append share "/" dir)))
2490 '("config"))
2491 (mkdir-p (string-append out "/bin/"))
2492 (copy-file "bin_unix/native_client" client)
2493 (copy-file "bin_unix/native_server"
2494 (string-append out "/bin/tesseract-server"))
2495 (call-with-output-file bin
2496 (lambda (p)
2497 (format p "#!~a
2498 TESS_DATA=~a
2499 TESS_BIN=~a
2500 TESS_OPTIONS=\"-u$HOME/.tesseract\"
2501 cd \"$TESS_DATA\"
2502 exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
2503 (which "bash")
2504 share
2505 client)))
2506 (chmod bin #o755)
2507 (install-file "src/readme_tesseract.txt"
2508 (string-append out "/share/licenses/tesseract/LICENSE")))
2509 #t)))))
2510 (inputs
2511 `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
2512 ("zlib" ,zlib)
2513 ("libpng" ,libpng)
2514 ("libgl" ,mesa)))
2515 (home-page "http://tesseract.gg/")
2516 (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
2517 (description "This package contains the game engine of Tesseract, a
2518 first-person shooter focused on cooperative in-game map editing.
2519
2520 The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
2521 upgraded modern rendering techniques. The new rendering features include
2522 fully dynamic omnidirectional shadows, global illumination, HDR lighting,
2523 deferred shading, morphological / temporal / multisample anti-aliasing, and
2524 much more.")
2525 (license license:zlib))))