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