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