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 utils)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system python)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages boost)
39 #:use-module (gnu packages curl)
40 #:use-module (gnu packages databases)
41 #:use-module (gnu packages documentation)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages freedesktop)
44 #:use-module (gnu packages fribidi)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gnunet)
47 #:use-module (gnu packages guile)
48 #:use-module (gnu packages multiprecision)
49 #:use-module (gnu packages music)
50 #:use-module (gnu packages ncurses)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages qt)
53 #:use-module (gnu packages video)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages gl)
56 #:use-module (gnu packages linux)
57 #:use-module (gnu packages xorg)
58 #:use-module (gnu packages xdisorg)
59 #:use-module (gnu packages fontutils)
60 #:use-module (gnu packages image)
61 #:use-module (gnu packages audio)
62 #:use-module (gnu packages pulseaudio)
63 #:use-module (gnu packages gnome)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages sdl)
66 #:use-module (gnu packages pkg-config)
67 #:use-module (gnu packages xiph)
68 #:use-module (gnu packages lua)
69 #:use-module (gnu packages mp3)
70 #:use-module (gnu packages xml))
78 (uri (string-append "https://github.com/bulletphysics/bullet3/"
79 "archive/" version ".tar.gz"))
80 (file-name (string-append name "-" version ".tar.gz"))
83 "0nghzcl84p8di215p7xj0gy1hyy072hw2xk9cnmav9hv6bjb4n60"))))
84 (build-system cmake-build-system)
86 '(#:configure-flags (list (string-append
87 "-DBUILD_SHARED_LIBS=ON "
88 "-DCMAKE_CXX_FLAGS=-fPIC "
89 (or (getenv "CXXFLAGS") "")))))
94 (home-page "http://bulletphysics.org/")
95 (synopsis "3D physics engine library")
97 "Bullet is a physics engine library usable for collision detection. It
98 is used in some video games and movies.")
99 (license license:zlib)))
101 (define-public deutex
107 (uri (string-append "https://github.com/Doom-Utils/" name
108 "/archive/v" version ".tar.gz"))
109 (file-name (string-append name "-" version ".tar.gz"))
112 "0rwz1yzgd539x4h25kzhar4q02xyxjwfrcpz4m8ixi312a82p7cn"))))
113 (build-system gnu-build-system)
115 '(#:tests? #f ; no check target
117 (modify-phases %standard-phases
118 ;; The provided configure script takes a restricted number of arguments.
120 (lambda* (#:key outputs #:allow-other-keys)
121 (zero? (system* "./configure" "--prefix"
122 (assoc-ref %outputs "out")))))
123 ;; "make install" is broken for this package.
124 ;; Notably, the binaries overrwrite one another upon installation as
125 ;; they are all installed to the "bin" file in the output directory,
126 ;; and the manual page fails to install because the directory for the
127 ;; manual page is not created.
129 (lambda* (#:key outputs #:allow-other-keys)
130 (let* ((out (assoc-ref %outputs "out"))
131 (bin (string-append out "/bin"))
132 (share (string-append out "/share")))
133 (install-file "deusf" bin)
134 (install-file "deutex" bin)
135 (install-file "deutex.6" (string-append share "/man/man6")))
137 (home-page "https://github.com/Doom-Utils/deutex")
138 (synopsis "WAD file composer for Doom and related games")
140 "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
141 used to extract the lumps of a wad and save them as individual files.
142 Conversely, it can also build a wad from separate files. When extracting a
143 lump to a file, it does not just copy the raw data, it converts it to an
144 appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
145 Conversely, when it reads files for inclusion in pwads, it does the necessary
146 conversions (for example, from PPM to Doom picture format). In addition,
147 DeuTex has functions such as merging wads, etc.")
148 (license license:gpl2+)))
150 (define-public grfcodec
156 (uri (string-append "http://binaries.openttd.org/extra/"
157 name "/" version "/" name "-" version
161 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
162 (build-system gnu-build-system)
164 '(#:tests? #f ; no check target
166 (modify-phases %standard-phases
167 (delete 'configure) ; no configure script
168 (replace 'install ; no install target
169 (lambda* (#:key outputs #:allow-other-keys)
170 (let* ((out (assoc-ref outputs "out"))
171 (bin (string-append out "/bin"))
172 (doc (string-append out "/share/doc"))
173 (man (string-append out "/share/man/man1")))
174 (for-each (lambda (file)
175 (install-file file bin))
176 '("grfcodec" "grfid" "grfstrip" "nforenum"))
177 (install-file "COPYING" doc)
178 (with-directory-excursion "docs"
179 (for-each (lambda (file)
180 (install-file (string-append file ".txt") doc))
181 '("auto_correct" "commands" "grf" "grfcodec" "grftut"
182 "readme" "readme.rpn"))
183 (for-each (lambda (file)
184 (install-file file man))
185 (find-files "." "\\.1"))))
191 (synopsis "GRF development tools")
193 "The @dfn{Graphics Resource File} (GRF) development tools are a set of
194 tools for developing (New)GRFs. It includes a number of smaller programs, each
195 with a specific task:
197 @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
198 @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
199 @item @code{grfstrip} strips all sprites from a GRF.
200 @item @code{nforenum} checks NFO code for errors, making corrections when
203 (home-page "http://dev.openttdcoop.org/projects/grfcodec")
204 ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
205 ;; NFORenum is under the GPL2+.
206 ;; The MD5 implementation contained in GRFID is under the zlib license.
207 (license (list license:gpl2 license:gpl2+ license:zlib))))
209 (define-public gzochi
215 (uri (string-append "mirror://savannah/gzochi/gzochi-"
219 "166rawdal45kvanhvi0bkzy1d2pwf1p0lzslb287lcnm9vdw97yy"))))
220 (build-system gnu-build-system)
222 '(#:phases (modify-phases %standard-phases
223 (add-before 'configure 'remove-Werror
225 ;; We can't build with '-Werror', notably
226 ;; because deprecated functions of
227 ;; libmicrohttpd are being used.
228 (substitute* (find-files "." "^Makefile\\.in$")
232 (native-inputs `(("pkgconfig" ,pkg-config)))
233 (inputs `(("bdb" ,bdb)
236 ("libmicrohttpd" ,libmicrohttpd)
240 (home-page "http://www.nongnu.org/gzochi/")
241 (synopsis "Scalable middleware for multiplayer games")
243 "gzochi is a framework for developing massively multiplayer online games.
244 A server container provides services to deployed games, which are written in
245 Guile Scheme, that abstract and simplify some of the most challenging and
246 error-prone aspects of online game development: Concurrency, data persistence,
247 and network communications. A very thin client library can be embedded to
248 provide connectivity for client applications written in any language.")
249 (license license:gpl3+)))
258 (uri (string-append "http://bundles.openttdcoop.org/nml/releases/"
259 version "/nml-" version ".tar.gz"))
262 "0wk9ls5qyjwkra54rkj1gg94xbwzi7b84a5fh1ma1q7pbimi8rmg"))))
263 (build-system python-build-system)
265 `(("python-pillow" ,python-pillow)
266 ("python-ply" ,python-ply)))
267 (home-page "http://dev.openttdcoop.org/projects/nml")
268 (synopsis "NML compiler")
270 "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
271 compiling NML files (along with their associated language, sound and graphic
272 files) into @file{.grf} and/or @file{.nfo} files.")
273 (license license:gpl2+)))
275 (define-public python-sge-pygame
277 (name "python-sge-pygame")
282 (uri (pypi-uri "sge-pygame" version))
285 "0g0n722md6nfayiqzadwf0dh821hzqv0alp4by0vjfwr1xzv49mc"))))
286 (build-system python-build-system)
288 `(("python-pygame" ,python-pygame)
289 ("python-six" ,python-six)
290 ("python-uniseg" ,python-uniseg)))
291 (home-page "http://stellarengine.nongnu.org")
292 (synopsis "2D game engine for Python")
294 "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
295 general-purpose 2D game engine. It takes care of several details fro you so
296 you can focus on the game itself. This makes more rapid game development
297 possible, and it also makes the SGE easy to learn.")
298 (license license:lgpl3+)))
300 (define-public python2-sge-pygame
301 (package-with-python2 python-sge-pygame))
303 (define-public python-tmx
310 (uri (string-append "mirror://savannah/python-tmx/"
311 (version-major+minor version) "/tmx-"
315 "1is107sx3lr09dqjiyn10xqhyv5x54c2ryhys9mb9j3mxjbm227l"))))
316 (build-system python-build-system)
318 `(("python-six" ,python-six)))
319 (home-page "http://python-tmx.nongnu.org")
320 (synopsis "Python library for the @code{Tiled} TMX format")
322 "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
323 This is useful for map editors or generic level editors, and it's also useful
324 for using a map editor or generic level editor like Tiled to edit your game's
326 (license (list license:asl2.0
327 ;; Documentation (only available in the source tarball) is
328 ;; under the CC0 license.
331 (define-public python2-tmx
332 (let ((python2-tmx (package-with-python2 python-tmx)))
334 (inherit python2-tmx)
336 `(("python2-pathlib" ,python2-pathlib)
337 ,@(package-propagated-inputs python2-tmx))))))
339 (define-public python-xsge
342 (version "2017.06.09")
345 (uri (string-append "mirror://savannah/xsge/xsge/xsge-"
349 "1vy7c2y7ihvmggs93zgfv2h3049s384wid8a5snzrrba8bhbb89p"))))
350 (build-system python-build-system)
353 (modify-phases %standard-phases
354 ;; xSGE's setup.py script does not support one of the Python build
355 ;; system's default flags, "--single-version-externally-managed".
357 (lambda* (#:key outputs #:allow-other-keys)
359 (system* "python" "setup.py" "install"
360 (string-append "--prefix=" (assoc-ref outputs "out"))
362 #:tests? #f)) ; no check target
364 `(("python-sge-pygame" ,python-sge-pygame)
365 ("python-pygame" ,python-pygame)
366 ("python-six" ,python-six)
367 ("python-tmx" ,python-tmx)))
368 (home-page "http://xsge.nongnu.org")
369 (synopsis "Extensions for the SGE Game Engine")
371 "xSGE is a collection of modules that make doing certain tasks with the SGE
372 Game Engine easier. In addition to SGE's conveniences, the user has access to a
373 GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
375 (license license:gpl3+)))
377 (define-public python2-xsge
378 (package-with-python2 python-xsge))
386 (uri (string-append "https://github.com/bjorn/tiled/archive/v"
388 (file-name (string-append name "-" version ".tar.gz"))
391 "1y75jmpcf2lv8s3g9v3ghnrwvs2fc4ni7nx74csaylg1g04cwlq7"))))
392 (build-system gnu-build-system)
398 `(("qttools" ,qttools)))
401 (modify-phases %standard-phases
403 (lambda* (#:key inputs outputs #:allow-other-keys)
404 (substitute* "translations/translations.pro"
406 (string-append "LRELEASE = "
407 (assoc-ref inputs "qttools")
409 (let ((out (assoc-ref outputs "out")))
411 (string-append "PREFIX=" out))))))))
412 (home-page "http://www.mapeditor.org/")
413 (synopsis "Tile map editor")
415 "Tiled is a general purpose tile map editor. It is meant to be used for
416 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
419 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
421 (license license:gpl2+)))
429 ;; Do not fetch the archives from
430 ;; http://mirror0.sfml-dev.org/files/ because files there seem
431 ;; to be changed in place.
432 (uri (string-append "https://github.com/SFML/SFML/archive/"
434 (file-name (string-append name "-" version ".tar.gz"))
437 "0k2fl5xk3ni2q8bsxl0551inx26ww3w6cp6hssvww0wfjdjcirsm"))))
438 (build-system cmake-build-system)
441 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE")
442 #:tests? #f)) ; no tests
447 ("libvorbis" ,libvorbis)
449 ("xcb-util-image" ,xcb-util-image)
450 ("libxrandr" ,libxrandr)
452 ("freetype" ,freetype)
454 ("libsndfile" ,libsndfile)
456 (home-page "https://www.sfml-dev.org")
457 (synopsis "Simple and Fast Multimedia Library")
459 "SFML provides a simple interface to the various computer components,
460 to ease the development of games and multimedia applications. It is composed
461 of five modules: system, window, graphics, audio and network.")
462 (license license:zlib)))
470 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
473 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
474 (build-system gnu-build-system)
476 `(#:phases (modify-phases %standard-phases
477 (delete 'configure) ; no configure script
478 (add-before 'build 'patch-makefile
479 (lambda* (#:key outputs #:allow-other-keys)
480 (let ((out (assoc-ref outputs "out")))
481 (substitute* "Makefile"
482 (("\\$\\(DESTDIR\\)/usr") out))
483 (substitute* "main.cpp"
485 (string-append out "/share")))
487 #:tests? #f)) ; no tests
489 `(("pkg-config" ,pkg-config)
490 ("desktop-file-utils" ,desktop-file-utils)))
494 (synopsis "Simple sound effect generator")
495 (description "Sfxr is a tool for quickly generating simple sound effects.
496 Originally created for use in video game prototypes, it can generate random
497 sounds from presets such as \"explosion\" or \"powerup\".")
498 (home-page "http://www.drpetter.se/project_sfxr.html")
499 (license license:expat)))
501 (define-public physfs
508 "https://icculus.org/physfs/downloads/physfs-"
510 (file-name (string-append name "-" version ".tar.gz"))
513 "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na"))))
514 (build-system cmake-build-system)
516 '(#:tests? #f)) ; no check target
520 `(("doxygen" ,doxygen)))
521 (home-page "https://icculus.org/physfs")
522 (synopsis "File system abstraction library")
524 "PhysicsFS is a library to provide abstract access to various archives.
525 It is intended for use in video games. For security, no file writing done
526 through the PhysicsFS API can leave a defined @emph{write directory}. For
527 file reading, a @emph{search path} with archives and directories is defined,
528 and it becomes a single, transparent hierarchical file system. So archive
529 files can be accessed in the same way as you access files directly on a disk,
530 and it makes it easy to ship a new archive that will override a previous
531 archive on a per-file basis.")
532 (license license:zlib)))
540 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
541 "love-" version "-linux-src.tar.gz"))
544 "11x346pw0gqad8nmkmywzx4xpcbfc3dslbrdw5x94n1i25mk0sxj"))))
545 (build-system gnu-build-system)
547 `(("pkg-config" ,pkg-config)))
550 ("freetype" ,freetype)
551 ("libmodplug" ,libmodplug)
552 ("libtheora" ,libtheora)
553 ("libvorbis" ,libvorbis)
561 (synopsis "2D game framework for Lua")
562 (description "LÖVE is a framework for making 2D games in the Lua
563 programming language.")
564 (home-page "https://love2d.org/")
565 (license license:zlib)))
567 (define-public allegro-4
573 (uri (string-append "https://github.com/liballeg/allegro5/"
574 "releases/download/" version "/allegro-"
578 "1p0ghkmpc4kwij1z9rzxfv7adnpy4ayi0ifahlns1bdzgmbyf88v"))))
579 (build-system cmake-build-system)
582 (modify-phases %standard-phases
583 (add-after 'unpack 'patch-build-system
585 ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
586 ;; via a command line option doesn't work because it is
587 ;; unconditionally clobbered in the build script.
588 (substitute* '("CMakeLists.txt")
589 (("ADDON_LINKAGE STATIC")
590 "ADDON_LINKAGE SHARED"))
595 ("libvorbis" ,libvorbis)
598 (synopsis "Game programming library")
599 (description "Allegro is a library mainly aimed at video game and
600 multimedia programming. It handles common, low-level tasks such as creating
601 windows, accepting user input, loading data, drawing images, playing sounds,
603 (home-page "http://liballeg.org")
604 (license license:giftware)))
606 (define-public allegro
612 (uri (string-append "https://github.com/liballeg/allegro5/releases"
613 "/download/" version "/allegro-"
614 (if (equal? "0" (string-take-right version 1))
615 (string-drop-right version 2)
620 "1z4lrrlmn471wb7vzbd9iw7g379vj0k964vy1s64hcvv5bhvk1g2"))))
621 (build-system cmake-build-system)
622 (arguments `(#:tests? #f)) ; there are no tests
624 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
626 ("freetype" ,freetype)
631 ("libtheora" ,libtheora)
632 ("libvorbis" ,libvorbis)
633 ("libxcursor" ,libxcursor)
634 ("libxinerama" ,libxinerama)
635 ("libxrandr" ,libxrandr)
641 `(("pkg-config" ,pkg-config)))
642 (synopsis "Game programming library")
643 (description "Allegro is a library mainly aimed at video game and
644 multimedia programming. It handles common, low-level tasks such as creating
645 windows, accepting user input, loading data, drawing images, playing sounds,
647 (home-page "http://liballeg.org")
648 (license license:bsd-3)))
650 (define-public allegro-5.0
651 (package (inherit allegro)
656 (uri (string-append "https://github.com/liballeg/allegro5/releases"
657 "/download/" version "/allegro-"
658 (if (equal? "0" (string-take-right version 1))
659 (string-drop-right version 2)
664 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
666 (define-public aseprite
669 (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
670 ;; TODO: Unbundle third party software.
672 (method url-fetch/zipbomb)
673 (uri (string-append "https://github.com/aseprite/aseprite"
674 "/releases/download/v" version
675 "/Aseprite-v" version "-Source.zip"))
678 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
679 (build-system cmake-build-system)
682 ;; Use shared libraries instead of building bundled source.
683 (list "-DWITH_WEBP_SUPPORT=1"
684 "-DUSE_SHARED_CURL=1"
685 "-DUSE_SHARED_GIFLIB=1"
686 "-DUSE_SHARED_JPEGLIB=1"
687 "-DUSE_SHARED_ZLIB=1"
688 "-DUSE_SHARED_LIBPNG=1"
689 "-DUSE_SHARED_LIBLOADPNG=1"
690 "-DUSE_SHARED_LIBWEBP=1"
691 "-DUSE_SHARED_TINYXML=1"
692 "-DUSE_SHARED_PIXMAN=1"
693 "-DUSE_SHARED_FREETYPE=1"
694 "-DUSE_SHARED_ALLEGRO4=1"
695 "-DENABLE_UPDATER=0" ; no auto-updates
696 (string-append "-DFREETYPE_INCLUDE_DIR="
697 (assoc-ref %build-inputs "freetype")
698 "/include/freetype2"))))
700 `(("pkg-config" ,pkg-config)))
701 ;; TODO: Use a patched Allegro 4 that supports window resizing. This
702 ;; patched version is bundled with Aseprite, but the patches should be
703 ;; extracted and applied on top of a standalone Allegro 4 package.
705 `(("allegro" ,allegro-4)
707 ("freetype" ,freetype)
714 ("libxxf86vm" ,libxxf86vm)
718 (synopsis "Animated sprite editor and pixel art tool")
719 (description "Aseprite is a tool for creating 2D pixel art for video
720 games. In addition to basic pixel editing features, Aseprite can assist in
721 the creation of animations, tiled graphics, texture atlases, and more.")
722 (home-page "https://www.aseprite.org/")
723 (license license:gpl2+)))
725 (define-public qqwing
732 "https://qqwing.com/"
733 name "-" version ".tar.gz"))
736 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
737 (build-system gnu-build-system)
739 `(("pkg-config" ,pkg-config)))
740 (home-page "https://qqwing.com/")
741 (synopsis "Sudoku puzzle solver and generator")
743 "QQWing is a Sudoku puzzle generator and solver.
744 It offers the following features:
746 @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
747 @item Uses logic. Uses as many solve techniques as possible when solving
748 puzzles rather than guessing.
749 @item Rates puzzles. Most generators don't give an indication of the difficulty
750 of a Sudoku puzzle. QQwing does.
751 @item Can print solve instructions for any puzzle.
752 @item Customizable output style, including a CSV style that is easy to
753 import into a database.
755 (license license:gpl2+)))
757 (define-public quesoglc
763 (uri (string-append "mirror://sourceforge/" name "/" version "/"
764 name "-" version "-free.tar.bz2"))
767 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
768 (build-system gnu-build-system)
769 (native-inputs `(("pkg-config" ,pkg-config)))
770 (inputs `(("fontconfig" ,fontconfig)
771 ("freeglute" ,freeglut)
774 (home-page "http://quesoglc.sourceforge.net")
775 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
777 "The OpenGL Character Renderer (GLC) is a state machine that provides
778 OpenGL programs with character rendering services via an application programming
780 (license (list license:expat license:lgpl2.1+))))
782 (define-public python-pygame
784 (name "python-pygame")
788 (uri (pypi-uri "pygame" version))
791 "1hlydiyygl444bq5m5g8n3jsxsgrdyxlm42ipmfbw36wkf0j243m"))))
792 (build-system python-build-system)
794 `(#:tests? #f ; Tests require pygame to be installed first.
796 (modify-phases %standard-phases
797 ;; Set the paths to the dependencies manually because
798 ;; the configure script does not allow passing them as
799 ;; parameters. This also means we can skip the configure
801 (add-before 'build 'set-library-paths
802 (lambda* (#:key inputs outputs #:allow-other-keys)
803 (let ((sdl-ref (assoc-ref inputs "sdl"))
804 (font-ref (assoc-ref inputs "sdl-ttf"))
805 (image-ref (assoc-ref inputs "sdl-image"))
806 (mixer-ref (assoc-ref inputs "sdl-mixer"))
807 (smpeg-ref (assoc-ref inputs "libsmpeg"))
808 (png-ref (assoc-ref inputs "libpng"))
809 (jpeg-ref (assoc-ref inputs "libjpeg"))
810 (freetype-ref (assoc-ref inputs "freetype"))
811 (v4l-ref (assoc-ref inputs "v4l-utils"))
812 (out-ref (assoc-ref outputs "out")))
813 (substitute* "Setup.in"
814 (("SDL = -I/usr/include/SDL")
815 (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
816 (substitute* "Setup.in"
817 (("FONT = -lSDL_ttf")
818 (string-append "FONT = -I" font-ref "/include/SDL -L"
819 font-ref "/lib -lSDL_ttf")))
820 (substitute* "Setup.in"
821 (("IMAGE = -lSDL_image")
822 (string-append "IMAGE = -I" image-ref "/include/SDL -L"
823 image-ref "/lib -lSDL_image")))
824 (substitute* "Setup.in"
825 (("MIXER = -lSDL_mixer")
826 (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
827 mixer-ref "/lib -lSDL_mixer")))
828 (substitute* "Setup.in"
830 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
831 smpeg-ref "/lib -lsmpeg")))
832 (substitute* "Setup.in"
834 (string-append "PNG = -I" png-ref "/include -L"
835 png-ref "/lib -lpng")))
836 (substitute* "Setup.in"
838 (string-append "JPEG = -I" jpeg-ref "/include -L"
839 jpeg-ref "/lib -ljpeg")))
841 (substitute* "Setup.in"
842 (("FREETYPE = -lfreetype")
843 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
844 freetype-ref "/lib -lfreetype")))
846 (substitute* "Setup.in"
848 ;; Create a path to a header file provided by v4l-utils.
849 (system* "mkdir" "linux")
850 (system* "ln" "--symbolic"
851 (string-append v4l-ref "/include/libv4l1-videodev.h")
853 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
855 `(("freetype" ,freetype)
857 ("sdl-image" ,sdl-image)
858 ("sdl-mixer" ,sdl-mixer)
864 ("libsmpeg" ,libsmpeg)
865 ("portmidi" ,portmidi)
866 ("v4l-utils" ,v4l-utils)))
867 (home-page "https://www.pygame.org")
868 (synopsis "SDL wrapper for Python")
869 (description "Pygame is a set of Python modules designed for writing games.
870 Pygame adds functionality on top of the excellent SDL library. This allows you
871 to create fully featured games and multimedia programs in the python language.")
872 (license (list license:bsd-2
873 ;; python numeric license as listed by Debian looks like
874 ;; an Expat-style license with a warranty disclaimer for
875 ;; the U.S. government and the University of California.
881 license:public-domain
884 (define-public python2-pygame
885 (package-with-python2 python-pygame))
887 (define-public grafx2
893 ;; XXX: There is no URL that contains the version. :(
894 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
897 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
898 (build-system gnu-build-system)
901 (modify-phases %standard-phases
902 (delete 'configure) ; no configure script
903 (add-before 'build 'change-to-src-directory
908 ;; SDL header files are referenced without the preceeding "SDL/".
909 (list (string-append "CFLAGS=-I"
910 (assoc-ref %build-inputs "sdl-union")
912 (string-append "prefix="
913 (assoc-ref %outputs "out")))
914 #:tests? #f)) ; no check target
916 `(("pkg-config" ,pkg-config)))
920 ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
921 (synopsis "Bitmap paint program")
922 (description "GrafX2 is a bitmap paint program inspired by the Amiga
923 programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
924 includes a very large number of tools and effects that make it particularly
925 suitable for pixel art, game graphics, and generally any detailed graphics
926 painted with a mouse.")
927 (home-page "http://pulkomandy.tk/projects/GrafX2")
928 (license license:gpl2))) ; GPLv2 only