gnu: Add font-artifika.
[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
8394619b 523 (list qtbase-5 qtdeclarative qtsvg 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
62a74551
LMP
1212 ;; Using latest git commit as of 2022-06-17, because there is no tagged
1213 ;; release for renpy 8.
1214 ;; Revert back to URLs once renpy 8 is released!
8476e585 1215 (let ((real-version "2.1.0")
62a74551
LMP
1216 ;;(renpy-version "8.0.0")
1217 (commit "1705c6e3004dcb1daf859560bcd52eb093e97d45"))
8476e585 1218 (package
313d5e62
LP
1219 (inherit python-pygame)
1220 (name "python-pygame-sdl2")
62a74551 1221 (version (git-version real-version "0" commit))
8476e585
CY
1222 (source
1223 (origin
62a74551
LMP
1224 (method git-fetch)
1225 (uri (git-reference
1226 (url "https://github.com/renpy/pygame_sdl2")
1227 (commit commit)))
1228 (file-name (git-file-name name version))
1229 (sha256 (base32 "1g0arhpd59zypspk36sgajf1kzavppfkv766vifvxar60968rrjn"))))
8476e585
CY
1230 (build-system python-build-system)
1231 (arguments
1232 `(#:tests? #f ; tests require pygame to be installed first
8476e585
CY
1233 #:phases
1234 (modify-phases %standard-phases
1235 (add-after 'set-paths 'set-sdl-vars
1236 (lambda* (#:key inputs #:allow-other-keys)
1237 (setenv "PYGAME_SDL2_CFLAGS"
1238 (string-append "-I"
1239 (assoc-ref inputs "sdl-union")
1240 "/include/SDL2 -D_REENTRANT"))
1241 (setenv "PYGAME_SDL2_LDFLAGS"
1242 (string-append "-L"
1243 (assoc-ref inputs "sdl-union")
1244 "/lib -Wl,-rpath,"
1245 (assoc-ref inputs "sdl-union")
1246 "/lib -Wl,--enable-new-dtags -lSDL2"))
8476e585
CY
1247 #t)))))
1248 (inputs
8394619b 1249 (list (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))))
8476e585 1250 (native-inputs
8394619b 1251 (list python-cython))
dfb67d2c 1252 (home-page "https://www.renpy.org/")
8476e585
CY
1253 (synopsis "Reimplementation of the Pygame API using SDL2")
1254 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1255staying close to the original, but also adding some SDL2-specific features.
1256While it aims to be used as a drop-in replacement, it appears to be
1257developed mainly for Ren'py.")
1258 (license (list license:lgpl2.1 license:zlib)))))
1259
6c04a896
LMP
1260;; Using nightly from 2022-06-16.
1261;; Revert back to URLs once renpy 8 is released!
1262(define %renpy-commit "3e854bc7cb1642ca18b061a0c6e349f168965c43")
8e19e3a3 1263(define-public python-renpy
8476e585 1264 (package
8e19e3a3 1265 (name "python-renpy")
6c04a896 1266 (version (git-version "7.99.99" "0" %renpy-commit))
8476e585
CY
1267 (source
1268 (origin
6c04a896
LMP
1269 (method git-fetch)
1270 (uri (git-reference
1271 (url "https://github.com/renpy/renpy")
1272 (commit %renpy-commit)))
1273 (file-name (git-file-name name version))
1274 (sha256 (base32 "11g7hqhw4gbkx5ib2wsawrznmjbn8r9zkgf2sg39z56h96y8wfbn"))
1592491c
LP
1275 (modules '((guix build utils)))
1276 (patches
1277 (search-patches
1278 "renpy-use-system-fribidi.patch"))
1279 (snippet
1280 '(with-directory-excursion "module"
1592491c
LP
1281 ;; drop fribidi sources
1282 (delete-file-recursively "fribidi-src")
1283 #t))))
8476e585
CY
1284 (build-system python-build-system)
1285 (arguments
9f1bd63f 1286 `(#:tests? #f ; Ren'py doesn't seem to package tests
8476e585
CY
1287 #:phases
1288 (modify-phases %standard-phases
1289 (add-after 'unpack 'fix-commands
3d7dea09 1290 (lambda* (#:key inputs #:allow-other-keys)
8476e585
CY
1291 (substitute* "renpy/editor.py"
1292 (("xdg-open")
3d7dea09 1293 (string-append (assoc-ref inputs "xdg-utils")
9f1bd63f 1294 "/bin/xdg-open")))))
1592491c
LP
1295 (add-after 'unpack 'fix-include-paths
1296 (lambda* (#:key inputs #:allow-other-keys)
1297 (substitute* "module/setup.py"
1298 (("/usr/include/fribidi")
425ccde6 1299 (search-input-directory inputs "include/fribidi")))))
8476e585 1300 (add-after 'set-paths 'set-build-vars
3d7dea09 1301 (lambda* (#:key inputs native-inputs #:allow-other-keys)
8476e585 1302 (setenv "RENPY_CYTHON"
bc64d955
LC
1303 (search-input-file (or native-inputs inputs)
1304 "/bin/cython"))
9f1bd63f 1305 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))))
8476e585 1306 (replace 'build
37c52b5b
LP
1307 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1308 ;; The "module" subdirectory contains a python (really cython)
1309 ;; project, which is built using a script, that is thankfully
1310 ;; named "setup.py".
1311 (with-directory-excursion "module"
1312 (apply (assoc-ref %standard-phases 'build) args))
72d43df6
LMP
1313 ;; The above only builds the cython modules, but nothing else,
1314 ;; so we do that here.
9f1bd63f 1315 (invoke "python" "-m" "compileall" "renpy")))
8476e585 1316 (replace 'install
37c52b5b
LP
1317 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1318 ;; Again, we have to wrap the module installation.
1319 ;; Additionally, we want to install the python code
1320 ;; (both source and compiled) in the same directory.
1321 (let* ((out (assoc-ref outputs "out"))
1322 (site (string-append "/lib/python"
eaa99857
LP
1323 (python-version
1324 (assoc-ref inputs "python"))
37c52b5b
LP
1325 "/site-packages")))
1326 (with-directory-excursion "module"
1327 (apply (assoc-ref %standard-phases 'install) args))
1328 (copy-recursively "renpy"
d4bef961 1329 (string-append out site "/renpy"))
9f1bd63f
MC
1330 (delete-file-recursively (string-append out site
1331 "/renpy/common"))))))))
1332 (native-inputs (list python-cython))
8476e585 1333 (inputs
8394619b
LC
1334 (list ffmpeg
1335 freetype
1336 fribidi
1337 glew
1338 libpng
1339 (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))
1340 xdg-utils))
9f1bd63f 1341 (propagated-inputs (list python-future python-pygame-sdl2))
22e5a77a 1342 (home-page "https://www.renpy.org/")
8476e585 1343 (synopsis "Ren'py python module")
a613e626
LP
1344 (description "This package contains the shared libraries and Python modules
1345of Ren'py. While functional, they are not meaningful on their own without
1346the launcher and common Ren'py code provided by the @code{renpy} package and
1347are only used to bootstrap it.")
8476e585
CY
1348 (license license:expat)))
1349
8e19e3a3
LMP
1350(define-public renpy
1351 (package
1352 (inherit python-renpy)
1353 (name "renpy")
1354 (build-system python-build-system)
1355 (arguments
f7d66e41
LMP
1356 (list
1357 #:tests? #f ; see python-renpy
1358 #:modules '((srfi srfi-1)
8e19e3a3
LMP
1359 (guix build python-build-system)
1360 (guix build utils))
f7d66e41
LMP
1361 #:imported-modules `((srfi srfi-1) ,@%python-build-system-modules)
1362 #:phases
1363 #~(modify-phases %standard-phases
1364 (add-after 'unpack 'fix-commands
1365 (lambda* (#:key inputs outputs #:allow-other-keys)
1366 (substitute* "launcher/game/choose_directory.rpy"
1367 (("/usr/bin/python")
1368 (search-input-file inputs "/bin/python3")))
1369 (substitute* "launcher/game/front_page.rpy"
1370 (("xdg-open")
1371 (search-input-file inputs "/bin/xdg-open")))
1372 (substitute* "launcher/game/project.rpy"
1373 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1374 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1375 "/bin/renpy\" ]"))
1376 ;; Projects are still created in the usual style, so we need
1377 ;; to adjust the path.
1378 (("cmd.append\\(self.path\\)")
1379 "cmd.append(self.path + \"/game\")"))))
1380 (add-after 'unpack 'drop-game-from-paths
1381 (lambda _
1382 (substitute* (list "launcher/game/gui7.rpy"
1383 "launcher/game/gui7/images.py")
1384 ((", \"game\",") ","))
1385 #t))
1386 (add-before 'build 'start-xserver
1387 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1388 (let ((Xvfb (search-input-file (or native-inputs inputs)
1389 "/bin/Xvfb")))
1390 (setenv "HOME" (getcwd))
1391 (system (format #f "~a :1 &" Xvfb))
1392 (setenv "DISPLAY" ":1"))))
1393 (replace 'build
1394 (lambda _
1395 (invoke "python" "renpy.py" "launcher" "quit")
1396 (invoke "python" "renpy.py" "the_question" "quit")
1397 (invoke "python" "renpy.py" "tutorial" "quit")))
1398 (replace 'install
1399 (lambda* (#:key inputs outputs #:allow-other-keys)
1400 ;; Here we install our custom renpy program.
1401 ;; After finishing this step, "out" will have the following:
1402 ;; |-- bin/renpy
1403 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1404 ;; |-- common
1405 ;; `-- gui
1406 ;;
1407 ;; Note that common shares the source files that would be installed
1408 ;; by python2-renpy (which are instead deleted from that package),
1409 ;; but also contains their byte-compiled versions.
1410 ;; On other systems, renpy_base would point to site-packages or
1411 ;; even somewhere in /opt.
1412 ;; The former approach is not as straightforward as it seems
1413 ;; -- it causes renpy to load files twice for some weird reason --
1414 ;; and the latter is impossible on Guix. Hence the detour through
1415 ;; share/renpy and the custom renpy program.
1416 ;;
1417 ;; As a convention, other games should be installed as
1418 ;; subdirectories of share/renpy in their respective outputs as
1419 ;; well. This differs from the traditional layout, which is
1420 ;; roughly the following:
1421 ;; `-- Super Awesome Game
1422 ;; |-- game ; <- the folder we actually want
1423 ;; |-- lib ; compiled renpy module and dependencies
1424 ;; |-- renpy ; yet another copy of Ren'py's code
1425 ;; | |-- common ; the common folder from above
1426 ;; | `-- ... ; Python code (source + compiled)
1427 ;; |-- Super Awesome Game.py
1428 ;; `-- Super Awesome Game.sh
1429 (let* ((out (assoc-ref outputs "out"))
1430 (bin/renpy (string-append out "/bin/renpy")))
1431 (copy-recursively "renpy/common"
1432 (string-append out "/share/renpy/common"))
1433 (copy-recursively "gui"
1434 (string-append out "/share/renpy/gui"))
8e19e3a3 1435
f7d66e41
LMP
1436 (mkdir-p (string-append out "/bin"))
1437 (copy-file #$(local-file (search-auxiliary-file "renpy/renpy.in"))
1438 bin/renpy)
1439 (substitute* bin/renpy
1440 (("@PYTHON@") (search-input-file inputs "bin/python3"))
1441 (("@RENPY_BASE@") (string-append out "/share/renpy")))
1442 (chmod bin/renpy #o755))))
8e19e3a3 1443
f7d66e41
LMP
1444 (add-after 'install 'install-games
1445 (lambda* (#:key inputs outputs #:allow-other-keys)
1446 (define renpy (assoc-ref outputs "out"))
1447 ;; TODO: We should offer a renpy-build-system to make the
1448 ;; installation of Ren'py games easier.
1449 (define* (install-renpy-game #:key output game name (renpy renpy)
1450 #:allow-other-keys)
1451 (let* ((name (or name (basename game)))
1452 (launcher (string-append output "/bin/renpy-" name))
1453 (share (string-append output "/share/renpy/" name)))
1454 (copy-recursively (string-append game "/game") share)
1455 (mkdir-p (string-append output "/bin"))
1456 (with-output-to-file launcher
1457 (lambda ()
1458 (format #t
1459 "#!~a~%~a ~a \"$@\""
1460 (search-input-file inputs "/bin/bash")
1461 (string-append renpy "/bin/renpy")
1462 share)))
1463 (chmod launcher #o755)))
8e19e3a3 1464
f7d66e41
LMP
1465 (install-renpy-game #:output (assoc-ref outputs "out")
1466 #:game "launcher")
8e19e3a3 1467
f7d66e41
LMP
1468 (install-renpy-game #:output (assoc-ref outputs "the-question")
1469 #:game "the_question"
1470 #:name "the-question")
8e19e3a3 1471
f7d66e41
LMP
1472 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1473 #:game "tutorial")))
1474 (replace 'wrap
1475 (lambda* (#:key inputs outputs #:allow-other-keys)
1476 (let ((out (assoc-ref outputs "out"))
1477 (site (string-append "/lib/python"
1478 (python-version
1479 (assoc-ref inputs "python"))
1480 "/site-packages")))
1481 (wrap-program (string-append out "/bin/renpy")
1482 `("GUIX_PYTHONPATH" =
1483 (,@(delete-duplicates
1484 (map
1485 (lambda (store-path)
1486 (string-append store-path site))
1487 (cons (assoc-ref outputs "out")
1488 (map cdr
1489 (filter
1490 (lambda (input)
1491 (string-prefix? "python" (car input)))
1492 inputs))))))))))))))
1493 (inputs (list bash-minimal
1494 python
1495 python-pefile
1496 python-requests
1497 python-renpy
1498 python-six
1499 `(,python "tk")
1500 xdg-utils))
8e19e3a3 1501 (propagated-inputs '())
f7d66e41
LMP
1502 (native-inputs (list xorg-server-for-tests))
1503 (outputs (list "out" "tutorial" "the-question"))
8e19e3a3
LMP
1504 (home-page "https://www.renpy.org/")
1505 (synopsis "Visual Novel Engine")
1506 (description "Ren'Py is a visual novel engine that helps you use words,
1507images, and sounds to tell interactive stories that run on computers and
1508mobile devices. These can be both visual novels and life simulation games.
1509The easy to learn script language allows anyone to efficiently write large
1510visual novels, while its Python scripting is enough for complex simulation
1511games.")
1512 (license license:expat)))
1513
bca5d7db
LP
1514(define-public python-pyxel
1515 (package
1516 (name "python-pyxel")
1517 (version "1.4.3")
1518 (source
1519 (origin
1520 (method git-fetch)
1521 (uri
1522 (git-reference
1523 (url "https://github.com/kitao/pyxel")
1524 (commit (string-append "v" version))))
1525 (file-name (git-file-name name version))
1526 (sha256
1527 (base32
1528 "0bwsgb5yq5s479cnf046v379zsn5ybp5195kbfvzr9l11qbaicm9"))
1529 (modules '((guix build utils)))
1530 (snippet
1531 '(begin
1532 (delete-file-recursively "pyxel/core/bin")))))
1533 (build-system python-build-system)
1534 (arguments
1535 `(#:tests? #f ; "Tests" are actually example programs that never halt.
1536 #:phases
1537 (modify-phases %standard-phases
1538 (add-after 'unpack 'patch-build-files
1539 (lambda* (#:key inputs #:allow-other-keys)
1540 (substitute* "setup.py"
1541 (("\"pyxel\\.core\\.bin\\.(.*)\"," all arch)
1542 (if (string=? arch "linux")
1543 all
1544 "")))
1545 (substitute* "pyxel/core/Makefile"
1546 (("`sdl2-config")
1547 (string-append "`sdl2-config --prefix="
1548 (assoc-ref inputs "sdl2"))))))
1549 (add-before 'build 'prebuild
1550 (lambda _
1551 (invoke "make" "-C" "pyxel/core"))))))
1552 (inputs
1553 `(("gifsicle" ,gifsicle)
1554 ("sdl2" ,(sdl-union (list sdl2 sdl2-image)))))
bca5d7db
LP
1555 (home-page "https://github.com/kitao/pyxel")
1556 (synopsis "Retro game engine for Python")
1557 (description "Pyxel is a game engine inspired by retro gaming consoles.
1558It has a fixed 16-color palette, can hold up to 3 image banks and 8 tilemaps
1559(256x256 pixels each) and 4 sound channels with 64 definable sounds. It
1560also comes with a built-in image and sound editor.")
1561 (license license:expat)))
1562
68c6110c
DT
1563(define-public grafx2
1564 (package
1565 (name "grafx2")
1566 (version "2.4")
1567 (source (origin
1568 (method url-fetch)
1569 ;; XXX: There is no URL that contains the version. :(
1570 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
c34bb6b3 1571 (file-name (string-append "grafx2-" version ".tgz"))
68c6110c
DT
1572 (sha256
1573 (base32
1574 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1575 (build-system gnu-build-system)
1576 (arguments
1577 '(#:phases
1578 (modify-phases %standard-phases
1579 (delete 'configure) ; no configure script
1580 (add-before 'build 'change-to-src-directory
1581 (lambda _
1582 (chdir "src")
1583 #t)))
1584 #:make-flags
1585 ;; SDL header files are referenced without the preceeding "SDL/".
1586 (list (string-append "CFLAGS=-I"
1587 (assoc-ref %build-inputs "sdl-union")
83010a08
LC
1588 "/include/SDL"
1589 " -fcommon")
68c6110c
DT
1590 (string-append "prefix="
1591 (assoc-ref %outputs "out")))
1592 #:tests? #f)) ; no check target
1593 (native-inputs
8394619b 1594 (list pkg-config))
68c6110c 1595 (inputs
8394619b
LC
1596 (list libpng lua-5.1
1597 (sdl-union (list sdl sdl-image sdl-ttf))))
68c6110c
DT
1598 (synopsis "Bitmap paint program")
1599 (description "GrafX2 is a bitmap paint program inspired by the Amiga
7432d3ae 1600programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
68c6110c
DT
1601includes a very large number of tools and effects that make it particularly
1602suitable for pixel art, game graphics, and generally any detailed graphics
1603painted with a mouse.")
1604 (home-page "http://pulkomandy.tk/projects/GrafX2")
1605 (license license:gpl2))) ; GPLv2 only
c608fe8c
MR
1606
1607(define-public ois
1608 (package
1609 (name "ois")
1c4144a1 1610 (version "1.5.1")
c608fe8c
MR
1611 (source
1612 (origin
c608fe8c
MR
1613 (method git-fetch)
1614 (uri (git-reference
b0e7b699 1615 (url "https://github.com/wgois/OIS")
006345c1
TGR
1616 (commit (string-append "v" version))))
1617 (file-name (git-file-name name version))
c608fe8c 1618 (sha256
1c4144a1 1619 (base32 "0nkh0zrsbyv47c0i0vhdna3jsnvs69pb1svg75avxw6z7kwskgla"))))
006345c1
TGR
1620 (build-system cmake-build-system)
1621 (arguments
1622 `(#:tests? #f)) ; no test suite
c608fe8c 1623 (inputs
8394619b 1624 (list libx11))
c608fe8c
MR
1625 (synopsis "Object Oriented Input System")
1626 (description
1627 "Cross Platform Object Oriented Input Lib System is a cross platform,
1628simple solution for using all kinds of Input Devices (Keyboards, Mice,
1629Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1630robust and compatible with many systems and operating systems.")
1631 (home-page "https://github.com/wgois/OIS")
1632 (license license:zlib)))
42d0d13d
MR
1633
1634(define-public mygui
1635 (package
1636 (name "mygui")
1637 (version "3.2.2")
1638 (source
1639 (origin
47f4d5d3
PN
1640 (method git-fetch)
1641 (uri (git-reference
1642 (url "https://github.com/MyGUI/mygui")
1643 (commit (string-append "MyGUI" version))))
1644 (file-name (git-file-name name version))
42d0d13d
MR
1645 (sha256
1646 (base32
47f4d5d3 1647 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
42d0d13d
MR
1648 (build-system cmake-build-system)
1649 (arguments
1650 '(#:tests? #f ; No test target
1651 #:configure-flags
1652 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1653 (string-append "-DOGRE_INCLUDE_DIR="
1654 (assoc-ref %build-inputs "ogre")
47f4d5d3
PN
1655 "/include/OGRE")
1656 ;; Demos and tools are Windows-specific:
1657 ;; https://github.com/MyGUI/mygui/issues/24.
1658 "-DMYGUI_BUILD_DEMOS=FALSE"
1659 "-DMYGUI_BUILD_TOOLS=FALSE")))
42d0d13d 1660 (native-inputs
8394619b 1661 (list boost doxygen pkg-config))
42d0d13d 1662 (inputs
8394619b
LC
1663 (list font-dejavu
1664 freetype
1665 graphviz
1666 libx11
1667 ogre
1668 ois))
42d0d13d
MR
1669 (synopsis "Fast, flexible and simple GUI")
1670 (description
1671 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1672and 3D applications. The main goals of mygui are: speed, flexibility and ease
1673of use.")
1674 (home-page "http://mygui.info/")
1675 (license license:expat)))
e9a599cd 1676
9fd50db3
PN
1677(define-public mygui-gl
1678 ;; Closure size is reduced by some 800 MiB.
1679 (package
1680 (inherit mygui)
1681 (name "mygui-gl")
1682 (version "3.2.2")
1683 (arguments
1684 (substitute-keyword-arguments (package-arguments mygui)
1685 ((#:configure-flags _)
1686 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1687 ;; We can't reuse the flags because of the mention to Ogre.
1688 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1689 ;; Demos and tools are Windows-specific:
1690 ;; https://github.com/MyGUI/mygui/issues/24.
1691 "-DMYGUI_BUILD_DEMOS=FALSE"
1692 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1693 (inputs
8394619b
LC
1694 (modify-inputs (package-inputs mygui)
1695 (delete "ogre")
1696 (prepend mesa glu)))
9fd50db3
PN
1697 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1698
e9a599cd
MR
1699(define-public openmw
1700 (package
1701 (name "openmw")
92faad0a 1702 (version "0.47.0")
e9a599cd
MR
1703 (source
1704 (origin
aa246eaa
EF
1705 (method git-fetch)
1706 (uri (git-reference
1707 (url "https://github.com/OpenMW/openmw")
1708 (commit (string-append "openmw-" version))))
1709 (file-name (git-file-name name version))
e9a599cd
MR
1710 (sha256
1711 (base32
92faad0a 1712 "19mcbnjl4279qalb97msf965bjax48mx1r1qczyvwhn28h6n3bsy"))))
e9a599cd
MR
1713 (build-system cmake-build-system)
1714 (arguments
1715 `(#:tests? #f ; No test target
1716 #:configure-flags
92faad0a
FG
1717 (list "-DDESIRED_QT_VERSION=5"
1718 "-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=ON")))
e9a599cd 1719 (native-inputs
8394619b 1720 (list boost doxygen pkg-config))
e9a599cd 1721 (inputs
92faad0a
FG
1722 (list bullet
1723 ffmpeg
1724 libxt
1725 lz4
1726 mygui-gl ; OpenMW does not need Ogre.
1727 openal
1728 openmw-openscenegraph
1729 qtbase-5
1730 recastnavigation
1731 sdl2
1732 unshield))
5a80c15c 1733 (synopsis "Re-implementation of the RPG Morrowind engine")
e9a599cd 1734 (description
5a80c15c
RW
1735 "OpenMW is a game engine which reimplements and extends the one that runs
1736the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1737called OpenMW-CS which allows the user to edit or create their own original
1738games.")
e9a599cd 1739 (home-page "https://openmw.org")
8b1f8f64 1740 (license license:gpl3)))
194b4e7d
PM
1741
1742(define-public godot
1743 (package
1744 (name "godot")
8f90ff4c 1745 (version "3.4.2")
194b4e7d 1746 (source (origin
39f516cb
TGR
1747 (method git-fetch)
1748 (uri (git-reference
1749 (url "https://github.com/godotengine/godot")
1750 (commit (string-append version "-stable"))))
1751 (file-name (git-file-name name version))
194b4e7d 1752 (sha256
9766c6e2 1753 (base32
8f90ff4c 1754 "1bm9yl995chvx6jwkdia12yjrgwcpzb1r9bmj606q8z264aw2ma5"))
18f8e935
TL
1755 (modules '((guix build utils)
1756 (ice-9 ftw)
1757 (srfi srfi-1)))
5b8d2ace
MB
1758 (snippet
1759 '(begin
18f8e935
TL
1760 ;; Keep only those bundled files we have not (yet) replaced
1761 ;; with Guix versions. Note that some of these may be
1762 ;; modified; see "thirdparty/README.md".
5b8d2ace 1763 (with-directory-excursion "thirdparty"
18f8e935
TL
1764 (let* ((preserved-files
1765 '("README.md"
451e1075 1766 "assimp"
18f8e935
TL
1767 "certs"
1768 "cvtt"
af067eaf 1769 "embree"
18f8e935
TL
1770 "enet"
1771 "etc2comp"
1772 "fonts"
1773 "glad"
1774 "jpeg-compressor"
1775 "libsimplewebm"
af067eaf 1776 "minimp3"
18f8e935
TL
1777 "miniupnpc"
1778 "minizip"
1779 "misc"
1780 "nanosvg"
af067eaf 1781 "oidn"
18f8e935
TL
1782 "pvrtccompressor"
1783 "recastnavigation"
1784 "squish"
af067eaf 1785 "stb_rect_pack"
18f8e935 1786 "tinyexr"
451e1075 1787 "vhacd"
18f8e935
TL
1788 "xatlas")))
1789 (for-each delete-file-recursively
1790 (lset-difference string=?
1791 (scandir ".")
8f90ff4c 1792 (cons* "." ".." preserved-files)))))))))
92b51d12 1793 (build-system scons-build-system)
194b4e7d 1794 (arguments
92b51d12 1795 `(#:scons ,scons-python2
ab67f84b 1796 #:scons-flags (list "platform=x11" "target=release_debug"
92b51d12
AI
1797 ;; Avoid using many of the bundled libs.
1798 ;; Note: These options can be found in the SConstruct file.
c1bc92c0 1799 "builtin_bullet=no"
92b51d12
AI
1800 "builtin_freetype=no"
1801 "builtin_glew=no"
1802 "builtin_libmpdec=no"
1803 "builtin_libogg=no"
1804 "builtin_libpng=no"
1805 "builtin_libtheora=no"
1806 "builtin_libvorbis=no"
5b8d2ace 1807 "builtin_libvpx=no"
92b51d12 1808 "builtin_libwebp=no"
c1bc92c0 1809 "builtin_mbedtls=no"
92b51d12 1810 "builtin_opus=no"
c1bc92c0 1811 "builtin_pcre2=no"
451e1075 1812 "builtin_wslay=no"
c1bc92c0
TL
1813 "builtin_zlib=no"
1814 "builtin_zstd=no")
545511df 1815 #:tests? #f ; There are no tests
194b4e7d
PM
1816 #:phases
1817 (modify-phases %standard-phases
194b4e7d
PM
1818 (add-after 'unpack 'scons-use-env
1819 (lambda _
1820 ;; Scons does not use the environment variables by default,
1821 ;; but this substitution makes it do so.
1822 (substitute* "SConstruct"
1823 (("env_base = Environment\\(tools=custom_tools\\)")
1824 (string-append
1825 "env_base = Environment(tools=custom_tools)\n"
8f90ff4c 1826 "env_base = Environment(ENV=os.environ)")))))
545511df
TL
1827 ;; Build headless tools, used for packaging games without depending on X.
1828 (add-after 'build 'build-headless
1829 (lambda* (#:key scons-flags #:allow-other-keys)
1830 (apply invoke "scons"
1831 `(,(string-append "-j" (number->string (parallel-job-count)))
1832 "platform=server" ,@(delete "platform=x11" scons-flags)))))
194b4e7d 1833 (replace 'install
545511df 1834 (lambda* (#:key inputs outputs #:allow-other-keys)
194b4e7d 1835 (let* ((out (assoc-ref outputs "out"))
545511df
TL
1836 (headless (assoc-ref outputs "headless"))
1837 (zenity (assoc-ref inputs "zenity")))
1838 ;; Strip build info from filenames.
194b4e7d 1839 (with-directory-excursion "bin"
545511df
TL
1840 (for-each
1841 (lambda (file)
1842 (let ((dest (car (string-split (basename file) #\.))))
1843 (rename-file file dest)))
1844 (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
1845 (install-file "godot" (string-append out "/bin"))
1846 (install-file "godot_server" (string-append headless "/bin")))
1847 ;; Tell the editor where to find zenity for OS.alert().
1848 (wrap-program (string-append out "/bin/godot")
8f90ff4c 1849 `("PATH" ":" prefix (,(string-append zenity "/bin")))))))
af067eaf
AT
1850 (add-after 'install 'wrap
1851 (lambda* (#:key inputs outputs #:allow-other-keys)
1852 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
1853 ;; fix of the mesa package we wrap the pcb executable such that
1854 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
1855 ;; also append ld path for pulseaudio and alsa-lib
1856 (let* ((out (assoc-ref outputs "out"))
457416bb 1857 (udev_path (string-append (assoc-ref inputs "eudev") "/lib"))
af067eaf
AT
1858 (pulseaudio_path (string-append (assoc-ref inputs "pulseaudio") "/lib"))
1859 (alas_lib_path (string-append (assoc-ref inputs "alsa-lib") "/lib")))
1860 (wrap-program (string-append out "/bin/godot")
8f90ff4c 1861 `("LD_LIBRARY_PATH" ":" prefix (,udev_path ,pulseaudio_path ,alas_lib_path))))))
194b4e7d
PM
1862 (add-after 'install 'install-godot-desktop
1863 (lambda* (#:key outputs #:allow-other-keys)
1864 (let* ((out (assoc-ref outputs "out"))
bf076da9
TL
1865 (applications (string-append out "/share/applications"))
1866 (icons (string-append out "/share/icons/hicolor")))
1867 (mkdir-p applications)
1868 (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
1869 (string-append applications "/godot.desktop"))
1870 (for-each (lambda (icon dest)
1871 (mkdir-p (dirname dest))
1872 (copy-file icon dest))
1873 '("icon.png" "icon.svg")
1874 `(,(string-append icons "/256x256/apps/godot.png")
8f90ff4c 1875 ,(string-append icons "/scalable/apps/godot.svg")))))))))
545511df 1876 (outputs '("out" "headless"))
457416bb
TGR
1877 (native-inputs
1878 (list pkg-config))
1879 (inputs
1880 (list alsa-lib
1881 bullet
1882 freetype
1883 glew
1884 glu
1885 libtheora
1886 libvorbis
1887 libvpx
1888 libwebp
1889 libx11
1890 libxcursor
1891 libxi
1892 libxinerama
1893 libxrandr
1894 mbedtls-apache
1895 mesa
1896 opusfile
1897 pcre2
1898 pulseaudio
1899 eudev ; FIXME: required by mesa
1900 wslay
1901 zenity
1902 `(,zstd "lib")))
194b4e7d
PM
1903 (home-page "https://godotengine.org/")
1904 (synopsis "Advanced 2D and 3D game engine")
1905 (description
1906 "Godot is an advanced multi-platform game engine written in C++. If
1907features design tools such as a visual editor, can import 3D models and
1908provide high-quality 3D rendering, it contains an animation editor, and can be
1909scripted in a Python-like language.")
1910 (license license:expat)))
531003be 1911
a0609772
ASM
1912(define-public entt
1913 (package
1914 (name "entt")
d3480fbf 1915 (version "3.7.1")
a0609772
ASM
1916 (source (origin
1917 (method git-fetch)
1918 (uri (git-reference
1919 (url "https://github.com/skypjack/entt")
1920 (commit (string-append "v" version))))
1921 (file-name (git-file-name name version))
1922 (sha256
1923 (base32
d3480fbf 1924 "151jg3m262xwaywl2rqnc90yr6p48rhmgi5mxyv6bwqvmfli2m5p"))))
a0609772
ASM
1925 (build-system cmake-build-system)
1926 (arguments
1927 `(#:configure-flags (list "-DENTT_BUILD_TESTING=ON"
1928 "-DENTT_FIND_GTEST_PACKAGE=ON"
1929 "-DENTT_BUILD_DOCS=ON")
1930 ;; Only tests are compiled, and they need assertions to work correctly.
1931 #:build-type "Debug"))
1932 (native-inputs
8394619b
LC
1933 (list ;; for testing
1934 googletest
1935 ;; for documentation
1936 doxygen graphviz))
a0609772
ASM
1937 (synopsis "Entity component system")
1938 (description "EnTT is a header-only library, containing (among other things)
1939@itemize
1940@item an entity component system based on sparse sets,
1941@item a configuration system using the monostate pattern,
1942@item a static reflection system,
1943@item and a cooperative scheduler.
1944@end itemize")
1945 (home-page "https://github.com/skypjack/entt")
1946 (license (list license:expat ; code
1947 license:cc-by4.0)))) ; documentation
1948
531003be 1949(define-public eureka
1950 (package
1951 (name "eureka")
75f66e4a 1952 (version "1.24")
531003be 1953 (source (origin
1954 (method url-fetch)
1955 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1956 version "/eureka-"
1957 ;; version without dots e.g 1.21 => 121
1958 (string-join (string-split version #\.) "")
1959 "-source.tar.gz"))
1960 (sha256
1961 (base32
75f66e4a 1962 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
531003be 1963 (build-system gnu-build-system)
1964 (arguments
1965 '(#:tests? #f
1966 #:make-flags
1967 (let ((out (assoc-ref %outputs "out")))
1968 (list (string-append "PREFIX=" out)))
1969 #:phases
1970 (modify-phases %standard-phases
1971 (delete 'configure)
1972 (add-before 'build 'prepare-install-directories
1973 (lambda* (#:key outputs #:allow-other-keys)
1974 (let ((out (assoc-ref outputs "out")))
1975 (mkdir-p (string-append out "/bin"))
1976 (mkdir-p (string-append out "/share"))
1977
1978 (with-fluids ((%default-port-encoding #f))
1979 (substitute* "./src/main.cc"
1980 (("/usr/local") out)))
1981
1982 (substitute* "Makefile"
1983 (("-o root") ""))))))))
1984 (inputs `(("mesa" ,mesa)
1985 ("libxft" ,libxft)
1986 ("libxinerama" ,libxinerama)
1987 ("libfontconfig" ,fontconfig)
4bd428a7 1988 ("libjpeg" ,libjpeg-turbo)
531003be 1989 ("libpng" ,libpng)
1990 ("fltk" ,fltk)
1991 ("zlib" ,zlib)))
8394619b 1992 (native-inputs (list pkg-config xdg-utils))
531003be 1993 (synopsis "Doom map editor")
1994 (description "Eureka is a map editor for the classic DOOM games, and a few
1995related games such as Heretic and Hexen. It comes with a 3d preview mode and
1996a 2D editor view.")
1997 (home-page "http://eureka-editor.sourceforge.net/")
1998 (license license:gpl2+)))
00fca594
RW
1999
2000(define-public guile-chickadee
2001 (package
2002 (name "guile-chickadee")
338dfc92 2003 (version "0.8.0")
00fca594
RW
2004 (source (origin
2005 (method url-fetch)
2006 (uri (string-append "https://files.dthompson.us/chickadee/"
2007 "chickadee-" version ".tar.gz"))
2008 (sha256
2009 (base32
338dfc92 2010 "1k2dml2z57lnc36wrmwhh7avnpczxgxnshlfhpbk174vg6v609n0"))))
00fca594 2011 (build-system gnu-build-system)
daca7077
EF
2012 (arguments
2013 '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
00fca594 2014 (propagated-inputs
be4d9527 2015 `(("guile-opengl" ,guile3.0-opengl)
338dfc92 2016 ("guile-sdl2" ,guile-sdl2)))
00fca594 2017 (inputs
8394619b
LC
2018 (list freetype
2019 guile-3.0-latest
2020 libvorbis
2021 mpg123
2022 openal
2023 readline))
00fca594 2024 (native-inputs
8394619b 2025 (list guile-3.0-latest pkg-config texinfo))
00fca594
RW
2026 (home-page "https://dthompson.us/projects/chickadee.html")
2027 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
2028 (description "Chickadee is a game development toolkit for Guile Scheme
2029built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
2030that parenthetically inclined game developers need to make 2D (and eventually
20313D) games in Scheme, such as:
2032
abb0ff45
RW
2033@enumerate
2034@item extensible, fixed-timestep game loop
2035@item OpenGL-based rendering engine
2036@item keyboard, mouse, controller input
2037@item REPL-driven development model
2038@end enumerate\n")
2039 (license license:gpl3+)))
2040
4041fabb
PN
2041(define-public bennu-game-development
2042 (package
2043 (name "bennu-game-development")
abb64b5e 2044 (version "353")
4041fabb
PN
2045 (source (origin
2046 (method svn-fetch)
2047 (uri (svn-reference
2048 (url "http://svn.code.sf.net/p/bennugd/code")
2049 (revision (string->number version))))
2050 (file-name (string-append name "-" version))
2051 (sha256
2052 (base32
abb64b5e 2053 "1iri58ryk9lbqn585cbccnvrfkj8qxlbcsk8rpih40jhvs1j101l"))
edf1ce60
EF
2054 (modules '((guix build utils)))
2055 (snippet
2056 '(begin
2057 (delete-file-recursively "3rdparty") #t))))
4041fabb
PN
2058 (build-system gnu-build-system)
2059 (arguments
2060 '(#:phases
2061 (modify-phases %standard-phases
f0e4cfcb 2062 (add-after 'unpack 'patch-configure-to-use-openssl
4041fabb
PN
2063 (lambda* (#:key outputs #:allow-other-keys)
2064 (chdir "core")
2065 (delete-file "configure")
2066 (substitute* "configure.in"
2067 (("i\\*86\\)")
f0e4cfcb 2068 "*)
4041fabb
PN
2069 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
2070 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
2071 LIBSSL=\"crypto\"
2072 USE_OPENSSL=yes
2073 ;;
2074
f0e4cfcb
EF
2075 i*86)"))
2076 #t)))))
8394619b
LC
2077 (inputs (list openssl zlib))
2078 (native-inputs (list pkg-config autoconf automake libtool))
4041fabb
PN
2079 (synopsis "Programming language to create games")
2080 (description "Bennu Game Development, also known as bennudg, is a
2081programming language tailored at game development. It is the successor of
2082Fenix.")
2083 (home-page "https://sourceforge.net/projects/bennugd/")
2084 (license license:zlib)))
24c4b012
PN
2085
2086(define-public bennu-game-development-modules
2087 (package
2088 (inherit bennu-game-development)
2089 (name "bennu-game-development-modules")
2090 (arguments
2091 '(#:phases
2092 (modify-phases %standard-phases
2093 (add-after 'unpack 'patch-conflicting-definitions
2094 (lambda _
2095 (with-fluids ((%default-port-encoding #f))
2096 (substitute* "core/include/fmath.h"
2097 (("extern fixed fmul\\( int x, int y \\);") "")
2098 (("extern fixed fdiv\\( int x, int y \\);") "")))
2099 (chdir "modules"))))))
8394619b 2100 (inputs (list zlib libpng openssl sdl-mixer bennu-game-development))
0525864b 2101 (synopsis "Modules for the Bennu Game Development programming language")
24c4b012 2102 (description "This package contains a collection of modules for the Bennu
0525864b 2103Game Development programming language, from CD handling through SDL to
24c4b012 2104joystick support.")))
cd528946
RW
2105
2106(define-public plib
2107 (package
2108 (name "plib")
2109 (version "1.8.5")
2110 (source (origin
2111 (method url-fetch)
2112 (uri (string-append "http://plib.sourceforge.net/dist/"
2113 "plib-" version ".tar.gz"))
2114 (sha256
2115 (base32
05f386f1
EF
2116 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
2117 (patches (search-patches "plib-CVE-2011-4620.patch"
2118 "plib-CVE-2012-4552.patch"))))
cd528946
RW
2119 (build-system gnu-build-system)
2120 (inputs
8394619b 2121 (list mesa libxi libxmu))
cd528946 2122 (native-inputs
8394619b 2123 (list pkg-config))
cd528946
RW
2124 (home-page "http://plib.sourceforge.net/")
2125 (synopsis "Suite of portable game libraries")
2126 (description "PLIB is a set of libraries that will permit programmers to
2127write games and other realtime interactive applications that are 100% portable
2128across a wide range of hardware and operating systems. PLIB includes sound
2129effects, music, a complete 3D engine, font rendering, a simple Windowing
2130library, a game scripting language, a GUI, networking, 3D math library and a
2131collection of handy utility functions. All are 100% portable across nearly
2132all modern computing platforms. Each library component is fairly independent
2133of the others")
2134 (license license:lgpl2.0+)))
e4ff9dff
PN
2135
2136(define-public ioquake3
2137 ;; We follow master since it seems that there won't be releases after 1.3.6.
2138 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
2139 (package
2140 (name "ioquake3")
2141 (version (git-version "1.3.6" "1" commit))
2142 (source
2143 (origin
2144 (method git-fetch)
2145 (uri (git-reference
b0e7b699 2146 (url "https://github.com/ioquake/ioq3")
e4ff9dff
PN
2147 (commit commit)))
2148 (file-name (git-file-name name version))
2149 (sha256
2150 (base32
2151 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
2152 (build-system gnu-build-system)
2153 (inputs
2154 `(("sdl2" ,sdl2)
4bd428a7 2155 ("libjpeg" ,libjpeg-turbo)
e4ff9dff
PN
2156 ("openal" ,openal)
2157 ("curl" ,curl)
2158 ("opusfile" ,opusfile)
2159 ("opus" ,opus)
2160 ("libvorbis" ,libvorbis)
2161 ("freetype" ,freetype)
2162 ("libogg" ,libogg)))
2163 (native-inputs
8394619b
LC
2164 (list which ; Else SDL_version.h won't be found.
2165 pkg-config))
e4ff9dff
PN
2166 (arguments
2167 '(#:tests? #f ; No tests.
2168 #:make-flags '("CC=gcc"
2169 "USE_INTERNAL_LIBS=0"
2170 "USE_FREETYPE=1"
2171 "USE_RENDERER_DLOPEN=0"
2172 "USE_OPENAL_DLOPEN=0"
2173 "USE_CURL_DLOPEN=0")
2174 #:phases
2175 (modify-phases %standard-phases
2176 (delete 'configure)
2177 (replace 'install
2178 (lambda* (#:key outputs #:allow-other-keys)
2179 (invoke "make" "copyfiles" "CC=gcc"
2180 "USE_INTERNAL_LIBS=0"
2181 (string-append "COPYDIR="
2182 (assoc-ref outputs "out")
2183 "/bin")))))))
2184 (home-page "https://ioquake3.org/")
2185 (synopsis "FPS game engine based on Quake 3")
2186 (description "ioquake3 is a free software first person shooter engine
2187based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
2188the original, ioquake3 has been cleaned up, bugs have been fixed and features
2189added. The permanent goal is to create the open source Quake 3 distribution
2190upon which people base their games, ports to new platforms, and other
2191projects.")
e4ff9dff 2192 (license license:gpl2))))
545946f6 2193
2e0ddc74
DP
2194(define-public instead
2195 (package
2196 (name "instead")
2197 (version "3.3.5")
2198 (build-system cmake-build-system)
2199 (source
2200 (origin
2201 (method git-fetch)
2202 (uri (git-reference
2203 (url "https://github.com/instead-hub/instead")
2204 (commit version)))
2205 (file-name (git-file-name name version))
2206 (sha256
2207 (base32 "02j8cw623j51qmr4991i5hsbrzmnp0qfzds8m6nwwr15sjv3hv1g"))
2208 (patches
2209 (search-patches
2210 "instead-use-games-path.patch"))
2211 (modules '((guix build utils)))
2212 (snippet
2213 '(begin
2214 (delete-file-recursively "src/zlib")))))
2215 (arguments
2216 '(#:configure-flags
2217 (list (string-append
2218 "-DLUA_INCLUDE_DIR="
2219 (assoc-ref %build-inputs "luajit") "/include/luajit-2.1/")
2220 "-DWITH_LUAJIT=1"
2221 "-DWITH_GTK3=1")
2222 #:tests? #f))
2223 (inputs
2224 `(("gtk+",gtk+)
2225 ("lua" ,lua)
2226 ("luajit" ,luajit)
2227 ("pkg-config" ,pkg-config)
2228 ("sdl2-images" ,sdl2-image)
2229 ("sdl2-ttf" ,sdl2-ttf)
2230 ("sdl2-mixer" ,sdl2-mixer)
2231 ("zlib" ,zlib)))
2232 (home-page "https://instead3.syscall.ru/")
2233 (synopsis "Text adventure interpreter")
2234 (description "The STEAD (Simple TExt ADventures) interpreter provides
2235functionality to play games that mix elements of visual novels, interactive
2236fiction and classic point-and-click adventures.")
2237 (native-search-paths
2238 (list (search-path-specification
2239 (variable "INSTEAD_GAMES_PATH")
2240 (separator #f) ;single entry
2241 (files '("share/instead/games")))))
2242 (license license:expat)))
2243
545946f6
PN
2244(define-public openvr
2245 (package
2246 (name "openvr")
1854a0ec 2247 (version "1.8.19")
545946f6
PN
2248 (home-page "https://github.com/ValveSoftware/openvr/")
2249 (source
2250 (origin
2251 (method git-fetch)
2252 (uri (git-reference
2253 (url home-page)
2254 (commit (string-append "v" version))))
2255 (file-name (git-file-name name version))
2256 (sha256
1854a0ec 2257 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
545946f6
PN
2258 (build-system cmake-build-system)
2259 (arguments
2260 ;; No tests.
2261 '(#:tests? #f
2262 #:configure-flags (list "-DBUILD_SHARED=1")))
2263 (synopsis "Virtual reality software development kit")
2264 (description "OpenVR is an API and runtime that allows access to VR
2265hardware from multiple vendors without requiring that applications have
2266specific knowledge of the hardware they are targeting.")
2267 (license license:bsd-3)))
7158fe4d 2268
93c47bff
NG
2269(define-public flatzebra
2270 (package
2271 (name "flatzebra")
2272 (version "0.1.7")
2273 (source
2274 (origin
2275 (method url-fetch)
2276 (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
2277 "flatzebra-" version ".tar.gz"))
2278 (sha256
2279 (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
2280 (build-system gnu-build-system)
2281 (arguments
2282 `(#:phases
2283 (modify-phases %standard-phases
2284 (add-after 'unpack 'fix-sdl-config
2285 (lambda* (#:key inputs #:allow-other-keys)
2286 ;; XXX: sdl-config in sdl-union is a link to sdl-config from
2287 ;; plain sdl package. As a consequence, the prefix is wrong.
2288 ;; Force correct one with "--prefix" argument.
2289 (let ((sdl-union (assoc-ref inputs "sdl")))
2290 (setenv "SDL_CONFIG"
2291 (string-append sdl-union
2292 "/bin/sdl-config --prefix="
2293 sdl-union)))
2294 #t)))))
2295 (native-inputs
8394619b 2296 (list pkg-config))
93c47bff
NG
2297 (inputs
2298 `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
2299 (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
2300 (synopsis "Generic game engine for 2D double-buffering animation")
2301 (description
2302 "Flatzebra is a simple, generic C++ game engine library supporting 2D
2303double-buffering.")
2304 (license license:gpl2+)))
2305
7158fe4d
PN
2306(define-public fna
2307 (package
2308 (name "fna")
2309 (version "19.12.01")
2310 (source
2311 (origin
2312 (method git-fetch)
2313 (uri (git-reference
b0e7b699 2314 (url "https://github.com/FNA-XNA/FNA")
7158fe4d
PN
2315 (commit version)))
2316 (file-name (git-file-name name version))
2317 (sha256
2318 (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
2319 (build-system gnu-build-system)
2320 (arguments
2321 '(#:tests? #f ; No tests.
2322 #:phases
2323 (modify-phases %standard-phases
2324 (add-after 'unpack 'link-dep-src
2325 (lambda* (#:key inputs #:allow-other-keys)
2326 (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
2327 (mojoshader (assoc-ref inputs "mojoshader-src"))
2328 (faudio (assoc-ref inputs "faudio-src"))
2329 (theorafile (assoc-ref inputs "theorafile-src")))
2330 (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
2331 (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
2332 (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
2333 (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
2334 (delete 'configure)
2335 (replace 'build
2336 (lambda _
2337 (invoke "make" "release")))
2338 (replace 'install
2339 (lambda* (#:key outputs #:allow-other-keys)
2340 (let ((out (assoc-ref outputs "out")))
2341 (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
2342 #t))))))
2343 (native-inputs
8394619b 2344 (list mono))
7158fe4d
PN
2345 (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
2346 ("mojoshader-src" ,(package-source mojoshader-cs))
2347 ("faudio-src" ,(package-source faudio))
2348 ("theorafile-src" ,(package-source theorafile))))
2349 (home-page "https://fna-xna.github.io/")
2350 (synopsis "Accuracy-focused XNA4 reimplementation")
2351 (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
2352focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
2353 (license (list license:ms-pl ; FNA
2354 license:lgpl2.1 ; LzxDecoder.cs
2355 ;; Mono.Xna:
2356 license:expat))))
45c552ec
NG
2357
2358(define-public libccd
2359 (package
2360 (name "libccd")
2361 (version "2.1")
2362 (source
2363 (origin
2364 (method git-fetch)
2365 (uri (git-reference
b0e7b699 2366 (url "https://github.com/danfis/libccd")
45c552ec
NG
2367 (commit (string-append "v" version))))
2368 (file-name (git-file-name name version))
2369 (sha256
2370 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2371 (build-system cmake-build-system)
2372 (arguments
2373 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2374 "-DBUILD_TESTING=ON"
2375 "-DENABLE_DOUBLE_PRECISION=ON")))
2376 (native-inputs
8394619b 2377 (list python-sphinx))
45c552ec
NG
2378 (home-page "https://github.com/danfis/libccd")
2379 (synopsis "Library for collision detection between two convex shapes")
2380 (description "@code{libccd} is library for a collision detection
2381between two convex shapes. @code{libccd} implements variation on
2382Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2383and also implements algorithm Minkowski Portal Refinement (MPR,
2384a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2385 (license license:expat)))
42399ad7
NG
2386
2387(define-public ode
2388 (package
2389 (name "ode")
416fe466 2390 (version "0.16.2")
42399ad7
NG
2391 (source
2392 (origin
2393 (method url-fetch)
2394 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2395 "ode-" version ".tar.gz"))
2396 (sha256
416fe466 2397 (base32 "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj"))
42399ad7
NG
2398 (modules '((guix build utils)))
2399 (snippet
2400 '(begin
2401 (delete-file-recursively "libccd")
2402 #t))))
2403 (build-system cmake-build-system)
2404 (arguments
416fe466 2405 `(#:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
42399ad7
NG
2406 #:phases
2407 (modify-phases %standard-phases
2408 (add-after 'unpack 'unbundle-libccd
2409 (lambda _
2410 (substitute* "CMakeLists.txt"
2411 (("configure_file\\(libccd/.*") ""))
2412 #t)))))
2413 (inputs
8394619b 2414 (list glu libccd mesa))
76fcbb78 2415 (home-page "https://www.ode.org/")
42399ad7
NG
2416 (synopsis "High performance library for simulating rigid body dynamics")
2417 (description "ODE is a high performance library for simulating
2418rigid body dynamics. It is fully featured, stable, mature and
2419platform independent with an easy to use C/C++ API. It has advanced
2420joint types and integrated collision detection with friction. ODE is
2421useful for simulating vehicles, objects in virtual reality
2422environments and virtual creatures. It is currently used in many
2423computer games, 3D authoring tools and simulation tools.")
2424 ;; Software is dual-licensed.
2425 (license (list license:lgpl2.1+ license:expat))))
d6ab5f4f
NG
2426
2427(define-public chipmunk
2428 (package
2429 (name "chipmunk")
2430 (version "7.0.3")
2431 (source
2432 (origin
2433 (method git-fetch)
2434 (uri (git-reference
b0e7b699 2435 (url "https://github.com/slembcke/Chipmunk2D")
d6ab5f4f
NG
2436 (commit (string-append "Chipmunk-" version))))
2437 (file-name (git-file-name name version))
2438 (sha256
2439 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2440 (build-system cmake-build-system)
2441 (arguments
2442 `(#:tests? #f ;no test
2443 #:configure-flags '("-DBUILD_STATIC=OFF"
2444 "-DBUILD_DEMOS=OFF")))
2445 (inputs
8394619b 2446 (list freeglut libxmu libxrandr))
d0bb1c2f 2447 (home-page "https://chipmunk-physics.net/")
d6ab5f4f
NG
2448 (synopsis "Fast and lightweight 2D game physics library")
2449 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2450rigid body physics library written in C.")
2451 (license license:expat)))
2e0787a5 2452
920a3639
EF
2453(define-public box2d
2454 (package
2455 (name "box2d")
2456 (version "2.4.1")
2457 (source
2458 (origin
2459 (method git-fetch)
2460 (uri (git-reference
2461 (url "https://github.com/erincatto/box2d")
2462 (commit (string-append "v" version))))
2463 (file-name (git-file-name name version))
2464 (sha256
2465 (base32 "1ja9cahf3z9zzrdaqcw44lpjmqf2ir2g4chwz0iwqwlkckwhpgvh"))
2466 (modules '((guix build utils)))
2467 (snippet
2468 '(begin
2469 ;; Bundled code only used for the testbed.
2470 (delete-file-recursively "extern")))))
2471 (build-system cmake-build-system)
2472 (arguments
2473 `(#:test-target "unit_test"
2474 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
2475 "-DBOX2D_BUILD_TESTBED=OFF")))
2476 (inputs
8394619b 2477 (list libx11))
920a3639
EF
2478 (home-page "https://box2d.org/")
2479 (synopsis "2D physics engine for games")
2480 (description "Box2D is a 2D rigid body simulation library for games.
2481Programmers can use it in their games to make objects move in realistic ways and
2482make the game world more interactive. From the game engine's point of view, a
2483physics engine is just a system for procedural animation.")
2484 (license license:expat)))
2485
2e0787a5
GL
2486(define-public libtcod
2487 (package
2488 (name "libtcod")
2489 (version "1.15.1")
2490 (source (origin
2491 (method git-fetch)
2492 (uri (git-reference
b0e7b699 2493 (url "https://github.com/libtcod/libtcod")
2e0787a5
GL
2494 (commit version)))
2495 (file-name (git-file-name name version))
2496 (sha256
2497 (base32
2498 "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
2499 (modules '((guix build utils)))
2500 (snippet '(begin
2501 (delete-file-recursively "src/vendor/utf8proc")
2502 (delete-file-recursively "src/vendor/zlib")
2503 (delete-file "src/vendor/stb_truetype.h")
2504 (delete-file "src/vendor/stb_sprintf.h")
2505 (delete-file "src/vendor/lodepng.cpp")
2506 (delete-file "src/vendor/lodepng.h")
2507
2508 (substitute* "buildsys/autotools/sources.am"
2509 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
2510 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
2511 "../../src/vendor/stb.c")
2512 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
2513
2514 (substitute* "src/libtcod/sys_sdl_img_png.cpp"
2515 (("\\.\\./vendor/") ""))
2516
2517 (substitute* '("src/libtcod/color/canvas.cpp"
2518 "src/libtcod/sys_sdl_img_png.cpp"
2519 "src/libtcod/tileset/truetype.cpp"
2520 "src/libtcod/tileset/tilesheet.cpp")
2521 (("\\.\\./\\.\\./vendor/") ""))
2522
2523 (substitute* "src/libtcod/console/printing.cpp"
2524 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
2525 #t))))
2526 (build-system gnu-build-system)
2527 (arguments
2528 `(#:configure-flags '("--with-gnu-ld"
2529 "LIBS=-lutf8proc -llodepng")
2530 #:phases
2531 (modify-phases %standard-phases
2532 (add-after 'unpack 'change-to-build-dir
2533 (lambda _
2534 (chdir "buildsys/autotools")
85c50333 2535 (patch-shebang "get_version.py"))))))
2e0787a5 2536 (native-inputs
8394619b
LC
2537 (list autoconf
2538 automake
2539 libtool
2540 python
2541 pkg-config
2542 stb-sprintf
2543 stb-truetype))
2e0787a5 2544 (inputs
8394619b 2545 (list lodepng sdl2 utf8proc zlib))
2e0787a5
GL
2546 (home-page "https://github.com/libtcod/libtcod")
2547 (synopsis "Library specifically designed for writing roguelikes")
2548 (description
2549 "libtcod is a fast, portable and uncomplicated API for roguelike
2550developers providing an advanced true color console, input, and lots of other
2551utilities frequently used in roguelikes.")
2552 (license license:bsd-3)))
0b5bf615
PN
2553
2554(define-public warsow-qfusion
2555 ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
2556 ;; The 2.5 beta as published on the homepage is commit
2557 ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
2558 (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
2559 (package
2560 (name "warsow-qfusion")
2561 (version (git-version "2.5" "1" commit)) ; 2.5-beta
2562 (source (origin
2563 (method git-fetch)
2564 (uri (git-reference
2565 (url "https://github.com/Warsow/qfusion/")
2566 (commit commit)
2567 (recursive? #t)))
2568 (file-name (git-file-name name version))
2569 (sha256
2570 (base32
2571 "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
2572 ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
e5f1f5ce
PN
2573 (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
2574 (modules '((guix build utils)))
2575 (snippet '(begin
2576 (delete-file-recursively "platforms")
2577 (delete-file-recursively "debian")
2578 (delete-file-recursively "libsrcs")
2579 #t))))
0b5bf615
PN
2580 (build-system cmake-build-system)
2581 (arguments
2582 `(#:tests? #f ; No tests.
2583 #:configure-flags '("-DQFUSION_GAME=Warsow")
2584 #:modules
2585 ((guix build utils)
2586 (guix build cmake-build-system)
2587 (ice-9 match))
2588 #:phases
2589 (modify-phases %standard-phases
2590 (add-after 'unpack 'change-to-build-dir
2591 (lambda _
2592 (chdir "source")
2593 #t))
2594 (add-after 'install 'really-install
2595 (lambda* (#:key outputs system #:allow-other-keys)
2596 (let ((arch (match system
2597 ("x86_64-linux" "x86_64")
2598 ("i686-linux" "i386")))
2599 (out (assoc-ref outputs "out")))
2600 (install-file (string-append "../source/build/basewsw/libgame_"
2601 arch ".so")
2602 (string-append out "/lib/"))
2603 (install-file (string-append "../source/build/libui_" arch ".so")
2604 (string-append out "/lib/"))
2605 (for-each
2606 (lambda (file)
2607 (install-file file (string-append out "/bin/")))
2608 (append (find-files "../source/build" "warsow")
2609 (find-files "../source/build" "wsw_server."))))
2610 #t)))))
2611 (inputs
2612 `(("alsa-lib" ,alsa-lib)
2613 ("curl" ,curl)
2614 ("freetype" ,freetype)
2615 ("ffmpeg" ,ffmpeg)
c263cfdc 2616 ("libjpeg" ,libjpeg-turbo)
0b5bf615
PN
2617 ("libogg" ,libogg)
2618 ("libpng" ,libpng)
2619 ("libtheora" ,libtheora)
2620 ("libvorbis" ,libvorbis)
2621 ("mesa" ,mesa)
2622 ("openal" ,openal)
2623 ("pulseaudio" ,pulseaudio)
ea0a5107 2624 ("qtbase" ,qtbase-5)
0b5bf615
PN
2625 ("qtdeclarative" ,qtdeclarative)
2626 ("sdl2" ,sdl2)
c263cfdc 2627 ("uuid.h" ,util-linux "lib")
0b5bf615
PN
2628 ("zlib" ,zlib)))
2629 (native-inputs
8394619b 2630 (list pkg-config))
0b5bf615
PN
2631 (home-page "https://github.com/Warsow/qfusion")
2632 (supported-systems '("i686-linux" "x86_64-linux"))
2633 (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
2634 (description
2635 "This package contains the game engine of Warsow, a first-person
2636shooter video game. The engine is based on qfusion, the id Tech 2 derived
2637game engine. id Tech 2 is the engine originally behind Quake 2.")
2638 (license license:gpl2+))))
5f7474a2
PN
2639
2640(define-public dhewm3
2641 (package
2642 (name "dhewm3")
b6df89ef 2643 (version "1.5.1")
5f7474a2
PN
2644 (source (origin
2645 (method url-fetch)
2646 (uri (string-append
2647 "https://github.com/dhewm/dhewm3/releases/download/"
2648 version "/dhewm3-" version "-src.tar.xz"))
2649 (sha256
2650 (base32
b6df89ef 2651 "0s2brx6wyljhjbpli97iy4lc4fqqsvdc09raz8njg0vgzcsiyrri"))))
5f7474a2
PN
2652 (build-system cmake-build-system)
2653 (arguments
2654 `(#:tests? #f ; No tests.
2655 #:phases
2656 (modify-phases %standard-phases
2657 (add-after 'unpack 'change-to-build-dir
2658 (lambda _
2659 (chdir "neo")
2660 #t)))))
2661 (inputs
2662 `(("curl" ,curl)
2663 ("libjpeg" ,libjpeg-turbo)
2664 ("libogg" ,libogg)
2665 ("libvorbis" ,libvorbis)
2666 ("libx11" ,libx11)
2667 ("openal" ,openal)
2668 ("sdl2" ,sdl2)
2669 ("zlib" ,zlib)))
2670 (home-page "https://dhewm3.org/")
2671 (synopsis "Port of the original Doom 3 engine")
2672 (description
2673 "@command{dhewm3} is a source port of the original Doom 3 engine (not
2674Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
2675version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
2676sound effects on all operating systems and hardware (via OpenAL Softs EFX
2677support), has much better support for widescreen resolutions and has 64bit
2678support.")
2679 (license license:gpl3)))
f67ae666
PN
2680
2681(define-public tesseract-engine
2682 (let ((svn-revision 2411))
2683 (package
2684 (name "tesseract-engine")
2685 (version (string-append "20200615-" (number->string svn-revision)))
2686 (source
2687 (origin
2688 (method svn-fetch)
2689 (uri (svn-reference
2690 (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
2691 (revision svn-revision)))
2692 (file-name (git-file-name name version))
2693 (sha256
2694 (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
2695 (modules '((guix build utils)))
2696 (snippet
2697 '(begin
2698 (for-each delete-file-recursively
2699 '("bin" "bin64"
2700 ;; Remove "media" since some files such as
2701 ;; media/sound/game/soundsnap/info.txt refer to a
2702 ;; non-commercial license.
2703 "media"
2704 "server.bat"
2705 "tesseract.bat"
2706 "src/lib"
2707 "src/lib64"))
2708 #t))))
2709 (build-system gnu-build-system)
2710 (arguments
2711 `(#:make-flags (list "CC=gcc")
2712 #:tests? #f ; No tests.
2713 #:phases
2714 (modify-phases %standard-phases
2715 (delete 'configure)
2716 (add-after 'unpack 'cd-src
2717 (lambda _ (chdir "src") #t))
2718 (add-before 'build 'fix-env
2719 (lambda* (#:key inputs #:allow-other-keys)
2720 (setenv "CPATH"
bf182596
LC
2721 (string-append
2722 (search-input-directory inputs "include/SDL2")
2723 ":" (or (getenv "CPATH") "")))))
f67ae666
PN
2724 (add-after 'install 'really-install
2725 (lambda* (#:key outputs #:allow-other-keys)
2726 (let* ((out (assoc-ref outputs "out"))
2727 (share (string-append out "/share/tesseract"))
2728 (bin (string-append out "/bin/tesseract"))
2729 (client (string-append out "/bin/tesseract-client")))
2730 (chdir "..") ; Back to root.
2731 (for-each
2732 (lambda (dir)
2733 (mkdir-p (string-append share "/" dir))
2734 (copy-recursively dir (string-append share "/" dir)))
2735 '("config"))
2736 (mkdir-p (string-append out "/bin/"))
2737 (copy-file "bin_unix/native_client" client)
2738 (copy-file "bin_unix/native_server"
2739 (string-append out "/bin/tesseract-server"))
2740 (call-with-output-file bin
2741 (lambda (p)
2742 (format p "#!~a
2743TESS_DATA=~a
2744TESS_BIN=~a
2745TESS_OPTIONS=\"-u$HOME/.tesseract\"
2746cd \"$TESS_DATA\"
2747exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
2748 (which "bash")
2749 share
2750 client)))
2751 (chmod bin #o755)
2752 (install-file "src/readme_tesseract.txt"
2753 (string-append out "/share/licenses/tesseract/LICENSE")))
2754 #t)))))
2755 (inputs
2756 `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
2757 ("zlib" ,zlib)
2758 ("libpng" ,libpng)
2759 ("libgl" ,mesa)))
2760 (home-page "http://tesseract.gg/")
2761 (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
2762 (description "This package contains the game engine of Tesseract, a
2763first-person shooter focused on cooperative in-game map editing.
2764
2765The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
2766upgraded modern rendering techniques. The new rendering features include
2767fully dynamic omnidirectional shadows, global illumination, HDR lighting,
2768deferred shading, morphological / temporal / multisample anti-aliasing, and
2769much more.")
2770 (license license:zlib))))
0aac289d
FG
2771
2772(define-public recastnavigation
2773 ;; We follow master since there hasn't been a release since 1.5.1 in 2016.
2774 (let ((commit "c5cbd53024c8a9d8d097a4371215e3342d2fdc87")
2775 (revision "1"))
2776 (package
2777 (name "recastnavigation")
2778 (version (git-version "1.5.1" revision commit))
2779 (source (origin
2780 (method git-fetch)
2781 (uri (git-reference
2782 (url "https://github.com/recastnavigation/recastnavigation")
2783 (commit commit)))
2784 (file-name (git-file-name name version))
2785 (sha256
2786 (base32
2787 "034bm47gc3r285w1pnvkhmm74zz99d204b1r865gisaiq4qfbza0"))))
2788 (build-system cmake-build-system)
2789 (arguments
2790 `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
2791 "-DRECASTNAVIGATION_DEMO=OFF"
2792 "-DRECASTNAVIGATION_TESTS=ON"
2793 "-DRECASTNAVIGATION_EXAMPLES=OFF")))
2794 (synopsis "Navigation system for games")
2795 (description "Recast is state of the art navigation mesh
2796construction toolset for games.
2797
2798@itemize
2799@item It is automatic, which means that you can throw any level geometry
2800 at it and you will get robust mesh out.
2801@item It is fast which means swift turnaround times for level designers.
2802@item It is open source so it comes with full source and you can
2803 customize it to your heart's content.
2804@end itemize
2805
2806The Recast process starts with constructing a voxel mold from a level
2807geometry and then casting a navigation mesh over it. The process
2808consists of three steps, building the voxel mold, partitioning the mold
2809into simple regions, peeling off the regions as simple polygons.
2810
2811Recast is accompanied with Detour, path-finding and spatial reasoning
2812toolkit. You can use any navigation mesh with Detour, but of course the
2813data generated with Recast fits perfectly.
2814
2815Detour offers simple static navigation mesh which is suitable for many
2816simple cases, as well as tiled navigation mesh which allows you to plug
2817in and out pieces of the mesh. The tiled mesh allows you to create
2818systems where you stream new navigation data in and out as the player
2819progresses the level, or you may regenerate tiles as the world changes.")
2820 (home-page "https://github.com/recastnavigation/recastnavigation")
2821 (license license:zlib))))