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