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 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 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages game-development)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix svn-download)
40 #:use-module (guix utils)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system python)
44 #:use-module (guix build-system scons)
45 #:use-module (gnu packages)
46 #:use-module (gnu packages audio)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages boost)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages curl)
51 #:use-module (gnu packages documentation)
52 #:use-module (gnu packages fltk)
53 #:use-module (gnu packages fonts)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages freedesktop)
56 #:use-module (gnu packages fribidi)
57 #:use-module (gnu packages dbm)
58 #:use-module (gnu packages gl)
59 #:use-module (gnu packages glib)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages gnunet)
62 #:use-module (gnu packages graphics)
63 #:use-module (gnu packages graphviz)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages guile)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages linux)
68 #:use-module (gnu packages lua)
69 #:use-module (gnu packages m4)
70 #:use-module (gnu packages mp3)
71 #:use-module (gnu packages multiprecision)
72 #:use-module (gnu packages music)
73 #:use-module (gnu packages ncurses)
74 #:use-module (gnu packages pkg-config)
75 #:use-module (gnu packages pulseaudio)
76 #:use-module (gnu packages python)
77 #:use-module (gnu packages python-xyz)
78 #:use-module (gnu packages qt)
79 #:use-module (gnu packages sdl)
80 #:use-module (gnu packages stb)
81 #:use-module (gnu packages texinfo)
82 #:use-module (gnu packages tls)
83 #:use-module (gnu packages video)
84 #:use-module (gnu packages xdisorg)
85 #:use-module (gnu packages xiph)
86 #:use-module (gnu packages xml)
87 #:use-module (gnu packages xorg))
96 (url "https://github.com/bulletphysics/bullet3/")
98 (file-name (git-file-name name version))
101 "00qkif245yj7n2f262bgjaxv1bz3wmmcsfnjgy3qpzvlpzpns5z8"))
102 (modules '((guix build utils)))
105 (for-each delete-file (find-files "build3" "premake*"))
106 (with-directory-excursion "examples/ThirdPartyLibs"
107 (for-each delete-file-recursively
108 '("Gwen" "clsocket" "enet" "glad" "imgui"
109 "lua-5.2.3" "midi" "minizip" "openvr"
110 "optionalX11" "serial" "zlib")))
111 ;; These need files from ThirdPartyLibs
112 (substitute* "Extras/CMakeLists.txt"
113 (("BulletRobotics") "")
115 ;; Tests fail on linking, cannot find -lBussIK
116 (substitute* "test/CMakeLists.txt"
117 ((" InverseDynamics")
118 "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
119 ; (("SharedMemory") ""))
121 (build-system cmake-build-system)
123 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
124 "-DBUILD_CPU_DEMOS=OFF"
125 "-DBUILD_OPENGL3_DEMOS=OFF"
126 "-DBUILD_BULLET2_DEMOS=OFF"
127 (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
128 (or (getenv "CXXFLAGS") "")))
130 (modify-phases %standard-phases
131 (add-after 'unpack 'remove-failing-tests
132 ;; These tests fail specifically after removing 3rd party code
134 (substitute* "test/SharedMemory/CMakeLists.txt"
135 (("ADD_TEST") "# ADD_TEST"))
136 (substitute* "test/InverseDynamics/CMakeLists.txt"
137 (("ADD_TEST\\(Test_BulletInverseForward")
138 "# ADD_TEST(Test_BulletInverseForward"))
144 (home-page "https://pybullet.org/wordpress/")
145 (synopsis "3D physics engine library")
147 "Bullet is a physics engine library usable for collision detection. It
148 is used in some video games and movies.")
149 (license license:zlib)))
151 (define-public deutex
157 (uri (string-append "https://github.com/Doom-Utils/" name
158 "/releases/download/v" version "/"
159 name "-" version ".tar.xz"))
162 "1rj3w4xa0n4jixy4j7p6gbclylbgxvhdnji7xnkydrqii9rxnbp4"))))
163 (build-system gnu-build-system)
164 (native-inputs `(("asciidoc" ,asciidoc)))
165 (home-page "https://github.com/Doom-Utils/deutex")
166 (synopsis "WAD file composer for Doom and related games")
168 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
169 used to extract the lumps of a wad and save them as individual files.
170 Conversely, it can also build a wad from separate files. When extracting a
171 lump to a file, it does not just copy the raw data, it converts it to an
172 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
173 Conversely, when it reads files for inclusion in pwads, it does the necessary
174 conversions (for example, from PPM to Doom picture format). In addition,
175 DeuTex has functions such as merging wads, etc.")
176 (license license:gpl2+)))
178 (define-public grfcodec
184 (uri (string-append "http://binaries.openttd.org/extra/"
185 name "/" version "/" name "-" version
189 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
190 (build-system gnu-build-system)
192 '(#:tests? #f ; no check target
194 (modify-phases %standard-phases
195 (delete 'configure) ; no configure script
196 (replace 'install ; no install target
197 (lambda* (#:key outputs #:allow-other-keys)
198 (let* ((out (assoc-ref outputs "out"))
199 (bin (string-append out "/bin"))
200 (doc (string-append out "/share/doc"))
201 (man (string-append out "/share/man/man1")))
202 (for-each (lambda (file)
203 (install-file file bin))
204 '("grfcodec" "grfid" "grfstrip" "nforenum"))
205 (install-file "COPYING" doc)
206 (with-directory-excursion "docs"
207 (for-each (lambda (file)
208 (install-file (string-append file ".txt") doc))
209 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
210 "readme" "readme.rpn"))
211 (for-each (lambda (file)
212 (install-file file man))
213 (find-files "." "\\.1"))))
219 (synopsis "GRF development tools")
221 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
222 tools for developing (New)GRFs. It includes a number of smaller programs, each
223 with a specific task:
225 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
226 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
227 @item @code{grfstrip} strips all sprites from a GRF.
228 @item @code{nforenum} checks NFO code for errors, making corrections when
231 (home-page "http://dev.openttdcoop.org/projects/grfcodec")
232 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
233 ;; NFORenum is under the GPL2+.
234 ;; The MD5 implementation contained in GRFID is under the zlib license.
235 (license (list license:gpl2 license:gpl2+ license:zlib))))
237 (define-public catcodec
244 (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
245 version "/catcodec-" version "-source.tar.xz"))
248 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
249 (build-system gnu-build-system)
251 `(#:tests? #f ; no tests
252 #:make-flags (list (string-append "prefix=" %output))
253 #:phases (modify-phases %standard-phases
254 (delete 'configure))))
255 (home-page "http://dev.openttdcoop.org/projects/catcodec")
256 (synopsis "Encode/decode OpenTTD sounds")
257 (description "catcodec encodes and decodes sounds for OpenTTD. These
258 sounds are not much more than some metadata (description and filename) and raw
260 (license license:gpl2)))
262 (define-public gzochi
268 (uri (string-append "mirror://savannah/gzochi/gzochi-"
272 "0h8yvk7154kd8zdfa9nqy73blrjq2x19kv305jcnwlmm09vvss59"))))
273 (build-system gnu-build-system)
275 '(#:phases (modify-phases %standard-phases
276 (add-before 'build 'no-Werror
278 ;; Don't abort builds due to things like GLib
279 ;; deprecation warnings.
280 (substitute* (find-files "." "^Makefile\\.in$")
283 (native-inputs `(("pkgconfig" ,pkg-config)))
284 (inputs `(("bdb" ,bdb)
287 ("libmicrohttpd" ,libmicrohttpd)
291 (home-page "https://www.nongnu.org/gzochi/")
292 (synopsis "Scalable middleware for multiplayer games")
294 "gzochi is a framework for developing massively multiplayer online games.
295 A server container provides services to deployed games, which are written in
296 Guile Scheme, that abstract and simplify some of the most challenging and
297 error-prone aspects of online game development: Concurrency, data persistence,
298 and network communications. A very thin client library can be embedded to
299 provide connectivity for client applications written in any language.")
300 (license license:gpl3+)))
309 (uri (string-append "http://bundles.openttdcoop.org/nml/releases/"
310 version "/nml-" version ".tar.gz"))
313 "1pmvvm3sgnpngfa7884mqhq3fwdjh9sr0ca07ypnidcg0y341w53"))))
314 (build-system python-build-system)
316 `(("python-pillow" ,python-pillow)
317 ("python-ply" ,python-ply)))
318 (home-page "https://dev.openttdcoop.org/projects/nml")
319 (synopsis "NML compiler")
321 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
322 compiling NML files (along with their associated language, sound and graphic
323 files) into @file{.grf} and/or @file{.nfo} files.")
324 (license license:gpl2+)))
326 (define-public python-sge-pygame
328 (name "python-sge-pygame")
333 (uri (string-append "mirror://savannah/stellarengine/"
334 (version-major+minor version) "/sge-pygame-"
336 (file-name (string-append name "-" version ".tar.gz"))
339 "1rl3xjzh78sl0sq3xl8rl7cgp9v9v3h7s2pfwn7nj1vrmffzkcpd"))))
340 (build-system python-build-system)
342 `(("python-pygame" ,python-pygame)
343 ("python-six" ,python-six)
344 ("python-uniseg" ,python-uniseg)))
345 (home-page "http://stellarengine.nongnu.org")
346 (synopsis "2D game engine for Python")
348 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
349 general-purpose 2D game engine. It takes care of several details for you so
350 you can focus on the game itself. This makes more rapid game development
351 possible, and it also makes the SGE easy to learn.")
352 (license license:lgpl3+)))
354 (define-public python2-sge-pygame
355 (package-with-python2 python-sge-pygame))
357 (define-public python-tmx
364 (uri (string-append "mirror://savannah/python-tmx/"
365 (version-major+minor version) "/tmx-"
369 "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
370 (build-system python-build-system)
372 `(("python-six" ,python-six)))
373 (home-page "http://python-tmx.nongnu.org")
374 (synopsis "Python library for the @code{Tiled} TMX format")
376 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
377 This is useful for map editors or generic level editors, and it's also useful
378 for using a map editor or generic level editor like Tiled to edit your game's
380 (license (list license:asl2.0
381 ;; Documentation (only available in the source tarball) is
382 ;; under the CC0 license.
385 (define-public python2-tmx
386 (let ((python2-tmx (package-with-python2 python-tmx)))
388 (inherit python2-tmx)
390 `(("python2-pathlib" ,python2-pathlib)
391 ,@(package-propagated-inputs python2-tmx))))))
393 (define-public python-xsge
396 (version "2018.02.26")
399 (uri (string-append "mirror://savannah/xsge/xsge/xsge-"
403 "0bx93hgf7cgdw2gsygbh59y8vpw37pgsa279rajw3fkdpl8vrc40"))))
404 (build-system python-build-system)
407 (modify-phases %standard-phases
408 ;; xSGE's setup.py script does not support one of the Python build
409 ;; system's default flags, "--single-version-externally-managed".
411 (lambda* (#:key outputs #:allow-other-keys)
412 (invoke "python" "setup.py" "install"
413 (string-append "--prefix=" (assoc-ref outputs "out"))
415 #:tests? #f)) ; no check target
417 `(("python-sge-pygame" ,python-sge-pygame)
418 ("python-pygame" ,python-pygame)
419 ("python-six" ,python-six)
420 ("python-tmx" ,python-tmx)))
421 (home-page "http://xsge.nongnu.org")
422 (synopsis "Extensions for the SGE Game Engine")
424 "xSGE is a collection of modules that make doing certain tasks with the SGE
425 Game Engine easier. In addition to SGE's conveniences, the user has access to a
426 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
428 (license license:gpl3+)))
430 (define-public python2-xsge
431 (package-with-python2 python-xsge))
440 (url "https://github.com/bjorn/tiled.git")
441 (commit (string-append "v" version))))
442 (file-name (git-file-name name version))
445 "1nfyigfkl10n9r82p1qxhpr09jn2kwalh9n5r209bcaj8dxspph8"))))
446 (build-system gnu-build-system)
452 `(("qttools" ,qttools)))
455 (modify-phases %standard-phases
457 (lambda* (#:key inputs outputs #:allow-other-keys)
458 (substitute* "translations/translations.pro"
460 (string-append "LRELEASE = "
461 (assoc-ref inputs "qttools")
463 (let ((out (assoc-ref outputs "out")))
465 (string-append "PREFIX=" out))))))))
466 (home-page "http://www.mapeditor.org/")
467 (synopsis "Tile map editor")
469 "Tiled is a general purpose tile map editor. It is meant to be used for
470 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
473 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
475 (license license:gpl2+)))
483 ;; Do not fetch the archives from
484 ;; http://mirror0.sfml-dev.org/files/ because files there seem
485 ;; to be changed in place.
487 (url "https://github.com/SFML/SFML.git")
489 (file-name (git-file-name name version))
492 "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
493 (modules '((guix build utils)))
496 ;; Ensure system libraries are used.
497 (delete-file-recursively "extlibs")
499 (build-system cmake-build-system)
502 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
503 "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
504 #:tests? #f)) ; no tests
506 `(("pkg-config" ,pkg-config)))
511 ("xcb-util-image" ,xcb-util-image)
512 ("libxrandr" ,libxrandr)
515 ("libsndfile" ,libsndfile)
516 ("stb-image" ,stb-image)
517 ("stb-image-write" ,stb-image-write)))
519 ;; In Requires.private of pkg-config files.
521 ("freetype" ,freetype)
522 ("libvorbis" ,libvorbis)
524 (home-page "https://www.sfml-dev.org")
525 (synopsis "Simple and Fast Multimedia Library")
527 "SFML provides a simple interface to the various computer components,
528 to ease the development of games and multimedia applications. It is composed
529 of five modules: system, window, graphics, audio and network.")
530 (license license:zlib)))
538 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
541 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
542 (build-system gnu-build-system)
544 `(#:phases (modify-phases %standard-phases
545 (delete 'configure) ; no configure script
546 (add-before 'build 'patch-makefile
547 (lambda* (#:key outputs #:allow-other-keys)
548 (let ((out (assoc-ref outputs "out")))
549 (substitute* "Makefile"
550 (("\\$\\(DESTDIR\\)/usr") out))
551 (substitute* "main.cpp"
553 (string-append out "/share")))
555 #:tests? #f)) ; no tests
557 `(("pkg-config" ,pkg-config)
558 ("desktop-file-utils" ,desktop-file-utils)))
562 (synopsis "Simple sound effect generator")
563 (description "Sfxr is a tool for quickly generating simple sound effects.
564 Originally created for use in video game prototypes, it can generate random
565 sounds from presets such as \"explosion\" or \"powerup\".")
566 (home-page "http://www.drpetter.se/project_sfxr.html")
567 (license license:expat)))
569 (define-public physfs
576 "https://icculus.org/physfs/downloads/physfs-"
578 (file-name (string-append name "-" version ".tar.gz"))
581 "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
582 (build-system cmake-build-system)
584 '(#:tests? #f ; no check target
585 #:phases (modify-phases %standard-phases
586 (add-after 'unpack 'patch-CMakeLists.txt
588 (substitute* "CMakeLists.txt"
589 ;; XXX: For some reason CMakeLists.txt disables
590 ;; RUNPATH manipulation when the compiler is GCC.
591 (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
596 `(("doxygen" ,doxygen)))
597 (home-page "https://icculus.org/physfs")
598 (synopsis "File system abstraction library")
600 "PhysicsFS is a library to provide abstract access to various archives.
601 It is intended for use in video games. For security, no file writing done
602 through the PhysicsFS API can leave a defined @emph{write directory}. For
603 file reading, a @emph{search path} with archives and directories is defined,
604 and it becomes a single, transparent hierarchical file system. So archive
605 files can be accessed in the same way as you access files directly on a disk,
606 and it makes it easy to ship a new archive that will override a previous
607 archive on a per-file basis.")
608 (license license:zlib)))
616 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
617 "love-" version "-linux-src.tar.gz"))
620 "1pkwiszmjs0xrwk0wqbc5cp9108b1y8gwsid0gqk1s0x09q9lpmw"))))
621 (build-system gnu-build-system)
623 `(("pkg-config" ,pkg-config)))
626 ("freetype" ,freetype)
627 ("libmodplug" ,libmodplug)
628 ("libtheora" ,libtheora)
629 ("libvorbis" ,libvorbis)
637 (synopsis "2D game framework for Lua")
638 (description "LÖVE is a framework for making 2D games in the Lua
639 programming language.")
640 (home-page "https://love2d.org/")
641 (license license:zlib)))
643 (define-public allegro-4
649 (uri (string-append "https://github.com/liballeg/allegro5/"
650 "releases/download/" version "/allegro-"
654 "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
655 (build-system cmake-build-system)
658 (modify-phases %standard-phases
659 (add-after 'unpack 'patch-build-system
661 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
662 ;; via a command line option doesn't work because it is
663 ;; unconditionally clobbered in the build script.
664 (substitute* '("CMakeLists.txt")
665 (("ADDON_LINKAGE STATIC")
666 "ADDON_LINKAGE SHARED"))
671 ("libvorbis" ,libvorbis)
674 (synopsis "Game programming library")
675 (description "Allegro is a library mainly aimed at video game and
676 multimedia programming. It handles common, low-level tasks such as creating
677 windows, accepting user input, loading data, drawing images, playing sounds,
679 (home-page "http://liballeg.org")
680 (license license:giftware)))
682 (define-public allegro
688 (uri (string-append "https://github.com/liballeg/allegro5/releases"
689 "/download/" version "/allegro-"
691 (patches (search-patches
692 "allegro-mesa-18.2.5-and-later.patch"))
695 "1w9a5yqi5q03b2qvmx5ff90paz0xbr9cy7i7f0xiqa65ava66q9l"))))
696 (build-system cmake-build-system)
697 (arguments `(#:tests? #f)) ; there are no tests
699 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
701 ("freetype" ,freetype)
706 ("libtheora" ,libtheora)
707 ("libvorbis" ,libvorbis)
708 ("libxcursor" ,libxcursor)
709 ("libxinerama" ,libxinerama)
710 ("libxrandr" ,libxrandr)
716 `(("pkg-config" ,pkg-config)))
717 (synopsis "Game programming library")
718 (description "Allegro is a library mainly aimed at video game and
719 multimedia programming. It handles common, low-level tasks such as creating
720 windows, accepting user input, loading data, drawing images, playing sounds,
722 (home-page "http://liballeg.org")
723 (license license:bsd-3)))
725 (define-public allegro-5.0
726 (package (inherit allegro)
731 (uri (string-append "https://github.com/liballeg/allegro5/releases"
732 "/download/" version "/allegro-"
733 (if (equal? "0" (string-take-right version 1))
734 (string-drop-right version 2)
737 (patches (search-patches
738 "allegro-mesa-18.2.5-and-later.patch"))
741 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
743 (define-public aseprite
746 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
747 ;; TODO: Unbundle third party software.
749 (method url-fetch/zipbomb)
750 (uri (string-append "https://github.com/aseprite/aseprite"
751 "/releases/download/v" version
752 "/Aseprite-v" version "-Source.zip"))
755 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
756 (build-system cmake-build-system)
759 ;; Use shared libraries instead of building bundled source.
760 (list "-DWITH_WEBP_SUPPORT=1"
761 "-DUSE_SHARED_CURL=1"
762 "-DUSE_SHARED_GIFLIB=1"
763 "-DUSE_SHARED_JPEGLIB=1"
764 "-DUSE_SHARED_ZLIB=1"
765 "-DUSE_SHARED_LIBPNG=1"
766 "-DUSE_SHARED_LIBLOADPNG=1"
767 "-DUSE_SHARED_LIBWEBP=1"
768 "-DUSE_SHARED_TINYXML=1"
769 "-DUSE_SHARED_PIXMAN=1"
770 "-DUSE_SHARED_FREETYPE=1"
771 "-DUSE_SHARED_ALLEGRO4=1"
772 "-DENABLE_UPDATER=0" ; no auto-updates
773 (string-append "-DFREETYPE_INCLUDE_DIR="
774 (assoc-ref %build-inputs "freetype")
775 "/include/freetype2"))))
777 `(("pkg-config" ,pkg-config)))
778 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
779 ;; patched version is bundled with Aseprite, but the patches should be
780 ;; extracted and applied on top of a standalone Allegro 4 package.
782 `(("allegro" ,allegro-4)
784 ("freetype" ,freetype)
791 ("libxxf86vm" ,libxxf86vm)
795 (synopsis "Animated sprite editor and pixel art tool")
796 (description "Aseprite is a tool for creating 2D pixel art for video
797 games. In addition to basic pixel editing features, Aseprite can assist in
798 the creation of animations, tiled graphics, texture atlases, and more.")
799 (home-page "https://www.aseprite.org/")
800 (license license:gpl2+)))
802 (define-public qqwing
809 "https://qqwing.com/"
810 name "-" version ".tar.gz"))
813 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
814 (build-system gnu-build-system)
816 `(("pkg-config" ,pkg-config)))
817 (home-page "https://qqwing.com/")
818 (synopsis "Sudoku puzzle solver and generator")
820 "QQWing is a Sudoku puzzle generator and solver.
821 It offers the following features:
823 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
824 @item Uses logic. Uses as many solve techniques as possible when solving
825 puzzles rather than guessing.
826 @item Rates puzzles. Most generators don't give an indication of the difficulty
827 of a Sudoku puzzle. QQwing does.
828 @item Can print solve instructions for any puzzle.
829 @item Customizable output style, including a CSV style that is easy to
830 import into a database.
832 (license license:gpl2+)))
834 (define-public quesoglc
840 (uri (string-append "mirror://sourceforge/" name "/" version "/"
841 name "-" version "-free.tar.bz2"))
844 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
845 (build-system gnu-build-system)
846 (native-inputs `(("pkg-config" ,pkg-config)))
847 (inputs `(("fontconfig" ,fontconfig)
848 ("freeglute" ,freeglut)
851 (home-page "http://quesoglc.sourceforge.net")
852 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
854 "The OpenGL Character Renderer (GLC) is a state machine that provides
855 OpenGL programs with character rendering services via an application programming
857 (license (list license:expat license:lgpl2.1+))))
859 (define-public python-pygame
861 (name "python-pygame")
865 (uri (pypi-uri "pygame" version))
868 "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
869 (build-system python-build-system)
871 `(#:tests? #f ; tests require pygame to be installed first
873 (modify-phases %standard-phases
874 ;; Set the paths to the dependencies manually because
875 ;; the configure script does not allow passing them as
876 ;; parameters. This also means we can skip the configure
878 (add-before 'build 'set-library-paths
879 (lambda* (#:key inputs outputs #:allow-other-keys)
880 (let ((sdl-ref (assoc-ref inputs "sdl"))
881 (font-ref (assoc-ref inputs "sdl-ttf"))
882 (image-ref (assoc-ref inputs "sdl-image"))
883 (mixer-ref (assoc-ref inputs "sdl-mixer"))
884 (smpeg-ref (assoc-ref inputs "libsmpeg"))
885 (png-ref (assoc-ref inputs "libpng"))
886 (jpeg-ref (assoc-ref inputs "libjpeg"))
887 (freetype-ref (assoc-ref inputs "freetype"))
888 (v4l-ref (assoc-ref inputs "v4l-utils"))
889 (out-ref (assoc-ref outputs "out")))
890 (substitute* "Setup.in"
891 (("SDL = -I/usr/include/SDL")
892 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
893 (substitute* "Setup.in"
894 (("FONT = -lSDL_ttf")
895 (string-append "FONT = -I" font-ref "/include/SDL -L"
896 font-ref "/lib -lSDL_ttf")))
897 (substitute* "Setup.in"
898 (("IMAGE = -lSDL_image")
899 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
900 image-ref "/lib -lSDL_image")))
901 (substitute* "Setup.in"
902 (("MIXER = -lSDL_mixer")
903 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
904 mixer-ref "/lib -lSDL_mixer")))
905 (substitute* "Setup.in"
907 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
908 smpeg-ref "/lib -lsmpeg")))
909 (substitute* "Setup.in"
911 (string-append "PNG = -I" png-ref "/include -L"
912 png-ref "/lib -lpng")))
913 (substitute* "Setup.in"
915 (string-append "JPEG = -I" jpeg-ref "/include -L"
916 jpeg-ref "/lib -ljpeg")))
918 (substitute* "Setup.in"
919 (("FREETYPE = -lfreetype")
920 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
921 freetype-ref "/lib -lfreetype")))
923 (substitute* "Setup.in"
925 ;; Create a path to a header file provided by v4l-utils.
926 (system* "mkdir" "linux")
927 (system* "ln" "--symbolic"
928 (string-append v4l-ref "/include/libv4l1-videodev.h")
930 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
932 `(("freetype" ,freetype)
934 ("sdl-image" ,sdl-image)
935 ("sdl-mixer" ,sdl-mixer)
941 ("libsmpeg" ,libsmpeg)
942 ("portmidi" ,portmidi)
943 ("v4l-utils" ,v4l-utils)))
944 (home-page "https://www.pygame.org")
945 (synopsis "SDL wrapper for Python")
946 (description "Pygame is a set of Python modules designed for writing games.
947 Pygame adds functionality on top of the excellent SDL library. This allows you
948 to create fully featured games and multimedia programs in the python language.")
949 (license (list license:bsd-2
950 ;; python numeric license as listed by Debian looks like
951 ;; an Expat-style license with a warranty disclaimer for
952 ;; the U.S. government and the University of California.
958 license:public-domain
961 (define-public python2-pygame
962 (package-with-python2 python-pygame))
964 (define-public grafx2
970 ;; XXX: There is no URL that contains the version. :(
971 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
974 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
975 (build-system gnu-build-system)
978 (modify-phases %standard-phases
979 (delete 'configure) ; no configure script
980 (add-before 'build 'change-to-src-directory
985 ;; SDL header files are referenced without the preceeding "SDL/".
986 (list (string-append "CFLAGS=-I"
987 (assoc-ref %build-inputs "sdl-union")
989 (string-append "prefix="
990 (assoc-ref %outputs "out")))
991 #:tests? #f)) ; no check target
993 `(("pkg-config" ,pkg-config)))
997 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
998 (synopsis "Bitmap paint program")
999 (description "GrafX2 is a bitmap paint program inspired by the Amiga
1000 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
1001 includes a very large number of tools and effects that make it particularly
1002 suitable for pixel art, game graphics, and generally any detailed graphics
1003 painted with a mouse.")
1004 (home-page "http://pulkomandy.tk/projects/GrafX2")
1005 (license license:gpl2))) ; GPLv2 only
1015 (url "https://github.com/wgois/OIS.git")
1016 (commit (string-append "v" version))))
1017 (file-name (git-file-name name version))
1019 (base32 "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa"))))
1020 (build-system cmake-build-system)
1022 `(#:tests? #f)) ; no test suite
1024 `(("libx11" ,libx11)))
1025 (synopsis "Object Oriented Input System")
1027 "Cross Platform Object Oriented Input Lib System is a cross platform,
1028 simple solution for using all kinds of Input Devices (Keyboards, Mice,
1029 Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
1030 robust and compatible with many systems and operating systems.")
1031 (home-page "https://github.com/wgois/OIS")
1032 (license license:zlib)))
1034 (define-public mygui
1042 (string-append "https://github.com/MyGUI/" name
1043 "/archive/MyGUI" version ".tar.gz"))
1046 "13x7cydmj7gjmsg702sqjbfi53z265iv6j7binv3r6a7ibndfa0a"))))
1047 (build-system cmake-build-system)
1049 '(#:tests? #f ; No test target
1051 (list "-DMYGUI_INSTALL_DOCS=TRUE"
1052 (string-append "-DOGRE_INCLUDE_DIR="
1053 (assoc-ref %build-inputs "ogre")
1057 ("doxygen" ,doxygen)
1058 ("pkg-config" ,pkg-config)))
1060 `(("font-dejavu" ,font-dejavu)
1061 ("freetype" ,freetype)
1062 ("graphviz" ,graphviz)
1066 (synopsis "Fast, flexible and simple GUI")
1068 "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
1069 and 3D applications. The main goals of mygui are: speed, flexibility and ease
1071 (home-page "http://mygui.info/")
1072 (license license:expat)))
1074 (define-public openmw
1082 (string-append "https://github.com/OpenMW/openmw/archive/"
1083 name "-" version ".tar.gz"))
1086 "03fgm2f2r7y0aqlgp038pdlnllgvm3jimrp968p4nhz1sffvjzcy"))))
1087 (build-system cmake-build-system)
1089 `(#:tests? #f ; No test target
1091 (list "-DDESIRED_QT_VERSION=5")))
1094 ("doxygen" ,doxygen)
1095 ("pkg-config" ,pkg-config)))
1097 `(("bullet" ,bullet)
1102 ("openscenegraph" ,openscenegraph)
1105 ("unshield" ,unshield)))
1106 (synopsis "Re-implementation of the RPG Morrowind engine")
1108 "OpenMW is a game engine which reimplements and extends the one that runs
1109 the 2002 open-world RPG Morrowind. The engine comes with its own editor,
1110 called OpenMW-CS which allows the user to edit or create their own original
1112 (home-page "https://openmw.org")
1113 (license license:gpl3)))
1115 (define-public godot
1122 (url "https://github.com/godotengine/godot")
1123 (commit (string-append version "-stable"))))
1124 (file-name (git-file-name name version))
1127 "0g64h0x8dlv6aa9ggfcidk2mknkfl5li7z1phcav8aqp9srj8avf"))
1128 (modules '((guix build utils)))
1131 ;; Drop libraries that we take from Guix. Note that some
1132 ;; of these may be modified; see "thirdparty/README.md".
1133 (with-directory-excursion "thirdparty"
1134 (for-each delete-file-recursively
1146 (build-system scons-build-system)
1148 `(#:scons ,scons-python2
1149 #:scons-flags (list "platform=x11"
1150 ,@(if (string-prefix? "aarch64" (or (%current-target-system)
1152 `("CCFLAGS=-DNO_THREADS")
1154 ;; Avoid using many of the bundled libs.
1155 ;; Note: These options can be found in the SConstruct file.
1156 "builtin_freetype=no"
1158 "builtin_libmpdec=no"
1161 "builtin_libtheora=no"
1162 "builtin_libvorbis=no"
1164 "builtin_libwebp=no"
1165 "builtin_openssl=no"
1168 #:tests? #f ; There are no tests
1170 (modify-phases %standard-phases
1171 (add-after 'unpack 'scons-use-env
1173 ;; Scons does not use the environment variables by default,
1174 ;; but this substitution makes it do so.
1175 (substitute* "SConstruct"
1176 (("env_base = Environment\\(tools=custom_tools\\)")
1178 "env_base = Environment(tools=custom_tools)\n"
1179 "env_base = Environment(ENV=os.environ)")))
1182 (lambda* (#:key outputs #:allow-other-keys)
1183 (let* ((out (assoc-ref outputs "out"))
1184 (bin (string-append out "/bin")))
1185 (with-directory-excursion "bin"
1186 (if (file-exists? "godot.x11.tools.64")
1187 (rename-file "godot.x11.tools.64" "godot")
1188 (rename-file "godot.x11.tools.32" "godot"))
1189 (install-file "godot" bin))
1191 (add-after 'install 'install-godot-desktop
1192 (lambda* (#:key outputs #:allow-other-keys)
1193 (let* ((out (assoc-ref outputs "out"))
1194 (desktop (string-append out "/share/applications"))
1195 (icon-dir (string-append out "/share/pixmaps")))
1196 (rename-file "icon.png" "godot.png")
1197 (install-file "godot.png" icon-dir)
1199 (with-output-to-file
1200 (string-append desktop "/godot.desktop")
1205 Comment=The godot game engine~@
1207 TryExec=~@*~a/bin/godot~@
1212 (native-inputs `(("pkg-config" ,pkg-config)))
1213 (inputs `(("alsa-lib" ,alsa-lib)
1214 ("freetype" ,freetype)
1217 ("libtheora" ,libtheora)
1218 ("libvorbis" ,libvorbis)
1220 ("libwebp" ,libwebp)
1222 ("libxcursor" ,libxcursor)
1224 ("libxinerama" ,libxinerama)
1225 ("libxrandr" ,libxrandr)
1227 ("openssl" ,openssl)
1228 ("opusfile" ,opusfile)
1229 ("pulseaudio" ,pulseaudio)))
1230 (home-page "https://godotengine.org/")
1231 (synopsis "Advanced 2D and 3D game engine")
1233 "Godot is an advanced multi-platform game engine written in C++. If
1234 features design tools such as a visual editor, can import 3D models and
1235 provide high-quality 3D rendering, it contains an animation editor, and can be
1236 scripted in a Python-like language.")
1237 (license license:expat)))
1239 (define-public eureka
1245 (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
1247 ;; version without dots e.g 1.21 => 121
1248 (string-join (string-split version #\.) "")
1252 "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
1253 (build-system gnu-build-system)
1257 (let ((out (assoc-ref %outputs "out")))
1258 (list (string-append "PREFIX=" out)))
1260 (modify-phases %standard-phases
1262 (add-before 'build 'prepare-install-directories
1263 (lambda* (#:key outputs #:allow-other-keys)
1264 (let ((out (assoc-ref outputs "out")))
1265 (mkdir-p (string-append out "/bin"))
1266 (mkdir-p (string-append out "/share"))
1268 (with-fluids ((%default-port-encoding #f))
1269 (substitute* "./src/main.cc"
1270 (("/usr/local") out)))
1272 (substitute* "Makefile"
1273 (("-o root") ""))))))))
1274 (inputs `(("mesa" ,mesa)
1276 ("libxinerama" ,libxinerama)
1277 ("libfontconfig" ,fontconfig)
1278 ("libjpeg" ,libjpeg)
1282 (native-inputs `(("pkg-config" ,pkg-config)
1283 ("xdg-utils" ,xdg-utils)))
1284 (synopsis "Doom map editor")
1285 (description "Eureka is a map editor for the classic DOOM games, and a few
1286 related games such as Heretic and Hexen. It comes with a 3d preview mode and
1288 (home-page "http://eureka-editor.sourceforge.net/")
1289 (license license:gpl2+)))
1291 (define-public guile-chickadee
1293 (name "guile-chickadee")
1297 (uri (string-append "https://files.dthompson.us/chickadee/"
1298 "chickadee-" version ".tar.gz"))
1301 "0jl223dybsj5gvs7z4q60gnafj1b7kgi5mx0kj58m5knrp8qwg5h"))))
1302 (build-system gnu-build-system)
1304 '(#:make-flags '("GUILE_AUTO_COMPILE=0")
1306 (modify-phases %standard-phases
1307 (add-before 'configure 'patch-godir
1309 ;; Install compiled '.go' files into the site directory.
1310 (substitute* "Makefile.in"
1311 (("/ccache") "/site-ccache")))))))
1313 `(("guile-opengl" ,guile-opengl)
1314 ("guile-sdl2" ,guile-sdl2)))
1316 `(("guile" ,guile-2.2)))
1318 `(("pkg-config" ,pkg-config)
1319 ("texinfo" ,texinfo)))
1320 (home-page "https://dthompson.us/projects/chickadee.html")
1321 (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
1322 (description "Chickadee is a game development toolkit for Guile Scheme
1323 built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
1324 that parenthetically inclined game developers need to make 2D (and eventually
1325 3D) games in Scheme, such as:
1328 @item extensible, fixed-timestep game loop
1329 @item OpenGL-based rendering engine
1330 @item keyboard, mouse, controller input
1331 @item REPL-driven development model
1333 (license license:gpl3+)))
1335 (define-public bennu-game-development
1337 (name "bennu-game-development")
1342 (url "http://svn.code.sf.net/p/bennugd/code")
1343 (revision (string->number version))))
1344 (file-name (string-append name "-" version))
1347 "0wpzsbh4zi3931493dnyl5ffmh1b7fj2sx3mzrq304z9zs4d6lqq"))
1348 (modules '((guix build utils)))
1351 (delete-file-recursively "3rdparty") #t))))
1352 (build-system gnu-build-system)
1355 (modify-phases %standard-phases
1356 (add-after 'unpack 'patch-configure-to-use-openssl
1357 (lambda* (#:key outputs #:allow-other-keys)
1359 (delete-file "configure")
1360 (substitute* "configure.in"
1363 COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
1364 COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
1371 (inputs `(("openssl" ,openssl)
1373 (native-inputs `(("pkg-config" ,pkg-config)
1374 ("autoconf" ,autoconf)
1375 ("automake" ,automake)
1376 ("libtool" ,libtool)))
1377 (synopsis "Programming language to create games")
1378 (description "Bennu Game Development, also known as bennudg, is a
1379 programming language tailored at game development. It is the successor of
1381 (home-page "https://sourceforge.net/projects/bennugd/")
1382 (license license:zlib)))
1384 (define-public bennu-game-development-modules
1386 (inherit bennu-game-development)
1387 (name "bennu-game-development-modules")
1390 (modify-phases %standard-phases
1391 (add-after 'unpack 'patch-conflicting-definitions
1393 (with-fluids ((%default-port-encoding #f))
1394 (substitute* "core/include/fmath.h"
1395 (("extern fixed fmul\\( int x, int y \\);") "")
1396 (("extern fixed fdiv\\( int x, int y \\);") "")))
1397 (chdir "modules"))))))
1398 (inputs `(("zlib" ,zlib)
1400 ("openssl" ,openssl)
1401 ("sdl-mixer" ,sdl-mixer)
1402 ("bennu-game-development" ,bennu-game-development)))
1403 (synopsis "Modules for the Bennu Game Developement programming language")
1404 (description "This package contains a collection of modules for the Bennu
1405 Game Developement programming language, from CD handling through SDL to
1406 joystick support.")))