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 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
7 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
9 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2016 Julian Graham <joolean@gmail.com>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages game-development)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system python)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages curl)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages documentation)
39 #:use-module (gnu packages fontutils)
40 #:use-module (gnu packages fribidi)
41 #:use-module (gnu packages glib)
42 #:use-module (gnu packages gnunet)
43 #:use-module (gnu packages guile)
44 #:use-module (gnu packages multiprecision)
45 #:use-module (gnu packages music)
46 #:use-module (gnu packages ncurses)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages qt)
49 #:use-module (gnu packages video)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages zip)
52 #:use-module (gnu packages gl)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages xorg)
55 #:use-module (gnu packages xdisorg)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages image)
58 #:use-module (gnu packages audio)
59 #:use-module (gnu packages pulseaudio)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages sdl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages xiph)
65 #:use-module (gnu packages lua)
66 #:use-module (gnu packages mp3)
67 #:use-module (gnu packages xml))
75 (uri (string-append "https://github.com/bulletphysics/bullet3/"
76 "archive/" version ".tar.gz"))
77 (file-name (string-append name "-" version ".tar.gz"))
80 "0qpd37ws0xlxwy55dg058a5b4yw2jxiz09yyc3lc0frpa05pq5bf"))))
81 (build-system cmake-build-system)
83 '(#:configure-flags (list (string-append
84 "-DBUILD_SHARED_LIBS=ON "
85 "-DCMAKE_CXX_FLAGS=-fPIC "
86 (or (getenv "CXXFLAGS") "")))))
91 (home-page "http://bulletphysics.org/")
92 (synopsis "3D physics engine library")
94 "Bullet is a physics engine library usable for collision detection. It
95 is used in some video games and movies.")
96 (license license:zlib)))
104 (uri (string-append "mirror://savannah/gzochi/gzochi-"
108 "166rawdal45kvanhvi0bkzy1d2pwf1p0lzslb287lcnm9vdw97yy"))))
109 (build-system gnu-build-system)
111 '(#:phases (modify-phases %standard-phases
112 (add-before 'configure 'remove-Werror
114 ;; We can't build with '-Werror', notably
115 ;; because deprecated functions of
116 ;; libmicrohttpd are being used.
117 (substitute* (find-files "." "^Makefile\\.in$")
121 (native-inputs `(("pkgconfig" ,pkg-config)))
122 (inputs `(("bdb" ,bdb)
125 ("libmicrohttpd" ,libmicrohttpd)
129 (home-page "http://www.nongnu.org/gzochi/")
130 (synopsis "Scalable middleware for multiplayer games")
132 "gzochi is a framework for developing massively multiplayer online games.
133 A server container provides services to deployed games, which are written in
134 Guile Scheme, that abstract and simplify some of the most challenging and
135 error-prone aspects of online game development: Concurrency, data persistence,
136 and network communications. A very thin client library can be embedded to
137 provide connectivity for client applications written in any language.")
138 (license license:gpl3+)))
146 (uri (string-append "https://github.com/bjorn/tiled/archive/v"
148 (file-name (string-append name "-" version ".tar.gz"))
151 "0csrwf7k3fxv6bv580w6wxjk1q2j9mj9k0xba3nb1ms6jiz1bvzk"))))
152 (build-system gnu-build-system)
157 (modify-phases %standard-phases
159 (lambda* (#:key outputs #:allow-other-keys)
160 (let ((out (assoc-ref outputs "out")))
162 (string-append "PREFIX=" out))))))))
163 (home-page "http://www.mapeditor.org/")
164 (synopsis "Tile map editor")
166 "Tiled is a general purpose tile map editor. It is meant to be used for
167 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
170 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
172 (license license:gpl2+)))
180 ;; Do not fetch the archives from
181 ;; http://mirror0.sfml-dev.org/files/ because files there seem
182 ;; to be changed in place.
183 (uri (string-append "https://github.com/SFML/SFML/archive/"
185 (file-name (string-append name "-" version ".tar.gz"))
188 "0k2fl5xk3ni2q8bsxl0551inx26ww3w6cp6hssvww0wfjdjcirsm"))))
189 (build-system cmake-build-system)
192 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE")
193 #:tests? #f)) ; no tests
198 ("libvorbis" ,libvorbis)
200 ("xcb-util-image" ,xcb-util-image)
201 ("libxrandr" ,libxrandr)
203 ("freetype" ,freetype)
205 ("libsndfile" ,libsndfile)
207 (home-page "http://www.sfml-dev.org")
208 (synopsis "Simple and Fast Multimedia Library")
210 "SFML provides a simple interface to the various computer components,
211 to ease the development of games and multimedia applications. It is composed
212 of five modules: system, window, graphics, audio and network.")
213 (license license:zlib)))
221 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
224 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
225 (build-system gnu-build-system)
227 `(#:phases (modify-phases %standard-phases
228 (delete 'configure) ; no configure script
229 (add-before 'build 'patch-makefile
230 (lambda* (#:key outputs #:allow-other-keys)
231 (let ((out (assoc-ref outputs "out")))
232 (substitute* "Makefile"
233 (("\\$\\(DESTDIR\\)/usr") out))
234 (substitute* "main.cpp"
236 (string-append out "/share")))
238 #:tests? #f)) ; no tests
240 `(("pkg-config" ,pkg-config)
241 ("desktop-file-utils" ,desktop-file-utils)))
245 (synopsis "Simple sound effect generator")
246 (description "Sfxr is a tool for quickly generating simple sound effects.
247 Originally created for use in video game prototypes, it can generate random
248 sounds from presets such as \"explosion\" or \"powerup\".")
249 (home-page "http://www.drpetter.se/project_sfxr.html")
250 (license license:expat)))
252 (define-public physfs
259 "http://icculus.org/physfs/downloads/physfs-"
261 (file-name (string-append name "-" version ".tar.gz"))
264 "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na"))))
265 (build-system cmake-build-system)
267 '(#:tests? #f)) ; no check target
271 `(("doxygen" ,doxygen)))
272 (home-page "http://icculus.org/physfs")
273 (synopsis "File system abstraction library")
275 "PhysicsFS is a library to provide abstract access to various archives.
276 It is intended for use in video games. For security, no file writing done
277 through the PhysicsFS API can leave a defined @emph{write directory}. For
278 file reading, a @emph{search path} with archives and directories is defined,
279 and it becomes a single, transparent hierarchical file system. So archive
280 files can be accessed in the same way as you access files directly on a disk,
281 and it makes it easy to ship a new archive that will override a previous
282 archive on a per-file basis.")
283 (license license:zlib)))
291 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
292 "love-" version "-linux-src.tar.gz"))
295 "11x346pw0gqad8nmkmywzx4xpcbfc3dslbrdw5x94n1i25mk0sxj"))))
296 (build-system gnu-build-system)
298 `(("pkg-config" ,pkg-config)))
301 ("freetype" ,freetype)
302 ("libmodplug" ,libmodplug)
303 ("libtheora" ,libtheora)
304 ("libvorbis" ,libvorbis)
312 (synopsis "2D game framework for Lua")
313 (description "LÖVE is a framework for making 2D games in the Lua
314 programming language.")
315 (home-page "https://love2d.org/")
316 (license license:zlib)))
318 (define-public allegro-4
324 (uri (string-append "http://download.gna.org/allegro/allegro/"
325 version "/allegro-" version ".tar.gz"))
328 "1p0ghkmpc4kwij1z9rzxfv7adnpy4ayi0ifahlns1bdzgmbyf88v"))))
329 (build-system cmake-build-system)
332 (modify-phases %standard-phases
333 (add-after 'unpack 'patch-build-system
335 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
336 ;; via a command line option doesn't work because it is
337 ;; unconditionally clobbered in the build script.
338 (substitute* '("CMakeLists.txt")
339 (("ADDON_LINKAGE STATIC")
340 "ADDON_LINKAGE SHARED"))
345 ("libvorbis" ,libvorbis)
348 (synopsis "Game programming library")
349 (description "Allegro is a library mainly aimed at video game and
350 multimedia programming. It handles common, low-level tasks such as creating
351 windows, accepting user input, loading data, drawing images, playing sounds,
353 (home-page "http://liballeg.org")
354 (license license:giftware)))
356 (define-public allegro
362 (uri (string-append "http://download.gna.org/allegro/allegro/"
363 version "/allegro-" version ".tar.gz"))
366 "1mwzgzc4nb5k5zkbq7yrc6hg63yxq3wk69lmjag1h19x8b6njnmg"))))
367 (build-system cmake-build-system)
368 (arguments `(#:tests? #f)) ; there are no tests
370 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
372 ("freetype" ,freetype)
377 ("libtheora" ,libtheora)
378 ("libvorbis" ,libvorbis)
379 ("libxcursor" ,libxcursor)
380 ("libxinerama" ,libxinerama)
381 ("libxrandr" ,libxrandr)
387 `(("pkg-config" ,pkg-config)))
388 (synopsis "Game programming library")
389 (description "Allegro is a library mainly aimed at video game and
390 multimedia programming. It handles common, low-level tasks such as creating
391 windows, accepting user input, loading data, drawing images, playing sounds,
393 (home-page "http://liballeg.org")
394 (license license:bsd-3)))
396 (define-public allegro-5.0
397 (package (inherit allegro)
402 (uri (string-append "http://download.gna.org/allegro/allegro/"
403 version "/allegro-" version ".tar.gz"))
406 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
408 (define-public aseprite
412 ;; The release tarball isn't good enough because it's missing some
413 ;; necessary code that is only in git submodules.
417 (url "https://github.com/aseprite/aseprite.git")
422 "1yr0l3bc68lyrffrzxgw98zznv8yz5ldl98lyvp6s5grny4s4jyk"))))
423 (build-system cmake-build-system)
426 ;; Use shared libraries instead of building bundled source.
427 (list "-DWITH_WEBP_SUPPORT=1"
428 "-DUSE_SHARED_CURL=1"
429 "-DUSE_SHARED_GIFLIB=1"
430 "-DUSE_SHARED_JPEGLIB=1"
431 "-DUSE_SHARED_ZLIB=1"
432 "-DUSE_SHARED_LIBPNG=1"
433 "-DUSE_SHARED_LIBLOADPNG=1"
434 "-DUSE_SHARED_LIBWEBP=1"
435 "-DUSE_SHARED_TINYXML=1"
436 "-DUSE_SHARED_PIXMAN=1"
437 "-DUSE_SHARED_FREETYPE=1"
438 "-DUSE_SHARED_ALLEGRO4=1"
439 "-DENABLE_UPDATER=0" ; no auto-updates
440 (string-append "-DFREETYPE_INCLUDE_DIR="
441 (assoc-ref %build-inputs "freetype")
442 "/include/freetype2"))))
444 `(("pkg-config" ,pkg-config)))
445 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
446 ;; patched version is bundled with Aseprite, but the patches should be
447 ;; extracted and applied on top of a standalone Allegro 4 package.
449 `(("allegro" ,allegro-4)
451 ("freetype" ,freetype)
458 ("libxxf86vm" ,libxxf86vm)
462 (synopsis "Animated sprite editor and pixel art tool")
463 (description "Aseprite is a tool for creating 2D pixel art for video
464 games. In addition to basic pixel editing features, Aseprite can assist in
465 the creation of animations, tiled graphics, texture atlases, and more.")
466 (home-page "http://www.aseprite.org/")
467 (license license:gpl2+)))
469 (define-public qqwing
476 "https://qqwing.com/"
477 name "-" version ".tar.gz"))
480 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
481 (build-system gnu-build-system)
483 `(("pkg-config" ,pkg-config)))
484 (home-page "https://qqwing.com/")
485 (synopsis "Sudoku puzzle solver and generator")
487 "QQWing is a Sudoku puzzle generator and solver.
488 It offers the following features:
490 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
491 @item Uses logic. Uses as many solve techniques as possible when solving
492 puzzles rather than guessing.
493 @item Rates puzzles. Most generators don't give an indication of the difficulty
494 of a Sudoku puzzle. QQwing does.
495 @item Can print solve instructions for any puzzle.
496 @item Customizable output style, including a CSV style that is easy to
497 import into a database.
499 (license license:gpl2+)))
501 (define-public quesoglc
507 (uri (string-append "mirror://sourceforge/" name "/" version "/"
508 name "-" version "-free.tar.bz2"))
511 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
512 (build-system gnu-build-system)
513 (native-inputs `(("pkg-config" ,pkg-config)))
514 (inputs `(("fontconfig" ,fontconfig)
515 ("freeglute" ,freeglut)
518 (home-page "http://quesoglc.sourceforge.net")
519 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
521 "The OpenGL Character Renderer (GLC) is a state machine that provides
522 OpenGL programs with character rendering services via an application programming
524 (license (list license:expat license:lgpl2.1+))))
526 (define-public python-pygame
528 (name "python-pygame")
532 (uri (pypi-uri "pygame" version))
535 "1hlydiyygl444bq5m5g8n3jsxsgrdyxlm42ipmfbw36wkf0j243m"))))
536 (build-system python-build-system)
538 `(#:tests? #f ; Tests require pygame to be installed first.
540 (modify-phases %standard-phases
541 ;; Set the paths to the dependencies manually because
542 ;; the configure script does not allow passing them as
543 ;; parameters. This also means we can skip the configure
545 (add-before 'build 'set-library-paths
546 (lambda* (#:key inputs outputs #:allow-other-keys)
547 (let ((sdl-ref (assoc-ref inputs "sdl"))
548 (font-ref (assoc-ref inputs "sdl-ttf"))
549 (image-ref (assoc-ref inputs "sdl-image"))
550 (mixer-ref (assoc-ref inputs "sdl-mixer"))
551 (smpeg-ref (assoc-ref inputs "libsmpeg"))
552 (png-ref (assoc-ref inputs "libpng"))
553 (jpeg-ref (assoc-ref inputs "libjpeg"))
554 (freetype-ref (assoc-ref inputs "freetype"))
555 (v4l-ref (assoc-ref inputs "v4l-utils"))
556 (out-ref (assoc-ref outputs "out")))
557 (substitute* "Setup.in"
558 (("SDL = -I/usr/include/SDL")
559 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
560 (substitute* "Setup.in"
561 (("FONT = -lSDL_ttf")
562 (string-append "FONT = -I" font-ref "/include/SDL -L"
563 font-ref "/lib -lSDL_ttf")))
564 (substitute* "Setup.in"
565 (("IMAGE = -lSDL_image")
566 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
567 image-ref "/lib -lSDL_image")))
568 (substitute* "Setup.in"
569 (("MIXER = -lSDL_mixer")
570 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
571 mixer-ref "/lib -lSDL_mixer")))
572 (substitute* "Setup.in"
574 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
575 smpeg-ref "/lib -lsmpeg")))
576 (substitute* "Setup.in"
578 (string-append "PNG = -I" png-ref "/include -L"
579 png-ref "/lib -lpng")))
580 (substitute* "Setup.in"
582 (string-append "JPEG = -I" jpeg-ref "/include -L"
583 jpeg-ref "/lib -ljpeg")))
585 (substitute* "Setup.in"
586 (("FREETYPE = -lfreetype")
587 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
588 freetype-ref "/lib -lfreetype")))
590 (substitute* "Setup.in"
592 ;; Create a path to a header file provided by v4l-utils.
593 (system* "mkdir" "linux")
594 (system* "ln" "--symbolic"
595 (string-append v4l-ref "/include/libv4l1-videodev.h")
597 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
599 `(("freetype" ,freetype)
601 ("sdl-image" ,sdl-image)
602 ("sdl-mixer" ,sdl-mixer)
608 ("libsmpeg" ,libsmpeg)
609 ("portmidi" ,portmidi)
610 ("v4l-utils" ,v4l-utils)))
611 (home-page "http://www.pygame.org")
612 (synopsis "SDL wrapper for Python")
613 (description "Pygame is a set of Python modules designed for writing games.
614 Pygame adds functionality on top of the excellent SDL library. This allows you
615 to create fully featured games and multimedia programs in the python language.")
616 (license (list license:bsd-2
617 ;; python numeric license as listed by Debian looks like
618 ;; an Expat-style license with a warranty disclaimer for
619 ;; the U.S. government and the University of California.
625 license:public-domain
628 (define-public python2-pygame
629 (package-with-python2 python-pygame))