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