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))
72 (version "2.82-r2704")
75 (uri (string-append "https://bullet.googlecode.com/files/bullet-"
79 "1lnfksxa9b1slyfcxys313ymsllvbsnxh9np06azkbgpfvmwkr37"))))
80 (build-system cmake-build-system)
81 (arguments '(#:tests? #f ; no 'test' target
82 #:configure-flags (list
84 "-DCMAKE_CXX_FLAGS=-fPIC "
85 (or (getenv "CXXFLAGS") "")))))
86 (home-page "http://bulletphysics.org/")
87 (synopsis "3D physics engine library")
89 "Bullet is a physics engine library usable for collision detection. It
90 is used in some video games and movies.")
91 (license license:zlib)))
99 (uri (string-append "mirror://savannah/gzochi/gzochi-"
103 "166rawdal45kvanhvi0bkzy1d2pwf1p0lzslb287lcnm9vdw97yy"))))
104 (build-system gnu-build-system)
106 '(#:phases (modify-phases %standard-phases
107 (add-before 'configure 'remove-Werror
109 ;; We can't build with '-Werror', notably
110 ;; because deprecated functions of
111 ;; libmicrohttpd are being used.
112 (substitute* (find-files "." "^Makefile\\.in$")
116 (native-inputs `(("pkgconfig" ,pkg-config)))
117 (inputs `(("bdb" ,bdb)
120 ("libmicrohttpd" ,libmicrohttpd)
124 (home-page "http://www.nongnu.org/gzochi/")
125 (synopsis "Scalable middleware for multiplayer games")
127 "gzochi is a framework for developing massively multiplayer online games.
128 A server container provides services to deployed games, which are written in
129 Guile Scheme, that abstract and simplify some of the most challenging and
130 error-prone aspects of online game development: Concurrency, data persistence,
131 and network communications. A very thin client library can be embedded to
132 provide connectivity for client applications written in any language.")
133 (license license:gpl3+)))
141 (uri (string-append "https://github.com/bjorn/tiled/archive/v"
143 (file-name (string-append name "-" version ".tar.gz"))
146 "0c9gykxmq0sk0yyfdq81g9psd922scqzn5asskjydj84d80f5z7p"))))
147 (build-system gnu-build-system)
152 (modify-phases %standard-phases
154 (lambda* (#:key outputs #:allow-other-keys)
155 (let ((out (assoc-ref outputs "out")))
157 (string-append "PREFIX=" out))))))))
158 (home-page "http://www.mapeditor.org/")
159 (synopsis "Tile map editor")
161 "Tiled is a general purpose tile map editor. It is meant to be used for
162 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
165 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
167 (license license:gpl2+)))
175 ;; Do not fetch the archives from
176 ;; http://mirror0.sfml-dev.org/files/ because files there seem
177 ;; to be changed in place.
178 (uri (string-append "https://github.com/SFML/SFML/archive/"
180 (file-name (string-append name "-" version ".tar.gz"))
183 "0k2fl5xk3ni2q8bsxl0551inx26ww3w6cp6hssvww0wfjdjcirsm"))))
184 (build-system cmake-build-system)
186 '(#:tests? #f)) ; no tests
191 ("libvorbis" ,libvorbis)
193 ("xcb-util-image" ,xcb-util-image)
194 ("libxrandr" ,libxrandr)
196 ("freetype" ,freetype)
198 ("libsndfile" ,libsndfile)
200 (home-page "http://www.sfml-dev.org")
201 (synopsis "Simple and Fast Multimedia Library")
203 "SFML provides a simple interface to the various computer components,
204 to ease the development of games and multimedia applications. It is composed
205 of five modules: system, window, graphics, audio and network.")
206 (license license:zlib)))
214 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
217 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
218 (build-system gnu-build-system)
220 `(#:phases (modify-phases %standard-phases
221 (delete 'configure) ; no configure script
222 (add-before 'build 'patch-makefile
223 (lambda* (#:key outputs #:allow-other-keys)
224 (let ((out (assoc-ref outputs "out")))
225 (substitute* "Makefile"
226 (("\\$\\(DESTDIR\\)/usr") out))
227 (substitute* "main.cpp"
229 (string-append out "/share")))
231 #:tests? #f)) ; no tests
233 `(("pkg-config" ,pkg-config)
234 ("desktop-file-utils" ,desktop-file-utils)))
238 (synopsis "Simple sound effect generator")
239 (description "Sfxr is a tool for quickly generating simple sound effects.
240 Originally created for use in video game prototypes, it can generate random
241 sounds from presets such as \"explosion\" or \"powerup\".")
242 (home-page "http://www.drpetter.se/project_sfxr.html")
243 (license license:expat)))
245 (define-public physfs
252 "http://icculus.org/physfs/downloads/physfs-"
254 (file-name (string-append name "-" version ".tar.gz"))
257 "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na"))))
258 (build-system cmake-build-system)
260 '(#:tests? #f)) ; no check target
264 `(("doxygen" ,doxygen)))
265 (home-page "http://icculus.org/physfs")
266 (synopsis "File system abstraction library")
268 "PhysicsFS is a library to provide abstract access to various archives.
269 It is intended for use in video games. For security, no file writing done
270 through the PhysicsFS API can leave a defined @emph{write directory}. For
271 file reading, a @emph{search path} with archives and directories is defined,
272 and it becomes a single, transparent hierarchical file system. So archive
273 files can be accessed in the same way as you access files directly on a disk,
274 and it makes it easy to ship a new archive that will override a previous
275 archive on a per-file basis.")
276 (license license:zlib)))
284 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
285 "love-" version "-linux-src.tar.gz"))
288 "1ys18m7c4994k5s7avqlf17sc2icx5zgvfplz504q1ka16hwkc52"))))
289 (build-system gnu-build-system)
291 `(("pkg-config" ,pkg-config)))
294 ("freetype" ,freetype)
295 ("libmodplug" ,libmodplug)
296 ("libtheora" ,libtheora)
297 ("libvorbis" ,libvorbis)
305 (synopsis "2D game framework for Lua")
306 (description "LÖVE is a framework for making 2D games in the Lua
307 programming language.")
308 (home-page "https://love2d.org/")
309 (license license:zlib)))
311 (define-public allegro-4
317 (uri (string-append "http://download.gna.org/allegro/allegro/"
318 version "/allegro-" version ".tar.gz"))
321 "1p0ghkmpc4kwij1z9rzxfv7adnpy4ayi0ifahlns1bdzgmbyf88v"))))
322 (build-system cmake-build-system)
325 (modify-phases %standard-phases
326 (add-after 'unpack 'patch-build-system
328 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
329 ;; via a command line option doesn't work because it is
330 ;; unconditionally clobbered in the build script.
331 (substitute* '("CMakeLists.txt")
332 (("ADDON_LINKAGE STATIC")
333 "ADDON_LINKAGE SHARED"))
338 ("libvorbis" ,libvorbis)
341 (synopsis "Game programming library")
342 (description "Allegro is a library mainly aimed at video game and
343 multimedia programming. It handles common, low-level tasks such as creating
344 windows, accepting user input, loading data, drawing images, playing sounds,
346 (home-page "http://liballeg.org")
347 (license license:giftware)))
349 (define-public allegro
355 (uri (string-append "http://download.gna.org/allegro/allegro/"
356 version "/allegro-" version ".tar.gz"))
359 "1mwzgzc4nb5k5zkbq7yrc6hg63yxq3wk69lmjag1h19x8b6njnmg"))))
360 (build-system cmake-build-system)
361 (arguments `(#:tests? #f)) ; there are no tests
363 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
365 ("freetype" ,freetype)
370 ("libtheora" ,libtheora)
371 ("libvorbis" ,libvorbis)
372 ("libxcursor" ,libxcursor)
373 ("libxinerama" ,libxinerama)
374 ("libxrandr" ,libxrandr)
380 `(("pkg-config" ,pkg-config)))
381 (synopsis "Game programming library")
382 (description "Allegro is a library mainly aimed at video game and
383 multimedia programming. It handles common, low-level tasks such as creating
384 windows, accepting user input, loading data, drawing images, playing sounds,
386 (home-page "http://liballeg.org")
387 (license license:bsd-3)))
389 (define-public allegro-5.0
390 (package (inherit allegro)
395 (uri (string-append "http://download.gna.org/allegro/allegro/"
396 version "/allegro-" version ".tar.gz"))
399 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
401 (define-public aseprite
405 ;; The release tarball isn't good enough because it's missing some
406 ;; necessary code that is only in git submodules.
410 (url "https://github.com/aseprite/aseprite.git")
415 "1yr0l3bc68lyrffrzxgw98zznv8yz5ldl98lyvp6s5grny4s4jyk"))))
416 (build-system cmake-build-system)
419 ;; Use shared libraries instead of building bundled source.
420 (list "-DWITH_WEBP_SUPPORT=1"
421 "-DUSE_SHARED_CURL=1"
422 "-DUSE_SHARED_GIFLIB=1"
423 "-DUSE_SHARED_JPEGLIB=1"
424 "-DUSE_SHARED_ZLIB=1"
425 "-DUSE_SHARED_LIBPNG=1"
426 "-DUSE_SHARED_LIBLOADPNG=1"
427 "-DUSE_SHARED_LIBWEBP=1"
428 "-DUSE_SHARED_TINYXML=1"
429 "-DUSE_SHARED_PIXMAN=1"
430 "-DUSE_SHARED_FREETYPE=1"
431 "-DUSE_SHARED_ALLEGRO4=1"
432 "-DENABLE_UPDATER=0" ; no auto-updates
433 (string-append "-DFREETYPE_INCLUDE_DIR="
434 (assoc-ref %build-inputs "freetype")
435 "/include/freetype2"))))
437 `(("pkg-config" ,pkg-config)))
438 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
439 ;; patched version is bundled with Aseprite, but the patches should be
440 ;; extracted and applied on top of a standalone Allegro 4 package.
442 `(("allegro" ,allegro-4)
444 ("freetype" ,freetype)
451 ("libxxf86vm" ,libxxf86vm)
455 (synopsis "Animated sprite editor and pixel art tool")
456 (description "Aseprite is a tool for creating 2D pixel art for video
457 games. In addition to basic pixel editing features, Aseprite can assist in
458 the creation of animations, tiled graphics, texture atlases, and more.")
459 (home-page "http://www.aseprite.org/")
460 (license license:gpl2+)))
462 (define-public qqwing
469 "https://qqwing.com/"
470 name "-" version ".tar.gz"))
473 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
474 (build-system gnu-build-system)
476 `(("pkg-config" ,pkg-config)))
477 (home-page "https://qqwing.com/")
478 (synopsis "Sudoku puzzle solver and generator")
480 "QQWing is a Sudoku puzzle generator and solver.
481 It offers the following features:
483 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
484 @item Uses logic. Uses as many solve techniques as possible when solving
485 puzzles rather than guessing.
486 @item Rates puzzles. Most generators don't give an indication of the difficulty
487 of a Sudoku puzzle. QQwing does.
488 @item Can print solve instructions for any puzzle.
489 @item Customizable output style, including a CSV style that is easy to
490 import into a database.
492 (license license:gpl2+)))
494 (define-public quesoglc
500 (uri (string-append "mirror://sourceforge/" name "/" version "/"
501 name "-" version "-free.tar.bz2"))
504 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
505 (build-system gnu-build-system)
506 (native-inputs `(("pkg-config" ,pkg-config)))
507 (inputs `(("fontconfig" ,fontconfig)
508 ("freeglute" ,freeglut)
511 (home-page "http://quesoglc.sourceforge.net")
512 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
514 "The OpenGL Character Renderer (GLC) is a state machine that provides
515 OpenGL programs with character rendering services via an application programming
517 (license (list license:expat license:lgpl2.1+))))
519 (define-public python-pygame
521 (name "python-pygame")
525 (uri (string-append "http://pygame.org/ftp/pygame-"
526 version "release.tar.gz"))
529 "0cyl0ww4fjlf289pjxa53q4klyn55ajvkgymw0qrdgp4593raq52"))))
530 (build-system python-build-system)
533 #:tests? #f ; Tests require pygame to be installed first.
535 (modify-phases %standard-phases
536 ;; Set the paths to the dependencies manually because
537 ;; the configure script does not allow passing them as
538 ;; parameters. This also means we can skip the configure
540 (add-before 'build 'set-library-paths
541 (lambda* (#:key inputs outputs #:allow-other-keys)
542 (let ((sdl-ref (assoc-ref inputs "sdl"))
543 (font-ref (assoc-ref inputs "sdl-ttf"))
544 (image-ref (assoc-ref inputs "sdl-image"))
545 (mixer-ref (assoc-ref inputs "sdl-mixer"))
546 (smpeg-ref (assoc-ref inputs "libsmpeg"))
547 (png-ref (assoc-ref inputs "libpng"))
548 (jpeg-ref (assoc-ref inputs "libjpeg"))
549 (v4l-ref (assoc-ref inputs "v4l-utils"))
550 (out-ref (assoc-ref outputs "out")))
551 (substitute* "Setup.in"
552 (("SDL = -I/usr/include/SDL")
553 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
554 (substitute* "Setup.in"
555 (("FONT = -lSDL_ttf")
556 (string-append "FONT = -I" font-ref "/include/SDL -L"
557 font-ref "/lib -lSDL_ttf")))
558 (substitute* "Setup.in"
559 (("IMAGE = -lSDL_image")
560 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
561 image-ref "/lib -lSDL_image")))
562 (substitute* "Setup.in"
563 (("MIXER = -lSDL_mixer")
564 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
565 mixer-ref "/lib -lSDL_mixer")))
566 (substitute* "Setup.in"
568 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
569 smpeg-ref "/lib -lsmpeg")))
570 (substitute* "Setup.in"
572 (string-append "PNG = -I" png-ref "/include -L"
573 png-ref "/lib -lpng")))
574 (substitute* "Setup.in"
576 (string-append "JPEG = -I" jpeg-ref "/include -L"
577 jpeg-ref "/lib -ljpeg")))
578 (substitute* "Setup.in"
580 (substitute* "src/movie.c")
581 ;; Create a path to a header file provided by v4l-utils.
582 (system* "mkdir" "linux")
583 (system* "ln" "--symbolic"
584 (string-append v4l-ref "/include/libv4l1-videodev.h")
586 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
588 `(("python-setuptools" ,python-setuptools)))
591 ("sdl-image" ,sdl-image)
592 ("sdl-mixer" ,sdl-mixer)
598 ("libsmpeg" ,libsmpeg)
599 ("portmidi" ,portmidi)
600 ("v4l-utils" ,v4l-utils)))
601 (home-page "http://www.pygame.org")
602 (synopsis "SDL wrapper for Python")
603 (description "Pygame is a set of Python modules designed for writing games.
604 Pygame adds functionality on top of the excellent SDL library. This allows you
605 to create fully featured games and multimedia programs in the python language.")
606 (license (list license:bsd-2
607 ;; python numeric license as listed by Debian looks like
608 ;; an Expat-style license with a warranty disclaimer for
609 ;; the U.S. government and the University of California.
615 license:public-domain