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, 2017 David Thompson <davet@gnu.org>
7 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2016, 2017 Kei Kebreau <kei@openmailbox.org>
9 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2016 Julian Graham <joolean@gmail.com>
11 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages game-development)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system python)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages curl)
38 #:use-module (gnu packages databases)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages fontutils)
41 #:use-module (gnu packages fribidi)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages gnunet)
44 #:use-module (gnu packages guile)
45 #:use-module (gnu packages multiprecision)
46 #:use-module (gnu packages music)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages qt)
50 #:use-module (gnu packages video)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages zip)
53 #:use-module (gnu packages gl)
54 #:use-module (gnu packages linux)
55 #:use-module (gnu packages xorg)
56 #:use-module (gnu packages xdisorg)
57 #:use-module (gnu packages fontutils)
58 #:use-module (gnu packages image)
59 #:use-module (gnu packages audio)
60 #:use-module (gnu packages pulseaudio)
61 #:use-module (gnu packages gnome)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages sdl)
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages xiph)
66 #:use-module (gnu packages lua)
67 #:use-module (gnu packages mp3)
68 #:use-module (gnu packages xml))
76 (uri (string-append "https://github.com/bulletphysics/bullet3/"
77 "archive/" version ".tar.gz"))
78 (file-name (string-append name "-" version ".tar.gz"))
81 "0qpd37ws0xlxwy55dg058a5b4yw2jxiz09yyc3lc0frpa05pq5bf"))))
82 (build-system cmake-build-system)
84 '(#:configure-flags (list (string-append
85 "-DBUILD_SHARED_LIBS=ON "
86 "-DCMAKE_CXX_FLAGS=-fPIC "
87 (or (getenv "CXXFLAGS") "")))))
92 (home-page "http://bulletphysics.org/")
93 (synopsis "3D physics engine library")
95 "Bullet is a physics engine library usable for collision detection. It
96 is used in some video games and movies.")
97 (license license:zlib)))
105 (uri (string-append "https://github.com/Doom-Utils/" name
106 "/archive/v" version ".tar.gz"))
107 (file-name (string-append name "-" version ".tar.gz"))
110 "0rwz1yzgd539x4h25kzhar4q02xyxjwfrcpz4m8ixi312a82p7cn"))))
111 (build-system gnu-build-system)
113 '(#:tests? #f ; no check target
115 (modify-phases %standard-phases
116 ;; The provided configure script takes a restricted number of arguments.
118 (lambda* (#:key outputs #:allow-other-keys)
119 (zero? (system* "./configure" "--prefix"
120 (assoc-ref %outputs "out")))))
121 ;; "make install" is broken for this package.
122 ;; Notably, the binaries overrwrite one another upon installation as
123 ;; they are all installed to the "bin" file in the output directory,
124 ;; and the manual page fails to install because the directory for the
125 ;; manual page is not created.
127 (lambda* (#:key outputs #:allow-other-keys)
128 (let* ((out (assoc-ref %outputs "out"))
129 (bin (string-append out "/bin"))
130 (share (string-append out "/share")))
131 (install-file "deusf" bin)
132 (install-file "deutex" bin)
133 (install-file "deutex.6" (string-append share "/man/man6")))
135 (home-page "https://github.com/Doom-Utils/deutex")
136 (synopsis "WAD file composer for Doom and related games")
138 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
139 used to extract the lumps of a wad and save them as individual files.
140 Conversely, it can also build a wad from separate files. When extracting a
141 lump to a file, it does not just copy the raw data, it converts it to an
142 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
143 Conversely, when it reads files for inclusion in pwads, it does the necessary
144 conversions (for example, from PPM to Doom picture format). In addition,
145 DeuTex has functions such as merging wads, etc.")
146 (license license:gpl2+)))
148 (define-public gzochi
154 (uri (string-append "mirror://savannah/gzochi/gzochi-"
158 "166rawdal45kvanhvi0bkzy1d2pwf1p0lzslb287lcnm9vdw97yy"))))
159 (build-system gnu-build-system)
161 '(#:phases (modify-phases %standard-phases
162 (add-before 'configure 'remove-Werror
164 ;; We can't build with '-Werror', notably
165 ;; because deprecated functions of
166 ;; libmicrohttpd are being used.
167 (substitute* (find-files "." "^Makefile\\.in$")
171 (native-inputs `(("pkgconfig" ,pkg-config)))
172 (inputs `(("bdb" ,bdb)
175 ("libmicrohttpd" ,libmicrohttpd)
179 (home-page "http://www.nongnu.org/gzochi/")
180 (synopsis "Scalable middleware for multiplayer games")
182 "gzochi is a framework for developing massively multiplayer online games.
183 A server container provides services to deployed games, which are written in
184 Guile Scheme, that abstract and simplify some of the most challenging and
185 error-prone aspects of online game development: Concurrency, data persistence,
186 and network communications. A very thin client library can be embedded to
187 provide connectivity for client applications written in any language.")
188 (license license:gpl3+)))
196 (uri (string-append "https://github.com/bjorn/tiled/archive/v"
198 (file-name (string-append name "-" version ".tar.gz"))
201 "1kcj2blrlfpghjv0qigip2qcbxfx7vv9i8nr4997hkwhsh6i2pjp"))))
202 (build-system gnu-build-system)
207 (modify-phases %standard-phases
209 (lambda* (#:key outputs #:allow-other-keys)
210 (let ((out (assoc-ref outputs "out")))
212 (string-append "PREFIX=" out))))))))
213 (home-page "http://www.mapeditor.org/")
214 (synopsis "Tile map editor")
216 "Tiled is a general purpose tile map editor. It is meant to be used for
217 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
220 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
222 (license license:gpl2+)))
230 ;; Do not fetch the archives from
231 ;; http://mirror0.sfml-dev.org/files/ because files there seem
232 ;; to be changed in place.
233 (uri (string-append "https://github.com/SFML/SFML/archive/"
235 (file-name (string-append name "-" version ".tar.gz"))
238 "0k2fl5xk3ni2q8bsxl0551inx26ww3w6cp6hssvww0wfjdjcirsm"))))
239 (build-system cmake-build-system)
242 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE")
243 #:tests? #f)) ; no tests
248 ("libvorbis" ,libvorbis)
250 ("xcb-util-image" ,xcb-util-image)
251 ("libxrandr" ,libxrandr)
253 ("freetype" ,freetype)
255 ("libsndfile" ,libsndfile)
257 (home-page "https://www.sfml-dev.org")
258 (synopsis "Simple and Fast Multimedia Library")
260 "SFML provides a simple interface to the various computer components,
261 to ease the development of games and multimedia applications. It is composed
262 of five modules: system, window, graphics, audio and network.")
263 (license license:zlib)))
271 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
274 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
275 (build-system gnu-build-system)
277 `(#:phases (modify-phases %standard-phases
278 (delete 'configure) ; no configure script
279 (add-before 'build 'patch-makefile
280 (lambda* (#:key outputs #:allow-other-keys)
281 (let ((out (assoc-ref outputs "out")))
282 (substitute* "Makefile"
283 (("\\$\\(DESTDIR\\)/usr") out))
284 (substitute* "main.cpp"
286 (string-append out "/share")))
288 #:tests? #f)) ; no tests
290 `(("pkg-config" ,pkg-config)
291 ("desktop-file-utils" ,desktop-file-utils)))
295 (synopsis "Simple sound effect generator")
296 (description "Sfxr is a tool for quickly generating simple sound effects.
297 Originally created for use in video game prototypes, it can generate random
298 sounds from presets such as \"explosion\" or \"powerup\".")
299 (home-page "http://www.drpetter.se/project_sfxr.html")
300 (license license:expat)))
302 (define-public physfs
309 "https://icculus.org/physfs/downloads/physfs-"
311 (file-name (string-append name "-" version ".tar.gz"))
314 "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na"))))
315 (build-system cmake-build-system)
317 '(#:tests? #f)) ; no check target
321 `(("doxygen" ,doxygen)))
322 (home-page "https://icculus.org/physfs")
323 (synopsis "File system abstraction library")
325 "PhysicsFS is a library to provide abstract access to various archives.
326 It is intended for use in video games. For security, no file writing done
327 through the PhysicsFS API can leave a defined @emph{write directory}. For
328 file reading, a @emph{search path} with archives and directories is defined,
329 and it becomes a single, transparent hierarchical file system. So archive
330 files can be accessed in the same way as you access files directly on a disk,
331 and it makes it easy to ship a new archive that will override a previous
332 archive on a per-file basis.")
333 (license license:zlib)))
341 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
342 "love-" version "-linux-src.tar.gz"))
345 "11x346pw0gqad8nmkmywzx4xpcbfc3dslbrdw5x94n1i25mk0sxj"))))
346 (build-system gnu-build-system)
348 `(("pkg-config" ,pkg-config)))
351 ("freetype" ,freetype)
352 ("libmodplug" ,libmodplug)
353 ("libtheora" ,libtheora)
354 ("libvorbis" ,libvorbis)
362 (synopsis "2D game framework for Lua")
363 (description "LÖVE is a framework for making 2D games in the Lua
364 programming language.")
365 (home-page "https://love2d.org/")
366 (license license:zlib)))
368 (define-public allegro-4
374 (uri (string-append "http://download.gna.org/allegro/allegro/"
375 version "/allegro-" version ".tar.gz"))
378 "1p0ghkmpc4kwij1z9rzxfv7adnpy4ayi0ifahlns1bdzgmbyf88v"))))
379 (build-system cmake-build-system)
382 (modify-phases %standard-phases
383 (add-after 'unpack 'patch-build-system
385 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
386 ;; via a command line option doesn't work because it is
387 ;; unconditionally clobbered in the build script.
388 (substitute* '("CMakeLists.txt")
389 (("ADDON_LINKAGE STATIC")
390 "ADDON_LINKAGE SHARED"))
395 ("libvorbis" ,libvorbis)
398 (synopsis "Game programming library")
399 (description "Allegro is a library mainly aimed at video game and
400 multimedia programming. It handles common, low-level tasks such as creating
401 windows, accepting user input, loading data, drawing images, playing sounds,
403 (home-page "http://liballeg.org")
404 (license license:giftware)))
406 (define-public allegro
412 (uri (string-append "http://download.gna.org/allegro/allegro/"
413 version "/allegro-" version ".tar.gz"))
416 "1mwzgzc4nb5k5zkbq7yrc6hg63yxq3wk69lmjag1h19x8b6njnmg"))))
417 (build-system cmake-build-system)
418 (arguments `(#:tests? #f)) ; there are no tests
420 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
422 ("freetype" ,freetype)
427 ("libtheora" ,libtheora)
428 ("libvorbis" ,libvorbis)
429 ("libxcursor" ,libxcursor)
430 ("libxinerama" ,libxinerama)
431 ("libxrandr" ,libxrandr)
437 `(("pkg-config" ,pkg-config)))
438 (synopsis "Game programming library")
439 (description "Allegro is a library mainly aimed at video game and
440 multimedia programming. It handles common, low-level tasks such as creating
441 windows, accepting user input, loading data, drawing images, playing sounds,
443 (home-page "http://liballeg.org")
444 (license license:bsd-3)))
446 (define-public allegro-5.0
447 (package (inherit allegro)
452 (uri (string-append "http://download.gna.org/allegro/allegro/"
453 version "/allegro-" version ".tar.gz"))
456 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
458 (define-public aseprite
461 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
462 ;; TODO: Unbundle third party software.
464 (method url-fetch/zipbomb)
465 (uri (string-append "https://github.com/aseprite/aseprite"
466 "/releases/download/v" version
467 "/Aseprite-v" version "-Source.zip"))
470 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
471 (build-system cmake-build-system)
474 ;; Use shared libraries instead of building bundled source.
475 (list "-DWITH_WEBP_SUPPORT=1"
476 "-DUSE_SHARED_CURL=1"
477 "-DUSE_SHARED_GIFLIB=1"
478 "-DUSE_SHARED_JPEGLIB=1"
479 "-DUSE_SHARED_ZLIB=1"
480 "-DUSE_SHARED_LIBPNG=1"
481 "-DUSE_SHARED_LIBLOADPNG=1"
482 "-DUSE_SHARED_LIBWEBP=1"
483 "-DUSE_SHARED_TINYXML=1"
484 "-DUSE_SHARED_PIXMAN=1"
485 "-DUSE_SHARED_FREETYPE=1"
486 "-DUSE_SHARED_ALLEGRO4=1"
487 "-DENABLE_UPDATER=0" ; no auto-updates
488 (string-append "-DFREETYPE_INCLUDE_DIR="
489 (assoc-ref %build-inputs "freetype")
490 "/include/freetype2"))))
492 `(("pkg-config" ,pkg-config)))
493 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
494 ;; patched version is bundled with Aseprite, but the patches should be
495 ;; extracted and applied on top of a standalone Allegro 4 package.
497 `(("allegro" ,allegro-4)
499 ("freetype" ,freetype)
506 ("libxxf86vm" ,libxxf86vm)
510 (synopsis "Animated sprite editor and pixel art tool")
511 (description "Aseprite is a tool for creating 2D pixel art for video
512 games. In addition to basic pixel editing features, Aseprite can assist in
513 the creation of animations, tiled graphics, texture atlases, and more.")
514 (home-page "https://www.aseprite.org/")
515 (license license:gpl2+)))
517 (define-public qqwing
524 "https://qqwing.com/"
525 name "-" version ".tar.gz"))
528 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
529 (build-system gnu-build-system)
531 `(("pkg-config" ,pkg-config)))
532 (home-page "https://qqwing.com/")
533 (synopsis "Sudoku puzzle solver and generator")
535 "QQWing is a Sudoku puzzle generator and solver.
536 It offers the following features:
538 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
539 @item Uses logic. Uses as many solve techniques as possible when solving
540 puzzles rather than guessing.
541 @item Rates puzzles. Most generators don't give an indication of the difficulty
542 of a Sudoku puzzle. QQwing does.
543 @item Can print solve instructions for any puzzle.
544 @item Customizable output style, including a CSV style that is easy to
545 import into a database.
547 (license license:gpl2+)))
549 (define-public quesoglc
555 (uri (string-append "mirror://sourceforge/" name "/" version "/"
556 name "-" version "-free.tar.bz2"))
559 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
560 (build-system gnu-build-system)
561 (native-inputs `(("pkg-config" ,pkg-config)))
562 (inputs `(("fontconfig" ,fontconfig)
563 ("freeglute" ,freeglut)
566 (home-page "http://quesoglc.sourceforge.net")
567 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
569 "The OpenGL Character Renderer (GLC) is a state machine that provides
570 OpenGL programs with character rendering services via an application programming
572 (license (list license:expat license:lgpl2.1+))))
574 (define-public python-pygame
576 (name "python-pygame")
580 (uri (pypi-uri "pygame" version))
583 "1hlydiyygl444bq5m5g8n3jsxsgrdyxlm42ipmfbw36wkf0j243m"))))
584 (build-system python-build-system)
586 `(#:tests? #f ; Tests require pygame to be installed first.
588 (modify-phases %standard-phases
589 ;; Set the paths to the dependencies manually because
590 ;; the configure script does not allow passing them as
591 ;; parameters. This also means we can skip the configure
593 (add-before 'build 'set-library-paths
594 (lambda* (#:key inputs outputs #:allow-other-keys)
595 (let ((sdl-ref (assoc-ref inputs "sdl"))
596 (font-ref (assoc-ref inputs "sdl-ttf"))
597 (image-ref (assoc-ref inputs "sdl-image"))
598 (mixer-ref (assoc-ref inputs "sdl-mixer"))
599 (smpeg-ref (assoc-ref inputs "libsmpeg"))
600 (png-ref (assoc-ref inputs "libpng"))
601 (jpeg-ref (assoc-ref inputs "libjpeg"))
602 (freetype-ref (assoc-ref inputs "freetype"))
603 (v4l-ref (assoc-ref inputs "v4l-utils"))
604 (out-ref (assoc-ref outputs "out")))
605 (substitute* "Setup.in"
606 (("SDL = -I/usr/include/SDL")
607 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
608 (substitute* "Setup.in"
609 (("FONT = -lSDL_ttf")
610 (string-append "FONT = -I" font-ref "/include/SDL -L"
611 font-ref "/lib -lSDL_ttf")))
612 (substitute* "Setup.in"
613 (("IMAGE = -lSDL_image")
614 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
615 image-ref "/lib -lSDL_image")))
616 (substitute* "Setup.in"
617 (("MIXER = -lSDL_mixer")
618 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
619 mixer-ref "/lib -lSDL_mixer")))
620 (substitute* "Setup.in"
622 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
623 smpeg-ref "/lib -lsmpeg")))
624 (substitute* "Setup.in"
626 (string-append "PNG = -I" png-ref "/include -L"
627 png-ref "/lib -lpng")))
628 (substitute* "Setup.in"
630 (string-append "JPEG = -I" jpeg-ref "/include -L"
631 jpeg-ref "/lib -ljpeg")))
633 (substitute* "Setup.in"
634 (("FREETYPE = -lfreetype")
635 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
636 freetype-ref "/lib -lfreetype")))
638 (substitute* "Setup.in"
640 ;; Create a path to a header file provided by v4l-utils.
641 (system* "mkdir" "linux")
642 (system* "ln" "--symbolic"
643 (string-append v4l-ref "/include/libv4l1-videodev.h")
645 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
647 `(("freetype" ,freetype)
649 ("sdl-image" ,sdl-image)
650 ("sdl-mixer" ,sdl-mixer)
656 ("libsmpeg" ,libsmpeg)
657 ("portmidi" ,portmidi)
658 ("v4l-utils" ,v4l-utils)))
659 (home-page "https://www.pygame.org")
660 (synopsis "SDL wrapper for Python")
661 (description "Pygame is a set of Python modules designed for writing games.
662 Pygame adds functionality on top of the excellent SDL library. This allows you
663 to create fully featured games and multimedia programs in the python language.")
664 (license (list license:bsd-2
665 ;; python numeric license as listed by Debian looks like
666 ;; an Expat-style license with a warranty disclaimer for
667 ;; the U.S. government and the University of California.
673 license:public-domain
676 (define-public python2-pygame
677 (package-with-python2 python-pygame))
679 (define-public grafx2
685 ;; XXX: There is no URL that contains the version. :(
686 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
689 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
690 (build-system gnu-build-system)
693 (modify-phases %standard-phases
694 (delete 'configure) ; no configure script
695 (add-before 'build 'change-to-src-directory
700 ;; SDL header files are referenced without the preceeding "SDL/".
701 (list (string-append "CFLAGS=-I"
702 (assoc-ref %build-inputs "sdl-union")
704 (string-append "prefix="
705 (assoc-ref %outputs "out")))
706 #:tests? #f)) ; no check target
708 `(("pkg-config" ,pkg-config)))
712 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
713 (synopsis "Bitmap paint program")
714 (description "GrafX2 is a bitmap paint program inspired by the Amiga
715 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
716 includes a very large number of tools and effects that make it particularly
717 suitable for pixel art, game graphics, and generally any detailed graphics
718 painted with a mouse.")
719 (home-page "http://pulkomandy.tk/projects/GrafX2")
720 (license license:gpl2))) ; GPLv2 only