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