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