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