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