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