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