gnu: add RetroArch.
[jackhill/guix/guix.git] / gnu / packages / games.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2014 David Thompson <dthompson2@worcester.edu>
4 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com>
6 ;;; Copyright © 2014 Sylvain Beucler <beuc@beuc.net>
7 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
8 ;;; Copyright © 2014, 2015 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages games)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix utils)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages admin)
34 #:use-module (gnu packages boost)
35 #:use-module (gnu packages gettext)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gnome)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages guile)
41 #:use-module (gnu packages libcanberra)
42 #:use-module (gnu packages image)
43 #:use-module (gnu packages ncurses)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages readline)
46 #:use-module (gnu packages xorg)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages databases)
49 #:use-module (gnu packages sdl)
50 #:use-module (gnu packages texinfo)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages fontutils)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages qt)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages pulseaudio)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages zip)
60 #:use-module (gnu packages xiph)
61 #:use-module (gnu packages curl)
62 #:use-module (gnu packages lua)
63 #:use-module (gnu packages video)
64 #:use-module (gnu packages which)
65 #:use-module (gnu packages xml)
66 #:use-module (guix build-system trivial)
67 #:use-module (guix build-system gnu)
68 #:use-module (guix build-system cmake)
69 #:use-module (guix build-system trivial))
70
71 (define-public gnubg
72 (package
73 (name "gnubg")
74 (version "1.02")
75 (source
76 (origin
77 (method url-fetch)
78 (uri (string-append "http://files.gnubg.org/media/sources/gnubg-release-"
79 version ".000-sources." "tar.gz"))
80 (sha256
81 (base32
82 "015mvjk2iw1cg1kxwxfnvp2rxb9cylf6yc39i30fdy414k07zkky"))))
83 (build-system gnu-build-system)
84 (inputs `(("glib" ,glib)
85 ("readline" ,readline)
86 ("gtk+" ,gtk+-2)
87 ("mesa" ,mesa)
88 ("glu" ,glu)
89 ("gtkglext" ,gtkglext)
90 ("sqlite" ,sqlite)
91 ("libcanberra" ,libcanberra)))
92 (native-inputs `(("python-2" ,python-2)
93 ("pkg-config" ,pkg-config)))
94 (home-page "http://gnubg.org")
95 (synopsis "Backgammon game")
96 (description "The GNU backgammon application can be used for playing, analyzing and
97 teaching the game. It has an advanced evaluation engine based on artificial
98 neural networks suitable for both beginners and advanced players. In
99 addition to a command-line interface, it also features an attractive, 3D
100 representation of the playing board.")
101 (license license:gpl3+)))
102
103 (define-public gnubik
104 (package
105 (name "gnubik")
106 (version "2.4.1")
107 (source
108 (origin
109 (method url-fetch)
110 (uri (string-append "mirror://gnu/gnubik/gnubik-"
111 version ".tar.gz"))
112 (sha256
113 (base32
114 "0mfpwz341i1qpzi2qgslpc5i7d4fv7i01kv392m11pczqdc7i7m5"))))
115 (build-system gnu-build-system)
116 (inputs `(("gtk+" ,gtk+-2)
117 ("mesa" ,mesa)
118 ("glu" ,glu)
119 ("libx11" ,libx11)
120 ("guile" ,guile-2.0)
121 ("gtkglext" ,gtkglext)))
122 (native-inputs `(("gettext" ,gnu-gettext)
123 ("pkg-config" ,pkg-config)))
124 (home-page "https://www.gnu.org/software/gnubik/")
125 (synopsis "3d Rubik's cube game")
126 (description
127 "GNUbik is a puzzle game in which you must manipulate a cube to make
128 each of its faces have a uniform color. The game is customizable, allowing
129 you to set the size of the cube (the default is 3x3) or to change the colors.
130 You may even apply photos to the faces instead of colors. The game is
131 scriptable with Guile.")
132 (license license:gpl3+)))
133
134 (define-public abbaye
135 (package
136 (name "abbaye")
137 (version "1.13")
138 (source
139 (origin
140 (method url-fetch)
141 (uri (string-append "http://abbaye-for-linux.googlecode.com/files/abbaye-for-linux-src-"
142 version ".tar.gz"))
143 (sha256
144 (base32
145 "1wgvckgqa2084rbskxif58wbb83xbas8s1i8s7d57xbj08ryq8rk"))))
146 (build-system gnu-build-system)
147 (arguments
148 '(#:modules ((ice-9 match)
149 (guix build gnu-build-system)
150 (guix build utils))
151 #:phases (alist-cons-after
152 'set-paths 'set-sdl-paths
153 (lambda* (#:key inputs outputs (search-paths '()) #:allow-other-keys)
154 (define input-directories
155 (match inputs
156 (((_ . dir) ...)
157 dir)))
158 ;; This package does not use pkg-config, so modify CPATH
159 ;; variable to point to include/SDL for SDL header files.
160 (set-path-environment-variable "CPATH"
161 '("include/SDL")
162 input-directories))
163 (alist-cons-after
164 'patch-source-shebangs 'patch-makefile
165 (lambda* (#:key outputs #:allow-other-keys)
166 ;; Replace /usr with package output directory.
167 (for-each (lambda (file)
168 (substitute* file
169 (("/usr") (assoc-ref outputs "out"))))
170 '("makefile" "src/pantallas.c" "src/comun.h")))
171 (alist-cons-before
172 'install 'make-install-dirs
173 (lambda* (#:key outputs #:allow-other-keys)
174 (let ((prefix (assoc-ref outputs "out")))
175 ;; Create directories that the makefile assumes exist.
176 (mkdir-p (string-append prefix "/bin"))
177 (mkdir-p (string-append prefix "/share/applications"))
178 (mkdir-p (string-append prefix "/share/pixmaps"))))
179 ;; No configure script.
180 (alist-delete 'configure %standard-phases))))
181 #:tests? #f)) ;; No check target.
182 (native-inputs `(("pkg-config" ,pkg-config)))
183 (inputs `(("sdl" ,sdl)
184 ("sdl-gfx" ,sdl-gfx)
185 ("sdl-image" ,sdl-image)
186 ("sdl-mixer" ,sdl-mixer)
187 ("sdl-ttf" ,sdl-ttf)))
188 (home-page "http://code.google.com/p/abbaye-for-linux/")
189 (synopsis "GNU/Linux port of the indie game \"l'Abbaye des Morts\"")
190 (description "L'Abbaye des Morts is a 2D platform game set in 13th century
191 France. The Cathars, who preach about good Christian beliefs, were being
192 expelled by the Catholic Church out of the Languedoc region in France. One of
193 them, called Jean Raymond, found an old church in which to hide, not knowing
194 that beneath its ruins lay buried an ancient evil.")
195 (license license:gpl3+)))
196
197 (define-public pingus
198 (package
199 (name "pingus")
200 (version "0.7.6")
201 (source
202 (origin
203 (method url-fetch)
204 (uri (string-append "http://pingus.googlecode.com/files/pingus-"
205 version ".tar.bz2"))
206 (sha256
207 (base32
208 "0q34d2k6anzqvb0mf67x85q92lfx9jr71ry13dlp47jx0x9i573m"))
209 (patches (list (search-patch "pingus-sdl-libs-config.patch")))))
210 (build-system gnu-build-system)
211 (native-inputs `(("pkg-config" ,pkg-config)
212 ("scons" ,scons)))
213 (inputs `(("sdl" ,sdl)
214 ("sdl-image" ,sdl-image)
215 ("sdl-mixer" ,sdl-mixer)
216 ("mesa" ,mesa)
217 ("glu" ,glu)
218 ("libpng" ,libpng)
219 ("boost" ,boost)))
220 (arguments
221 '(#:tests? #f ;no check target
222 #:phases
223 (alist-delete
224 'configure
225 (alist-replace
226 'install
227 (lambda* (#:key outputs #:allow-other-keys)
228 (zero? (system* "make" "install"
229 (string-append "PREFIX="
230 (assoc-ref outputs "out")))))
231 %standard-phases))))
232 (home-page "http://pingus.seul.org/welcome.html")
233 (synopsis "Lemmings clone")
234 (description
235 "Pingus is a free Lemmings-like puzzle game in which the player takes
236 command of a bunch of small animals and has to guide them through levels.
237 Since the animals walk on their own, the player can only influence them by
238 giving them commands, like build a bridge, dig a hole, or redirect all animals
239 in the other direction. Multiple such commands are necessary to reach the
240 level's exit. The game is presented in a 2D side view.")
241 ;; Some source files are under bsd-3 and gpl2+ licenses.
242 (license license:gpl3+)))
243
244 (define-public talkfilters
245 (package
246 (name "talkfilters")
247 (version "2.3.8")
248 (source
249 (origin
250 (method url-fetch)
251 (uri (string-append "http://www.hyperrealm.com/" name "/"
252 name "-" version ".tar.gz"))
253 (sha256
254 (base32 "19nc5vq4bnkjvhk8srqddzhcs93jyvpm9r6lzjzwc1mgf08yg0a6"))))
255 (build-system gnu-build-system)
256 (home-page "http://www.gnu.org/software/talkfilters")
257 (synopsis "Convert English text to humorous dialects")
258 (description "The GNU Talk Filters are programs that convert English text
259 into stereotyped or otherwise humorous dialects. The filters are provided as
260 a C library, so they can easily be integrated into other programs.")
261 (license license:gpl2+)))
262
263 (define-public cmatrix
264 (package
265 (name "cmatrix")
266 (version "1.2a")
267 (source
268 (origin
269 (method url-fetch)
270 (uri (string-append "http://www.asty.org/cmatrix/dist/cmatrix-" version
271 ".tar.gz"))
272 (sha256
273 (base32
274 "0k06fw2n8nzp1pcdynhajp5prba03gfgsbj91bknyjr5xb5fd9hz"))))
275 (build-system gnu-build-system)
276 (arguments
277 '(#:phases
278 (alist-replace 'configure
279 (lambda* (#:key outputs #:allow-other-keys)
280 ;; This old `configure' script doesn't support
281 ;; variables passed as arguments.
282 (let ((out (assoc-ref outputs "out")))
283 (setenv "CONFIG_SHELL" (which "bash"))
284 (zero?
285 (system* "./configure"
286 (string-append "--prefix=" out)))))
287 %standard-phases)))
288 (inputs `(("ncurses" ,ncurses)))
289 (home-page "http://www.asty.org/cmatrix")
290 (synopsis "Simulate the display from \"The Matrix\"")
291 (description "CMatrix simulates the display from \"The Matrix\" and is
292 based on the screensaver from the movie's website. It works with terminal
293 settings up to 132x300 and can scroll lines all at the same rate or
294 asynchronously and at a user-defined speed.")
295 (license license:gpl2+)))
296
297 (define-public chess
298 (package
299 (name "chess")
300 (version "6.1.1")
301 (source
302 (origin
303 (method url-fetch)
304 (uri (string-append "mirror://gnu/chess/gnuchess-" version
305 ".tar.gz"))
306 (sha256
307 (base32
308 "1jckpg1qi1vjr3pqs0dnip3rmn0mgklx63xflrpqiv3cx2qlz8kn"))))
309 (build-system gnu-build-system)
310 (home-page "http://www.gnu.org/software/chess")
311 (synopsis "Full chess implementation")
312 (description "GNU Chess is a chess engine. It allows you to compete
313 against the computer in a game of chess, either through the default terminal
314 interface or via an external visual interface such as GNU XBoard.")
315 (license license:gpl3+)))
316
317 (define freedink-engine
318 (package
319 (name "freedink-engine")
320 (version "108.4")
321 (source (origin
322 (method url-fetch)
323 (uri (string-append "mirror://gnu/freedink/freedink-" version
324 ".tar.gz"))
325 (sha256
326 (base32
327 "08c51imfjfcydm7h0va09z8qfw5nc837bi2x754ni2z737hb5kw2"))))
328 (build-system gnu-build-system)
329 (arguments `(#:configure-flags '("--disable-embedded-resources")))
330 (native-inputs `(("gettext" ,gnu-gettext)
331 ("pkg-config" ,pkg-config)))
332 (inputs `(("sdl" ,sdl)
333 ("sdl-image" ,sdl-image)
334 ("sdl-mixer" ,sdl-mixer)
335 ("sdl-ttf" ,sdl-ttf)
336 ("sdl-gfx" ,sdl-gfx)
337 ("fontconfig" ,fontconfig)
338 ("check" ,check)))
339 (home-page "http://www.gnu.org/software/freedink/")
340 (synopsis "Twisted adventures of young pig farmer Dink Smallwood")
341 (description
342 "GNU FreeDink is a free and portable re-implementation of the engine
343 for the role-playing game Dink Smallwood. It supports not only the original
344 game data files but it also supports user-produced game mods or \"D-Mods\".
345 To that extent, it also includes a front-end for managing all of your D-Mods.")
346 (license license:gpl3+)))
347
348 (define freedink-data
349 (package
350 (name "freedink-data")
351 (version "1.08.20140901")
352 (source (origin
353 (method url-fetch)
354 (uri (string-append "mirror://gnu/freedink/freedink-data-"
355 version ".tar.gz"))
356 (sha256
357 (base32
358 "04f1aa8gfz30qkgv7chjz5n1s8v5hbqs01h2113cq1ylm3isd5sp"))))
359 (build-system gnu-build-system)
360 (arguments
361 `(#:phases (alist-delete 'configure (alist-delete 'check %standard-phases))
362 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
363 (home-page "http://www.gnu.org/software/freedink/")
364 (synopsis "Game data for GNU Freedink")
365 (description
366 "This package contains the game data of GNU Freedink.")
367 (license license:gpl3+)))
368
369 ;; TODO: Add freedink-dfarc when there's a wxWidgets package.
370
371 (define-public freedink
372 ;; This is a wrapper that tells the engine where to find the data.
373 (package (inherit freedink-engine)
374 (name "freedink")
375 (build-system trivial-build-system)
376 (arguments
377 '(#:builder (begin
378 (use-modules (guix build utils))
379
380 (let* ((output (assoc-ref %outputs "out"))
381 (bin (string-append output "/bin"))
382 (executable (string-append bin "/freedink")))
383 (mkdir-p bin)
384 (call-with-output-file executable
385 (lambda (port)
386 (format port "#!~a/bin/sh
387 exec ~a/bin/freedink -refdir ~a/share/dink\n"
388 (assoc-ref %build-inputs "bash")
389 (assoc-ref %build-inputs "engine")
390 (assoc-ref %build-inputs "data"))
391 (chmod port #o777)))))
392 #:modules ((guix build utils))))
393 (inputs `(("engine" ,freedink-engine)
394 ("data" ,freedink-data)
395 ("bash" ,bash)))
396 (native-inputs '())))
397
398 (define-public xboard
399 (package
400 (name "xboard")
401 (version "4.7.3")
402 (source
403 (origin
404 (method url-fetch)
405 (uri (string-append "mirror://gnu/xboard/xboard-" version
406 ".tar.gz"))
407 (sha256
408 (base32
409 "1amy9krr0qkvcc7gnp3i9x9ma91fc5cq8hy3gdc7rmfsaczv1l3z"))))
410 (build-system gnu-build-system)
411 (arguments
412 '(#:phases
413 (alist-cons-before
414 'configure 'pre-conf
415 ;; This is GNU. So use gnuchess as the first choice of engine
416 (lambda _
417 (substitute* "xboard.conf.in"
418 (("-firstChessProgram fairymax") "-firstChessProgram gnuchess")))
419 %standard-phases)))
420 (inputs `(("cairo" ,cairo)
421 ("librsvg" ,librsvg)
422 ("libxt" ,libxt)
423 ("libxaw" ,libxaw)))
424 (native-inputs `(("texinfo" ,texinfo)
425 ("pkg-config" ,pkg-config)))
426 (home-page "http://www.gnu.org/software/xboard")
427 (synopsis "Graphical user interface for chess programs")
428 (description "GNU XBoard is a graphical board for all varieties of chess,
429 including international chess, xiangqi (Chinese chess), shogi (Japanese chess)
430 and Makruk. Several lesser-known variants are also supported. It presents a
431 fully interactive graphical interface and it can load and save games in the
432 Portable Game Notation.")
433 (license license:gpl3+)))
434
435
436 (define-public xboing
437 (package
438 (name "xboing")
439 (version "2.4")
440 (source
441 (origin
442 (method url-fetch)
443 (uri (string-append "http://www.techrescue.org/xboing/xboing"
444 version ".tar.gz"))
445 (sha256
446 (base32 "16m2si8wmshxpifk861vhpqviqxgcg8bxj6wfw8hpnm4r2w9q0b7"))))
447 (arguments
448 `(#:tests? #f
449 #:phases
450 (alist-replace
451 'configure
452 (lambda* (#:key outputs #:allow-other-keys)
453
454 (substitute* "Imakefile"
455 (("XPMINCLUDE[\t ]*= -I/usr/X11/include/X11")
456 (string-append "XPMINCLUDE = -I" (assoc-ref %build-inputs "libxpm")
457 "/include/X11")))
458
459 (substitute* "Imakefile"
460 (("XBOING_DIR = \\.") "XBOING_DIR=$(PROJECTROOT)"))
461
462 ;; FIXME: HIGH_SCORE_FILE should be set to somewhere writeable
463
464 (zero? (system* "xmkmf" "-a"
465 (string-append "-DProjectRoot="
466 (assoc-ref outputs "out")))))
467 (alist-replace 'install
468 (lambda* (#:key outputs #:allow-other-keys)
469 (and
470 (zero? (system* "make" "install.man"))
471 (zero? (system* "make" "install"))))
472 %standard-phases))))
473 (inputs `(("libx11" ,libx11)
474 ("libxext" ,libxext)
475 ("libxpm" ,libxpm)))
476 (native-inputs `(("imake" ,imake)
477 ("inetutils" ,inetutils)
478 ("makedepend" ,makedepend)))
479 (build-system gnu-build-system)
480 (home-page "http://www.techrescue.org/xboing")
481 (synopsis "Ball and paddle game")
482 (description "XBoing is a blockout type game where you have a paddle which
483 you control to bounce a ball around the game zone destroying blocks with a
484 proton ball. Each block carries a different point value. The more blocks you
485 destroy, the better your score. The person with the highest score wins.")
486 (license (license:x11-style "file://COPYING"
487 "Very similar to the X11 licence."))))
488
489 (define-public gtypist
490 (package
491 (name "gtypist")
492 (version "2.9.5")
493 (source (origin
494 (method url-fetch)
495 (uri (string-append "mirror://gnu/gtypist/gtypist-"
496 version ".tar.xz"))
497 (sha256
498 (base32
499 "0xzrkkmj0b1dw3yr0m9hml2y634cc4h61im6zwcq57s7285z8fn1"))
500 (modules '((guix build utils)))
501 (snippet
502 ;; We do not provide `ncurses.h' within an `ncursesw'
503 ;; sub-directory, so patch the source accordingly. See
504 ;; <http://bugs.gnu.org/19018>.
505 '(for-each (lambda (file)
506 (substitute* file
507 (("ncursesw/ncurses.h")
508 "ncurses.h")))
509 (find-files "." "configure$|\\.c$")))))
510 (build-system gnu-build-system)
511 (inputs `(("ncurses" ,ncurses)
512 ("perl" ,perl)))
513 (home-page "http://www.gnu.org/software/gtypist/")
514 (synopsis "Typing tutor")
515 (description
516 "GNU Typist is a universal typing tutor. It can be used to learn and
517 practice touch-typing. Several tutorials are included; in addition to
518 tutorials for the standard QWERTY layout, there are also tutorials for the
519 alternative layouts Dvorak and Colemak, as well as for the numpad. Tutorials
520 are primarily in English, however some in other languages are provided.")
521 (license license:gpl3+)))
522
523 (define-public tiled
524 (package
525 (name "tiled")
526 (version "0.10.2")
527 (source (origin
528 (method url-fetch)
529 (uri (string-append "https://github.com/bjorn/tiled/archive/v"
530 version ".tar.gz"))
531 (sha256
532 (base32
533 "0p4p3lv4nw11fkfvvyjirb93r2x4w2rrc2w650gl2k57k92jpiij"))))
534 (build-system gnu-build-system)
535 (inputs `(("qt" ,qt)
536 ("zlib" ,zlib)))
537 (arguments
538 '(#:phases
539 (alist-replace
540 'configure
541 (lambda* (#:key outputs #:allow-other-keys)
542 (let ((out (assoc-ref outputs "out")))
543 (system* "qmake"
544 (string-append "PREFIX=" out))))
545 %standard-phases)))
546 (home-page "http://www.mapeditor.org/")
547 (synopsis "Tile map editor")
548 (description
549 "Tiled is a general purpose tile map editor. It is meant to be used for
550 editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
551 clone.")
552
553 ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
554 ;; under BSD-2.
555 (license license:gpl2+)))
556
557 (define-public openal
558 (package
559 (name "openal")
560 (version "1.15.1")
561 (source (origin
562 (method url-fetch)
563 (uri (string-append
564 "http://kcat.strangesoft.net/openal-releases/openal-soft-"
565 version ".tar.bz2"))
566 (sha256
567 (base32
568 "0mmhdqiyb3c9dzvxspm8h2v8jibhi8pfjxnf6m0wn744y1ia2a8f"))))
569 (build-system cmake-build-system)
570 (arguments
571 `(#:tests? #f)) ; no check target
572 (inputs
573 `(("alsa-lib" ,alsa-lib)
574 ("pulseaudio" ,pulseaudio)))
575 (synopsis "3D audio API")
576 (description
577 "OpenAL provides capabilities for playing audio in a virtual 3D
578 environment. Distance attenuation, doppler shift, and directional sound
579 emitters are among the features handled by the API. More advanced effects,
580 including air absorption, occlusion, and environmental reverb, are available
581 through the EFX extension. It also facilitates streaming audio, multi-channel
582 buffers, and audio capture.")
583 (home-page "http://kcat.strangesoft.net/openal.html")
584 (license license:lgpl2.0+)))
585
586 (define-public irrlicht
587 (package
588 (name "irrlicht")
589 (version "1.8.1")
590 (source (origin
591 (method url-fetch)
592 (uri (string-append
593 "mirror://sourceforge/irrlicht/Irrlicht%20SDK/"
594 (version-major+minor version)
595 "/" version "/irrlicht-" version ".zip"))
596 (sha256
597 (base32
598 "0yz9lvsc8aqk8wj4rnpanxrw90gqpwn9w5hxp94r8hnm2q0vjjw1"))))
599 (build-system gnu-build-system)
600 (arguments
601 '(#:phases (alist-cons-after
602 'unpack 'fix-build-env
603 (lambda* (#:key outputs #:allow-other-keys)
604 (let ((out (assoc-ref outputs "out")))
605 (substitute* "Makefile"
606 (("INSTALL_DIR = /usr/local/lib")
607 (string-append "INSTALL_DIR = " out "/lib")))
608 ;; The Makefile assumes these directories exist.
609 (mkdir-p (string-append out "/lib"))
610 (mkdir-p (string-append out "/include"))))
611 (alist-replace
612 'unpack
613 (lambda* (#:key source #:allow-other-keys)
614 (and (zero? (system* "unzip" source))
615 ;; The actual source is buried a few directories deep.
616 (chdir "irrlicht-1.8.1/source/Irrlicht/")))
617 (alist-cons-after
618 'unpack 'apply-patch/mesa-10-fix
619 (lambda* (#:key inputs #:allow-other-keys)
620 (zero? (system* "patch" "--force" "-p3" "-i"
621 (assoc-ref inputs "patch/mesa-10-fix"))))
622 ;; No configure script
623 (alist-delete 'configure %standard-phases))))
624 #:tests? #f ; no check target
625 #:make-flags '("CC=gcc" "sharedlib")))
626 (native-inputs
627 `(("patch/mesa-10-fix" ,(search-patch "irrlicht-mesa-10.patch"))
628 ("unzip" ,unzip)))
629 (inputs
630 `(("mesa" ,mesa)
631 ("glu" ,glu)))
632 (synopsis "3D game engine written in C++")
633 (description
634 "The Irrlicht Engine is a high performance realtime 3D engine written in
635 C++. Features include an OpenGL renderer, extensible materials, scene graph
636 management, character animation, particle and other special effects, support
637 for common mesh file formats, and collision detection.")
638 (home-page "http://irrlicht.sourceforge.net/")
639 (license license:zlib)))
640
641 (define minetest-data
642 (package
643 (name "minetest-data")
644 (version "0.4.11")
645 (source (origin
646 (method url-fetch)
647 (uri (string-append
648 "https://github.com/minetest/minetest_game/archive/"
649 version ".tar.gz"))
650 (sha256
651 (base32
652 "0hzb27srv6f2j84dpxx2p0p0aaq9vdp5jvbrfpklb5q5ssdjxvc6"))))
653 (build-system trivial-build-system)
654 (native-inputs
655 `(("source" ,source)
656 ("tar" ,tar)
657 ("gzip" ,(@ (gnu packages compression) gzip))))
658 (arguments
659 `(#:modules ((guix build utils))
660 #:builder (begin
661 (use-modules (guix build utils))
662 (let ((tar (string-append (assoc-ref %build-inputs "tar")
663 "/bin/tar"))
664 (install-dir (string-append
665 %output
666 "/share/minetest/games/minetest_game"))
667 (path (string-append (assoc-ref %build-inputs
668 "gzip")
669 "/bin")))
670 (setenv "PATH" path)
671 (system* tar "xvf" (assoc-ref %build-inputs "source"))
672 (chdir (string-append "minetest_game-" ,version))
673 (mkdir-p install-dir)
674 (copy-recursively "." install-dir)))))
675 (synopsis "Main game data for the Minetest game engine")
676 (description
677 "Game data for the Minetest infinite-world block sandox game.")
678 (home-page "http://minetest.net")
679 (license license:lgpl2.1+)))
680
681 (define-public minetest
682 (package
683 (name "minetest")
684 (version "0.4.11")
685 (source (origin
686 (method url-fetch)
687 (uri (string-append
688 "https://github.com/minetest/minetest/archive/"
689 version ".tar.gz"))
690 (sha256
691 (base32
692 "0h223svzkvp63b77nqfxy7k8whw4543gahs3kxd3x4myi5ax5z5f"))))
693 (build-system cmake-build-system)
694 (arguments
695 '(#:modules ((guix build utils)
696 (guix build cmake-build-system)
697 (ice-9 match))
698 #:phases (alist-cons-before
699 'configure 'set-cpath
700 (lambda* (#:key inputs #:allow-other-keys)
701 (use-modules (ice-9 match))
702 ;; Adjust the CPATH so that cmake can find irrlicht,
703 ;; openal, and curl headers.
704 (set-path-environment-variable "CPATH"
705 '("include/AL"
706 "include/irrlicht"
707 "include/curl"
708 "include")
709 (map (match-lambda
710 ((_ . dir) dir))
711 inputs)))
712 %standard-phases)
713 #:configure-flags '("-DRUN_IN_PLACE=0"
714 "-DENABLE_FREETYPE=1"
715 "-DENABLE_GETTEXT=1")
716 #:tests? #f)) ; no check target
717 (native-search-paths
718 (list (search-path-specification
719 (variable "MINETEST_SUBGAME_PATH")
720 (directories '("share/minetest/games")))))
721 (native-inputs
722 `(("pkg-config" ,pkg-config)))
723 (inputs
724 `(("irrlicht" ,irrlicht)
725 ("libpng" ,libpng)
726 ("libjpeg-8" ,libjpeg-8)
727 ("libxxf86vm" ,libxxf86vm)
728 ("mesa" ,mesa)
729 ("libogg" ,libogg)
730 ("libvorbis" ,libvorbis)
731 ("openal" ,openal)
732 ("freetype" ,(@ (gnu packages fontutils) freetype))
733 ("curl" ,curl)
734 ("luajit" ,luajit)
735 ("gettext" ,gnu-gettext)
736 ("sqlite" ,sqlite)))
737 (propagated-inputs
738 `(("minetest-data" ,minetest-data)))
739 (synopsis "Infinite-world block sandbox game")
740 (description
741 "Minetest is a sandbox construction game. Players can create and destroy
742 various types of blocks in a three-dimensional open world. This allows
743 forming structures in every possible creation, on multiplayer servers or as a
744 single player. Mods and texture packs allow players to personalize the game
745 in different ways.")
746 (home-page "http://minetest.net")
747 (license license:lgpl2.1+)))
748
749 (define glkterm
750 (package
751 (name "glkterm")
752 (version "1.0.4")
753 (source
754 (origin
755 (method url-fetch)
756 (uri (string-append "http://www.ifarchive.org/if-archive/programming/"
757 "glk/implementations/glkterm-104.tar.gz"))
758 (sha256
759 (base32
760 "0zlj9nlnkdlvgbiliczinirqygiq8ikg5hzh5vgcmnpg9pvnwga7"))))
761 (build-system gnu-build-system)
762 (propagated-inputs `(("ncurses" ,ncurses))) ; required by Make.glkterm
763 (arguments
764 '(#:tests? #f ; no check target
765 #:phases
766 (alist-replace
767 'install
768 (lambda* (#:key outputs #:allow-other-keys)
769 (let* ((out (assoc-ref outputs "out"))
770 (inc (string-append out "/include")))
771 (mkdir-p inc)
772 (for-each
773 (lambda (file)
774 (copy-file file (string-append inc "/" file)))
775 '("glk.h" "glkstart.h" "gi_blorb.h" "gi_dispa.h" "Make.glkterm"))
776 (mkdir (string-append out "/lib"))
777 (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))
778 (alist-delete 'configure %standard-phases))))
779 (home-page "http://www.eblong.com/zarf/glk/")
780 (synopsis "Curses Implementation of the Glk API")
781 (description
782 "Glk defines a portable API for applications with text UIs. It was
783 primarily designed for interactive fiction, but it should be suitable for many
784 interactive text utilities, particularly those based on a command line.
785 This is an implementation of the Glk library which runs in a terminal window,
786 using the curses.h library for screen control.")
787 (license (license:fsf-free "file://README"))))
788
789 (define-public glulxe
790 (package
791 (name "glulxe")
792 (version "0.5.2")
793 (source
794 (origin
795 (method url-fetch)
796 (uri (string-append "http://www.ifarchive.org/if-archive/programming/"
797 "glulx/interpreters/glulxe/glulxe-052.tar.gz"))
798 (sha256
799 (base32
800 "19iw6kl8ncqcy9pv4gsqfh3xsa1n94zd234rqavvmxccnf3nj19g"))))
801 (build-system gnu-build-system)
802 (inputs `(("glk" ,glkterm)))
803 (arguments
804 '(#:tests? #f ; no check target
805 #:make-flags
806 (let* ((glk (assoc-ref %build-inputs "glk")))
807 (list (string-append "GLKINCLUDEDIR=" glk "/include")
808 (string-append "GLKLIBDIR=" glk "/lib")
809 (string-append "GLKMAKEFILE=" "Make.glkterm")))
810 #:phases
811 (alist-replace
812 'install
813 (lambda* (#:key outputs #:allow-other-keys)
814 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
815 (mkdir-p bin)
816 (copy-file "glulxe" (string-append bin "/glulxe"))))
817 (alist-delete 'configure %standard-phases))))
818 (home-page "http://www.eblong.com/zarf/glulx/")
819 (synopsis "Interpreter for Glulx VM")
820 (description
821 "Glulx is a 32-bit portable virtual machine intended for writing and
822 playing interactive fiction. It was designed by Andrew Plotkin to relieve
823 some of the restrictions in the venerable Z-machine format. This is the
824 reference interpreter, using Glk API.")
825 (license (license:fsf-free "file://README"))))
826
827 (define-public retroarch
828 (package
829 (name "retroarch")
830 (version "1.0.0.3-beta")
831 (source
832 (origin
833 (method url-fetch)
834 (uri (string-append "https://github.com/libretro/RetroArch/archive/"
835 version ".tar.gz"))
836 (sha256
837 (base32 "1iqcrb076xiih20sk8n1w79xsp4fb8pj4vkmdc1xn562h56y4nxx"))))
838 (build-system gnu-build-system)
839 (arguments
840 '(#:tests? #f ; no tests
841 #:phases
842 (alist-replace
843 'configure
844 (lambda _
845 (substitute* "qb/qb.libs.sh"
846 (("/bin/true") (which "true")))
847 (zero? (system*
848 "./configure"
849 (string-append "--prefix=" %output)
850 (string-append "--global-config-dir=" %output "/etc"))))
851 %standard-phases)))
852 (inputs
853 `(("alsa-lib" ,alsa-lib)
854 ("ffmpeg" ,ffmpeg)
855 ("freetype" ,freetype)
856 ("libxinerama" ,libxinerama)
857 ("libxkbcommon" ,libxkbcommon)
858 ("libxml2" ,libxml2)
859 ("libxv" ,libxv)
860 ("mesa" ,mesa)
861 ("openal" ,openal)
862 ("pulseaudio" ,pulseaudio)
863 ("python" ,python)
864 ("sdl" ,sdl2)
865 ("udev" ,eudev)
866 ("zlib" ,zlib)))
867 (native-inputs
868 `(("pkg-config" ,pkg-config)
869 ("which" ,which)))
870 (home-page "http://www.libretro.com/")
871 (synopsis "Reference frontend for the libretro API")
872 (description
873 "Libretro is a simple but powerful development interface that allows for
874 the easy creation of emulators, games and multimedia applications that can plug
875 straight into any libretro-compatible frontend. RetroArch is the official
876 reference frontend for the libretro API, currently used by most as a modular
877 multi-system game/emulator system.")
878 (license license:gpl3+)))