Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / game-development.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Tomáš Čech <sleep_walker@suse.cz>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2018 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015, 2018 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
7 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
9 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2016, 2017, 2018 Julian Graham <joolean@gmail.com>
11 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
12 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
13 ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
14 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
18 ;;; Copyright © 2019, 2020 Leo Prikler <leo.prikler@student.tugraz.at>
19 ;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
20 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
21 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
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)
39 #:use-module (srfi srfi-1)
40 #:use-module ((guix licenses) #:prefix license:)
41 #:use-module (guix packages)
42 #:use-module (guix download)
43 #:use-module (guix git-download)
44 #:use-module (guix svn-download)
45 #:use-module (guix utils)
46 #:use-module (guix build-system cmake)
47 #:use-module (guix build-system gnu)
48 #:use-module (guix build-system python)
49 #:use-module (guix build-system scons)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages audio)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages boost)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages curl)
57 #:use-module (gnu packages documentation)
58 #:use-module (gnu packages fltk)
59 #:use-module (gnu packages fonts)
60 #:use-module (gnu packages fontutils)
61 #:use-module (gnu packages freedesktop)
62 #:use-module (gnu packages fribidi)
63 #:use-module (gnu packages dbm)
64 #:use-module (gnu packages gl)
65 #:use-module (gnu packages glib)
66 #:use-module (gnu packages gnome)
67 #:use-module (gnu packages gnunet)
68 #:use-module (gnu packages graphics)
69 #:use-module (gnu packages graphviz)
70 #:use-module (gnu packages gtk)
71 #:use-module (gnu packages guile)
72 #:use-module (gnu packages image)
73 #:use-module (gnu packages linux)
74 #:use-module (gnu packages lua)
75 #:use-module (gnu packages m4)
76 #:use-module (gnu packages mono)
77 #:use-module (gnu packages mp3)
78 #:use-module (gnu packages multiprecision)
79 #:use-module (gnu packages music)
80 #:use-module (gnu packages ncurses)
81 #:use-module (gnu packages pcre)
82 #:use-module (gnu packages pkg-config)
83 #:use-module (gnu packages pulseaudio)
84 #:use-module (gnu packages python)
85 #:use-module (gnu packages python-xyz)
86 #:use-module (gnu packages qt)
87 #:use-module (gnu packages sdl)
88 #:use-module (gnu packages sphinx)
89 #:use-module (gnu packages stb)
90 #:use-module (gnu packages texinfo)
91 #:use-module (gnu packages tls)
92 #:use-module (gnu packages video)
93 #:use-module (gnu packages web)
94 #:use-module (gnu packages xdisorg)
95 #:use-module (gnu packages xiph)
96 #:use-module (gnu packages xml)
97 #:use-module (gnu packages xorg))
98
99 (define-public bullet
100 (package
101 (name "bullet")
102 (version "2.89")
103 (source (origin
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))
109 (sha256
110 (base32
111 "10ncf2z474jnv7p5lv01ak2mk2hib3rj5rz1zr8v2v5pnciqbijl"))
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")))
121 ;; These need files from ThirdPartyLibs.
122 (substitute* "Extras/CMakeLists.txt"
123 (("BulletRobotics") ""))
124 ;; Tests fail on linking, cannot find -lBussIK.
125 (substitute* "test/CMakeLists.txt"
126 ((" InverseDynamics")
127 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
128 ; (("SharedMemory") ""))
129 #t))))
130 (build-system cmake-build-system)
131 (arguments
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
141 ;; These tests fail specifically after removing 3rd party code.
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)))))
149 (inputs
150 `(("glu" ,glu)
151 ("libx11" ,libx11)
152 ("mesa" ,mesa)))
153 (home-page "https://pybullet.org/wordpress/")
154 (synopsis "3D physics engine library")
155 (description
156 "Bullet is a physics engine library usable for collision detection. It
157 is used in some video games and movies.")
158 (license license:zlib)))
159
160 (define-public deutex
161 (package
162 (name "deutex")
163 (version "5.2.1")
164 (source (origin
165 (method url-fetch)
166 (uri (string-append "https://github.com/Doom-Utils/deutex"
167 "/releases/download/v" version "/"
168 "deutex-" version ".tar.xz"))
169 (sha256
170 (base32
171 "07w3asqxx89wl2wfv1z3cak8v83h3ys3b39mq9qq4gyf3xdhs76n"))))
172 (build-system gnu-build-system)
173 (native-inputs `(("asciidoc" ,asciidoc)))
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
178 used to extract the lumps of a wad and save them as individual files.
179 Conversely, it can also build a wad from separate files. When extracting a
180 lump to a file, it does not just copy the raw data, it converts it to an
181 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
182 Conversely, when it reads files for inclusion in pwads, it does the necessary
183 conversions (for example, from PPM to Doom picture format). In addition,
184 DeuTex has functions such as merging wads, etc.")
185 (license license:gpl2+)))
186
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
230 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
231 tools for developing (New)GRFs. It includes a number of smaller programs, each
232 with 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
238 necessary.
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
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
267 sounds are not much more than some metadata (description and filename) and raw
268 PCM data.")
269 (license license:gpl2)))
270
271 (define-public gzochi
272 (package
273 (name "gzochi")
274 (version "0.12")
275 (source (origin
276 (method url-fetch)
277 (uri (string-append "mirror://savannah/gzochi/gzochi-"
278 version ".tar.gz"))
279 (sha256
280 (base32
281 "0h8yvk7154kd8zdfa9nqy73blrjq2x19kv305jcnwlmm09vvss59"))))
282 (build-system gnu-build-system)
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)))))
292 (native-inputs `(("pkgconfig" ,pkg-config)))
293 (inputs `(("bdb" ,bdb)
294 ("glib" ,glib)
295 ("guile" ,guile-2.2)
296 ("libmicrohttpd" ,libmicrohttpd)
297 ("ncurses" ,ncurses)
298 ("sdl" ,sdl)
299 ("zlib" ,zlib)))
300 (home-page "https://www.nongnu.org/gzochi/")
301 (synopsis "Scalable middleware for multiplayer games")
302 (description
303 "gzochi is a framework for developing massively multiplayer online games.
304 A server container provides services to deployed games, which are written in
305 Guile Scheme, that abstract and simplify some of the most challenging and
306 error-prone aspects of online game development: Concurrency, data persistence,
307 and network communications. A very thin client library can be embedded to
308 provide connectivity for client applications written in any language.")
309 (license license:gpl3+)))
310
311 (define-public nml
312 (package
313 (name "nml")
314 (version "0.4.5")
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
322 "1pmvvm3sgnpngfa7884mqhq3fwdjh9sr0ca07ypnidcg0y341w53"))))
323 (build-system python-build-system)
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)))))
334 (propagated-inputs
335 `(("python-pillow" ,python-pillow)
336 ("python-ply" ,python-ply)))
337 (home-page "https://dev.openttdcoop.org/projects/nml")
338 (synopsis "NML compiler")
339 (description
340 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
341 compiling NML files (along with their associated language, sound and graphic
342 files) into @file{.grf} and/or @file{.nfo} files.")
343 (license license:gpl2+)))
344
345 (define-public python-sge-pygame
346 (package
347 (name "python-sge-pygame")
348 (version "1.5.1")
349 (source
350 (origin
351 (method url-fetch)
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"))
356 (sha256
357 (base32
358 "1rl3xjzh78sl0sq3xl8rl7cgp9v9v3h7s2pfwn7nj1vrmffzkcpd"))))
359 (build-system python-build-system)
360 (propagated-inputs
361 `(("python-pygame" ,python-pygame)
362 ("python-six" ,python-six)
363 ("python-uniseg" ,python-uniseg)))
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
368 general-purpose 2D game engine. It takes care of several details for you so
369 you can focus on the game itself. This makes more rapid game development
370 possible, 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
376 (define-public python-tmx
377 (package
378 (name "python-tmx")
379 (version "1.10")
380 (source
381 (origin
382 (method url-fetch)
383 (uri (string-append "mirror://savannah/python-tmx/"
384 (version-major+minor version) "/tmx-"
385 version ".tar.gz"))
386 (sha256
387 (base32
388 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
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.
396 This is useful for map editors or generic level editors, and it's also useful
397 for using a map editor or generic level editor like Tiled to edit your game's
398 levels.")
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
412 (define-public python-xsge
413 (package
414 (name "python-xsge")
415 (version "2018.02.26")
416 (source (origin
417 (method url-fetch)
418 (uri (string-append "mirror://savannah/xsge/xsge/xsge-"
419 version ".tar.gz"))
420 (sha256
421 (base32
422 "0bx93hgf7cgdw2gsygbh59y8vpw37pgsa279rajw3fkdpl8vrc40"))))
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)
431 (invoke "python" "setup.py" "install"
432 (string-append "--prefix=" (assoc-ref outputs "out"))
433 "--root=/"))))
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
444 Game Engine easier. In addition to SGE's conveniences, the user has access to a
445 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
446 support.")
447 (license license:gpl3+)))
448
449 (define-public python2-xsge
450 (package-with-python2 python-xsge))
451
452 (define-public tiled
453 (package
454 (name "tiled")
455 (version "1.2.5")
456 (source (origin
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))
462 (sha256
463 (base32
464 "14v2zfka2y3h0r0biw1rl59585lji5074x958s4xnb352jm5h9b9"))))
465 (build-system gnu-build-system)
466 (inputs
467 `(("qtbase" ,qtbase)
468 ("qtsvg" ,qtsvg)
469 ("zlib" ,zlib)))
470 (native-inputs
471 `(("qttools" ,qttools)))
472 (arguments
473 '(#:phases
474 (modify-phases %standard-phases
475 (replace 'configure
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")))
482 (let ((out (assoc-ref outputs "out")))
483 (invoke "qmake"
484 (string-append "PREFIX=" out))))))))
485 (home-page "https://www.mapeditor.org/")
486 (synopsis "Tile map editor")
487 (description
488 "Tiled is a general purpose tile map editor. It is meant to be used for
489 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
490 clone.")
491
492 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
493 ;; under BSD-2.
494 (license license:gpl2+)))
495
496 (define-public sfml
497 (package
498 (name "sfml")
499 (version "2.5.1")
500 (source (origin
501 (method git-fetch)
502 ;; Do not fetch the archives from
503 ;; http://mirror0.sfml-dev.org/files/ because files there seem
504 ;; to be changed in place.
505 (uri (git-reference
506 (url "https://github.com/SFML/SFML.git")
507 (commit version)))
508 (file-name (git-file-name name version))
509 (sha256
510 (base32
511 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
512 (modules '((guix build utils)))
513 (snippet
514 '(begin
515 ;; Ensure system libraries are used.
516 (delete-file-recursively "extlibs")
517 #t))))
518 (build-system cmake-build-system)
519 (arguments
520 '(#:configure-flags
521 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
522 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
523 #:tests? #f)) ; no tests
524 (native-inputs
525 `(("pkg-config" ,pkg-config)))
526 (inputs
527 `(("mesa" ,mesa)
528 ("glew" ,glew)
529 ("libx11" ,libx11)
530 ("xcb-util-image" ,xcb-util-image)
531 ("libxrandr" ,libxrandr)
532 ("eudev" ,eudev)
533 ("libjpeg" ,libjpeg-turbo)
534 ("libsndfile" ,libsndfile)
535 ("stb-image" ,stb-image)
536 ("stb-image-write" ,stb-image-write)))
537 (propagated-inputs
538 ;; In Requires.private of pkg-config files.
539 `(("flac" ,flac)
540 ("freetype" ,freetype)
541 ("libvorbis" ,libvorbis)
542 ("openal" ,openal)))
543 (home-page "https://www.sfml-dev.org")
544 (synopsis "Simple and Fast Multimedia Library")
545 (description
546 "SFML provides a simple interface to the various computer components,
547 to ease the development of games and multimedia applications. It is composed
548 of five modules: system, window, graphics, audio and network.")
549 (license license:zlib)))
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.
583 Originally created for use in video game prototypes, it can generate random
584 sounds from presets such as \"explosion\" or \"powerup\".")
585 (home-page "http://www.drpetter.se/project_sfxr.html")
586 (license license:expat)))
587
588 (define-public physfs
589 (package
590 (name "physfs")
591 (version "3.0.2")
592 (source (origin
593 (method url-fetch)
594 (uri (string-append
595 "https://icculus.org/physfs/downloads/physfs-"
596 version ".tar.bz2"))
597 (file-name (string-append name "-" version ".tar.gz"))
598 (sha256
599 (base32
600 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
601 (build-system cmake-build-system)
602 (arguments
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)))))
612 (inputs
613 `(("zlib" ,zlib)))
614 (native-inputs
615 `(("doxygen" ,doxygen)))
616 (home-page "https://icculus.org/physfs")
617 (synopsis "File system abstraction library")
618 (description
619 "PhysicsFS is a library to provide abstract access to various archives.
620 It is intended for use in video games. For security, no file writing done
621 through the PhysicsFS API can leave a defined @emph{write directory}. For
622 file reading, a @emph{search path} with archives and directories is defined,
623 and it becomes a single, transparent hierarchical file system. So archive
624 files can be accessed in the same way as you access files directly on a disk,
625 and it makes it easy to ship a new archive that will override a previous
626 archive on a per-file basis.")
627 (license license:zlib)))
628
629 (define-public love
630 (package
631 (name "love")
632 (version "11.3")
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
639 "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
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)
647 ("libtheora" ,libtheora)
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
658 programming language.")
659 (home-page "https://love2d.org/")
660 (license license:zlib)))
661
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
688 is a minimal state immediate mode graphical user interface toolkit. This
689 package 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
693 (define-public allegro-4
694 (package
695 (name "allegro")
696 (version "4.4.3")
697 (source (origin
698 (method url-fetch)
699 (uri (string-append "https://github.com/liballeg/allegro5/"
700 "releases/download/" version "/allegro-"
701 version ".tar.gz"))
702 (sha256
703 (base32
704 "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
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
726 multimedia programming. It handles common, low-level tasks such as creating
727 windows, accepting user input, loading data, drawing images, playing sounds,
728 etc.")
729 (home-page "https://liballeg.org")
730 (license license:giftware)))
731
732 (define-public allegro
733 (package
734 (name "allegro")
735 (version "5.2.5.0")
736 (source (origin
737 (method url-fetch)
738 (uri (string-append "https://github.com/liballeg/allegro5/releases"
739 "/download/" version "/allegro-"
740 version ".tar.gz"))
741 (sha256
742 (base32
743 "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
744 (build-system cmake-build-system)
745 (arguments `(#:tests? #f)) ; there are no tests
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-turbo)
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
767 multimedia programming. It handles common, low-level tasks such as creating
768 windows, accepting user input, loading data, drawing images, playing sounds,
769 etc.")
770 (home-page "https://liballeg.org")
771 (license license:bsd-3)))
772
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)
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"))
785 (patches (search-patches
786 "allegro-mesa-18.2.5-and-later.patch"))
787 (sha256
788 (base32
789 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
790
791 (define-public aseprite
792 (package
793 (name "aseprite")
794 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
795 ;; TODO: Unbundle third party software.
796 (source (origin
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"))
801 (sha256
802 (base32
803 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
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")
823 "/include/freetype2"))))
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-turbo)
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
845 games. In addition to basic pixel editing features, Aseprite can assist in
846 the creation of animations, tiled graphics, texture atlases, and more.")
847 (home-page "https://www.aseprite.org/")
848 (license license:gpl2+)))
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.
869 It 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+)))
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
903 OpenGL programs with character rendering services via an application programming
904 interface (API).")
905 (license (list license:expat license:lgpl2.1+))))
906
907 (define-public python-pygame
908 (package
909 (name "python-pygame")
910 (version "1.9.4")
911 (source (origin
912 (method url-fetch)
913 (uri (pypi-uri "pygame" version))
914 (sha256
915 (base32
916 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
917 (build-system python-build-system)
918 (arguments
919 `(#:tests? #f ; tests require pygame to be installed first
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"))
935 (freetype-ref (assoc-ref inputs "freetype"))
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"
944 font-ref "/lib -lSDL_ttf")))
945 (substitute* "Setup.in"
946 (("IMAGE = -lSDL_image")
947 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
948 image-ref "/lib -lSDL_image")))
949 (substitute* "Setup.in"
950 (("MIXER = -lSDL_mixer")
951 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
952 mixer-ref "/lib -lSDL_mixer")))
953 (substitute* "Setup.in"
954 (("SMPEG = -lsmpeg")
955 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
956 smpeg-ref "/lib -lsmpeg")))
957 (substitute* "Setup.in"
958 (("PNG = -lpng")
959 (string-append "PNG = -I" png-ref "/include -L"
960 png-ref "/lib -lpng")))
961 (substitute* "Setup.in"
962 (("JPEG = -ljpeg")
963 (string-append "JPEG = -I" jpeg-ref "/include -L"
964 jpeg-ref "/lib -ljpeg")))
965
966 (substitute* "Setup.in"
967 (("FREETYPE = -lfreetype")
968 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
969 freetype-ref "/lib -lfreetype")))
970
971 (substitute* "Setup.in"
972 (("^pypm") "#pypm"))
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")))))))
979 (inputs
980 `(("freetype" ,freetype)
981 ("sdl" ,sdl)
982 ("sdl-image" ,sdl-image)
983 ("sdl-mixer" ,sdl-mixer)
984 ("sdl-ttf" ,sdl-ttf)
985 ("sdl-gfx" ,sdl-gfx)
986 ("libjpeg" ,libjpeg-turbo)
987 ("libpng" ,libpng)
988 ("libX11" ,libx11)
989 ("libsmpeg" ,libsmpeg)
990 ("portmidi" ,portmidi)
991 ("v4l-utils" ,v4l-utils)))
992 (home-page "https://www.pygame.org")
993 (synopsis "SDL wrapper for Python")
994 (description "Pygame is a set of Python modules designed for writing games.
995 Pygame adds functionality on top of the excellent SDL library. This allows you
996 to 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+))))
1008
1009 (define-public python2-pygame
1010 (package-with-python2 python-pygame))
1011
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,
1057 staying close to the original, but also adding some SDL2-specific features.
1058 While it aims to be used as a drop-in replacement, it appears to be
1059 developed 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
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")
1102 #t))
1103 (replace 'install
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")))
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
1132 modules 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 "
1219 from __future__ import print_function
1220
1221 import os
1222 import sys
1223 import warnings
1224
1225 def path_to_common(renpy_base):
1226 return renpy_base + \"/common\"
1227
1228 def 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
1240 def path_to_renpy_base():
1241 return \"~a\"
1242
1243 def 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.
1250 Please ensure you decompressed Ren'Py correctly, preserving the directory
1251 structure.\"\"\", 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.
1257 The basedir is the directory, in which .rpy files live -- usually the 'game'
1258 subdirectory of a game packaged by Ren'py.
1259
1260 If 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
1266 if __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,
1320 images, and sounds to tell interactive stories that run on computers and
1321 mobile devices. These can be both visual novels and life simulation games.
1322 The easy to learn script language allows anyone to efficiently write large
1323 visual novels, while its Python scripting is enough for complex simulation
1324 games.")
1325 (license license:expat)))
1326
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
1363 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1364 includes a very large number of tools and effects that make it particularly
1365 suitable for pixel art, game graphics, and generally any detailed graphics
1366 painted with a mouse.")
1367 (home-page "http://pulkomandy.tk/projects/GrafX2")
1368 (license license:gpl2))) ; GPLv2 only
1369
1370 (define-public ois
1371 (package
1372 (name "ois")
1373 (version "1.5")
1374 (source
1375 (origin
1376 (method git-fetch)
1377 (uri (git-reference
1378 (url "https://github.com/wgois/OIS.git")
1379 (commit (string-append "v" version))))
1380 (file-name (git-file-name name version))
1381 (sha256
1382 (base32 "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa"))))
1383 (build-system cmake-build-system)
1384 (arguments
1385 `(#:tests? #f)) ; no test suite
1386 (inputs
1387 `(("libx11" ,libx11)))
1388 (synopsis "Object Oriented Input System")
1389 (description
1390 "Cross Platform Object Oriented Input Lib System is a cross platform,
1391 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1392 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1393 robust and compatible with many systems and operating systems.")
1394 (home-page "https://github.com/wgois/OIS")
1395 (license license:zlib)))
1396
1397 (define-public mygui
1398 (package
1399 (name "mygui")
1400 (version "3.2.2")
1401 (source
1402 (origin
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))
1408 (sha256
1409 (base32
1410 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
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")
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")))
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
1437 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1438 of use.")
1439 (home-page "http://mygui.info/")
1440 (license license:expat)))
1441
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
1465 (define-public openmw
1466 (package
1467 (name "openmw")
1468 (version "0.45.0")
1469 (source
1470 (origin
1471 (method url-fetch)
1472 (uri
1473 (string-append "https://github.com/OpenMW/openmw/archive/"
1474 "openmw-" version ".tar.gz"))
1475 (sha256
1476 (base32
1477 "0r0wgvv1faan8z8lbply8lks4hcnppifjrcz04l5zvq6yiqzjg5n"))))
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)
1491 ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
1492 ("openal" ,openal)
1493 ("openscenegraph" ,openmw-openscenegraph)
1494 ("qtbase" ,qtbase)
1495 ("sdl" ,sdl2)
1496 ("unshield" ,unshield)))
1497 (synopsis "Re-implementation of the RPG Morrowind engine")
1498 (description
1499 "OpenMW is a game engine which reimplements and extends the one that runs
1500 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1501 called OpenMW-CS which allows the user to edit or create their own original
1502 games.")
1503 (home-page "https://openmw.org")
1504 (license license:gpl3)))
1505
1506 (define-public godot
1507 (package
1508 (name "godot")
1509 (version "3.2")
1510 (source (origin
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))
1516 (sha256
1517 (base32
1518 "0f15izjl4i2xlz1xj5pcslzl9gm3rmr3c21gh256ynpi2zhhkcdd"))
1519 (modules '((guix build utils)
1520 (ice-9 ftw)
1521 (srfi srfi-1)))
1522 (snippet
1523 '(begin
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".
1527 (with-directory-excursion "thirdparty"
1528 (let* ((preserved-files
1529 '("README.md"
1530 "assimp"
1531 "certs"
1532 "cvtt"
1533 "enet"
1534 "etc2comp"
1535 "fonts"
1536 "glad"
1537 "jpeg-compressor"
1538 "libsimplewebm"
1539 "miniupnpc"
1540 "minizip"
1541 "misc"
1542 "nanosvg"
1543 "pvrtccompressor"
1544 "recastnavigation"
1545 "squish"
1546 "tinyexr"
1547 "vhacd"
1548 "xatlas")))
1549 (for-each delete-file-recursively
1550 (lset-difference string=?
1551 (scandir ".")
1552 (cons* "." ".." preserved-files)))))
1553 #t))))
1554 (build-system scons-build-system)
1555 (arguments
1556 `(#:scons ,scons-python2
1557 #:scons-flags (list "platform=x11"
1558 ,@(if (string-prefix? "aarch64" (or (%current-target-system)
1559 (%current-system)))
1560 `("CCFLAGS=-DNO_THREADS")
1561 '())
1562 ;; Avoid using many of the bundled libs.
1563 ;; Note: These options can be found in the SConstruct file.
1564 "builtin_bullet=no"
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"
1572 "builtin_libvpx=no"
1573 "builtin_libwebp=no"
1574 "builtin_mbedtls=no"
1575 "builtin_opus=no"
1576 "builtin_pcre2=no"
1577 "builtin_wslay=no"
1578 "builtin_zlib=no"
1579 "builtin_zstd=no")
1580 #:tests? #f ; There are no tests
1581 #:phases
1582 (modify-phases %standard-phases
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))
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"))
1601 (install-file "godot" bin))
1602 ;; Tell Godot where to find zenity for OS.alert().
1603 (wrap-program (string-append bin "/godot")
1604 `("PATH" ":" prefix
1605 (,(string-append (assoc-ref %build-inputs "zenity") "/bin"))))
1606 #t)))
1607 (add-after 'install 'install-godot-desktop
1608 (lambda* (#:key outputs #:allow-other-keys)
1609 (let* ((out (assoc-ref outputs "out"))
1610 (desktop (string-append out "/share/applications"))
1611 (icon-dir (string-append out "/share/pixmaps")))
1612 (rename-file "icon.png" "godot.png")
1613 (install-file "godot.png" icon-dir)
1614 (mkdir-p desktop)
1615 (with-output-to-file
1616 (string-append desktop "/godot.desktop")
1617 (lambda _
1618 (format #t
1619 "[Desktop Entry]~@
1620 Name=godot~@
1621 Comment=The godot game engine~@
1622 Exec=~a/bin/godot~@
1623 TryExec=~@*~a/bin/godot~@
1624 Icon=godot~@
1625 Type=Application~%"
1626 out)))
1627 #t))))))
1628 (native-inputs `(("pkg-config" ,pkg-config)))
1629 (inputs `(("alsa-lib" ,alsa-lib)
1630 ("bullet" ,bullet)
1631 ("freetype" ,freetype)
1632 ("glew" ,glew)
1633 ("glu" ,glu)
1634 ("libtheora" ,libtheora)
1635 ("libvorbis" ,libvorbis)
1636 ("libvpx" ,libvpx)
1637 ("libwebp" ,libwebp)
1638 ("libx11" ,libx11)
1639 ("libxcursor" ,libxcursor)
1640 ("libxi" ,libxi)
1641 ("libxinerama" ,libxinerama)
1642 ("libxrandr" ,libxrandr)
1643 ("mbedtls" ,mbedtls-apache)
1644 ("mesa" ,mesa)
1645 ("opusfile" ,opusfile)
1646 ("pcre2" ,pcre2)
1647 ("pulseaudio" ,pulseaudio)
1648 ("wslay" ,wslay)
1649 ("zenity" ,zenity)
1650 ("zstd" ,zstd "lib")))
1651 (home-page "https://godotengine.org/")
1652 (synopsis "Advanced 2D and 3D game engine")
1653 (description
1654 "Godot is an advanced multi-platform game engine written in C++. If
1655 features design tools such as a visual editor, can import 3D models and
1656 provide high-quality 3D rendering, it contains an animation editor, and can be
1657 scripted in a Python-like language.")
1658 (license license:expat)))
1659
1660 (define-public eureka
1661 (package
1662 (name "eureka")
1663 (version "1.24")
1664 (source (origin
1665 (method url-fetch)
1666 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1667 version "/eureka-"
1668 ;; version without dots e.g 1.21 => 121
1669 (string-join (string-split version #\.) "")
1670 "-source.tar.gz"))
1671 (sha256
1672 (base32
1673 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1674 (build-system gnu-build-system)
1675 (arguments
1676 '(#:tests? #f
1677 #:make-flags
1678 (let ((out (assoc-ref %outputs "out")))
1679 (list (string-append "PREFIX=" out)))
1680 #:phases
1681 (modify-phases %standard-phases
1682 (delete 'configure)
1683 (add-before 'build 'prepare-install-directories
1684 (lambda* (#:key outputs #:allow-other-keys)
1685 (let ((out (assoc-ref outputs "out")))
1686 (mkdir-p (string-append out "/bin"))
1687 (mkdir-p (string-append out "/share"))
1688
1689 (with-fluids ((%default-port-encoding #f))
1690 (substitute* "./src/main.cc"
1691 (("/usr/local") out)))
1692
1693 (substitute* "Makefile"
1694 (("-o root") ""))))))))
1695 (inputs `(("mesa" ,mesa)
1696 ("libxft" ,libxft)
1697 ("libxinerama" ,libxinerama)
1698 ("libfontconfig" ,fontconfig)
1699 ("libjpeg" ,libjpeg-turbo)
1700 ("libpng" ,libpng)
1701 ("fltk" ,fltk)
1702 ("zlib" ,zlib)))
1703 (native-inputs `(("pkg-config" ,pkg-config)
1704 ("xdg-utils" ,xdg-utils)))
1705 (synopsis "Doom map editor")
1706 (description "Eureka is a map editor for the classic DOOM games, and a few
1707 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1708 a 2D editor view.")
1709 (home-page "http://eureka-editor.sourceforge.net/")
1710 (license license:gpl2+)))
1711
1712 (define-public guile-chickadee
1713 (package
1714 (name "guile-chickadee")
1715 (version "0.4.0")
1716 (source (origin
1717 (method url-fetch)
1718 (uri (string-append "https://files.dthompson.us/chickadee/"
1719 "chickadee-" version ".tar.gz"))
1720 (sha256
1721 (base32
1722 "1fdicsgls5cp0yffcm5vjmav67gv9bxhz1s3jvdvinspxb485x7l"))))
1723 (build-system gnu-build-system)
1724 (propagated-inputs
1725 `(("guile-opengl" ,guile-opengl)
1726 ("guile-sdl2" ,guile-sdl2)))
1727 (inputs
1728 `(("guile" ,guile-2.2)))
1729 (native-inputs
1730 `(("pkg-config" ,pkg-config)
1731 ("texinfo" ,texinfo)))
1732 (home-page "https://dthompson.us/projects/chickadee.html")
1733 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1734 (description "Chickadee is a game development toolkit for Guile Scheme
1735 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1736 that parenthetically inclined game developers need to make 2D (and eventually
1737 3D) games in Scheme, such as:
1738
1739 @enumerate
1740 @item extensible, fixed-timestep game loop
1741 @item OpenGL-based rendering engine
1742 @item keyboard, mouse, controller input
1743 @item REPL-driven development model
1744 @end enumerate\n")
1745 (license license:gpl3+)))
1746
1747 (define-public bennu-game-development
1748 (package
1749 (name "bennu-game-development")
1750 (version "348")
1751 (source (origin
1752 (method svn-fetch)
1753 (uri (svn-reference
1754 (url "http://svn.code.sf.net/p/bennugd/code")
1755 (revision (string->number version))))
1756 (file-name (string-append name "-" version))
1757 (sha256
1758 (base32
1759 "0wpzsbh4zi3931493dnyl5ffmh1b7fj2sx3mzrq304z9zs4d6lqq"))
1760 (modules '((guix build utils)))
1761 (snippet
1762 '(begin
1763 (delete-file-recursively "3rdparty") #t))))
1764 (build-system gnu-build-system)
1765 (arguments
1766 '(#:phases
1767 (modify-phases %standard-phases
1768 (add-after 'unpack 'patch-configure-to-use-openssl
1769 (lambda* (#:key outputs #:allow-other-keys)
1770 (chdir "core")
1771 (delete-file "configure")
1772 (substitute* "configure.in"
1773 (("i\\*86\\)")
1774 "*)
1775 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
1776 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
1777 LIBSSL=\"crypto\"
1778 USE_OPENSSL=yes
1779 ;;
1780
1781 i*86)"))
1782 #t)))))
1783 (inputs `(("openssl" ,openssl)
1784 ("zlib" ,zlib)))
1785 (native-inputs `(("pkg-config" ,pkg-config)
1786 ("autoconf" ,autoconf)
1787 ("automake" ,automake)
1788 ("libtool" ,libtool)))
1789 (synopsis "Programming language to create games")
1790 (description "Bennu Game Development, also known as bennudg, is a
1791 programming language tailored at game development. It is the successor of
1792 Fenix.")
1793 (home-page "https://sourceforge.net/projects/bennugd/")
1794 (license license:zlib)))
1795
1796 (define-public bennu-game-development-modules
1797 (package
1798 (inherit bennu-game-development)
1799 (name "bennu-game-development-modules")
1800 (arguments
1801 '(#:phases
1802 (modify-phases %standard-phases
1803 (add-after 'unpack 'patch-conflicting-definitions
1804 (lambda _
1805 (with-fluids ((%default-port-encoding #f))
1806 (substitute* "core/include/fmath.h"
1807 (("extern fixed fmul\\( int x, int y \\);") "")
1808 (("extern fixed fdiv\\( int x, int y \\);") "")))
1809 (chdir "modules"))))))
1810 (inputs `(("zlib" ,zlib)
1811 ("libpng" ,libpng)
1812 ("openssl" ,openssl)
1813 ("sdl-mixer" ,sdl-mixer)
1814 ("bennu-game-development" ,bennu-game-development)))
1815 (synopsis "Modules for the Bennu Game Development programming language")
1816 (description "This package contains a collection of modules for the Bennu
1817 Game Development programming language, from CD handling through SDL to
1818 joystick support.")))
1819
1820 (define-public plib
1821 (package
1822 (name "plib")
1823 (version "1.8.5")
1824 (source (origin
1825 (method url-fetch)
1826 (uri (string-append "http://plib.sourceforge.net/dist/"
1827 "plib-" version ".tar.gz"))
1828 (sha256
1829 (base32
1830 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
1831 (patches (search-patches "plib-CVE-2011-4620.patch"
1832 "plib-CVE-2012-4552.patch"))))
1833 (build-system gnu-build-system)
1834 (inputs
1835 `(("mesa" ,mesa)
1836 ("libxi" ,libxi)
1837 ("libxmu" ,libxmu)))
1838 (native-inputs
1839 `(("pkg-config" ,pkg-config)))
1840 (home-page "http://plib.sourceforge.net/")
1841 (synopsis "Suite of portable game libraries")
1842 (description "PLIB is a set of libraries that will permit programmers to
1843 write games and other realtime interactive applications that are 100% portable
1844 across a wide range of hardware and operating systems. PLIB includes sound
1845 effects, music, a complete 3D engine, font rendering, a simple Windowing
1846 library, a game scripting language, a GUI, networking, 3D math library and a
1847 collection of handy utility functions. All are 100% portable across nearly
1848 all modern computing platforms. Each library component is fairly independent
1849 of the others")
1850 (license license:lgpl2.0+)))
1851
1852 (define-public ioquake3
1853 ;; We follow master since it seems that there won't be releases after 1.3.6.
1854 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
1855 (package
1856 (name "ioquake3")
1857 (version (git-version "1.3.6" "1" commit))
1858 (source
1859 (origin
1860 (method git-fetch)
1861 (uri (git-reference
1862 (url "https://github.com/ioquake/ioq3.git")
1863 (commit commit)))
1864 (file-name (git-file-name name version))
1865 (sha256
1866 (base32
1867 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
1868 (build-system gnu-build-system)
1869 (inputs
1870 `(("sdl2" ,sdl2)
1871 ("libjpeg" ,libjpeg-turbo)
1872 ("openal" ,openal)
1873 ("curl" ,curl)
1874 ("opusfile" ,opusfile)
1875 ("opus" ,opus)
1876 ("libvorbis" ,libvorbis)
1877 ("freetype" ,freetype)
1878 ("libogg" ,libogg)))
1879 (native-inputs
1880 `(("which" ,which) ; Else SDL_version.h won't be found.
1881 ("pkg-config" ,pkg-config)))
1882 (arguments
1883 '(#:tests? #f ; No tests.
1884 #:make-flags '("CC=gcc"
1885 "USE_INTERNAL_LIBS=0"
1886 "USE_FREETYPE=1"
1887 "USE_RENDERER_DLOPEN=0"
1888 "USE_OPENAL_DLOPEN=0"
1889 "USE_CURL_DLOPEN=0")
1890 #:phases
1891 (modify-phases %standard-phases
1892 (delete 'configure)
1893 (replace 'install
1894 (lambda* (#:key outputs #:allow-other-keys)
1895 (invoke "make" "copyfiles" "CC=gcc"
1896 "USE_INTERNAL_LIBS=0"
1897 (string-append "COPYDIR="
1898 (assoc-ref outputs "out")
1899 "/bin")))))))
1900 (home-page "https://ioquake3.org/")
1901 (synopsis "FPS game engine based on Quake 3")
1902 (description "ioquake3 is a free software first person shooter engine
1903 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
1904 the original, ioquake3 has been cleaned up, bugs have been fixed and features
1905 added. The permanent goal is to create the open source Quake 3 distribution
1906 upon which people base their games, ports to new platforms, and other
1907 projects.")
1908 (license license:gpl2))))
1909
1910 (define-public openvr
1911 (package
1912 (name "openvr")
1913 (version "1.8.19")
1914 (home-page "https://github.com/ValveSoftware/openvr/")
1915 (source
1916 (origin
1917 (method git-fetch)
1918 (uri (git-reference
1919 (url home-page)
1920 (commit (string-append "v" version))))
1921 (file-name (git-file-name name version))
1922 (sha256
1923 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
1924 (build-system cmake-build-system)
1925 (arguments
1926 ;; No tests.
1927 '(#:tests? #f
1928 #:configure-flags (list "-DBUILD_SHARED=1")))
1929 (synopsis "Virtual reality software development kit")
1930 (description "OpenVR is an API and runtime that allows access to VR
1931 hardware from multiple vendors without requiring that applications have
1932 specific knowledge of the hardware they are targeting.")
1933 (license license:bsd-3)))
1934
1935 (define-public fna
1936 (package
1937 (name "fna")
1938 (version "19.12.01")
1939 (source
1940 (origin
1941 (method git-fetch)
1942 (uri (git-reference
1943 (url "https://github.com/FNA-XNA/FNA.git")
1944 (commit version)))
1945 (file-name (git-file-name name version))
1946 (sha256
1947 (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
1948 (build-system gnu-build-system)
1949 (arguments
1950 '(#:tests? #f ; No tests.
1951 #:phases
1952 (modify-phases %standard-phases
1953 (add-after 'unpack 'link-dep-src
1954 (lambda* (#:key inputs #:allow-other-keys)
1955 (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
1956 (mojoshader (assoc-ref inputs "mojoshader-src"))
1957 (faudio (assoc-ref inputs "faudio-src"))
1958 (theorafile (assoc-ref inputs "theorafile-src")))
1959 (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
1960 (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
1961 (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
1962 (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
1963 (delete 'configure)
1964 (replace 'build
1965 (lambda _
1966 (invoke "make" "release")))
1967 (replace 'install
1968 (lambda* (#:key outputs #:allow-other-keys)
1969 (let ((out (assoc-ref outputs "out")))
1970 (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
1971 #t))))))
1972 (native-inputs
1973 `(("mono" ,mono)))
1974 (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
1975 ("mojoshader-src" ,(package-source mojoshader-cs))
1976 ("faudio-src" ,(package-source faudio))
1977 ("theorafile-src" ,(package-source theorafile))))
1978 (home-page "https://fna-xna.github.io/")
1979 (synopsis "Accuracy-focused XNA4 reimplementation")
1980 (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
1981 focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
1982 (license (list license:ms-pl ; FNA
1983 license:lgpl2.1 ; LzxDecoder.cs
1984 ;; Mono.Xna:
1985 license:expat))))
1986
1987 (define-public libccd
1988 (package
1989 (name "libccd")
1990 (version "2.1")
1991 (source
1992 (origin
1993 (method git-fetch)
1994 (uri (git-reference
1995 (url "https://github.com/danfis/libccd.git")
1996 (commit (string-append "v" version))))
1997 (file-name (git-file-name name version))
1998 (sha256
1999 (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
2000 (build-system cmake-build-system)
2001 (arguments
2002 `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
2003 "-DBUILD_TESTING=ON"
2004 "-DENABLE_DOUBLE_PRECISION=ON")))
2005 (native-inputs
2006 `(("python-sphinx" ,python-sphinx)))
2007 (home-page "https://github.com/danfis/libccd")
2008 (synopsis "Library for collision detection between two convex shapes")
2009 (description "@code{libccd} is library for a collision detection
2010 between two convex shapes. @code{libccd} implements variation on
2011 Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
2012 and also implements algorithm Minkowski Portal Refinement (MPR,
2013 a.k.a. XenoCollide) as described in Game Programming Gems 7.")
2014 (license license:expat)))
2015
2016 (define-public ode
2017 (package
2018 (name "ode")
2019 (version "0.16")
2020 (source
2021 (origin
2022 (method url-fetch)
2023 (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
2024 "ode-" version ".tar.gz"))
2025 (sha256
2026 (base32 "09xzrarxwxcf6rdv5jsjfjh454jnn29dpcw3wh6ic50kkipvg8sb"))
2027 (modules '((guix build utils)))
2028 (snippet
2029 '(begin
2030 (delete-file-recursively "libccd")
2031 #t))))
2032 (build-system cmake-build-system)
2033 (arguments
2034 ;; Tests fail on all systems but x86_64.
2035 `(#:tests? ,(string-prefix? "x86_64-"
2036 (or (%current-target-system)
2037 (%current-system)))
2038 #:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
2039 #:phases
2040 (modify-phases %standard-phases
2041 (add-after 'unpack 'unbundle-libccd
2042 (lambda _
2043 (substitute* "CMakeLists.txt"
2044 (("configure_file\\(libccd/.*") ""))
2045 #t)))))
2046 (inputs
2047 `(("glu" ,glu)
2048 ("libccd" ,libccd)
2049 ("mesa" ,mesa)))
2050 (home-page "http://www.ode.org/")
2051 (synopsis "High performance library for simulating rigid body dynamics")
2052 (description "ODE is a high performance library for simulating
2053 rigid body dynamics. It is fully featured, stable, mature and
2054 platform independent with an easy to use C/C++ API. It has advanced
2055 joint types and integrated collision detection with friction. ODE is
2056 useful for simulating vehicles, objects in virtual reality
2057 environments and virtual creatures. It is currently used in many
2058 computer games, 3D authoring tools and simulation tools.")
2059 ;; Software is dual-licensed.
2060 (license (list license:lgpl2.1+ license:expat))))
2061
2062 (define-public chipmunk
2063 (package
2064 (name "chipmunk")
2065 (version "7.0.3")
2066 (source
2067 (origin
2068 (method git-fetch)
2069 (uri (git-reference
2070 (url "https://github.com/slembcke/Chipmunk2D.git")
2071 (commit (string-append "Chipmunk-" version))))
2072 (file-name (git-file-name name version))
2073 (sha256
2074 (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
2075 (build-system cmake-build-system)
2076 (arguments
2077 `(#:tests? #f ;no test
2078 #:configure-flags '("-DBUILD_STATIC=OFF"
2079 "-DBUILD_DEMOS=OFF")))
2080 (inputs
2081 `(("freeglut" ,freeglut)
2082 ("libxmu" ,libxmu)
2083 ("libxrandr" ,libxrandr)))
2084 (home-page "https://chipmunk-physics.net/")
2085 (synopsis "Fast and lightweight 2D game physics library")
2086 (description "Chipmunk is a simple, lightweight, fast and portable 2D
2087 rigid body physics library written in C.")
2088 (license license:expat)))