gnu: game-development: Use HTTPS where possible.
[jackhill/guix/guix.git] / gnu / packages / game-development.scm
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>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
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.
19 ;;;
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.
24 ;;;
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/>.
27
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))
69
70 (define-public bullet
71 (package
72 (name "bullet")
73 (version "2.85.1")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append "https://github.com/bulletphysics/bullet3/"
77 "archive/" version ".tar.gz"))
78 (file-name (string-append name "-" version ".tar.gz"))
79 (sha256
80 (base32
81 "0qpd37ws0xlxwy55dg058a5b4yw2jxiz09yyc3lc0frpa05pq5bf"))))
82 (build-system cmake-build-system)
83 (arguments
84 '(#:configure-flags (list (string-append
85 "-DBUILD_SHARED_LIBS=ON "
86 "-DCMAKE_CXX_FLAGS=-fPIC "
87 (or (getenv "CXXFLAGS") "")))))
88 (inputs
89 `(("glu" ,glu)
90 ("libx11" ,libx11)
91 ("mesa" ,mesa)))
92 (home-page "http://bulletphysics.org/")
93 (synopsis "3D physics engine library")
94 (description
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)))
98
99 (define-public deutex
100 (package
101 (name "deutex")
102 (version "4.4.902")
103 (source (origin
104 (method url-fetch)
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"))
108 (sha256
109 (base32
110 "0rwz1yzgd539x4h25kzhar4q02xyxjwfrcpz4m8ixi312a82p7cn"))))
111 (build-system gnu-build-system)
112 (arguments
113 '(#:tests? #f ; no check target
114 #:phases
115 (modify-phases %standard-phases
116 ;; The provided configure script takes a restricted number of arguments.
117 (replace 'configure
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.
126 (replace 'install
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")))
134 #t)))))
135 (home-page "https://github.com/Doom-Utils/deutex")
136 (synopsis "WAD file composer for Doom and related games")
137 (description
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+)))
147
148 (define-public gzochi
149 (package
150 (name "gzochi")
151 (version "0.10.1")
152 (source (origin
153 (method url-fetch)
154 (uri (string-append "mirror://savannah/gzochi/gzochi-"
155 version ".tar.gz"))
156 (sha256
157 (base32
158 "166rawdal45kvanhvi0bkzy1d2pwf1p0lzslb287lcnm9vdw97yy"))))
159 (build-system gnu-build-system)
160 (arguments
161 '(#:phases (modify-phases %standard-phases
162 (add-before 'configure 'remove-Werror
163 (lambda _
164 ;; We can't build with '-Werror', notably
165 ;; because deprecated functions of
166 ;; libmicrohttpd are being used.
167 (substitute* (find-files "." "^Makefile\\.in$")
168 (("-Werror")
169 ""))
170 #t)))))
171 (native-inputs `(("pkgconfig" ,pkg-config)))
172 (inputs `(("bdb" ,bdb)
173 ("glib" ,glib)
174 ("guile" ,guile-2.0)
175 ("libmicrohttpd" ,libmicrohttpd)
176 ("ncurses" ,ncurses)
177 ("sdl" ,sdl)
178 ("zlib" ,zlib)))
179 (home-page "http://www.nongnu.org/gzochi/")
180 (synopsis "Scalable middleware for multiplayer games")
181 (description
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+)))
189
190 (define-public tiled
191 (package
192 (name "tiled")
193 (version "0.18.2")
194 (source (origin
195 (method url-fetch)
196 (uri (string-append "https://github.com/bjorn/tiled/archive/v"
197 version ".tar.gz"))
198 (file-name (string-append name "-" version ".tar.gz"))
199 (sha256
200 (base32
201 "1kcj2blrlfpghjv0qigip2qcbxfx7vv9i8nr4997hkwhsh6i2pjp"))))
202 (build-system gnu-build-system)
203 (inputs `(("qt" ,qt)
204 ("zlib" ,zlib)))
205 (arguments
206 '(#:phases
207 (modify-phases %standard-phases
208 (replace 'configure
209 (lambda* (#:key outputs #:allow-other-keys)
210 (let ((out (assoc-ref outputs "out")))
211 (system* "qmake"
212 (string-append "PREFIX=" out))))))))
213 (home-page "http://www.mapeditor.org/")
214 (synopsis "Tile map editor")
215 (description
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
218 clone.")
219
220 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
221 ;; under BSD-2.
222 (license license:gpl2+)))
223
224 (define-public sfml
225 (package
226 (name "sfml")
227 (version "2.3.2")
228 (source (origin
229 (method url-fetch)
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/"
234 version ".tar.gz"))
235 (file-name (string-append name "-" version ".tar.gz"))
236 (sha256
237 (base32
238 "0k2fl5xk3ni2q8bsxl0551inx26ww3w6cp6hssvww0wfjdjcirsm"))))
239 (build-system cmake-build-system)
240 (arguments
241 '(#:configure-flags
242 (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE")
243 #:tests? #f)) ; no tests
244 (inputs
245 `(("mesa" ,mesa)
246 ("glew" ,glew)
247 ("flac" ,flac)
248 ("libvorbis" ,libvorbis)
249 ("libx11" ,libx11)
250 ("xcb-util-image" ,xcb-util-image)
251 ("libxrandr" ,libxrandr)
252 ("eudev" ,eudev)
253 ("freetype" ,freetype)
254 ("libjpeg" ,libjpeg)
255 ("libsndfile" ,libsndfile)
256 ("openal" ,openal)))
257 (home-page "https://www.sfml-dev.org")
258 (synopsis "Simple and Fast Multimedia Library")
259 (description
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)))
264
265 (define-public sfxr
266 (package
267 (name "sfxr")
268 (version "1.2.1")
269 (source (origin
270 (method url-fetch)
271 (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
272 (sha256
273 (base32
274 "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
275 (build-system gnu-build-system)
276 (arguments
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"
285 (("/usr/share")
286 (string-append out "/share")))
287 #t))))
288 #:tests? #f)) ; no tests
289 (native-inputs
290 `(("pkg-config" ,pkg-config)
291 ("desktop-file-utils" ,desktop-file-utils)))
292 (inputs
293 `(("sdl" ,sdl)
294 ("gtk+" ,gtk+)))
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)))
301
302 (define-public physfs
303 (package
304 (name "physfs")
305 (version "2.0.3")
306 (source (origin
307 (method url-fetch)
308 (uri (string-append
309 "https://icculus.org/physfs/downloads/physfs-"
310 version ".tar.bz2"))
311 (file-name (string-append name "-" version ".tar.gz"))
312 (sha256
313 (base32
314 "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na"))))
315 (build-system cmake-build-system)
316 (arguments
317 '(#:tests? #f)) ; no check target
318 (inputs
319 `(("zlib" ,zlib)))
320 (native-inputs
321 `(("doxygen" ,doxygen)))
322 (home-page "https://icculus.org/physfs")
323 (synopsis "File system abstraction library")
324 (description
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)))
334
335 (define-public love
336 (package
337 (name "love")
338 (version "0.10.2")
339 (source (origin
340 (method url-fetch)
341 (uri (string-append "https://bitbucket.org/rude/love/downloads/"
342 "love-" version "-linux-src.tar.gz"))
343 (sha256
344 (base32
345 "11x346pw0gqad8nmkmywzx4xpcbfc3dslbrdw5x94n1i25mk0sxj"))))
346 (build-system gnu-build-system)
347 (native-inputs
348 `(("pkg-config" ,pkg-config)))
349 (inputs
350 `(("devil" ,devil)
351 ("freetype" ,freetype)
352 ("libmodplug" ,libmodplug)
353 ("libtheora" ,libtheora)
354 ("libvorbis" ,libvorbis)
355 ("luajit" ,luajit)
356 ("mesa" ,mesa)
357 ("mpg123" ,mpg123)
358 ("openal" ,openal)
359 ("physfs" ,physfs)
360 ("sdl2" ,sdl2)
361 ("zlib" ,zlib)))
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)))
367
368 (define-public allegro-4
369 (package
370 (name "allegro")
371 (version "4.4.2")
372 (source (origin
373 (method url-fetch)
374 (uri (string-append "http://download.gna.org/allegro/allegro/"
375 version "/allegro-" version ".tar.gz"))
376 (sha256
377 (base32
378 "1p0ghkmpc4kwij1z9rzxfv7adnpy4ayi0ifahlns1bdzgmbyf88v"))))
379 (build-system cmake-build-system)
380 (arguments
381 '(#:phases
382 (modify-phases %standard-phases
383 (add-after 'unpack 'patch-build-system
384 (lambda _
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"))
391 #t)))))
392 (inputs
393 `(("glu" ,glu)
394 ("libpng" ,libpng)
395 ("libvorbis" ,libvorbis)
396 ("mesa" ,mesa)
397 ("zlib" ,zlib)))
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,
402 etc.")
403 (home-page "http://liballeg.org")
404 (license license:giftware)))
405
406 (define-public allegro
407 (package
408 (name "allegro")
409 (version "5.2.0")
410 (source (origin
411 (method url-fetch)
412 (uri (string-append "http://download.gna.org/allegro/allegro/"
413 version "/allegro-" version ".tar.gz"))
414 (sha256
415 (base32
416 "1mwzgzc4nb5k5zkbq7yrc6hg63yxq3wk69lmjag1h19x8b6njnmg"))))
417 (build-system cmake-build-system)
418 (arguments `(#:tests? #f)) ; there are no tests
419 (inputs
420 ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
421 `(("flac" ,flac)
422 ("freetype" ,freetype)
423 ("glu" ,glu)
424 ("gtk" ,gtk+-2)
425 ("libjpeg" ,libjpeg)
426 ("libpng" ,libpng)
427 ("libtheora" ,libtheora)
428 ("libvorbis" ,libvorbis)
429 ("libxcursor" ,libxcursor)
430 ("libxinerama" ,libxinerama)
431 ("libxrandr" ,libxrandr)
432 ("mesa" ,mesa)
433 ("openal" ,openal)
434 ("physfs" ,physfs)
435 ("zlib" ,zlib)))
436 (native-inputs
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,
442 etc.")
443 (home-page "http://liballeg.org")
444 (license license:bsd-3)))
445
446 (define-public allegro-5.0
447 (package (inherit allegro)
448 (name "allegro")
449 (version "5.0.11")
450 (source (origin
451 (method url-fetch)
452 (uri (string-append "http://download.gna.org/allegro/allegro/"
453 version "/allegro-" version ".tar.gz"))
454 (sha256
455 (base32
456 "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
457
458 (define-public aseprite
459 (package
460 (name "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.
463 (source (origin
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"))
468 (sha256
469 (base32
470 "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
471 (build-system cmake-build-system)
472 (arguments
473 '(#:configure-flags
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"))))
491 (native-inputs
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.
496 (inputs
497 `(("allegro" ,allegro-4)
498 ("curl" ,curl)
499 ("freetype" ,freetype)
500 ("giflib" ,giflib)
501 ("libjpeg" ,libjpeg)
502 ("libpng" ,libpng)
503 ("libwebp" ,libwebp)
504 ("libx11" ,libx11)
505 ("libxext" ,libxext)
506 ("libxxf86vm" ,libxxf86vm)
507 ("pixman" ,pixman)
508 ("tinyxml" ,tinyxml)
509 ("zlib" ,zlib)))
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+)))
516
517 (define-public qqwing
518 (package
519 (name "qqwing")
520 (version "1.3.4")
521 (source (origin
522 (method url-fetch)
523 (uri (string-append
524 "https://qqwing.com/"
525 name "-" version ".tar.gz"))
526 (sha256
527 (base32
528 "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
529 (build-system gnu-build-system)
530 (native-inputs
531 `(("pkg-config" ,pkg-config)))
532 (home-page "https://qqwing.com/")
533 (synopsis "Sudoku puzzle solver and generator")
534 (description
535 "QQWing is a Sudoku puzzle generator and solver.
536 It offers the following features:
537 @enumerate
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.
546 @end enumerate")
547 (license license:gpl2+)))
548
549 (define-public quesoglc
550 (package
551 (name "quesoglc")
552 (version "0.7.2")
553 (source (origin
554 (method url-fetch)
555 (uri (string-append "mirror://sourceforge/" name "/" version "/"
556 name "-" version "-free.tar.bz2"))
557 (sha256
558 (base32
559 "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
560 (build-system gnu-build-system)
561 (native-inputs `(("pkg-config" ,pkg-config)))
562 (inputs `(("fontconfig" ,fontconfig)
563 ("freeglute" ,freeglut)
564 ("fribidi" ,fribidi)
565 ("glew" ,glew)))
566 (home-page "http://quesoglc.sourceforge.net")
567 (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
568 (description
569 "The OpenGL Character Renderer (GLC) is a state machine that provides
570 OpenGL programs with character rendering services via an application programming
571 interface (API).")
572 (license (list license:expat license:lgpl2.1+))))
573
574 (define-public python-pygame
575 (package
576 (name "python-pygame")
577 (version "1.9.3")
578 (source (origin
579 (method url-fetch)
580 (uri (pypi-uri "pygame" version))
581 (sha256
582 (base32
583 "1hlydiyygl444bq5m5g8n3jsxsgrdyxlm42ipmfbw36wkf0j243m"))))
584 (build-system python-build-system)
585 (arguments
586 `(#:tests? #f ; Tests require pygame to be installed first.
587 #:phases
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
592 ;; phase.
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"
621 (("SMPEG = -lsmpeg")
622 (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
623 smpeg-ref "/lib -lsmpeg")))
624 (substitute* "Setup.in"
625 (("PNG = -lpng")
626 (string-append "PNG = -I" png-ref "/include -L"
627 png-ref "/lib -lpng")))
628 (substitute* "Setup.in"
629 (("JPEG = -ljpeg")
630 (string-append "JPEG = -I" jpeg-ref "/include -L"
631 jpeg-ref "/lib -ljpeg")))
632
633 (substitute* "Setup.in"
634 (("FREETYPE = -lfreetype")
635 (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
636 freetype-ref "/lib -lfreetype")))
637
638 (substitute* "Setup.in"
639 (("^pypm") "#pypm"))
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")
644 "linux/videodev.h")
645 (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
646 (inputs
647 `(("freetype" ,freetype)
648 ("sdl" ,sdl)
649 ("sdl-image" ,sdl-image)
650 ("sdl-mixer" ,sdl-mixer)
651 ("sdl-ttf" ,sdl-ttf)
652 ("sdl-gfx" ,sdl-gfx)
653 ("libjpeg" ,libjpeg)
654 ("libpng" ,libpng)
655 ("libX11" ,libx11)
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.
668 license:expat
669 license:lgpl2.0+
670 license:lgpl2.1+
671 license:gpl3+
672 license:psfl
673 license:public-domain
674 license:lgpl2.1+))))
675
676 (define-public python2-pygame
677 (package-with-python2 python-pygame))
678
679 (define-public grafx2
680 (package
681 (name "grafx2")
682 (version "2.4")
683 (source (origin
684 (method url-fetch)
685 ;; XXX: There is no URL that contains the version. :(
686 (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
687 (sha256
688 (base32
689 "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
690 (build-system gnu-build-system)
691 (arguments
692 '(#:phases
693 (modify-phases %standard-phases
694 (delete 'configure) ; no configure script
695 (add-before 'build 'change-to-src-directory
696 (lambda _
697 (chdir "src")
698 #t)))
699 #:make-flags
700 ;; SDL header files are referenced without the preceeding "SDL/".
701 (list (string-append "CFLAGS=-I"
702 (assoc-ref %build-inputs "sdl-union")
703 "/include/SDL")
704 (string-append "prefix="
705 (assoc-ref %outputs "out")))
706 #:tests? #f)) ; no check target
707 (native-inputs
708 `(("pkg-config" ,pkg-config)))
709 (inputs
710 `(("libpng" ,libpng)
711 ("lua" ,lua-5.1)
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