gnu: godot: Update to 3.2.
[jackhill/guix/guix.git] / gnu / packages / game-development.scm
CommitLineData
6cb89466
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Tomáš Čech <sleep_walker@suse.cz>
f586c877 3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
189be331 4;;; Copyright © 2015, 2018 Ludovic Courtès <ludo@gnu.org>
a6dec13b 5;;; Copyright © 2015, 2018 Alex Kost <alezost@gmail.com>
68c6110c 6;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
d5c60e0a 7;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
3c8ba11a 8;;; Copyright © 2016, 2017 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>
2702d665 11;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
42d0d13d 12;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
194b4e7d 13;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
3c399e9b 14;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
6bc30a57 15;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
5b8d2ace 16;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
4041fabb 17;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
4337140c 18;;; Copyright © 2019, 2020 Leo Prikler <leo.prikler@student.tugraz.at>
328dd9b7 19;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
45c552ec 20;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
d8682615 21;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
6cb89466
22;;;
23;;; This file is part of GNU Guix.
24;;;
25;;; GNU Guix is free software; you can redistribute it and/or modify it
26;;; under the terms of the GNU General Public License as published by
27;;; the Free Software Foundation; either version 3 of the License, or (at
28;;; your option) any later version.
29;;;
30;;; GNU Guix is distributed in the hope that it will be useful, but
31;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33;;; GNU General Public License for more details.
34;;;
35;;; You should have received a copy of the GNU General Public License
36;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38(define-module (gnu packages game-development)
9fd50db3 39 #:use-module (srfi srfi-1)
b0910aad 40 #:use-module ((guix licenses) #:prefix license:)
6cb89466
41 #:use-module (guix packages)
42 #:use-module (guix download)
2a068aec 43 #:use-module (guix git-download)
4041fabb 44 #:use-module (guix svn-download)
be4d26f5 45 #:use-module (guix utils)
6cb89466 46 #:use-module (guix build-system cmake)
b0910aad 47 #:use-module (guix build-system gnu)
4bc37bf0 48 #:use-module (guix build-system python)
92b51d12 49 #:use-module (guix build-system scons)
b0910aad 50 #:use-module (gnu packages)
1297bc05 51 #:use-module (gnu packages audio)
c608fe8c 52 #:use-module (gnu packages autotools)
e4ff9dff 53 #:use-module (gnu packages base)
94a66dd9 54 #:use-module (gnu packages boost)
1297bc05 55 #:use-module (gnu packages compression)
2a068aec 56 #:use-module (gnu packages curl)
99828fa7 57 #:use-module (gnu packages documentation)
531003be 58 #:use-module (gnu packages fltk)
42d0d13d 59 #:use-module (gnu packages fonts)
d2cc38b7 60 #:use-module (gnu packages fontutils)
324b0040 61 #:use-module (gnu packages freedesktop)
d2cc38b7 62 #:use-module (gnu packages fribidi)
255d1bbe 63 #:use-module (gnu packages dbm)
1297bc05 64 #:use-module (gnu packages gl)
c24fff61 65 #:use-module (gnu packages glib)
1297bc05 66 #:use-module (gnu packages gnome)
c24fff61 67 #:use-module (gnu packages gnunet)
42d0d13d
MR
68 #:use-module (gnu packages graphics)
69 #:use-module (gnu packages graphviz)
1297bc05 70 #:use-module (gnu packages gtk)
c24fff61 71 #:use-module (gnu packages guile)
1297bc05
EF
72 #:use-module (gnu packages image)
73 #:use-module (gnu packages linux)
74 #:use-module (gnu packages lua)
c608fe8c 75 #:use-module (gnu packages m4)
7158fe4d 76 #:use-module (gnu packages mono)
1297bc05 77 #:use-module (gnu packages mp3)
c24fff61 78 #:use-module (gnu packages multiprecision)
4bc37bf0 79 #:use-module (gnu packages music)
c24fff61 80 #:use-module (gnu packages ncurses)
c1bc92c0 81 #:use-module (gnu packages pcre)
1297bc05
EF
82 #:use-module (gnu packages pkg-config)
83 #:use-module (gnu packages pulseaudio)
4bc37bf0 84 #:use-module (gnu packages python)
44d10b1f 85 #:use-module (gnu packages python-xyz)
b0910aad 86 #:use-module (gnu packages qt)
1297bc05 87 #:use-module (gnu packages sdl)
45c552ec 88 #:use-module (gnu packages sphinx)
67c127c9 89 #:use-module (gnu packages stb)
00fca594 90 #:use-module (gnu packages texinfo)
1297bc05 91 #:use-module (gnu packages tls)
4bc37bf0 92 #:use-module (gnu packages video)
451e1075 93 #:use-module (gnu packages web)
2a068aec 94 #:use-module (gnu packages xdisorg)
83a4a70b 95 #:use-module (gnu packages xiph)
194b4e7d 96 #:use-module (gnu packages xml)
1297bc05 97 #:use-module (gnu packages xorg))
6cb89466
98
99(define-public bullet
100 (package
101 (name "bullet")
623a0d83 102 (version "2.89")
6cb89466 103 (source (origin
fbb456dd
EF
104 (method git-fetch)
105 (uri (git-reference
106 (url "https://github.com/bulletphysics/bullet3/")
107 (commit version)))
108 (file-name (git-file-name name version))
6cb89466
109 (sha256
110 (base32
623a0d83 111 "10ncf2z474jnv7p5lv01ak2mk2hib3rj5rz1zr8v2v5pnciqbijl"))
fbb456dd
EF
112 (modules '((guix build utils)))
113 (snippet
114 '(begin
115 (for-each delete-file (find-files "build3" "premake*"))
116 (with-directory-excursion "examples/ThirdPartyLibs"
117 (for-each delete-file-recursively
118 '("Gwen" "clsocket" "enet" "glad" "imgui"
119 "lua-5.2.3" "midi" "minizip" "openvr"
120 "optionalX11" "serial" "zlib")))
623a0d83 121 ;; These need files from ThirdPartyLibs.
fbb456dd 122 (substitute* "Extras/CMakeLists.txt"
623a0d83
TGR
123 (("BulletRobotics") ""))
124 ;; Tests fail on linking, cannot find -lBussIK.
fbb456dd
EF
125 (substitute* "test/CMakeLists.txt"
126 ((" InverseDynamics")
127 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
128 ; (("SharedMemory") ""))
129 #t))))
6cb89466 130 (build-system cmake-build-system)
937bc2d1 131 (arguments
fbb456dd
EF
132 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
133 "-DBUILD_CPU_DEMOS=OFF"
134 "-DBUILD_OPENGL3_DEMOS=OFF"
135 "-DBUILD_BULLET2_DEMOS=OFF"
136 (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
137 (or (getenv "CXXFLAGS") "")))
138 #:phases
139 (modify-phases %standard-phases
140 (add-after 'unpack 'remove-failing-tests
623a0d83 141 ;; These tests fail specifically after removing 3rd party code.
fbb456dd
EF
142 (lambda _
143 (substitute* "test/SharedMemory/CMakeLists.txt"
144 (("ADD_TEST") "# ADD_TEST"))
145 (substitute* "test/InverseDynamics/CMakeLists.txt"
146 (("ADD_TEST\\(Test_BulletInverseForward")
147 "# ADD_TEST(Test_BulletInverseForward"))
148 #t)))))
937bc2d1
EF
149 (inputs
150 `(("glu" ,glu)
151 ("libx11" ,libx11)
152 ("mesa" ,mesa)))
9b811f69 153 (home-page "https://pybullet.org/wordpress/")
6cb89466
154 (synopsis "3D physics engine library")
155 (description
156 "Bullet is a physics engine library usable for collision detection. It
157is used in some video games and movies.")
b0910aad
DT
158 (license license:zlib)))
159
1a0c4437
KK
160(define-public deutex
161 (package
162 (name "deutex")
2702d665 163 (version "5.2.1")
1a0c4437
KK
164 (source (origin
165 (method url-fetch)
5fbb9f0b 166 (uri (string-append "https://github.com/Doom-Utils/deutex"
f7b60fdc 167 "/releases/download/v" version "/"
5fbb9f0b 168 "deutex-" version ".tar.xz"))
1a0c4437
KK
169 (sha256
170 (base32
2702d665 171 "07w3asqxx89wl2wfv1z3cak8v83h3ys3b39mq9qq4gyf3xdhs76n"))))
1a0c4437 172 (build-system gnu-build-system)
f7b60fdc 173 (native-inputs `(("asciidoc" ,asciidoc)))
1a0c4437
KK
174 (home-page "https://github.com/Doom-Utils/deutex")
175 (synopsis "WAD file composer for Doom and related games")
176 (description
177 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
178used to extract the lumps of a wad and save them as individual files.
179Conversely, it can also build a wad from separate files. When extracting a
180lump to a file, it does not just copy the raw data, it converts it to an
181appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
182Conversely, when it reads files for inclusion in pwads, it does the necessary
183conversions (for example, from PPM to Doom picture format). In addition,
184DeuTex has functions such as merging wads, etc.")
185 (license license:gpl2+)))
186
94a66dd9
KK
187(define-public grfcodec
188 (package
189 (name "grfcodec")
190 (version "6.0.6")
191 (source (origin
192 (method url-fetch)
193 (uri (string-append "http://binaries.openttd.org/extra/"
194 name "/" version "/" name "-" version
195 "-source.tar.xz"))
196 (sha256
197 (base32
198 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
199 (build-system gnu-build-system)
200 (arguments
201 '(#:tests? #f ; no check target
202 #:phases
203 (modify-phases %standard-phases
204 (delete 'configure) ; no configure script
205 (replace 'install ; no install target
206 (lambda* (#:key outputs #:allow-other-keys)
207 (let* ((out (assoc-ref outputs "out"))
208 (bin (string-append out "/bin"))
209 (doc (string-append out "/share/doc"))
210 (man (string-append out "/share/man/man1")))
211 (for-each (lambda (file)
212 (install-file file bin))
213 '("grfcodec" "grfid" "grfstrip" "nforenum"))
214 (install-file "COPYING" doc)
215 (with-directory-excursion "docs"
216 (for-each (lambda (file)
217 (install-file (string-append file ".txt") doc))
218 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
219 "readme" "readme.rpn"))
220 (for-each (lambda (file)
221 (install-file file man))
222 (find-files "." "\\.1"))))
223 #t)))))
224 (inputs
225 `(("boost" ,boost)
226 ("libpng" ,libpng)
227 ("zlib" ,zlib)))
228 (synopsis "GRF development tools")
229 (description
3d77785a 230 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
94a66dd9
KK
231tools for developing (New)GRFs. It includes a number of smaller programs, each
232with a specific task:
233@enumerate
234@item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
235@item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
236@item @code{grfstrip} strips all sprites from a GRF.
237@item @code{nforenum} checks NFO code for errors, making corrections when
238necessary.
239@end enumerate")
240 (home-page "http://dev.openttdcoop.org/projects/grfcodec")
241 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
242 ;; NFORenum is under the GPL2+.
243 ;; The MD5 implementation contained in GRFID is under the zlib license.
244 (license (list license:gpl2 license:gpl2+ license:zlib))))
245
3c399e9b
AI
246(define-public catcodec
247 (package
248 (name "catcodec")
249 (version "1.0.5")
250 (source
251 (origin
252 (method url-fetch)
253 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
254 version "/catcodec-" version "-source.tar.xz"))
255 (sha256
256 (base32
257 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
258 (build-system gnu-build-system)
259 (arguments
260 `(#:tests? #f ; no tests
261 #:make-flags (list (string-append "prefix=" %output))
262 #:phases (modify-phases %standard-phases
263 (delete 'configure))))
264 (home-page "http://dev.openttdcoop.org/projects/catcodec")
265 (synopsis "Encode/decode OpenTTD sounds")
266 (description "catcodec encodes and decodes sounds for OpenTTD. These
267sounds are not much more than some metadata (description and filename) and raw
268PCM data.")
269 (license license:gpl2)))
270
c24fff61
JG
271(define-public gzochi
272 (package
273 (name "gzochi")
cd6ae1ce 274 (version "0.12")
c24fff61
JG
275 (source (origin
276 (method url-fetch)
277 (uri (string-append "mirror://savannah/gzochi/gzochi-"
278 version ".tar.gz"))
279 (sha256
280 (base32
cd6ae1ce 281 "0h8yvk7154kd8zdfa9nqy73blrjq2x19kv305jcnwlmm09vvss59"))))
c24fff61 282 (build-system gnu-build-system)
1798e9ee
LC
283 (arguments
284 '(#:phases (modify-phases %standard-phases
285 (add-before 'build 'no-Werror
286 (lambda _
287 ;; Don't abort builds due to things like GLib
288 ;; deprecation warnings.
289 (substitute* (find-files "." "^Makefile\\.in$")
290 (("-Werror") ""))
291 #t)))))
c24fff61
JG
292 (native-inputs `(("pkgconfig" ,pkg-config)))
293 (inputs `(("bdb" ,bdb)
294 ("glib" ,glib)
0e4885af 295 ("guile" ,guile-2.2)
c24fff61
JG
296 ("libmicrohttpd" ,libmicrohttpd)
297 ("ncurses" ,ncurses)
298 ("sdl" ,sdl)
299 ("zlib" ,zlib)))
340978d7 300 (home-page "https://www.nongnu.org/gzochi/")
c24fff61
JG
301 (synopsis "Scalable middleware for multiplayer games")
302 (description
303 "gzochi is a framework for developing massively multiplayer online games.
304A server container provides services to deployed games, which are written in
305Guile Scheme, that abstract and simplify some of the most challenging and
306error-prone aspects of online game development: Concurrency, data persistence,
307and network communications. A very thin client library can be embedded to
308provide connectivity for client applications written in any language.")
309 (license license:gpl3+)))
310
7357fcf2
KK
311(define-public nml
312 (package
313 (name "nml")
41770337 314 (version "0.4.5")
7357fcf2
KK
315 (source
316 (origin
317 (method url-fetch)
318 (uri (string-append "http://bundles.openttdcoop.org/nml/releases/"
319 version "/nml-" version ".tar.gz"))
320 (sha256
321 (base32
41770337 322 "1pmvvm3sgnpngfa7884mqhq3fwdjh9sr0ca07ypnidcg0y341w53"))))
7357fcf2 323 (build-system python-build-system)
e877f4d0
JL
324 (arguments
325 `(#:phases
326 (modify-phases %standard-phases
327 (add-before 'build 'fix-pillow
328 (lambda _
329 ;; pillow's version is not in PIL.Image.VERSION anymore
330 (substitute* "nml/version_info.py"
331 (("from PIL import Image") "import PIL")
332 (("Image.VERSION") "PIL.__version__"))
333 #t)))))
7357fcf2
KK
334 (propagated-inputs
335 `(("python-pillow" ,python-pillow)
336 ("python-ply" ,python-ply)))
df0fd7bf 337 (home-page "https://dev.openttdcoop.org/projects/nml")
7357fcf2
KK
338 (synopsis "NML compiler")
339 (description
a7cbe727 340 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
7357fcf2
KK
341compiling NML files (along with their associated language, sound and graphic
342files) into @file{.grf} and/or @file{.nfo} files.")
343 (license license:gpl2+)))
344
45f8e7f7
KK
345(define-public python-sge-pygame
346 (package
347 (name "python-sge-pygame")
b1d1a10c 348 (version "1.5.1")
45f8e7f7
KK
349 (source
350 (origin
351 (method url-fetch)
7f652029
KK
352 (uri (string-append "mirror://savannah/stellarengine/"
353 (version-major+minor version) "/sge-pygame-"
354 version ".tar.gz"))
355 (file-name (string-append name "-" version ".tar.gz"))
45f8e7f7
KK
356 (sha256
357 (base32
b1d1a10c 358 "1rl3xjzh78sl0sq3xl8rl7cgp9v9v3h7s2pfwn7nj1vrmffzkcpd"))))
45f8e7f7
KK
359 (build-system python-build-system)
360 (propagated-inputs
361 `(("python-pygame" ,python-pygame)
81353514
KK
362 ("python-six" ,python-six)
363 ("python-uniseg" ,python-uniseg)))
45f8e7f7
KK
364 (home-page "http://stellarengine.nongnu.org")
365 (synopsis "2D game engine for Python")
366 (description
367 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
ffbe2dc1 368general-purpose 2D game engine. It takes care of several details for you so
45f8e7f7
KK
369you can focus on the game itself. This makes more rapid game development
370possible, and it also makes the SGE easy to learn.")
371 (license license:lgpl3+)))
372
373(define-public python2-sge-pygame
374 (package-with-python2 python-sge-pygame))
375
1b775fd1
KK
376(define-public python-tmx
377 (package
378 (name "python-tmx")
95c1324a 379 (version "1.10")
1b775fd1
KK
380 (source
381 (origin
382 (method url-fetch)
be4d26f5
KK
383 (uri (string-append "mirror://savannah/python-tmx/"
384 (version-major+minor version) "/tmx-"
1b775fd1
KK
385 version ".tar.gz"))
386 (sha256
387 (base32
95c1324a 388 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
1b775fd1
KK
389 (build-system python-build-system)
390 (propagated-inputs
391 `(("python-six" ,python-six)))
392 (home-page "http://python-tmx.nongnu.org")
393 (synopsis "Python library for the @code{Tiled} TMX format")
394 (description
395 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
396This is useful for map editors or generic level editors, and it's also useful
397for using a map editor or generic level editor like Tiled to edit your game's
398levels.")
399 (license (list license:asl2.0
400 ;; Documentation (only available in the source tarball) is
401 ;; under the CC0 license.
402 license:cc0))))
403
404(define-public python2-tmx
405 (let ((python2-tmx (package-with-python2 python-tmx)))
406 (package
407 (inherit python2-tmx)
408 (propagated-inputs
409 `(("python2-pathlib" ,python2-pathlib)
410 ,@(package-propagated-inputs python2-tmx))))))
411
e99039b5
KK
412(define-public python-xsge
413 (package
414 (name "python-xsge")
6e92fba4 415 (version "2018.02.26")
e99039b5
KK
416 (source (origin
417 (method url-fetch)
795f3a00 418 (uri (string-append "mirror://savannah/xsge/xsge/xsge-"
e99039b5
KK
419 version ".tar.gz"))
420 (sha256
421 (base32
6e92fba4 422 "0bx93hgf7cgdw2gsygbh59y8vpw37pgsa279rajw3fkdpl8vrc40"))))
e99039b5
KK
423 (build-system python-build-system)
424 (arguments
425 '(#:phases
426 (modify-phases %standard-phases
427 ;; xSGE's setup.py script does not support one of the Python build
428 ;; system's default flags, "--single-version-externally-managed".
429 (replace 'install
430 (lambda* (#:key outputs #:allow-other-keys)
6e92fba4
KK
431 (invoke "python" "setup.py" "install"
432 (string-append "--prefix=" (assoc-ref outputs "out"))
433 "--root=/"))))
e99039b5
KK
434 #:tests? #f)) ; no check target
435 (propagated-inputs
436 `(("python-sge-pygame" ,python-sge-pygame)
437 ("python-pygame" ,python-pygame)
438 ("python-six" ,python-six)
439 ("python-tmx" ,python-tmx)))
440 (home-page "http://xsge.nongnu.org")
441 (synopsis "Extensions for the SGE Game Engine")
442 (description
443 "xSGE is a collection of modules that make doing certain tasks with the SGE
444Game Engine easier. In addition to SGE's conveniences, the user has access to a
445GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
446support.")
447 (license license:gpl3+)))
448
449(define-public python2-xsge
450 (package-with-python2 python-xsge))
451
b0910aad
DT
452(define-public tiled
453 (package
454 (name "tiled")
b66f2211 455 (version "1.2.5")
b0910aad 456 (source (origin
902068b4
RW
457 (method git-fetch)
458 (uri (git-reference
459 (url "https://github.com/bjorn/tiled.git")
460 (commit (string-append "v" version))))
461 (file-name (git-file-name name version))
b0910aad
DT
462 (sha256
463 (base32
b66f2211 464 "14v2zfka2y3h0r0biw1rl59585lji5074x958s4xnb352jm5h9b9"))))
b0910aad 465 (build-system gnu-build-system)
864cc7ef
RW
466 (inputs
467 `(("qtbase" ,qtbase)
468 ("qtsvg" ,qtsvg)
469 ("zlib" ,zlib)))
470 (native-inputs
471 `(("qttools" ,qttools)))
b0910aad
DT
472 (arguments
473 '(#:phases
d06fc008
EF
474 (modify-phases %standard-phases
475 (replace 'configure
864cc7ef
RW
476 (lambda* (#:key inputs outputs #:allow-other-keys)
477 (substitute* "translations/translations.pro"
478 (("LRELEASE =.*")
479 (string-append "LRELEASE = "
480 (assoc-ref inputs "qttools")
481 "/bin/lrelease\n")))
d06fc008 482 (let ((out (assoc-ref outputs "out")))
9dafb647
KK
483 (invoke "qmake"
484 (string-append "PREFIX=" out))))))))
88b028f3 485 (home-page "https://www.mapeditor.org/")
b0910aad
DT
486 (synopsis "Tile map editor")
487 (description
488 "Tiled is a general purpose tile map editor. It is meant to be used for
489editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
490clone.")
491
492 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
493 ;; under BSD-2.
494 (license license:gpl2+)))
5809ffcc
DT
495
496(define-public sfml
497 (package
498 (name "sfml")
9ac59ad3 499 (version "2.5.1")
5809ffcc 500 (source (origin
95f6adae 501 (method git-fetch)
7d1b5022
RW
502 ;; Do not fetch the archives from
503 ;; http://mirror0.sfml-dev.org/files/ because files there seem
504 ;; to be changed in place.
95f6adae
TGR
505 (uri (git-reference
506 (url "https://github.com/SFML/SFML.git")
507 (commit version)))
508 (file-name (git-file-name name version))
5809ffcc
DT
509 (sha256
510 (base32
9ac59ad3 511 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
67c127c9
MB
512 (modules '((guix build utils)))
513 (snippet
514 '(begin
515 ;; Ensure system libraries are used.
516 (delete-file-recursively "extlibs")
517 #t))))
5809ffcc
DT
518 (build-system cmake-build-system)
519 (arguments
a6e25a50 520 '(#:configure-flags
0bc27248
MB
521 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
522 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
a6e25a50 523 #:tests? #f)) ; no tests
0bc27248
MB
524 (native-inputs
525 `(("pkg-config" ,pkg-config)))
5809ffcc
DT
526 (inputs
527 `(("mesa" ,mesa)
528 ("glew" ,glew)
529 ("libx11" ,libx11)
240f2785 530 ("xcb-util-image" ,xcb-util-image)
5809ffcc
DT
531 ("libxrandr" ,libxrandr)
532 ("eudev" ,eudev)
5809ffcc 533 ("libjpeg" ,libjpeg)
67c127c9
MB
534 ("libsndfile" ,libsndfile)
535 ("stb-image" ,stb-image)
536 ("stb-image-write" ,stb-image-write)))
0bc27248
MB
537 (propagated-inputs
538 ;; In Requires.private of pkg-config files.
539 `(("flac" ,flac)
540 ("freetype" ,freetype)
541 ("libvorbis" ,libvorbis)
5809ffcc 542 ("openal" ,openal)))
167f0e82 543 (home-page "https://www.sfml-dev.org")
5809ffcc
DT
544 (synopsis "Simple and Fast Multimedia Library")
545 (description
546 "SFML provides a simple interface to the various computer components,
547to ease the development of games and multimedia applications. It is composed
548of five modules: system, window, graphics, audio and network.")
549 (license license:zlib)))
d620ea88
DT
550
551(define-public sfxr
552 (package
553 (name "sfxr")
554 (version "1.2.1")
555 (source (origin
556 (method url-fetch)
557 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
558 (sha256
559 (base32
560 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
561 (build-system gnu-build-system)
562 (arguments
563 `(#:phases (modify-phases %standard-phases
564 (delete 'configure) ; no configure script
565 (add-before 'build 'patch-makefile
566 (lambda* (#:key outputs #:allow-other-keys)
567 (let ((out (assoc-ref outputs "out")))
568 (substitute* "Makefile"
569 (("\\$\\(DESTDIR\\)/usr") out))
570 (substitute* "main.cpp"
571 (("/usr/share")
572 (string-append out "/share")))
573 #t))))
574 #:tests? #f)) ; no tests
575 (native-inputs
576 `(("pkg-config" ,pkg-config)
577 ("desktop-file-utils" ,desktop-file-utils)))
578 (inputs
579 `(("sdl" ,sdl)
580 ("gtk+" ,gtk+)))
581 (synopsis "Simple sound effect generator")
582 (description "Sfxr is a tool for quickly generating simple sound effects.
583Originally created for use in video game prototypes, it can generate random
584sounds from presets such as \"explosion\" or \"powerup\".")
585 (home-page "http://www.drpetter.se/project_sfxr.html")
586 (license license:expat)))
0f6139b1
AK
587
588(define-public physfs
589 (package
590 (name "physfs")
d00a8b84 591 (version "3.0.2")
0f6139b1
AK
592 (source (origin
593 (method url-fetch)
594 (uri (string-append
167f0e82 595 "https://icculus.org/physfs/downloads/physfs-"
0f6139b1
AK
596 version ".tar.bz2"))
597 (file-name (string-append name "-" version ".tar.gz"))
598 (sha256
599 (base32
d00a8b84 600 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
0f6139b1
AK
601 (build-system cmake-build-system)
602 (arguments
08e977d2
MB
603 '(#:tests? #f ; no check target
604 #:phases (modify-phases %standard-phases
605 (add-after 'unpack 'patch-CMakeLists.txt
606 (lambda _
607 (substitute* "CMakeLists.txt"
608 ;; XXX: For some reason CMakeLists.txt disables
609 ;; RUNPATH manipulation when the compiler is GCC.
610 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
611 #t)))))
0f6139b1
AK
612 (inputs
613 `(("zlib" ,zlib)))
614 (native-inputs
615 `(("doxygen" ,doxygen)))
167f0e82 616 (home-page "https://icculus.org/physfs")
0f6139b1
AK
617 (synopsis "File system abstraction library")
618 (description
619 "PhysicsFS is a library to provide abstract access to various archives.
620It is intended for use in video games. For security, no file writing done
621through the PhysicsFS API can leave a defined @emph{write directory}. For
622file reading, a @emph{search path} with archives and directories is defined,
623and it becomes a single, transparent hierarchical file system. So archive
624files can be accessed in the same way as you access files directly on a disk,
625and it makes it easy to ship a new archive that will override a previous
626archive on a per-file basis.")
627 (license license:zlib)))
83a4a70b
DT
628
629(define-public love
630 (package
631 (name "love")
dd88c89e 632 (version "11.3")
83a4a70b
DT
633 (source (origin
634 (method url-fetch)
635 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
636 "love-" version "-linux-src.tar.gz"))
637 (sha256
638 (base32
dd88c89e 639 "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
83a4a70b
DT
640 (build-system gnu-build-system)
641 (native-inputs
642 `(("pkg-config" ,pkg-config)))
643 (inputs
644 `(("devil" ,devil)
645 ("freetype" ,freetype)
646 ("libmodplug" ,libmodplug)
05d48c52 647 ("libtheora" ,libtheora)
83a4a70b
DT
648 ("libvorbis" ,libvorbis)
649 ("luajit" ,luajit)
650 ("mesa" ,mesa)
651 ("mpg123" ,mpg123)
652 ("openal" ,openal)
653 ("physfs" ,physfs)
654 ("sdl2" ,sdl2)
655 ("zlib" ,zlib)))
656 (synopsis "2D game framework for Lua")
657 (description "LÖVE is a framework for making 2D games in the Lua
658programming language.")
659 (home-page "https://love2d.org/")
660 (license license:zlib)))
154f6156 661
328dd9b7
JC
662(define-public love-nuklear
663 (let ((version "v2.6")
664 (commit "fef4e00a602efb16c57ae962850b6e7a01f7a29a"))
665 (package
666 (name "love-nuklear")
667 (version (git-version version "1" commit))
668 (source (origin
669 (method git-fetch)
670 (uri (git-reference
671 (url "https://github.com/keharriso/love-nuklear/")
672 (commit commit)
673 (recursive? #t)))
674 ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
675 ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
676 (file-name (git-file-name name version))
677 (sha256
678 (base32
679 "15qmy8mfwkxy2x9rmxs6f9cyvjvwwj6yf78bs863xmc56dmjzzbn"))))
680 (build-system cmake-build-system)
681 (arguments
682 `(#:build-type "Release"
683 #:tests? #f))
684 (inputs
685 `(("luajit" ,luajit)))
686 (synopsis "Lightweight immediate mode GUI for LÖVE games")
687 (description "LÖVE is a Lua framework for making 2D games. Nuklear
688is a minimal state immediate mode graphical user interface toolkit. This
689package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
690 (home-page "https://github.com/keharriso/love-nuklear/")
691 (license license:expat))))
692
154f6156
DT
693(define-public allegro-4
694 (package
695 (name "allegro")
b2cf5597 696 (version "4.4.3")
154f6156
DT
697 (source (origin
698 (method url-fetch)
3a12e21c
EF
699 (uri (string-append "https://github.com/liballeg/allegro5/"
700 "releases/download/" version "/allegro-"
701 version ".tar.gz"))
154f6156
DT
702 (sha256
703 (base32
b2cf5597 704 "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
154f6156
DT
705 (build-system cmake-build-system)
706 (arguments
707 '(#:phases
708 (modify-phases %standard-phases
709 (add-after 'unpack 'patch-build-system
710 (lambda _
711 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
712 ;; via a command line option doesn't work because it is
713 ;; unconditionally clobbered in the build script.
714 (substitute* '("CMakeLists.txt")
715 (("ADDON_LINKAGE STATIC")
716 "ADDON_LINKAGE SHARED"))
717 #t)))))
718 (inputs
719 `(("glu" ,glu)
720 ("libpng" ,libpng)
721 ("libvorbis" ,libvorbis)
722 ("mesa" ,mesa)
723 ("zlib" ,zlib)))
724 (synopsis "Game programming library")
725 (description "Allegro is a library mainly aimed at video game and
726multimedia programming. It handles common, low-level tasks such as creating
727windows, accepting user input, loading data, drawing images, playing sounds,
728etc.")
4968ea2c 729 (home-page "https://liballeg.org")
154f6156 730 (license license:giftware)))
2a068aec 731
19d311b4
RW
732(define-public allegro
733 (package
734 (name "allegro")
49405aaf 735 (version "5.2.5.0")
19d311b4
RW
736 (source (origin
737 (method url-fetch)
3a12e21c
EF
738 (uri (string-append "https://github.com/liballeg/allegro5/releases"
739 "/download/" version "/allegro-"
b15a020d 740 version ".tar.gz"))
19d311b4
RW
741 (sha256
742 (base32
49405aaf 743 "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
19d311b4 744 (build-system cmake-build-system)
49405aaf 745 (arguments `(#:tests? #f)) ; there are no tests
19d311b4
RW
746 (inputs
747 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
748 `(("flac" ,flac)
749 ("freetype" ,freetype)
750 ("glu" ,glu)
751 ("gtk" ,gtk+-2)
752 ("libjpeg" ,libjpeg)
753 ("libpng" ,libpng)
754 ("libtheora" ,libtheora)
755 ("libvorbis" ,libvorbis)
756 ("libxcursor" ,libxcursor)
757 ("libxinerama" ,libxinerama)
758 ("libxrandr" ,libxrandr)
759 ("mesa" ,mesa)
760 ("openal" ,openal)
761 ("physfs" ,physfs)
762 ("zlib" ,zlib)))
763 (native-inputs
764 `(("pkg-config" ,pkg-config)))
765 (synopsis "Game programming library")
766 (description "Allegro is a library mainly aimed at video game and
767multimedia programming. It handles common, low-level tasks such as creating
768windows, accepting user input, loading data, drawing images, playing sounds,
769etc.")
4968ea2c 770 (home-page "https://liballeg.org")
19d311b4
RW
771 (license license:bsd-3)))
772
cdf8f391
RW
773(define-public allegro-5.0
774 (package (inherit allegro)
775 (name "allegro")
776 (version "5.0.11")
777 (source (origin
778 (method url-fetch)
3a12e21c
EF
779 (uri (string-append "https://github.com/liballeg/allegro5/releases"
780 "/download/" version "/allegro-"
781 (if (equal? "0" (string-take-right version 1))
782 (string-drop-right version 2)
783 version)
784 ".tar.gz"))
0109b89c
EF
785 (patches (search-patches
786 "allegro-mesa-18.2.5-and-later.patch"))
cdf8f391
RW
787 (sha256
788 (base32
789 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
790
2a068aec
DT
791(define-public aseprite
792 (package
793 (name "aseprite")
82654d95 794 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
ff4dc16e 795 ;; TODO: Unbundle third party software.
2a068aec 796 (source (origin
ff4dc16e
MB
797 (method url-fetch/zipbomb)
798 (uri (string-append "https://github.com/aseprite/aseprite"
799 "/releases/download/v" version
800 "/Aseprite-v" version "-Source.zip"))
2a068aec
DT
801 (sha256
802 (base32
82654d95 803 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
2a068aec
DT
804 (build-system cmake-build-system)
805 (arguments
806 '(#:configure-flags
807 ;; Use shared libraries instead of building bundled source.
808 (list "-DWITH_WEBP_SUPPORT=1"
809 "-DUSE_SHARED_CURL=1"
810 "-DUSE_SHARED_GIFLIB=1"
811 "-DUSE_SHARED_JPEGLIB=1"
812 "-DUSE_SHARED_ZLIB=1"
813 "-DUSE_SHARED_LIBPNG=1"
814 "-DUSE_SHARED_LIBLOADPNG=1"
815 "-DUSE_SHARED_LIBWEBP=1"
816 "-DUSE_SHARED_TINYXML=1"
817 "-DUSE_SHARED_PIXMAN=1"
818 "-DUSE_SHARED_FREETYPE=1"
819 "-DUSE_SHARED_ALLEGRO4=1"
820 "-DENABLE_UPDATER=0" ; no auto-updates
821 (string-append "-DFREETYPE_INCLUDE_DIR="
822 (assoc-ref %build-inputs "freetype")
de1d68a2 823 "/include/freetype2"))))
2a068aec
DT
824 (native-inputs
825 `(("pkg-config" ,pkg-config)))
826 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
827 ;; patched version is bundled with Aseprite, but the patches should be
828 ;; extracted and applied on top of a standalone Allegro 4 package.
829 (inputs
830 `(("allegro" ,allegro-4)
831 ("curl" ,curl)
832 ("freetype" ,freetype)
833 ("giflib" ,giflib)
834 ("libjpeg" ,libjpeg)
835 ("libpng" ,libpng)
836 ("libwebp" ,libwebp)
837 ("libx11" ,libx11)
838 ("libxext" ,libxext)
839 ("libxxf86vm" ,libxxf86vm)
840 ("pixman" ,pixman)
841 ("tinyxml" ,tinyxml)
842 ("zlib" ,zlib)))
843 (synopsis "Animated sprite editor and pixel art tool")
844 (description "Aseprite is a tool for creating 2D pixel art for video
845games. In addition to basic pixel editing features, Aseprite can assist in
846the creation of animations, tiled graphics, texture atlases, and more.")
167f0e82 847 (home-page "https://www.aseprite.org/")
2a068aec 848 (license license:gpl2+)))
966dff3b
KY
849
850(define-public qqwing
851 (package
852 (name "qqwing")
853 (version "1.3.4")
854 (source (origin
855 (method url-fetch)
856 (uri (string-append
857 "https://qqwing.com/"
858 name "-" version ".tar.gz"))
859 (sha256
860 (base32
861 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
862 (build-system gnu-build-system)
863 (native-inputs
864 `(("pkg-config" ,pkg-config)))
865 (home-page "https://qqwing.com/")
866 (synopsis "Sudoku puzzle solver and generator")
867 (description
868 "QQWing is a Sudoku puzzle generator and solver.
869It offers the following features:
870@enumerate
871@item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
872@item Uses logic. Uses as many solve techniques as possible when solving
873 puzzles rather than guessing.
874@item Rates puzzles. Most generators don't give an indication of the difficulty
875 of a Sudoku puzzle. QQwing does.
876@item Can print solve instructions for any puzzle.
877@item Customizable output style, including a CSV style that is easy to
878 import into a database.
879@end enumerate")
880 (license license:gpl2+)))
d2cc38b7
KK
881
882(define-public quesoglc
883 (package
884 (name "quesoglc")
885 (version "0.7.2")
886 (source (origin
887 (method url-fetch)
888 (uri (string-append "mirror://sourceforge/" name "/" version "/"
889 name "-" version "-free.tar.bz2"))
890 (sha256
891 (base32
892 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
893 (build-system gnu-build-system)
894 (native-inputs `(("pkg-config" ,pkg-config)))
895 (inputs `(("fontconfig" ,fontconfig)
896 ("freeglute" ,freeglut)
897 ("fribidi" ,fribidi)
898 ("glew" ,glew)))
899 (home-page "http://quesoglc.sourceforge.net")
900 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
901 (description
902 "The OpenGL Character Renderer (GLC) is a state machine that provides
903OpenGL programs with character rendering services via an application programming
904interface (API).")
905 (license (list license:expat license:lgpl2.1+))))
4bc37bf0
KK
906
907(define-public python-pygame
908 (package
909 (name "python-pygame")
a9db93c1 910 (version "1.9.4")
4bc37bf0
KK
911 (source (origin
912 (method url-fetch)
052f75da 913 (uri (pypi-uri "pygame" version))
4bc37bf0
KK
914 (sha256
915 (base32
a9db93c1 916 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
4bc37bf0
KK
917 (build-system python-build-system)
918 (arguments
a9db93c1 919 `(#:tests? #f ; tests require pygame to be installed first
4bc37bf0
KK
920 #:phases
921 (modify-phases %standard-phases
922 ;; Set the paths to the dependencies manually because
923 ;; the configure script does not allow passing them as
924 ;; parameters. This also means we can skip the configure
925 ;; phase.
926 (add-before 'build 'set-library-paths
927 (lambda* (#:key inputs outputs #:allow-other-keys)
928 (let ((sdl-ref (assoc-ref inputs "sdl"))
929 (font-ref (assoc-ref inputs "sdl-ttf"))
930 (image-ref (assoc-ref inputs "sdl-image"))
931 (mixer-ref (assoc-ref inputs "sdl-mixer"))
932 (smpeg-ref (assoc-ref inputs "libsmpeg"))
933 (png-ref (assoc-ref inputs "libpng"))
934 (jpeg-ref (assoc-ref inputs "libjpeg"))
052f75da 935 (freetype-ref (assoc-ref inputs "freetype"))
4bc37bf0
KK
936 (v4l-ref (assoc-ref inputs "v4l-utils"))
937 (out-ref (assoc-ref outputs "out")))
938 (substitute* "Setup.in"
939 (("SDL = -I/usr/include/SDL")
940 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
941 (substitute* "Setup.in"
942 (("FONT = -lSDL_ttf")
943 (string-append "FONT = -I" font-ref "/include/SDL -L"
a9db93c1 944 font-ref "/lib -lSDL_ttf")))
4bc37bf0
KK
945 (substitute* "Setup.in"
946 (("IMAGE = -lSDL_image")
947 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
a9db93c1 948 image-ref "/lib -lSDL_image")))
4bc37bf0
KK
949 (substitute* "Setup.in"
950 (("MIXER = -lSDL_mixer")
951 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
a9db93c1 952 mixer-ref "/lib -lSDL_mixer")))
4bc37bf0
KK
953 (substitute* "Setup.in"
954 (("SMPEG = -lsmpeg")
955 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
a9db93c1 956 smpeg-ref "/lib -lsmpeg")))
4bc37bf0
KK
957 (substitute* "Setup.in"
958 (("PNG = -lpng")
959 (string-append "PNG = -I" png-ref "/include -L"
a9db93c1 960 png-ref "/lib -lpng")))
4bc37bf0
KK
961 (substitute* "Setup.in"
962 (("JPEG = -ljpeg")
963 (string-append "JPEG = -I" jpeg-ref "/include -L"
964 jpeg-ref "/lib -ljpeg")))
052f75da
DM
965
966 (substitute* "Setup.in"
967 (("FREETYPE = -lfreetype")
968 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
969 freetype-ref "/lib -lfreetype")))
970
4bc37bf0
KK
971 (substitute* "Setup.in"
972 (("^pypm") "#pypm"))
4bc37bf0
KK
973 ;; Create a path to a header file provided by v4l-utils.
974 (system* "mkdir" "linux")
975 (system* "ln" "--symbolic"
976 (string-append v4l-ref "/include/libv4l1-videodev.h")
977 "linux/videodev.h")
978 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
4bc37bf0 979 (inputs
052f75da
DM
980 `(("freetype" ,freetype)
981 ("sdl" ,sdl)
4bc37bf0
KK
982 ("sdl-image" ,sdl-image)
983 ("sdl-mixer" ,sdl-mixer)
984 ("sdl-ttf" ,sdl-ttf)
985 ("sdl-gfx" ,sdl-gfx)
986 ("libjpeg" ,libjpeg)
987 ("libpng" ,libpng)
988 ("libX11" ,libx11)
989 ("libsmpeg" ,libsmpeg)
990 ("portmidi" ,portmidi)
991 ("v4l-utils" ,v4l-utils)))
167f0e82 992 (home-page "https://www.pygame.org")
4bc37bf0
KK
993 (synopsis "SDL wrapper for Python")
994 (description "Pygame is a set of Python modules designed for writing games.
995Pygame adds functionality on top of the excellent SDL library. This allows you
996to create fully featured games and multimedia programs in the python language.")
997 (license (list license:bsd-2
998 ;; python numeric license as listed by Debian looks like
999 ;; an Expat-style license with a warranty disclaimer for
1000 ;; the U.S. government and the University of California.
1001 license:expat
1002 license:lgpl2.0+
1003 license:lgpl2.1+
1004 license:gpl3+
1005 license:psfl
1006 license:public-domain
1007 license:lgpl2.1+))))
052f75da
DM
1008
1009(define-public python2-pygame
1010 (package-with-python2 python-pygame))
68c6110c 1011
8476e585
CY
1012(define-public python2-pygame-sdl2
1013 (let ((real-version "2.1.0")
1014 (renpy-version "7.3.5"))
1015 (package
1016 (inherit python2-pygame)
1017 (name "python2-pygame-sdl2")
1018 (version (string-append real-version "-for-renpy-" renpy-version))
1019 (source
1020 (origin
1021 (method url-fetch)
1022 (uri (string-append "https://www.renpy.org/dl/" renpy-version
1023 "/pygame_sdl2-" version ".tar.gz"))
1024 (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))))
1025 (build-system python-build-system)
1026 (arguments
1027 `(#:tests? #f ; tests require pygame to be installed first
1028 #:python ,python-2
1029 #:phases
1030 (modify-phases %standard-phases
1031 (add-after 'set-paths 'set-sdl-vars
1032 (lambda* (#:key inputs #:allow-other-keys)
1033 (setenv "PYGAME_SDL2_CFLAGS"
1034 (string-append "-I"
1035 (assoc-ref inputs "sdl-union")
1036 "/include/SDL2 -D_REENTRANT"))
1037 (setenv "PYGAME_SDL2_LDFLAGS"
1038 (string-append "-L"
1039 (assoc-ref inputs "sdl-union")
1040 "/lib -Wl,-rpath,"
1041 (assoc-ref inputs "sdl-union")
1042 "/lib -Wl,--enable-new-dtags -lSDL2"))
1043 #t))
1044 (add-before 'build 'drop-generated-files
1045 (lambda args
1046 (delete-file-recursively "gen")
1047 (delete-file-recursively "gen3")
1048 #t)))))
1049 (inputs
1050 `(("sdl-union"
1051 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1052 (native-inputs
1053 `(("python2-cython" ,python2-cython)))
1054 (home-page "http://www.renpy.org/")
1055 (synopsis "Reimplementation of the Pygame API using SDL2")
1056 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1057staying close to the original, but also adding some SDL2-specific features.
1058While it aims to be used as a drop-in replacement, it appears to be
1059developed mainly for Ren'py.")
1060 (license (list license:lgpl2.1 license:zlib)))))
1061
1062(define-public python2-renpy
1063 (package
1064 (name "python2-renpy")
1065 (version "7.3.5")
1066 (source
1067 (origin
1068 (method url-fetch)
1069 (uri (string-append "https://www.renpy.org/dl/" version
1070 "/renpy-" version "-source.tar.bz2"))
1071 (sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))))
1072 (build-system python-build-system)
1073 (arguments
1074 `(#:tests? #f ; Ren'py doesn't seem to package tests
1075 #:python ,python-2
1076 #:phases
1077 (modify-phases %standard-phases
1078 (add-after 'unpack 'fix-commands
1079 (lambda _
1080 (substitute* "renpy/editor.py"
1081 (("xdg-open")
1082 (which "xdg-open")))
1083 #t))
1084 (add-after 'set-paths 'set-build-vars
1085 (lambda* (#:key inputs #:allow-other-keys)
1086 (setenv "RENPY_CYTHON"
1087 (string-append (assoc-ref inputs "python2-cython")
1088 "/bin/cython"))
1089 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
1090 #t))
1091 (replace 'build
37c52b5b
LP
1092 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1093 ;; The "module" subdirectory contains a python (really cython)
1094 ;; project, which is built using a script, that is thankfully
1095 ;; named "setup.py".
1096 (with-directory-excursion "module"
1097 (apply (assoc-ref %standard-phases 'build) args))
1098 ;; the above causes renpy.__init__ to be compiled but does not
1099 ;; compile anything else, hence we do that here
1100 (delete-file "renpy/__init__.pyc")
1101 (invoke "python" "-m" "compileall" "renpy")
8476e585
CY
1102 #t))
1103 (replace 'install
37c52b5b
LP
1104 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
1105 ;; Again, we have to wrap the module installation.
1106 ;; Additionally, we want to install the python code
1107 ;; (both source and compiled) in the same directory.
1108 (let* ((out (assoc-ref outputs "out"))
1109 (site (string-append "/lib/python"
1110 ,(version-major+minor
1111 (package-version python-2))
1112 "/site-packages")))
1113 (with-directory-excursion "module"
1114 (apply (assoc-ref %standard-phases 'install) args))
1115 (copy-recursively "renpy"
1116 (string-append out site "/renpy")))
8476e585
CY
1117 #t)))))
1118 (inputs
1119 `(("ffmpeg" ,ffmpeg)
1120 ("freetype" ,freetype)
1121 ("glew" ,glew)
1122 ("libpng" ,libpng)
1123 ("python2-pygame" ,python2-pygame-sdl2)
1124 ("sdl-union"
1125 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1126 (native-inputs
1127 `(("python2-cython" ,python2-cython)
1128 ("xdg-utils" ,xdg-utils)))
1129 (home-page "http://www.renpy.org/")
1130 (synopsis "Ren'py python module")
1131 (description "This package contains the shared libraries and Python
1132modules of Ren'py.")
1133 (license license:expat)))
1134
1135(define-public renpy
1136 (package
1137 (inherit python2-renpy)
1138 (name "renpy")
1139 (version "7.3.5")
1140 (build-system python-build-system)
1141 (arguments
1142 `(#:tests? #f ; see python2-renpy
1143 #:python ,python-2
1144 #:phases
1145 (modify-phases %standard-phases
1146 (add-after 'unpack 'fix-commands
1147 (lambda* (#:key outputs #:allow-other-keys)
1148 (substitute* "launcher/game/choose_directory.rpy"
1149 (("/usr/bin/python") (which "python2")))
1150 (substitute* "launcher/game/front_page.rpy"
1151 (("xdg-open")
1152 (which "xdg-open")))
1153 (substitute* "launcher/game/project.rpy"
1154 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1155 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1156 "/bin/renpy\" ]"))
1157 ;; Projects are still created in the usual style, so we need
1158 ;; to adjust the path.
1159 (("cmd.append\\(self.path\\)")
1160 "cmd.append(self.path + \"/game\")"))
1161 #t))
1162 (add-after 'unpack 'drop-game-from-paths
1163 (lambda _
1164 (substitute* (list "launcher/game/gui7.rpy"
1165 "launcher/game/gui7/images.py")
1166 ((", \"game\",") ","))
1167 #t))
1168 (add-before 'build 'start-xserver
1169 (lambda* (#:key inputs #:allow-other-keys)
1170 (let ((xorg-server (assoc-ref inputs "xorg-server")))
1171 (setenv "HOME" (getcwd))
1172 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
1173 (setenv "DISPLAY" ":1")
1174 #t)))
1175 (replace 'build
1176 (lambda _
1177 (invoke "python" "renpy.py" "launcher" "quit")
1178 (invoke "python" "renpy.py" "the_question" "quit")
1179 (invoke "python" "renpy.py" "tutorial" "quit")
1180 #t))
1181 (replace 'install
1182 (lambda* (#:key inputs outputs #:allow-other-keys)
1183 ;; Here we install our custom renpy program.
1184 ;; After finishing this step, "out" will have the following:
1185 ;; |-- bin/renpy
1186 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1187 ;; `-- common
1188 ;;
1189 ;; Note that common is also a de facto unused directory in
1190 ;; python2-renpy. On other systems, renpy_base would point to
1191 ;; site-packages or even somewhere in /opt.
1192 ;; The former approach is not as straightforward as it seems
1193 ;; -- it causes renpy to load files twice for some weird reason --
1194 ;; and the latter is impossible on Guix. Hence the detour through
1195 ;; share/renpy and the custom renpy program.
1196 ;;
1197 ;; As a convention, other games should be installed as
1198 ;; subdirectories of share/renpy in their respective outputs as
1199 ;; well. This differs from the traditional layout, which is
1200 ;; roughly the following:
1201 ;; `-- Super Awesome Game
1202 ;; |-- game ; <- the folder we actually want
1203 ;; |-- lib ; compiled renpy module and dependencies
1204 ;; |-- renpy ; Ren'py python code (source + compiled)
1205 ;; |-- Super Awesome Game.py
1206 ;; `-- Super Awesome Game.sh
1207 (let* ((out (assoc-ref outputs "out"))
1208 (bin/renpy (string-append out "/bin/renpy")))
1209 (mkdir-p (string-append out "/bin"))
1210 (copy-recursively "renpy/common"
1211 (string-append out "/share/renpy/common"))
1212 (copy-recursively "gui"
1213 (string-append out "/share/renpy/gui"))
1214
1215 (call-with-output-file bin/renpy
1216 (lambda (port)
1217 (format port "#!~a~%" (which "python2"))
1218 (format port "
1219from __future__ import print_function
1220
1221import os
1222import sys
1223import warnings
1224
1225def path_to_common(renpy_base):
1226 return renpy_base + \"/common\"
1227
1228def path_to_saves(gamedir, save_directory=None):
1229 import renpy # @UnresolvedImport
1230
1231 if save_directory is None:
1232 save_directory = renpy.config.save_directory
1233 save_directory = renpy.exports.fsencode(save_directory)
1234
1235 if not save_directory:
1236 return gamedir + \"/saves\"
1237
1238 return os.path.expanduser(\"~~/.renpy/\" + save_directory)
1239
1240def path_to_renpy_base():
1241 return \"~a\"
1242
1243def main():
1244 renpy_base = path_to_renpy_base()
1245 try:
1246 import renpy.bootstrap
1247 import renpy.arguments
1248 except ImportError:
1249 print(\"\"\"Could not import renpy.bootstrap.
1250Please ensure you decompressed Ren'Py correctly, preserving the directory
1251structure.\"\"\", file=sys.stderr)
1252 raise
1253
1254 args = renpy.arguments.bootstrap()
1255 if not args.basedir:
1256 print(\"\"\"This Ren'py requires a basedir to launch.
1257The basedir is the directory, in which .rpy files live -- usually the 'game'
1258subdirectory of a game packaged by Ren'py.
1259
1260If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
1261 file=sys.stderr)
1262 sys.exit()
1263
1264 renpy.bootstrap.bootstrap(renpy_base)
1265
1266if __name__ == \"__main__\":
1267 main()
1268"
1269 (string-append out "/share/renpy"))))
1270 (chmod bin/renpy #o755)
1271 #t)))
1272
1273 (add-after 'install 'install-games
1274 (lambda* (#:key outputs #:allow-other-keys)
1275 (define renpy (assoc-ref outputs "out"))
1276 ;; TODO: We should offer a renpy-build-system to make the
1277 ;; installation of Ren'py games easier.
1278 (define* (install-renpy-game #:key output game name (renpy renpy)
1279 #:allow-other-keys)
1280 (let* ((name (or name (basename game)))
1281 (launcher (string-append output "/bin/renpy-" name))
1282 (share (string-append output "/share/renpy/" name)))
1283 (copy-recursively (string-append game "/game") share)
1284 (mkdir-p (string-append output "/bin"))
1285 (with-output-to-file launcher
1286 (lambda ()
1287 (format #t
1288 "#!~a~%~a ~a \"$@\""
1289 (which "bash")
1290 (string-append renpy "/bin/renpy")
1291 share)))
1292 (chmod launcher #o755)))
1293
1294 (install-renpy-game #:output (assoc-ref outputs "out")
1295 #:game "launcher")
1296
1297 (install-renpy-game #:output (assoc-ref outputs "the-question")
1298 #:game "the_question"
1299 #:name "the-question")
1300
1301 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1302 #:game "tutorial")
1303 #t))
1304 (replace 'wrap
1305 (lambda* (#:key inputs outputs #:allow-other-keys)
1306 (wrap-program (string-append (assoc-ref outputs "out")
1307 "/bin/renpy")
1308 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
1309 #t)))))
1310 (inputs
1311 `(("python2-tkinter" ,python-2 "tk")
1312 ("python2-pygame" ,python2-pygame-sdl2)
1313 ("python2-renpy" ,python2-renpy)
1314 ("xorg-server" ,xorg-server)))
1315 (outputs
1316 (list "out" "tutorial" "the-question"))
1317 (home-page "http://www.renpy.org/")
1318 (synopsis "Visual Novel Engine")
1319 (description "Ren'Py is a visual novel engine that helps you use words,
1320images, and sounds to tell interactive stories that run on computers and
1321mobile devices. These can be both visual novels and life simulation games.
1322The easy to learn script language allows anyone to efficiently write large
1323visual novels, while its Python scripting is enough for complex simulation
1324games.")
1325 (license license:expat)))
1326
68c6110c
DT
1327(define-public grafx2
1328 (package
1329 (name "grafx2")
1330 (version "2.4")
1331 (source (origin
1332 (method url-fetch)
1333 ;; XXX: There is no URL that contains the version. :(
1334 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1335 (sha256
1336 (base32
1337 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1338 (build-system gnu-build-system)
1339 (arguments
1340 '(#:phases
1341 (modify-phases %standard-phases
1342 (delete 'configure) ; no configure script
1343 (add-before 'build 'change-to-src-directory
1344 (lambda _
1345 (chdir "src")
1346 #t)))
1347 #:make-flags
1348 ;; SDL header files are referenced without the preceeding "SDL/".
1349 (list (string-append "CFLAGS=-I"
1350 (assoc-ref %build-inputs "sdl-union")
1351 "/include/SDL")
1352 (string-append "prefix="
1353 (assoc-ref %outputs "out")))
1354 #:tests? #f)) ; no check target
1355 (native-inputs
1356 `(("pkg-config" ,pkg-config)))
1357 (inputs
1358 `(("libpng" ,libpng)
1359 ("lua" ,lua-5.1)
1360 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
1361 (synopsis "Bitmap paint program")
1362 (description "GrafX2 is a bitmap paint program inspired by the Amiga
7432d3ae 1363programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
68c6110c
DT
1364includes a very large number of tools and effects that make it particularly
1365suitable for pixel art, game graphics, and generally any detailed graphics
1366painted with a mouse.")
1367 (home-page "http://pulkomandy.tk/projects/GrafX2")
1368 (license license:gpl2))) ; GPLv2 only
c608fe8c
MR
1369
1370(define-public ois
1371 (package
1372 (name "ois")
006345c1 1373 (version "1.5")
c608fe8c
MR
1374 (source
1375 (origin
c608fe8c
MR
1376 (method git-fetch)
1377 (uri (git-reference
1378 (url "https://github.com/wgois/OIS.git")
006345c1
TGR
1379 (commit (string-append "v" version))))
1380 (file-name (git-file-name name version))
c608fe8c 1381 (sha256
006345c1
TGR
1382 (base32 "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa"))))
1383 (build-system cmake-build-system)
1384 (arguments
1385 `(#:tests? #f)) ; no test suite
c608fe8c 1386 (inputs
006345c1 1387 `(("libx11" ,libx11)))
c608fe8c
MR
1388 (synopsis "Object Oriented Input System")
1389 (description
1390 "Cross Platform Object Oriented Input Lib System is a cross platform,
1391simple solution for using all kinds of Input Devices (Keyboards, Mice,
1392Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1393robust and compatible with many systems and operating systems.")
1394 (home-page "https://github.com/wgois/OIS")
1395 (license license:zlib)))
42d0d13d
MR
1396
1397(define-public mygui
1398 (package
1399 (name "mygui")
1400 (version "3.2.2")
1401 (source
1402 (origin
47f4d5d3
PN
1403 (method git-fetch)
1404 (uri (git-reference
1405 (url "https://github.com/MyGUI/mygui")
1406 (commit (string-append "MyGUI" version))))
1407 (file-name (git-file-name name version))
42d0d13d
MR
1408 (sha256
1409 (base32
47f4d5d3 1410 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
42d0d13d
MR
1411 (build-system cmake-build-system)
1412 (arguments
1413 '(#:tests? #f ; No test target
1414 #:configure-flags
1415 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1416 (string-append "-DOGRE_INCLUDE_DIR="
1417 (assoc-ref %build-inputs "ogre")
47f4d5d3
PN
1418 "/include/OGRE")
1419 ;; Demos and tools are Windows-specific:
1420 ;; https://github.com/MyGUI/mygui/issues/24.
1421 "-DMYGUI_BUILD_DEMOS=FALSE"
1422 "-DMYGUI_BUILD_TOOLS=FALSE")))
42d0d13d
MR
1423 (native-inputs
1424 `(("boost" ,boost)
1425 ("doxygen" ,doxygen)
1426 ("pkg-config" ,pkg-config)))
1427 (inputs
1428 `(("font-dejavu" ,font-dejavu)
1429 ("freetype" ,freetype)
1430 ("graphviz" ,graphviz)
1431 ("libx11" ,libx11)
1432 ("ogre" ,ogre)
1433 ("ois" ,ois)))
1434 (synopsis "Fast, flexible and simple GUI")
1435 (description
1436 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1437and 3D applications. The main goals of mygui are: speed, flexibility and ease
1438of use.")
1439 (home-page "http://mygui.info/")
1440 (license license:expat)))
e9a599cd 1441
9fd50db3
PN
1442(define-public mygui-gl
1443 ;; Closure size is reduced by some 800 MiB.
1444 (package
1445 (inherit mygui)
1446 (name "mygui-gl")
1447 (version "3.2.2")
1448 (arguments
1449 (substitute-keyword-arguments (package-arguments mygui)
1450 ((#:configure-flags _)
1451 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1452 ;; We can't reuse the flags because of the mention to Ogre.
1453 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1454 ;; Demos and tools are Windows-specific:
1455 ;; https://github.com/MyGUI/mygui/issues/24.
1456 "-DMYGUI_BUILD_DEMOS=FALSE"
1457 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1458 (inputs
1459 `(("mesa" ,mesa)
1460 ("glu" ,glu)
1461 ,@(fold alist-delete (package-inputs mygui)
1462 '("ogre"))))
1463 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1464
e9a599cd
MR
1465(define-public openmw
1466 (package
1467 (name "openmw")
6bc30a57 1468 (version "0.45.0")
e9a599cd
MR
1469 (source
1470 (origin
8b1f8f64
AK
1471 (method url-fetch)
1472 (uri
1473 (string-append "https://github.com/OpenMW/openmw/archive/"
37bf216d 1474 "openmw-" version ".tar.gz"))
e9a599cd
MR
1475 (sha256
1476 (base32
6bc30a57 1477 "0r0wgvv1faan8z8lbply8lks4hcnppifjrcz04l5zvq6yiqzjg5n"))))
e9a599cd
MR
1478 (build-system cmake-build-system)
1479 (arguments
1480 `(#:tests? #f ; No test target
1481 #:configure-flags
1482 (list "-DDESIRED_QT_VERSION=5")))
1483 (native-inputs
1484 `(("boost" ,boost)
1485 ("doxygen" ,doxygen)
1486 ("pkg-config" ,pkg-config)))
1487 (inputs
1488 `(("bullet" ,bullet)
1489 ("ffmpeg" ,ffmpeg)
1490 ("libxt" ,libxt)
0655c16e 1491 ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
e9a599cd 1492 ("openal" ,openal)
f95ec65b 1493 ("openscenegraph" ,openmw-openscenegraph)
e9a599cd
MR
1494 ("qtbase" ,qtbase)
1495 ("sdl" ,sdl2)
1496 ("unshield" ,unshield)))
5a80c15c 1497 (synopsis "Re-implementation of the RPG Morrowind engine")
e9a599cd 1498 (description
5a80c15c
RW
1499 "OpenMW is a game engine which reimplements and extends the one that runs
1500the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1501called OpenMW-CS which allows the user to edit or create their own original
1502games.")
e9a599cd 1503 (home-page "https://openmw.org")
8b1f8f64 1504 (license license:gpl3)))
194b4e7d
PM
1505
1506(define-public godot
1507 (package
1508 (name "godot")
451e1075 1509 (version "3.2")
194b4e7d 1510 (source (origin
39f516cb
TGR
1511 (method git-fetch)
1512 (uri (git-reference
1513 (url "https://github.com/godotengine/godot")
1514 (commit (string-append version "-stable"))))
1515 (file-name (git-file-name name version))
194b4e7d 1516 (sha256
9766c6e2 1517 (base32
451e1075 1518 "0f15izjl4i2xlz1xj5pcslzl9gm3rmr3c21gh256ynpi2zhhkcdd"))
18f8e935
TL
1519 (modules '((guix build utils)
1520 (ice-9 ftw)
1521 (srfi srfi-1)))
5b8d2ace
MB
1522 (snippet
1523 '(begin
18f8e935
TL
1524 ;; Keep only those bundled files we have not (yet) replaced
1525 ;; with Guix versions. Note that some of these may be
1526 ;; modified; see "thirdparty/README.md".
5b8d2ace 1527 (with-directory-excursion "thirdparty"
18f8e935
TL
1528 (let* ((preserved-files
1529 '("README.md"
451e1075 1530 "assimp"
18f8e935
TL
1531 "certs"
1532 "cvtt"
1533 "enet"
1534 "etc2comp"
1535 "fonts"
1536 "glad"
1537 "jpeg-compressor"
1538 "libsimplewebm"
18f8e935
TL
1539 "miniupnpc"
1540 "minizip"
1541 "misc"
1542 "nanosvg"
1543 "pvrtccompressor"
1544 "recastnavigation"
1545 "squish"
18f8e935 1546 "tinyexr"
451e1075 1547 "vhacd"
18f8e935
TL
1548 "xatlas")))
1549 (for-each delete-file-recursively
1550 (lset-difference string=?
1551 (scandir ".")
1552 (cons* "." ".." preserved-files)))))
1553 #t))))
92b51d12 1554 (build-system scons-build-system)
194b4e7d 1555 (arguments
92b51d12
AI
1556 `(#:scons ,scons-python2
1557 #:scons-flags (list "platform=x11"
d6e8a84e
EF
1558 ,@(if (string-prefix? "aarch64" (or (%current-target-system)
1559 (%current-system)))
1560 `("CCFLAGS=-DNO_THREADS")
1561 '())
92b51d12
AI
1562 ;; Avoid using many of the bundled libs.
1563 ;; Note: These options can be found in the SConstruct file.
c1bc92c0 1564 "builtin_bullet=no"
92b51d12
AI
1565 "builtin_freetype=no"
1566 "builtin_glew=no"
1567 "builtin_libmpdec=no"
1568 "builtin_libogg=no"
1569 "builtin_libpng=no"
1570 "builtin_libtheora=no"
1571 "builtin_libvorbis=no"
5b8d2ace 1572 "builtin_libvpx=no"
92b51d12 1573 "builtin_libwebp=no"
c1bc92c0 1574 "builtin_mbedtls=no"
92b51d12 1575 "builtin_opus=no"
c1bc92c0 1576 "builtin_pcre2=no"
451e1075 1577 "builtin_wslay=no"
c1bc92c0
TL
1578 "builtin_zlib=no"
1579 "builtin_zstd=no")
92b51d12 1580 #:tests? #f ; There are no tests
194b4e7d
PM
1581 #:phases
1582 (modify-phases %standard-phases
194b4e7d
PM
1583 (add-after 'unpack 'scons-use-env
1584 (lambda _
1585 ;; Scons does not use the environment variables by default,
1586 ;; but this substitution makes it do so.
1587 (substitute* "SConstruct"
1588 (("env_base = Environment\\(tools=custom_tools\\)")
1589 (string-append
1590 "env_base = Environment(tools=custom_tools)\n"
1591 "env_base = Environment(ENV=os.environ)")))
1592 #t))
194b4e7d
PM
1593 (replace 'install
1594 (lambda* (#:key outputs #:allow-other-keys)
1595 (let* ((out (assoc-ref outputs "out"))
1596 (bin (string-append out "/bin")))
1597 (with-directory-excursion "bin"
1598 (if (file-exists? "godot.x11.tools.64")
1599 (rename-file "godot.x11.tools.64" "godot")
1600 (rename-file "godot.x11.tools.32" "godot"))
7da5db8e
TGR
1601 (install-file "godot" bin))
1602 #t)))
194b4e7d
PM
1603 (add-after 'install 'install-godot-desktop
1604 (lambda* (#:key outputs #:allow-other-keys)
1605 (let* ((out (assoc-ref outputs "out"))
1606 (desktop (string-append out "/share/applications"))
1607 (icon-dir (string-append out "/share/pixmaps")))
194b4e7d
PM
1608 (rename-file "icon.png" "godot.png")
1609 (install-file "godot.png" icon-dir)
7da5db8e 1610 (mkdir-p desktop)
194b4e7d
PM
1611 (with-output-to-file
1612 (string-append desktop "/godot.desktop")
1613 (lambda _
1614 (format #t
1615 "[Desktop Entry]~@
1616 Name=godot~@
1617 Comment=The godot game engine~@
1618 Exec=~a/bin/godot~@
1619 TryExec=~@*~a/bin/godot~@
1620 Icon=godot~@
1621 Type=Application~%"
1622 out)))
1623 #t))))))
92b51d12 1624 (native-inputs `(("pkg-config" ,pkg-config)))
194b4e7d 1625 (inputs `(("alsa-lib" ,alsa-lib)
c1bc92c0 1626 ("bullet" ,bullet)
194b4e7d
PM
1627 ("freetype" ,freetype)
1628 ("glew" ,glew)
1629 ("glu" ,glu)
1630 ("libtheora" ,libtheora)
1631 ("libvorbis" ,libvorbis)
5b8d2ace 1632 ("libvpx" ,libvpx)
194b4e7d
PM
1633 ("libwebp" ,libwebp)
1634 ("libx11" ,libx11)
1635 ("libxcursor" ,libxcursor)
9766c6e2 1636 ("libxi" ,libxi)
194b4e7d
PM
1637 ("libxinerama" ,libxinerama)
1638 ("libxrandr" ,libxrandr)
c1bc92c0 1639 ("mbedtls" ,mbedtls-apache)
194b4e7d 1640 ("mesa" ,mesa)
194b4e7d 1641 ("opusfile" ,opusfile)
c1bc92c0
TL
1642 ("pcre2" ,pcre2)
1643 ("pulseaudio" ,pulseaudio)
451e1075 1644 ("wslay" ,wslay)
c1bc92c0 1645 ("zstd" ,zstd "lib")))
194b4e7d
PM
1646 (home-page "https://godotengine.org/")
1647 (synopsis "Advanced 2D and 3D game engine")
1648 (description
1649 "Godot is an advanced multi-platform game engine written in C++. If
1650features design tools such as a visual editor, can import 3D models and
1651provide high-quality 3D rendering, it contains an animation editor, and can be
1652scripted in a Python-like language.")
1653 (license license:expat)))
531003be 1654
1655(define-public eureka
1656 (package
1657 (name "eureka")
75f66e4a 1658 (version "1.24")
531003be 1659 (source (origin
1660 (method url-fetch)
1661 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1662 version "/eureka-"
1663 ;; version without dots e.g 1.21 => 121
1664 (string-join (string-split version #\.) "")
1665 "-source.tar.gz"))
1666 (sha256
1667 (base32
75f66e4a 1668 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
531003be 1669 (build-system gnu-build-system)
1670 (arguments
1671 '(#:tests? #f
1672 #:make-flags
1673 (let ((out (assoc-ref %outputs "out")))
1674 (list (string-append "PREFIX=" out)))
1675 #:phases
1676 (modify-phases %standard-phases
1677 (delete 'configure)
1678 (add-before 'build 'prepare-install-directories
1679 (lambda* (#:key outputs #:allow-other-keys)
1680 (let ((out (assoc-ref outputs "out")))
1681 (mkdir-p (string-append out "/bin"))
1682 (mkdir-p (string-append out "/share"))
1683
1684 (with-fluids ((%default-port-encoding #f))
1685 (substitute* "./src/main.cc"
1686 (("/usr/local") out)))
1687
1688 (substitute* "Makefile"
1689 (("-o root") ""))))))))
1690 (inputs `(("mesa" ,mesa)
1691 ("libxft" ,libxft)
1692 ("libxinerama" ,libxinerama)
1693 ("libfontconfig" ,fontconfig)
1694 ("libjpeg" ,libjpeg)
1695 ("libpng" ,libpng)
1696 ("fltk" ,fltk)
1697 ("zlib" ,zlib)))
1698 (native-inputs `(("pkg-config" ,pkg-config)
1699 ("xdg-utils" ,xdg-utils)))
1700 (synopsis "Doom map editor")
1701 (description "Eureka is a map editor for the classic DOOM games, and a few
1702related games such as Heretic and Hexen. It comes with a 3d preview mode and
1703a 2D editor view.")
1704 (home-page "http://eureka-editor.sourceforge.net/")
1705 (license license:gpl2+)))
00fca594
RW
1706
1707(define-public guile-chickadee
1708 (package
1709 (name "guile-chickadee")
f6ea5237 1710 (version "0.4.0")
00fca594
RW
1711 (source (origin
1712 (method url-fetch)
1713 (uri (string-append "https://files.dthompson.us/chickadee/"
1714 "chickadee-" version ".tar.gz"))
1715 (sha256
1716 (base32
f6ea5237 1717 "1fdicsgls5cp0yffcm5vjmav67gv9bxhz1s3jvdvinspxb485x7l"))))
00fca594 1718 (build-system gnu-build-system)
00fca594
RW
1719 (propagated-inputs
1720 `(("guile-opengl" ,guile-opengl)
1721 ("guile-sdl2" ,guile-sdl2)))
1722 (inputs
1723 `(("guile" ,guile-2.2)))
1724 (native-inputs
1725 `(("pkg-config" ,pkg-config)
1726 ("texinfo" ,texinfo)))
1727 (home-page "https://dthompson.us/projects/chickadee.html")
1728 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1729 (description "Chickadee is a game development toolkit for Guile Scheme
1730built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1731that parenthetically inclined game developers need to make 2D (and eventually
17323D) games in Scheme, such as:
1733
1734@enumerate
1735@item extensible, fixed-timestep game loop
1736@item OpenGL-based rendering engine
1737@item keyboard, mouse, controller input
1738@item REPL-driven development model
1739@end enumerate\n")
1740 (license license:gpl3+)))
4041fabb
PN
1741
1742(define-public bennu-game-development
1743 (package
1744 (name "bennu-game-development")
1745 (version "348")
1746 (source (origin
1747 (method svn-fetch)
1748 (uri (svn-reference
1749 (url "http://svn.code.sf.net/p/bennugd/code")
1750 (revision (string->number version))))
1751 (file-name (string-append name "-" version))
1752 (sha256
1753 (base32
edf1ce60
EF
1754 "0wpzsbh4zi3931493dnyl5ffmh1b7fj2sx3mzrq304z9zs4d6lqq"))
1755 (modules '((guix build utils)))
1756 (snippet
1757 '(begin
1758 (delete-file-recursively "3rdparty") #t))))
4041fabb
PN
1759 (build-system gnu-build-system)
1760 (arguments
1761 '(#:phases
1762 (modify-phases %standard-phases
f0e4cfcb 1763 (add-after 'unpack 'patch-configure-to-use-openssl
4041fabb
PN
1764 (lambda* (#:key outputs #:allow-other-keys)
1765 (chdir "core")
1766 (delete-file "configure")
1767 (substitute* "configure.in"
1768 (("i\\*86\\)")
f0e4cfcb 1769 "*)
4041fabb
PN
1770 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
1771 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
1772 LIBSSL=\"crypto\"
1773 USE_OPENSSL=yes
1774 ;;
1775
f0e4cfcb
EF
1776 i*86)"))
1777 #t)))))
4041fabb
PN
1778 (inputs `(("openssl" ,openssl)
1779 ("zlib" ,zlib)))
1780 (native-inputs `(("pkg-config" ,pkg-config)
1781 ("autoconf" ,autoconf)
1782 ("automake" ,automake)
1783 ("libtool" ,libtool)))
1784 (synopsis "Programming language to create games")
1785 (description "Bennu Game Development, also known as bennudg, is a
1786programming language tailored at game development. It is the successor of
1787Fenix.")
1788 (home-page "https://sourceforge.net/projects/bennugd/")
1789 (license license:zlib)))
24c4b012
PN
1790
1791(define-public bennu-game-development-modules
1792 (package
1793 (inherit bennu-game-development)
1794 (name "bennu-game-development-modules")
1795 (arguments
1796 '(#:phases
1797 (modify-phases %standard-phases
1798 (add-after 'unpack 'patch-conflicting-definitions
1799 (lambda _
1800 (with-fluids ((%default-port-encoding #f))
1801 (substitute* "core/include/fmath.h"
1802 (("extern fixed fmul\\( int x, int y \\);") "")
1803 (("extern fixed fdiv\\( int x, int y \\);") "")))
1804 (chdir "modules"))))))
1805 (inputs `(("zlib" ,zlib)
1806 ("libpng" ,libpng)
1807 ("openssl" ,openssl)
1808 ("sdl-mixer" ,sdl-mixer)
1809 ("bennu-game-development" ,bennu-game-development)))
0525864b 1810 (synopsis "Modules for the Bennu Game Development programming language")
24c4b012 1811 (description "This package contains a collection of modules for the Bennu
0525864b 1812Game Development programming language, from CD handling through SDL to
24c4b012 1813joystick support.")))
cd528946
RW
1814
1815(define-public plib
1816 (package
1817 (name "plib")
1818 (version "1.8.5")
1819 (source (origin
1820 (method url-fetch)
1821 (uri (string-append "http://plib.sourceforge.net/dist/"
1822 "plib-" version ".tar.gz"))
1823 (sha256
1824 (base32
05f386f1
EF
1825 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
1826 (patches (search-patches "plib-CVE-2011-4620.patch"
1827 "plib-CVE-2012-4552.patch"))))
cd528946
RW
1828 (build-system gnu-build-system)
1829 (inputs
1830 `(("mesa" ,mesa)
1831 ("libxi" ,libxi)
1832 ("libxmu" ,libxmu)))
1833 (native-inputs
1834 `(("pkg-config" ,pkg-config)))
1835 (home-page "http://plib.sourceforge.net/")
1836 (synopsis "Suite of portable game libraries")
1837 (description "PLIB is a set of libraries that will permit programmers to
1838write games and other realtime interactive applications that are 100% portable
1839across a wide range of hardware and operating systems. PLIB includes sound
1840effects, music, a complete 3D engine, font rendering, a simple Windowing
1841library, a game scripting language, a GUI, networking, 3D math library and a
1842collection of handy utility functions. All are 100% portable across nearly
1843all modern computing platforms. Each library component is fairly independent
1844of the others")
1845 (license license:lgpl2.0+)))
e4ff9dff
PN
1846
1847(define-public ioquake3
1848 ;; We follow master since it seems that there won't be releases after 1.3.6.
1849 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
1850 (package
1851 (name "ioquake3")
1852 (version (git-version "1.3.6" "1" commit))
1853 (source
1854 (origin
1855 (method git-fetch)
1856 (uri (git-reference
1857 (url "https://github.com/ioquake/ioq3.git")
1858 (commit commit)))
1859 (file-name (git-file-name name version))
1860 (sha256
1861 (base32
1862 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
1863 (build-system gnu-build-system)
1864 (inputs
1865 `(("sdl2" ,sdl2)
1866 ("libjpeg" ,libjpeg)
1867 ("openal" ,openal)
1868 ("curl" ,curl)
1869 ("opusfile" ,opusfile)
1870 ("opus" ,opus)
1871 ("libvorbis" ,libvorbis)
1872 ("freetype" ,freetype)
1873 ("libogg" ,libogg)))
1874 (native-inputs
1875 `(("which" ,which) ; Else SDL_version.h won't be found.
1876 ("pkg-config" ,pkg-config)))
1877 (arguments
1878 '(#:tests? #f ; No tests.
1879 #:make-flags '("CC=gcc"
1880 "USE_INTERNAL_LIBS=0"
1881 "USE_FREETYPE=1"
1882 "USE_RENDERER_DLOPEN=0"
1883 "USE_OPENAL_DLOPEN=0"
1884 "USE_CURL_DLOPEN=0")
1885 #:phases
1886 (modify-phases %standard-phases
1887 (delete 'configure)
1888 (replace 'install
1889 (lambda* (#:key outputs #:allow-other-keys)
1890 (invoke "make" "copyfiles" "CC=gcc"
1891 "USE_INTERNAL_LIBS=0"
1892 (string-append "COPYDIR="
1893 (assoc-ref outputs "out")
1894 "/bin")))))))
1895 (home-page "https://ioquake3.org/")
1896 (synopsis "FPS game engine based on Quake 3")
1897 (description "ioquake3 is a free software first person shooter engine
1898based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
1899the original, ioquake3 has been cleaned up, bugs have been fixed and features
1900added. The permanent goal is to create the open source Quake 3 distribution
1901upon which people base their games, ports to new platforms, and other
1902projects.")
e4ff9dff 1903 (license license:gpl2))))
545946f6
PN
1904
1905(define-public openvr
1906 (package
1907 (name "openvr")
1854a0ec 1908 (version "1.8.19")
545946f6
PN
1909 (home-page "https://github.com/ValveSoftware/openvr/")
1910 (source
1911 (origin
1912 (method git-fetch)
1913 (uri (git-reference
1914 (url home-page)
1915 (commit (string-append "v" version))))
1916 (file-name (git-file-name name version))
1917 (sha256
1854a0ec 1918 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
545946f6
PN
1919 (build-system cmake-build-system)
1920 (arguments
1921 ;; No tests.
1922 '(#:tests? #f
1923 #:configure-flags (list "-DBUILD_SHARED=1")))
1924 (synopsis "Virtual reality software development kit")
1925 (description "OpenVR is an API and runtime that allows access to VR
1926hardware from multiple vendors without requiring that applications have
1927specific knowledge of the hardware they are targeting.")
1928 (license license:bsd-3)))
7158fe4d
PN
1929
1930(define-public fna
1931 (package
1932 (name "fna")
1933 (version "19.12.01")
1934 (source
1935 (origin
1936 (method git-fetch)
1937 (uri (git-reference
1938 (url "https://github.com/FNA-XNA/FNA.git")
1939 (commit version)))
1940 (file-name (git-file-name name version))
1941 (sha256
1942 (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
1943 (build-system gnu-build-system)
1944 (arguments
1945 '(#:tests? #f ; No tests.
1946 #:phases
1947 (modify-phases %standard-phases
1948 (add-after 'unpack 'link-dep-src
1949 (lambda* (#:key inputs #:allow-other-keys)
1950 (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
1951 (mojoshader (assoc-ref inputs "mojoshader-src"))
1952 (faudio (assoc-ref inputs "faudio-src"))
1953 (theorafile (assoc-ref inputs "theorafile-src")))
1954 (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
1955 (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
1956 (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
1957 (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
1958 (delete 'configure)
1959 (replace 'build
1960 (lambda _
1961 (invoke "make" "release")))
1962 (replace 'install
1963 (lambda* (#:key outputs #:allow-other-keys)
1964 (let ((out (assoc-ref outputs "out")))
1965 (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
1966 #t))))))
1967 (native-inputs
1968 `(("mono" ,mono)))
1969 (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
1970 ("mojoshader-src" ,(package-source mojoshader-cs))
1971 ("faudio-src" ,(package-source faudio))
1972 ("theorafile-src" ,(package-source theorafile))))
1973 (home-page "https://fna-xna.github.io/")
1974 (synopsis "Accuracy-focused XNA4 reimplementation")
1975 (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
1976focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
1977 (license (list license:ms-pl ; FNA
1978 license:lgpl2.1 ; LzxDecoder.cs
1979 ;; Mono.Xna:
1980 license:expat))))
45c552ec
NG
1981
1982(define-public libccd
1983 (package
1984 (name "libccd")
1985 (version "2.1")
1986 (source
1987 (origin
1988 (method git-fetch)
1989 (uri (git-reference
1990 (url "https://github.com/danfis/libccd.git")
1991 (commit (string-append "v" version))))
1992 (file-name (git-file-name name version))
1993 (sha256
1994 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
1995 (build-system cmake-build-system)
1996 (arguments
1997 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
1998 "-DBUILD_TESTING=ON"
1999 "-DENABLE_DOUBLE_PRECISION=ON")))
2000 (native-inputs
2001 `(("python-sphinx" ,python-sphinx)))
2002 (home-page "https://github.com/danfis/libccd")
2003 (synopsis "Library for collision detection between two convex shapes")
2004 (description "@code{libccd} is library for a collision detection
2005between two convex shapes. @code{libccd} implements variation on
2006Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2007and also implements algorithm Minkowski Portal Refinement (MPR,
2008a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2009 (license license:expat)))
42399ad7
NG
2010
2011(define-public ode
2012 (package
2013 (name "ode")
2014 (version "0.16")
2015 (source
2016 (origin
2017 (method url-fetch)
2018 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2019 "ode-" version ".tar.gz"))
2020 (sha256
2021 (base32 "09xzrarxwxcf6rdv5jsjfjh454jnn29dpcw3wh6ic50kkipvg8sb"))
2022 (modules '((guix build utils)))
2023 (snippet
2024 '(begin
2025 (delete-file-recursively "libccd")
2026 #t))))
2027 (build-system cmake-build-system)
2028 (arguments
5b7fdc82 2029 ;; Tests fail on all systems but x86_64.
07a7cccb
NG
2030 `(#:tests? ,(string-prefix? "x86_64-"
2031 (or (%current-target-system)
2032 (%current-system)))
049bdae5 2033 #:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
42399ad7
NG
2034 #:phases
2035 (modify-phases %standard-phases
2036 (add-after 'unpack 'unbundle-libccd
2037 (lambda _
2038 (substitute* "CMakeLists.txt"
2039 (("configure_file\\(libccd/.*") ""))
2040 #t)))))
2041 (inputs
2042 `(("glu" ,glu)
2043 ("libccd" ,libccd)
2044 ("mesa" ,mesa)))
2045 (home-page "http://www.ode.org/")
2046 (synopsis "High performance library for simulating rigid body dynamics")
2047 (description "ODE is a high performance library for simulating
2048rigid body dynamics. It is fully featured, stable, mature and
2049platform independent with an easy to use C/C++ API. It has advanced
2050joint types and integrated collision detection with friction. ODE is
2051useful for simulating vehicles, objects in virtual reality
2052environments and virtual creatures. It is currently used in many
2053computer games, 3D authoring tools and simulation tools.")
2054 ;; Software is dual-licensed.
2055 (license (list license:lgpl2.1+ license:expat))))
d6ab5f4f
NG
2056
2057(define-public chipmunk
2058 (package
2059 (name "chipmunk")
2060 (version "7.0.3")
2061 (source
2062 (origin
2063 (method git-fetch)
2064 (uri (git-reference
2065 (url "https://github.com/slembcke/Chipmunk2D.git")
2066 (commit (string-append "Chipmunk-" version))))
2067 (file-name (git-file-name name version))
2068 (sha256
2069 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2070 (build-system cmake-build-system)
2071 (arguments
2072 `(#:tests? #f ;no test
2073 #:configure-flags '("-DBUILD_STATIC=OFF"
2074 "-DBUILD_DEMOS=OFF")))
2075 (inputs
2076 `(("freeglut" ,freeglut)
2077 ("libxmu" ,libxmu)
2078 ("libxrandr" ,libxrandr)))
d0bb1c2f 2079 (home-page "https://chipmunk-physics.net/")
d6ab5f4f
NG
2080 (synopsis "Fast and lightweight 2D game physics library")
2081 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2082rigid body physics library written in C.")
2083 (license license:expat)))