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>
20 ;;; This file is part of GNU Guix.
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 (define-module (gnu packages game-development)
36 #:use-module (srfi srfi-1)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix svn-download)
42 #:use-module (guix utils)
43 #:use-module (guix build-system cmake)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system python)
46 #:use-module (guix build-system scons)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages audio)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages boost)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages curl)
54 #:use-module (gnu packages documentation)
55 #:use-module (gnu packages fltk)
56 #:use-module (gnu packages fonts)
57 #:use-module (gnu packages fontutils)
58 #:use-module (gnu packages freedesktop)
59 #:use-module (gnu packages fribidi)
60 #:use-module (gnu packages dbm)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gnome)
64 #:use-module (gnu packages gnunet)
65 #:use-module (gnu packages graphics)
66 #:use-module (gnu packages graphviz)
67 #:use-module (gnu packages gtk)
68 #:use-module (gnu packages guile)
69 #:use-module (gnu packages image)
70 #:use-module (gnu packages linux)
71 #:use-module (gnu packages lua)
72 #:use-module (gnu packages m4)
73 #:use-module (gnu packages mp3)
74 #:use-module (gnu packages multiprecision)
75 #:use-module (gnu packages music)
76 #:use-module (gnu packages ncurses)
77 #:use-module (gnu packages pkg-config)
78 #:use-module (gnu packages pulseaudio)
79 #:use-module (gnu packages python)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages qt)
82 #:use-module (gnu packages sdl)
83 #:use-module (gnu packages stb)
84 #:use-module (gnu packages texinfo)
85 #:use-module (gnu packages tls)
86 #:use-module (gnu packages video)
87 #:use-module (gnu packages xdisorg)
88 #:use-module (gnu packages xiph)
89 #:use-module (gnu packages xml)
90 #:use-module (gnu packages xorg))
99 (url "https://github.com/bulletphysics/bullet3/")
101 (file-name (git-file-name name version))
104 "00qkif245yj7n2f262bgjaxv1bz3wmmcsfnjgy3qpzvlpzpns5z8"))
105 (modules '((guix build utils)))
108 (for-each delete-file (find-files "build3" "premake*"))
109 (with-directory-excursion "examples/ThirdPartyLibs"
110 (for-each delete-file-recursively
111 '("Gwen" "clsocket" "enet" "glad" "imgui"
112 "lua-5.2.3" "midi" "minizip" "openvr"
113 "optionalX11" "serial" "zlib")))
114 ;; These need files from ThirdPartyLibs
115 (substitute* "Extras/CMakeLists.txt"
116 (("BulletRobotics") "")
118 ;; Tests fail on linking, cannot find -lBussIK
119 (substitute* "test/CMakeLists.txt"
120 ((" InverseDynamics")
121 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
122 ; (("SharedMemory") ""))
124 (build-system cmake-build-system)
126 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
127 "-DBUILD_CPU_DEMOS=OFF"
128 "-DBUILD_OPENGL3_DEMOS=OFF"
129 "-DBUILD_BULLET2_DEMOS=OFF"
130 (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
131 (or (getenv "CXXFLAGS") "")))
133 (modify-phases %standard-phases
134 (add-after 'unpack 'remove-failing-tests
135 ;; These tests fail specifically after removing 3rd party code
137 (substitute* "test/SharedMemory/CMakeLists.txt"
138 (("ADD_TEST") "# ADD_TEST"))
139 (substitute* "test/InverseDynamics/CMakeLists.txt"
140 (("ADD_TEST\\(Test_BulletInverseForward")
141 "# ADD_TEST(Test_BulletInverseForward"))
147 (home-page "https://pybullet.org/wordpress/")
148 (synopsis "3D physics engine library")
150 "Bullet is a physics engine library usable for collision detection. It
151 is used in some video games and movies.")
152 (license license:zlib)))
154 (define-public deutex
160 (uri (string-append "https://github.com/Doom-Utils/deutex"
161 "/releases/download/v" version "/"
162 "deutex-" version ".tar.xz"))
165 "1d536d3i78k4ch8mjg7lqnamnyfpp2x5x7mzx5smqi9ad8lb6hqz"))))
166 (build-system gnu-build-system)
167 (native-inputs `(("asciidoc" ,asciidoc)))
168 (home-page "https://github.com/Doom-Utils/deutex")
169 (synopsis "WAD file composer for Doom and related games")
171 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
172 used to extract the lumps of a wad and save them as individual files.
173 Conversely, it can also build a wad from separate files. When extracting a
174 lump to a file, it does not just copy the raw data, it converts it to an
175 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
176 Conversely, when it reads files for inclusion in pwads, it does the necessary
177 conversions (for example, from PPM to Doom picture format). In addition,
178 DeuTex has functions such as merging wads, etc.")
179 (license license:gpl2+)))
181 (define-public grfcodec
187 (uri (string-append "http://binaries.openttd.org/extra/"
188 name "/" version "/" name "-" version
192 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
193 (build-system gnu-build-system)
195 '(#:tests? #f ; no check target
197 (modify-phases %standard-phases
198 (delete 'configure) ; no configure script
199 (replace 'install ; no install target
200 (lambda* (#:key outputs #:allow-other-keys)
201 (let* ((out (assoc-ref outputs "out"))
202 (bin (string-append out "/bin"))
203 (doc (string-append out "/share/doc"))
204 (man (string-append out "/share/man/man1")))
205 (for-each (lambda (file)
206 (install-file file bin))
207 '("grfcodec" "grfid" "grfstrip" "nforenum"))
208 (install-file "COPYING" doc)
209 (with-directory-excursion "docs"
210 (for-each (lambda (file)
211 (install-file (string-append file ".txt") doc))
212 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
213 "readme" "readme.rpn"))
214 (for-each (lambda (file)
215 (install-file file man))
216 (find-files "." "\\.1"))))
222 (synopsis "GRF development tools")
224 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
225 tools for developing (New)GRFs. It includes a number of smaller programs, each
226 with a specific task:
228 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
229 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
230 @item @code{grfstrip} strips all sprites from a GRF.
231 @item @code{nforenum} checks NFO code for errors, making corrections when
234 (home-page "http://dev.openttdcoop.org/projects/grfcodec")
235 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
236 ;; NFORenum is under the GPL2+.
237 ;; The MD5 implementation contained in GRFID is under the zlib license.
238 (license (list license:gpl2 license:gpl2+ license:zlib))))
240 (define-public catcodec
247 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
248 version "/catcodec-" version "-source.tar.xz"))
251 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
252 (build-system gnu-build-system)
254 `(#:tests? #f ; no tests
255 #:make-flags (list (string-append "prefix=" %output))
256 #:phases (modify-phases %standard-phases
257 (delete 'configure))))
258 (home-page "http://dev.openttdcoop.org/projects/catcodec")
259 (synopsis "Encode/decode OpenTTD sounds")
260 (description "catcodec encodes and decodes sounds for OpenTTD. These
261 sounds are not much more than some metadata (description and filename) and raw
263 (license license:gpl2)))
265 (define-public gzochi
271 (uri (string-append "mirror://savannah/gzochi/gzochi-"
275 "0h8yvk7154kd8zdfa9nqy73blrjq2x19kv305jcnwlmm09vvss59"))))
276 (build-system gnu-build-system)
278 '(#:phases (modify-phases %standard-phases
279 (add-before 'build 'no-Werror
281 ;; Don't abort builds due to things like GLib
282 ;; deprecation warnings.
283 (substitute* (find-files "." "^Makefile\\.in$")
286 (native-inputs `(("pkgconfig" ,pkg-config)))
287 (inputs `(("bdb" ,bdb)
290 ("libmicrohttpd" ,libmicrohttpd)
294 (home-page "https://www.nongnu.org/gzochi/")
295 (synopsis "Scalable middleware for multiplayer games")
297 "gzochi is a framework for developing massively multiplayer online games.
298 A server container provides services to deployed games, which are written in
299 Guile Scheme, that abstract and simplify some of the most challenging and
300 error-prone aspects of online game development: Concurrency, data persistence,
301 and network communications. A very thin client library can be embedded to
302 provide connectivity for client applications written in any language.")
303 (license license:gpl3+)))
312 (uri (string-append "http://bundles.openttdcoop.org/nml/releases/"
313 version "/nml-" version ".tar.gz"))
316 "1pmvvm3sgnpngfa7884mqhq3fwdjh9sr0ca07ypnidcg0y341w53"))))
317 (build-system python-build-system)
320 (modify-phases %standard-phases
321 (add-before 'build 'fix-pillow
323 ;; pillow's version is not in PIL.Image.VERSION anymore
324 (substitute* "nml/version_info.py"
325 (("from PIL import Image") "import PIL")
326 (("Image.VERSION") "PIL.__version__"))
329 `(("python-pillow" ,python-pillow)
330 ("python-ply" ,python-ply)))
331 (home-page "https://dev.openttdcoop.org/projects/nml")
332 (synopsis "NML compiler")
334 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
335 compiling NML files (along with their associated language, sound and graphic
336 files) into @file{.grf} and/or @file{.nfo} files.")
337 (license license:gpl2+)))
339 (define-public python-sge-pygame
341 (name "python-sge-pygame")
346 (uri (string-append "mirror://savannah/stellarengine/"
347 (version-major+minor version) "/sge-pygame-"
349 (file-name (string-append name "-" version ".tar.gz"))
352 "1rl3xjzh78sl0sq3xl8rl7cgp9v9v3h7s2pfwn7nj1vrmffzkcpd"))))
353 (build-system python-build-system)
355 `(("python-pygame" ,python-pygame)
356 ("python-six" ,python-six)
357 ("python-uniseg" ,python-uniseg)))
358 (home-page "http://stellarengine.nongnu.org")
359 (synopsis "2D game engine for Python")
361 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
362 general-purpose 2D game engine. It takes care of several details for you so
363 you can focus on the game itself. This makes more rapid game development
364 possible, and it also makes the SGE easy to learn.")
365 (license license:lgpl3+)))
367 (define-public python2-sge-pygame
368 (package-with-python2 python-sge-pygame))
370 (define-public python-tmx
377 (uri (string-append "mirror://savannah/python-tmx/"
378 (version-major+minor version) "/tmx-"
382 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
383 (build-system python-build-system)
385 `(("python-six" ,python-six)))
386 (home-page "http://python-tmx.nongnu.org")
387 (synopsis "Python library for the @code{Tiled} TMX format")
389 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
390 This is useful for map editors or generic level editors, and it's also useful
391 for using a map editor or generic level editor like Tiled to edit your game's
393 (license (list license:asl2.0
394 ;; Documentation (only available in the source tarball) is
395 ;; under the CC0 license.
398 (define-public python2-tmx
399 (let ((python2-tmx (package-with-python2 python-tmx)))
401 (inherit python2-tmx)
403 `(("python2-pathlib" ,python2-pathlib)
404 ,@(package-propagated-inputs python2-tmx))))))
406 (define-public python-xsge
409 (version "2018.02.26")
412 (uri (string-append "mirror://savannah/xsge/xsge/xsge-"
416 "0bx93hgf7cgdw2gsygbh59y8vpw37pgsa279rajw3fkdpl8vrc40"))))
417 (build-system python-build-system)
420 (modify-phases %standard-phases
421 ;; xSGE's setup.py script does not support one of the Python build
422 ;; system's default flags, "--single-version-externally-managed".
424 (lambda* (#:key outputs #:allow-other-keys)
425 (invoke "python" "setup.py" "install"
426 (string-append "--prefix=" (assoc-ref outputs "out"))
428 #:tests? #f)) ; no check target
430 `(("python-sge-pygame" ,python-sge-pygame)
431 ("python-pygame" ,python-pygame)
432 ("python-six" ,python-six)
433 ("python-tmx" ,python-tmx)))
434 (home-page "http://xsge.nongnu.org")
435 (synopsis "Extensions for the SGE Game Engine")
437 "xSGE is a collection of modules that make doing certain tasks with the SGE
438 Game Engine easier. In addition to SGE's conveniences, the user has access to a
439 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
441 (license license:gpl3+)))
443 (define-public python2-xsge
444 (package-with-python2 python-xsge))
453 (url "https://github.com/bjorn/tiled.git")
454 (commit (string-append "v" version))))
455 (file-name (git-file-name name version))
458 "14v2zfka2y3h0r0biw1rl59585lji5074x958s4xnb352jm5h9b9"))))
459 (build-system gnu-build-system)
465 `(("qttools" ,qttools)))
468 (modify-phases %standard-phases
470 (lambda* (#:key inputs outputs #:allow-other-keys)
471 (substitute* "translations/translations.pro"
473 (string-append "LRELEASE = "
474 (assoc-ref inputs "qttools")
476 (let ((out (assoc-ref outputs "out")))
478 (string-append "PREFIX=" out))))))))
479 (home-page "https://www.mapeditor.org/")
480 (synopsis "Tile map editor")
482 "Tiled is a general purpose tile map editor. It is meant to be used for
483 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
486 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
488 (license license:gpl2+)))
496 ;; Do not fetch the archives from
497 ;; http://mirror0.sfml-dev.org/files/ because files there seem
498 ;; to be changed in place.
500 (url "https://github.com/SFML/SFML.git")
502 (file-name (git-file-name name version))
505 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
506 (modules '((guix build utils)))
509 ;; Ensure system libraries are used.
510 (delete-file-recursively "extlibs")
512 (build-system cmake-build-system)
515 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
516 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
517 #:tests? #f)) ; no tests
519 `(("pkg-config" ,pkg-config)))
524 ("xcb-util-image" ,xcb-util-image)
525 ("libxrandr" ,libxrandr)
528 ("libsndfile" ,libsndfile)
529 ("stb-image" ,stb-image)
530 ("stb-image-write" ,stb-image-write)))
532 ;; In Requires.private of pkg-config files.
534 ("freetype" ,freetype)
535 ("libvorbis" ,libvorbis)
537 (home-page "https://www.sfml-dev.org")
538 (synopsis "Simple and Fast Multimedia Library")
540 "SFML provides a simple interface to the various computer components,
541 to ease the development of games and multimedia applications. It is composed
542 of five modules: system, window, graphics, audio and network.")
543 (license license:zlib)))
551 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
554 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
555 (build-system gnu-build-system)
557 `(#:phases (modify-phases %standard-phases
558 (delete 'configure) ; no configure script
559 (add-before 'build 'patch-makefile
560 (lambda* (#:key outputs #:allow-other-keys)
561 (let ((out (assoc-ref outputs "out")))
562 (substitute* "Makefile"
563 (("\\$\\(DESTDIR\\)/usr") out))
564 (substitute* "main.cpp"
566 (string-append out "/share")))
568 #:tests? #f)) ; no tests
570 `(("pkg-config" ,pkg-config)
571 ("desktop-file-utils" ,desktop-file-utils)))
575 (synopsis "Simple sound effect generator")
576 (description "Sfxr is a tool for quickly generating simple sound effects.
577 Originally created for use in video game prototypes, it can generate random
578 sounds from presets such as \"explosion\" or \"powerup\".")
579 (home-page "http://www.drpetter.se/project_sfxr.html")
580 (license license:expat)))
582 (define-public physfs
589 "https://icculus.org/physfs/downloads/physfs-"
591 (file-name (string-append name "-" version ".tar.gz"))
594 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
595 (build-system cmake-build-system)
597 '(#:tests? #f ; no check target
598 #:phases (modify-phases %standard-phases
599 (add-after 'unpack 'patch-CMakeLists.txt
601 (substitute* "CMakeLists.txt"
602 ;; XXX: For some reason CMakeLists.txt disables
603 ;; RUNPATH manipulation when the compiler is GCC.
604 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
609 `(("doxygen" ,doxygen)))
610 (home-page "https://icculus.org/physfs")
611 (synopsis "File system abstraction library")
613 "PhysicsFS is a library to provide abstract access to various archives.
614 It is intended for use in video games. For security, no file writing done
615 through the PhysicsFS API can leave a defined @emph{write directory}. For
616 file reading, a @emph{search path} with archives and directories is defined,
617 and it becomes a single, transparent hierarchical file system. So archive
618 files can be accessed in the same way as you access files directly on a disk,
619 and it makes it easy to ship a new archive that will override a previous
620 archive on a per-file basis.")
621 (license license:zlib)))
629 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
630 "love-" version "-linux-src.tar.gz"))
633 "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
634 (build-system gnu-build-system)
636 `(("pkg-config" ,pkg-config)))
639 ("freetype" ,freetype)
640 ("libmodplug" ,libmodplug)
641 ("libtheora" ,libtheora)
642 ("libvorbis" ,libvorbis)
650 (synopsis "2D game framework for Lua")
651 (description "LÖVE is a framework for making 2D games in the Lua
652 programming language.")
653 (home-page "https://love2d.org/")
654 (license license:zlib)))
656 (define-public allegro-4
662 (uri (string-append "https://github.com/liballeg/allegro5/"
663 "releases/download/" version "/allegro-"
667 "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
668 (build-system cmake-build-system)
671 (modify-phases %standard-phases
672 (add-after 'unpack 'patch-build-system
674 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
675 ;; via a command line option doesn't work because it is
676 ;; unconditionally clobbered in the build script.
677 (substitute* '("CMakeLists.txt")
678 (("ADDON_LINKAGE STATIC")
679 "ADDON_LINKAGE SHARED"))
684 ("libvorbis" ,libvorbis)
687 (synopsis "Game programming library")
688 (description "Allegro is a library mainly aimed at video game and
689 multimedia programming. It handles common, low-level tasks such as creating
690 windows, accepting user input, loading data, drawing images, playing sounds,
692 (home-page "http://liballeg.org")
693 (license license:giftware)))
695 (define-public allegro
701 (uri (string-append "https://github.com/liballeg/allegro5/releases"
702 "/download/" version "/allegro-"
706 "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
707 (build-system cmake-build-system)
708 (arguments `(#:tests? #f)) ; there are no tests
710 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
712 ("freetype" ,freetype)
717 ("libtheora" ,libtheora)
718 ("libvorbis" ,libvorbis)
719 ("libxcursor" ,libxcursor)
720 ("libxinerama" ,libxinerama)
721 ("libxrandr" ,libxrandr)
727 `(("pkg-config" ,pkg-config)))
728 (synopsis "Game programming library")
729 (description "Allegro is a library mainly aimed at video game and
730 multimedia programming. It handles common, low-level tasks such as creating
731 windows, accepting user input, loading data, drawing images, playing sounds,
733 (home-page "http://liballeg.org")
734 (license license:bsd-3)))
736 (define-public allegro-5.0
737 (package (inherit allegro)
742 (uri (string-append "https://github.com/liballeg/allegro5/releases"
743 "/download/" version "/allegro-"
744 (if (equal? "0" (string-take-right version 1))
745 (string-drop-right version 2)
748 (patches (search-patches
749 "allegro-mesa-18.2.5-and-later.patch"))
752 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
754 (define-public aseprite
757 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
758 ;; TODO: Unbundle third party software.
760 (method url-fetch/zipbomb)
761 (uri (string-append "https://github.com/aseprite/aseprite"
762 "/releases/download/v" version
763 "/Aseprite-v" version "-Source.zip"))
766 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
767 (build-system cmake-build-system)
770 ;; Use shared libraries instead of building bundled source.
771 (list "-DWITH_WEBP_SUPPORT=1"
772 "-DUSE_SHARED_CURL=1"
773 "-DUSE_SHARED_GIFLIB=1"
774 "-DUSE_SHARED_JPEGLIB=1"
775 "-DUSE_SHARED_ZLIB=1"
776 "-DUSE_SHARED_LIBPNG=1"
777 "-DUSE_SHARED_LIBLOADPNG=1"
778 "-DUSE_SHARED_LIBWEBP=1"
779 "-DUSE_SHARED_TINYXML=1"
780 "-DUSE_SHARED_PIXMAN=1"
781 "-DUSE_SHARED_FREETYPE=1"
782 "-DUSE_SHARED_ALLEGRO4=1"
783 "-DENABLE_UPDATER=0" ; no auto-updates
784 (string-append "-DFREETYPE_INCLUDE_DIR="
785 (assoc-ref %build-inputs "freetype")
786 "/include/freetype2"))))
788 `(("pkg-config" ,pkg-config)))
789 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
790 ;; patched version is bundled with Aseprite, but the patches should be
791 ;; extracted and applied on top of a standalone Allegro 4 package.
793 `(("allegro" ,allegro-4)
795 ("freetype" ,freetype)
802 ("libxxf86vm" ,libxxf86vm)
806 (synopsis "Animated sprite editor and pixel art tool")
807 (description "Aseprite is a tool for creating 2D pixel art for video
808 games. In addition to basic pixel editing features, Aseprite can assist in
809 the creation of animations, tiled graphics, texture atlases, and more.")
810 (home-page "https://www.aseprite.org/")
811 (license license:gpl2+)))
813 (define-public qqwing
820 "https://qqwing.com/"
821 name "-" version ".tar.gz"))
824 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
825 (build-system gnu-build-system)
827 `(("pkg-config" ,pkg-config)))
828 (home-page "https://qqwing.com/")
829 (synopsis "Sudoku puzzle solver and generator")
831 "QQWing is a Sudoku puzzle generator and solver.
832 It offers the following features:
834 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
835 @item Uses logic. Uses as many solve techniques as possible when solving
836 puzzles rather than guessing.
837 @item Rates puzzles. Most generators don't give an indication of the difficulty
838 of a Sudoku puzzle. QQwing does.
839 @item Can print solve instructions for any puzzle.
840 @item Customizable output style, including a CSV style that is easy to
841 import into a database.
843 (license license:gpl2+)))
845 (define-public quesoglc
851 (uri (string-append "mirror://sourceforge/" name "/" version "/"
852 name "-" version "-free.tar.bz2"))
855 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
856 (build-system gnu-build-system)
857 (native-inputs `(("pkg-config" ,pkg-config)))
858 (inputs `(("fontconfig" ,fontconfig)
859 ("freeglute" ,freeglut)
862 (home-page "http://quesoglc.sourceforge.net")
863 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
865 "The OpenGL Character Renderer (GLC) is a state machine that provides
866 OpenGL programs with character rendering services via an application programming
868 (license (list license:expat license:lgpl2.1+))))
870 (define-public python-pygame
872 (name "python-pygame")
876 (uri (pypi-uri "pygame" version))
879 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
880 (build-system python-build-system)
882 `(#:tests? #f ; tests require pygame to be installed first
884 (modify-phases %standard-phases
885 ;; Set the paths to the dependencies manually because
886 ;; the configure script does not allow passing them as
887 ;; parameters. This also means we can skip the configure
889 (add-before 'build 'set-library-paths
890 (lambda* (#:key inputs outputs #:allow-other-keys)
891 (let ((sdl-ref (assoc-ref inputs "sdl"))
892 (font-ref (assoc-ref inputs "sdl-ttf"))
893 (image-ref (assoc-ref inputs "sdl-image"))
894 (mixer-ref (assoc-ref inputs "sdl-mixer"))
895 (smpeg-ref (assoc-ref inputs "libsmpeg"))
896 (png-ref (assoc-ref inputs "libpng"))
897 (jpeg-ref (assoc-ref inputs "libjpeg"))
898 (freetype-ref (assoc-ref inputs "freetype"))
899 (v4l-ref (assoc-ref inputs "v4l-utils"))
900 (out-ref (assoc-ref outputs "out")))
901 (substitute* "Setup.in"
902 (("SDL = -I/usr/include/SDL")
903 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
904 (substitute* "Setup.in"
905 (("FONT = -lSDL_ttf")
906 (string-append "FONT = -I" font-ref "/include/SDL -L"
907 font-ref "/lib -lSDL_ttf")))
908 (substitute* "Setup.in"
909 (("IMAGE = -lSDL_image")
910 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
911 image-ref "/lib -lSDL_image")))
912 (substitute* "Setup.in"
913 (("MIXER = -lSDL_mixer")
914 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
915 mixer-ref "/lib -lSDL_mixer")))
916 (substitute* "Setup.in"
918 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
919 smpeg-ref "/lib -lsmpeg")))
920 (substitute* "Setup.in"
922 (string-append "PNG = -I" png-ref "/include -L"
923 png-ref "/lib -lpng")))
924 (substitute* "Setup.in"
926 (string-append "JPEG = -I" jpeg-ref "/include -L"
927 jpeg-ref "/lib -ljpeg")))
929 (substitute* "Setup.in"
930 (("FREETYPE = -lfreetype")
931 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
932 freetype-ref "/lib -lfreetype")))
934 (substitute* "Setup.in"
936 ;; Create a path to a header file provided by v4l-utils.
937 (system* "mkdir" "linux")
938 (system* "ln" "--symbolic"
939 (string-append v4l-ref "/include/libv4l1-videodev.h")
941 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
943 `(("freetype" ,freetype)
945 ("sdl-image" ,sdl-image)
946 ("sdl-mixer" ,sdl-mixer)
952 ("libsmpeg" ,libsmpeg)
953 ("portmidi" ,portmidi)
954 ("v4l-utils" ,v4l-utils)))
955 (home-page "https://www.pygame.org")
956 (synopsis "SDL wrapper for Python")
957 (description "Pygame is a set of Python modules designed for writing games.
958 Pygame adds functionality on top of the excellent SDL library. This allows you
959 to create fully featured games and multimedia programs in the python language.")
960 (license (list license:bsd-2
961 ;; python numeric license as listed by Debian looks like
962 ;; an Expat-style license with a warranty disclaimer for
963 ;; the U.S. government and the University of California.
969 license:public-domain
972 (define-public python2-pygame
973 (package-with-python2 python-pygame))
975 (define-public python2-pygame-sdl2
976 (let ((real-version "2.1.0")
977 (renpy-version "7.3.5"))
979 (inherit python2-pygame)
980 (name "python2-pygame-sdl2")
981 (version (string-append real-version "-for-renpy-" renpy-version))
985 (uri (string-append "https://www.renpy.org/dl/" renpy-version
986 "/pygame_sdl2-" version ".tar.gz"))
987 (sha256 (base32 "1bmr7j9mlsc4czpgw70ld15ymyp4wxrk9hdsqad40wjwdxvvg2dr"))))
988 (build-system python-build-system)
990 `(#:tests? #f ; tests require pygame to be installed first
993 (modify-phases %standard-phases
994 (add-after 'set-paths 'set-sdl-vars
995 (lambda* (#:key inputs #:allow-other-keys)
996 (setenv "PYGAME_SDL2_CFLAGS"
998 (assoc-ref inputs "sdl-union")
999 "/include/SDL2 -D_REENTRANT"))
1000 (setenv "PYGAME_SDL2_LDFLAGS"
1002 (assoc-ref inputs "sdl-union")
1004 (assoc-ref inputs "sdl-union")
1005 "/lib -Wl,--enable-new-dtags -lSDL2"))
1007 (add-before 'build 'drop-generated-files
1009 (delete-file-recursively "gen")
1010 (delete-file-recursively "gen3")
1014 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1016 `(("python2-cython" ,python2-cython)))
1017 (home-page "http://www.renpy.org/")
1018 (synopsis "Reimplementation of the Pygame API using SDL2")
1019 (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
1020 staying close to the original, but also adding some SDL2-specific features.
1021 While it aims to be used as a drop-in replacement, it appears to be
1022 developed mainly for Ren'py.")
1023 (license (list license:lgpl2.1 license:zlib)))))
1025 (define-public python2-renpy
1027 (name "python2-renpy")
1032 (uri (string-append "https://www.renpy.org/dl/" version
1033 "/renpy-" version "-source.tar.bz2"))
1034 (sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))))
1035 (build-system python-build-system)
1037 `(#:tests? #f ; Ren'py doesn't seem to package tests
1040 (modify-phases %standard-phases
1041 (add-after 'unpack 'fix-commands
1043 (substitute* "renpy/editor.py"
1045 (which "xdg-open")))
1047 (add-after 'set-paths 'set-build-vars
1048 (lambda* (#:key inputs #:allow-other-keys)
1049 (setenv "RENPY_CYTHON"
1050 (string-append (assoc-ref inputs "python2-cython")
1052 (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
1057 (lambda* (build-root #:key inputs outputs #:allow-other-keys)
1058 ;; The "module" subdirectory contains a python (really cython)
1059 ;; project, which is built using a script, that is thankfully
1060 ;; named "setup.py".
1062 (apply (assoc-ref %standard-phases 'build) args)
1063 ;; the above causes renpy.__init__ to be compiled but does not
1064 ;; compile anything else, hence we do that here
1066 (delete-file "renpy/__init__.pyc")
1067 (invoke "python" "-m" "compileall" "renpy"))
1073 (lambda* (build-root #:key inputs outputs #:allow-other-keys)
1074 ;; Again, we have to wrap the module installation.
1075 ;; Additionally, we want to install the python code
1076 ;; (both source and compiled) in the same directory.
1077 (let* ((out (assoc-ref outputs "out"))
1078 (site (string-append "/lib/python"
1079 ,(version-major+minor
1080 (package-version python-2))
1083 (apply (assoc-ref %standard-phases 'install) args)
1085 (copy-recursively "renpy"
1086 (string-append out site "/renpy"))))
1090 `(("ffmpeg" ,ffmpeg)
1091 ("freetype" ,freetype)
1094 ("python2-pygame" ,python2-pygame-sdl2)
1096 ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
1098 `(("python2-cython" ,python2-cython)
1099 ("xdg-utils" ,xdg-utils)))
1100 (home-page "http://www.renpy.org/")
1101 (synopsis "Ren'py python module")
1102 (description "This package contains the shared libraries and Python
1103 modules of Ren'py.")
1104 (license license:expat)))
1106 (define-public renpy
1108 (inherit python2-renpy)
1111 (build-system python-build-system)
1113 `(#:tests? #f ; see python2-renpy
1116 (modify-phases %standard-phases
1117 (add-after 'unpack 'fix-commands
1118 (lambda* (#:key outputs #:allow-other-keys)
1119 (substitute* "launcher/game/choose_directory.rpy"
1120 (("/usr/bin/python") (which "python2")))
1121 (substitute* "launcher/game/front_page.rpy"
1123 (which "xdg-open")))
1124 (substitute* "launcher/game/project.rpy"
1125 (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
1126 (string-append "cmd = [ \"" (assoc-ref outputs "out")
1128 ;; Projects are still created in the usual style, so we need
1129 ;; to adjust the path.
1130 (("cmd.append\\(self.path\\)")
1131 "cmd.append(self.path + \"/game\")"))
1133 (add-after 'unpack 'drop-game-from-paths
1135 (substitute* (list "launcher/game/gui7.rpy"
1136 "launcher/game/gui7/images.py")
1137 ((", \"game\",") ","))
1139 (add-before 'build 'start-xserver
1140 (lambda* (#:key inputs #:allow-other-keys)
1141 (let ((xorg-server (assoc-ref inputs "xorg-server")))
1142 (setenv "HOME" (getcwd))
1143 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
1144 (setenv "DISPLAY" ":1")
1148 (invoke "python" "renpy.py" "launcher" "quit")
1149 (invoke "python" "renpy.py" "the_question" "quit")
1150 (invoke "python" "renpy.py" "tutorial" "quit")
1153 (lambda* (#:key inputs outputs #:allow-other-keys)
1154 ;; Here we install our custom renpy program.
1155 ;; After finishing this step, "out" will have the following:
1157 ;; `-- share/renpy ; i.e. path_to_renpy_base()
1160 ;; Note that common is also a de facto unused directory in
1161 ;; python2-renpy. On other systems, renpy_base would point to
1162 ;; site-packages or even somewhere in /opt.
1163 ;; The former approach is not as straightforward as it seems
1164 ;; -- it causes renpy to load files twice for some weird reason --
1165 ;; and the latter is impossible on Guix. Hence the detour through
1166 ;; share/renpy and the custom renpy program.
1168 ;; As a convention, other games should be installed as
1169 ;; subdirectories of share/renpy in their respective outputs as
1170 ;; well. This differs from the traditional layout, which is
1171 ;; roughly the following:
1172 ;; `-- Super Awesome Game
1173 ;; |-- game ; <- the folder we actually want
1174 ;; |-- lib ; compiled renpy module and dependencies
1175 ;; |-- renpy ; Ren'py python code (source + compiled)
1176 ;; |-- Super Awesome Game.py
1177 ;; `-- Super Awesome Game.sh
1178 (let* ((out (assoc-ref outputs "out"))
1179 (bin/renpy (string-append out "/bin/renpy")))
1180 (mkdir-p (string-append out "/bin"))
1181 (copy-recursively "renpy/common"
1182 (string-append out "/share/renpy/common"))
1183 (copy-recursively "gui"
1184 (string-append out "/share/renpy/gui"))
1186 (call-with-output-file bin/renpy
1188 (format port "#!~a~%" (which "python2"))
1190 from __future__ import print_function
1196 def path_to_common(renpy_base):
1197 return renpy_base + \"/common\"
1199 def path_to_saves(gamedir, save_directory=None):
1200 import renpy # @UnresolvedImport
1202 if save_directory is None:
1203 save_directory = renpy.config.save_directory
1204 save_directory = renpy.exports.fsencode(save_directory)
1206 if not save_directory:
1207 return gamedir + \"/saves\"
1209 return os.path.expanduser(\"~~/.renpy/\" + save_directory)
1211 def path_to_renpy_base():
1215 renpy_base = path_to_renpy_base()
1217 import renpy.bootstrap
1218 import renpy.arguments
1220 print(\"\"\"Could not import renpy.bootstrap.
1221 Please ensure you decompressed Ren'Py correctly, preserving the directory
1222 structure.\"\"\", file=sys.stderr)
1225 args = renpy.arguments.bootstrap()
1226 if not args.basedir:
1227 print(\"\"\"This Ren'py requires a basedir to launch.
1228 The basedir is the directory, in which .rpy files live -- usually the 'game'
1229 subdirectory of a game packaged by Ren'py.
1231 If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
1235 renpy.bootstrap.bootstrap(renpy_base)
1237 if __name__ == \"__main__\":
1240 (string-append out "/share/renpy"))))
1241 (chmod bin/renpy #o755)
1244 (add-after 'install 'install-games
1245 (lambda* (#:key outputs #:allow-other-keys)
1246 (define renpy (assoc-ref outputs "out"))
1247 ;; TODO: We should offer a renpy-build-system to make the
1248 ;; installation of Ren'py games easier.
1249 (define* (install-renpy-game #:key output game name (renpy renpy)
1251 (let* ((name (or name (basename game)))
1252 (launcher (string-append output "/bin/renpy-" name))
1253 (share (string-append output "/share/renpy/" name)))
1254 (copy-recursively (string-append game "/game") share)
1255 (mkdir-p (string-append output "/bin"))
1256 (with-output-to-file launcher
1259 "#!~a~%~a ~a \"$@\""
1261 (string-append renpy "/bin/renpy")
1263 (chmod launcher #o755)))
1265 (install-renpy-game #:output (assoc-ref outputs "out")
1268 (install-renpy-game #:output (assoc-ref outputs "the-question")
1269 #:game "the_question"
1270 #:name "the-question")
1272 (install-renpy-game #:output (assoc-ref outputs "tutorial")
1276 (lambda* (#:key inputs outputs #:allow-other-keys)
1277 (wrap-program (string-append (assoc-ref outputs "out")
1279 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
1282 `(("python2-tkinter" ,python-2 "tk")
1283 ("python2-pygame" ,python2-pygame-sdl2)
1284 ("python2-renpy" ,python2-renpy)
1285 ("xorg-server" ,xorg-server)))
1287 (list "out" "tutorial" "the-question"))
1288 (home-page "http://www.renpy.org/")
1289 (synopsis "Visual Novel Engine")
1290 (description "Ren'Py is a visual novel engine that helps you use words,
1291 images, and sounds to tell interactive stories that run on computers and
1292 mobile devices. These can be both visual novels and life simulation games.
1293 The easy to learn script language allows anyone to efficiently write large
1294 visual novels, while its Python scripting is enough for complex simulation
1296 (license license:expat)))
1298 (define-public grafx2
1304 ;; XXX: There is no URL that contains the version. :(
1305 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
1308 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
1309 (build-system gnu-build-system)
1312 (modify-phases %standard-phases
1313 (delete 'configure) ; no configure script
1314 (add-before 'build 'change-to-src-directory
1319 ;; SDL header files are referenced without the preceeding "SDL/".
1320 (list (string-append "CFLAGS=-I"
1321 (assoc-ref %build-inputs "sdl-union")
1323 (string-append "prefix="
1324 (assoc-ref %outputs "out")))
1325 #:tests? #f)) ; no check target
1327 `(("pkg-config" ,pkg-config)))
1329 `(("libpng" ,libpng)
1331 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
1332 (synopsis "Bitmap paint program")
1333 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1334 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1335 includes a very large number of tools and effects that make it particularly
1336 suitable for pixel art, game graphics, and generally any detailed graphics
1337 painted with a mouse.")
1338 (home-page "http://pulkomandy.tk/projects/GrafX2")
1339 (license license:gpl2))) ; GPLv2 only
1349 (url "https://github.com/wgois/OIS.git")
1350 (commit (string-append "v" version))))
1351 (file-name (git-file-name name version))
1353 (base32 "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa"))))
1354 (build-system cmake-build-system)
1356 `(#:tests? #f)) ; no test suite
1358 `(("libx11" ,libx11)))
1359 (synopsis "Object Oriented Input System")
1361 "Cross Platform Object Oriented Input Lib System is a cross platform,
1362 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1363 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1364 robust and compatible with many systems and operating systems.")
1365 (home-page "https://github.com/wgois/OIS")
1366 (license license:zlib)))
1368 (define-public mygui
1376 (url "https://github.com/MyGUI/mygui")
1377 (commit (string-append "MyGUI" version))))
1378 (file-name (git-file-name name version))
1381 "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
1382 (build-system cmake-build-system)
1384 '(#:tests? #f ; No test target
1386 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1387 (string-append "-DOGRE_INCLUDE_DIR="
1388 (assoc-ref %build-inputs "ogre")
1390 ;; Demos and tools are Windows-specific:
1391 ;; https://github.com/MyGUI/mygui/issues/24.
1392 "-DMYGUI_BUILD_DEMOS=FALSE"
1393 "-DMYGUI_BUILD_TOOLS=FALSE")))
1396 ("doxygen" ,doxygen)
1397 ("pkg-config" ,pkg-config)))
1399 `(("font-dejavu" ,font-dejavu)
1400 ("freetype" ,freetype)
1401 ("graphviz" ,graphviz)
1405 (synopsis "Fast, flexible and simple GUI")
1407 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1408 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1410 (home-page "http://mygui.info/")
1411 (license license:expat)))
1413 (define-public mygui-gl
1414 ;; Closure size is reduced by some 800 MiB.
1420 (substitute-keyword-arguments (package-arguments mygui)
1421 ((#:configure-flags _)
1422 `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
1423 ;; We can't reuse the flags because of the mention to Ogre.
1424 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1425 ;; Demos and tools are Windows-specific:
1426 ;; https://github.com/MyGUI/mygui/issues/24.
1427 "-DMYGUI_BUILD_DEMOS=FALSE"
1428 "-DMYGUI_BUILD_TOOLS=FALSE")))))
1432 ,@(fold alist-delete (package-inputs mygui)
1434 (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
1436 (define-public openmw
1444 (string-append "https://github.com/OpenMW/openmw/archive/"
1445 "openmw-" version ".tar.gz"))
1448 "0r0wgvv1faan8z8lbply8lks4hcnppifjrcz04l5zvq6yiqzjg5n"))))
1449 (build-system cmake-build-system)
1451 `(#:tests? #f ; No test target
1453 (list "-DDESIRED_QT_VERSION=5")))
1456 ("doxygen" ,doxygen)
1457 ("pkg-config" ,pkg-config)))
1459 `(("bullet" ,bullet)
1462 ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
1464 ("openscenegraph" ,openmw-openscenegraph)
1467 ("unshield" ,unshield)))
1468 (synopsis "Re-implementation of the RPG Morrowind engine")
1470 "OpenMW is a game engine which reimplements and extends the one that runs
1471 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1472 called OpenMW-CS which allows the user to edit or create their own original
1474 (home-page "https://openmw.org")
1475 (license license:gpl3)))
1477 (define-public godot
1484 (url "https://github.com/godotengine/godot")
1485 (commit (string-append version "-stable"))))
1486 (file-name (git-file-name name version))
1489 "0g64h0x8dlv6aa9ggfcidk2mknkfl5li7z1phcav8aqp9srj8avf"))
1490 (modules '((guix build utils)))
1493 ;; Drop libraries that we take from Guix. Note that some
1494 ;; of these may be modified; see "thirdparty/README.md".
1495 (with-directory-excursion "thirdparty"
1496 (for-each delete-file-recursively
1508 (build-system scons-build-system)
1510 `(#:scons ,scons-python2
1511 #:scons-flags (list "platform=x11"
1512 ,@(if (string-prefix? "aarch64" (or (%current-target-system)
1514 `("CCFLAGS=-DNO_THREADS")
1516 ;; Avoid using many of the bundled libs.
1517 ;; Note: These options can be found in the SConstruct file.
1518 "builtin_freetype=no"
1520 "builtin_libmpdec=no"
1523 "builtin_libtheora=no"
1524 "builtin_libvorbis=no"
1526 "builtin_libwebp=no"
1527 "builtin_openssl=no"
1530 #:tests? #f ; There are no tests
1532 (modify-phases %standard-phases
1533 (add-after 'unpack 'scons-use-env
1535 ;; Scons does not use the environment variables by default,
1536 ;; but this substitution makes it do so.
1537 (substitute* "SConstruct"
1538 (("env_base = Environment\\(tools=custom_tools\\)")
1540 "env_base = Environment(tools=custom_tools)\n"
1541 "env_base = Environment(ENV=os.environ)")))
1544 (lambda* (#:key outputs #:allow-other-keys)
1545 (let* ((out (assoc-ref outputs "out"))
1546 (bin (string-append out "/bin")))
1547 (with-directory-excursion "bin"
1548 (if (file-exists? "godot.x11.tools.64")
1549 (rename-file "godot.x11.tools.64" "godot")
1550 (rename-file "godot.x11.tools.32" "godot"))
1551 (install-file "godot" bin))
1553 (add-after 'install 'install-godot-desktop
1554 (lambda* (#:key outputs #:allow-other-keys)
1555 (let* ((out (assoc-ref outputs "out"))
1556 (desktop (string-append out "/share/applications"))
1557 (icon-dir (string-append out "/share/pixmaps")))
1558 (rename-file "icon.png" "godot.png")
1559 (install-file "godot.png" icon-dir)
1561 (with-output-to-file
1562 (string-append desktop "/godot.desktop")
1567 Comment=The godot game engine~@
1569 TryExec=~@*~a/bin/godot~@
1574 (native-inputs `(("pkg-config" ,pkg-config)))
1575 (inputs `(("alsa-lib" ,alsa-lib)
1576 ("freetype" ,freetype)
1579 ("libtheora" ,libtheora)
1580 ("libvorbis" ,libvorbis)
1582 ("libwebp" ,libwebp)
1584 ("libxcursor" ,libxcursor)
1586 ("libxinerama" ,libxinerama)
1587 ("libxrandr" ,libxrandr)
1589 ("openssl" ,openssl)
1590 ("opusfile" ,opusfile)
1591 ("pulseaudio" ,pulseaudio)))
1592 (home-page "https://godotengine.org/")
1593 (synopsis "Advanced 2D and 3D game engine")
1595 "Godot is an advanced multi-platform game engine written in C++. If
1596 features design tools such as a visual editor, can import 3D models and
1597 provide high-quality 3D rendering, it contains an animation editor, and can be
1598 scripted in a Python-like language.")
1599 (license license:expat)))
1601 (define-public eureka
1607 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1609 ;; version without dots e.g 1.21 => 121
1610 (string-join (string-split version #\.) "")
1614 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1615 (build-system gnu-build-system)
1619 (let ((out (assoc-ref %outputs "out")))
1620 (list (string-append "PREFIX=" out)))
1622 (modify-phases %standard-phases
1624 (add-before 'build 'prepare-install-directories
1625 (lambda* (#:key outputs #:allow-other-keys)
1626 (let ((out (assoc-ref outputs "out")))
1627 (mkdir-p (string-append out "/bin"))
1628 (mkdir-p (string-append out "/share"))
1630 (with-fluids ((%default-port-encoding #f))
1631 (substitute* "./src/main.cc"
1632 (("/usr/local") out)))
1634 (substitute* "Makefile"
1635 (("-o root") ""))))))))
1636 (inputs `(("mesa" ,mesa)
1638 ("libxinerama" ,libxinerama)
1639 ("libfontconfig" ,fontconfig)
1640 ("libjpeg" ,libjpeg)
1644 (native-inputs `(("pkg-config" ,pkg-config)
1645 ("xdg-utils" ,xdg-utils)))
1646 (synopsis "Doom map editor")
1647 (description "Eureka is a map editor for the classic DOOM games, and a few
1648 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1650 (home-page "http://eureka-editor.sourceforge.net/")
1651 (license license:gpl2+)))
1653 (define-public guile-chickadee
1655 (name "guile-chickadee")
1659 (uri (string-append "https://files.dthompson.us/chickadee/"
1660 "chickadee-" version ".tar.gz"))
1663 "1fdicsgls5cp0yffcm5vjmav67gv9bxhz1s3jvdvinspxb485x7l"))))
1664 (build-system gnu-build-system)
1666 `(("guile-opengl" ,guile-opengl)
1667 ("guile-sdl2" ,guile-sdl2)))
1669 `(("guile" ,guile-2.2)))
1671 `(("pkg-config" ,pkg-config)
1672 ("texinfo" ,texinfo)))
1673 (home-page "https://dthompson.us/projects/chickadee.html")
1674 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1675 (description "Chickadee is a game development toolkit for Guile Scheme
1676 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1677 that parenthetically inclined game developers need to make 2D (and eventually
1678 3D) games in Scheme, such as:
1681 @item extensible, fixed-timestep game loop
1682 @item OpenGL-based rendering engine
1683 @item keyboard, mouse, controller input
1684 @item REPL-driven development model
1686 (license license:gpl3+)))
1688 (define-public bennu-game-development
1690 (name "bennu-game-development")
1695 (url "http://svn.code.sf.net/p/bennugd/code")
1696 (revision (string->number version))))
1697 (file-name (string-append name "-" version))
1700 "0wpzsbh4zi3931493dnyl5ffmh1b7fj2sx3mzrq304z9zs4d6lqq"))
1701 (modules '((guix build utils)))
1704 (delete-file-recursively "3rdparty") #t))))
1705 (build-system gnu-build-system)
1708 (modify-phases %standard-phases
1709 (add-after 'unpack 'patch-configure-to-use-openssl
1710 (lambda* (#:key outputs #:allow-other-keys)
1712 (delete-file "configure")
1713 (substitute* "configure.in"
1716 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
1717 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
1724 (inputs `(("openssl" ,openssl)
1726 (native-inputs `(("pkg-config" ,pkg-config)
1727 ("autoconf" ,autoconf)
1728 ("automake" ,automake)
1729 ("libtool" ,libtool)))
1730 (synopsis "Programming language to create games")
1731 (description "Bennu Game Development, also known as bennudg, is a
1732 programming language tailored at game development. It is the successor of
1734 (home-page "https://sourceforge.net/projects/bennugd/")
1735 (license license:zlib)))
1737 (define-public bennu-game-development-modules
1739 (inherit bennu-game-development)
1740 (name "bennu-game-development-modules")
1743 (modify-phases %standard-phases
1744 (add-after 'unpack 'patch-conflicting-definitions
1746 (with-fluids ((%default-port-encoding #f))
1747 (substitute* "core/include/fmath.h"
1748 (("extern fixed fmul\\( int x, int y \\);") "")
1749 (("extern fixed fdiv\\( int x, int y \\);") "")))
1750 (chdir "modules"))))))
1751 (inputs `(("zlib" ,zlib)
1753 ("openssl" ,openssl)
1754 ("sdl-mixer" ,sdl-mixer)
1755 ("bennu-game-development" ,bennu-game-development)))
1756 (synopsis "Modules for the Bennu Game Development programming language")
1757 (description "This package contains a collection of modules for the Bennu
1758 Game Development programming language, from CD handling through SDL to
1759 joystick support.")))
1767 (uri (string-append "http://plib.sourceforge.net/dist/"
1768 "plib-" version ".tar.gz"))
1771 "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
1772 (patches (search-patches "plib-CVE-2011-4620.patch"
1773 "plib-CVE-2012-4552.patch"))))
1774 (build-system gnu-build-system)
1778 ("libxmu" ,libxmu)))
1780 `(("pkg-config" ,pkg-config)))
1781 (home-page "http://plib.sourceforge.net/")
1782 (synopsis "Suite of portable game libraries")
1783 (description "PLIB is a set of libraries that will permit programmers to
1784 write games and other realtime interactive applications that are 100% portable
1785 across a wide range of hardware and operating systems. PLIB includes sound
1786 effects, music, a complete 3D engine, font rendering, a simple Windowing
1787 library, a game scripting language, a GUI, networking, 3D math library and a
1788 collection of handy utility functions. All are 100% portable across nearly
1789 all modern computing platforms. Each library component is fairly independent
1791 (license license:lgpl2.0+)))
1793 (define-public ioquake3
1794 ;; We follow master since it seems that there won't be releases after 1.3.6.
1795 (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
1798 (version (git-version "1.3.6" "1" commit))
1803 (url "https://github.com/ioquake/ioq3.git")
1805 (file-name (git-file-name name version))
1808 "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
1809 (build-system gnu-build-system)
1812 ("libjpeg" ,libjpeg)
1815 ("opusfile" ,opusfile)
1817 ("libvorbis" ,libvorbis)
1818 ("freetype" ,freetype)
1819 ("libogg" ,libogg)))
1821 `(("which" ,which) ; Else SDL_version.h won't be found.
1822 ("pkg-config" ,pkg-config)))
1824 '(#:tests? #f ; No tests.
1825 #:make-flags '("CC=gcc"
1826 "USE_INTERNAL_LIBS=0"
1828 "USE_RENDERER_DLOPEN=0"
1829 "USE_OPENAL_DLOPEN=0"
1830 "USE_CURL_DLOPEN=0")
1832 (modify-phases %standard-phases
1835 (lambda* (#:key outputs #:allow-other-keys)
1836 (invoke "make" "copyfiles" "CC=gcc"
1837 "USE_INTERNAL_LIBS=0"
1838 (string-append "COPYDIR="
1839 (assoc-ref outputs "out")
1841 (home-page "https://ioquake3.org/")
1842 (synopsis "FPS game engine based on Quake 3")
1843 (description "ioquake3 is a free software first person shooter engine
1844 based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
1845 the original, ioquake3 has been cleaned up, bugs have been fixed and features
1846 added. The permanent goal is to create the open source Quake 3 distribution
1847 upon which people base their games, ports to new platforms, and other
1849 (license license:gpl2))))
1851 (define-public openvr
1855 (home-page "https://github.com/ValveSoftware/openvr/")
1861 (commit (string-append "v" version))))
1862 (file-name (git-file-name name version))
1864 (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
1865 (build-system cmake-build-system)
1869 #:configure-flags (list "-DBUILD_SHARED=1")))
1870 (synopsis "Virtual reality software development kit")
1871 (description "OpenVR is an API and runtime that allows access to VR
1872 hardware from multiple vendors without requiring that applications have
1873 specific knowledge of the hardware they are targeting.")
1874 (license license:bsd-3)))