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