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