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