gexp: Add pretty printer.
[jackhill/guix/guix.git] / gnu / packages / sdl.scm
CommitLineData
c3c516ea
DT
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 David Thompson <dthompson2@worcester.edu>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages sdl)
20 #:use-module (gnu packages)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
5cf3bcd4
DT
25 #:use-module ((gnu packages fontutils) #:prefix font:)
26 #:use-module (gnu packages libjpeg)
27 #:use-module (gnu packages libpng)
28 #:use-module (gnu packages libtiff)
c3c516ea 29 #:use-module (gnu packages linux)
5cf3bcd4 30 #:use-module (gnu packages mp3)
8bf8d7c7
DT
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages pulseaudio)
200726ed 33 #:use-module (gnu packages gl)
54ff0b7d 34 #:use-module (gnu packages xiph)
c3c516ea 35 #:use-module (gnu packages xorg)
8bf8d7c7
DT
36 #:export (sdl
37 sdl2
5cf3bcd4
DT
38 libmikmod
39 sdl-gfx
40 sdl-image
41 sdl-mixer
42 sdl-net
43 sdl-ttf))
8bf8d7c7
DT
44
45(define sdl
46 (package
47 (name "sdl")
48 (version "1.2.15")
49 (source (origin
50 (method url-fetch)
51 (uri
52 (string-append "http://libsdl.org/release/SDL-"
53 version ".tar.gz"))
54 (sha256
55 (base32
56 "005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn"))))
57 (build-system gnu-build-system)
22f33e61
LC
58 (arguments
59 '(;; Explicitly link against Xext because SDL tries to dlopen it and
60 ;; doesn't go very far otherwise (see
61 ;; <https://lists.gnu.org/archive/html/guix-devel/2013-11/msg00088.html>
62 ;; for details.)
63 #:configure-flags '("LDFLAGS=-lXext")
64
65 #:tests? #f)) ; no check target
558a5122
LC
66 (propagated-inputs
67 ;; SDL headers include X11 headers.
68 `(("libx11" ,libx11)))
22f33e61 69 (native-inputs `(("pkg-config" ,pkg-config)))
558a5122 70 (inputs `(("libxrandr" ,libxrandr)
8bf8d7c7
DT
71 ("mesa" ,mesa)
72 ("alsa-lib" ,alsa-lib)
8bf8d7c7
DT
73 ("pulseaudio" ,pulseaudio)))
74 (synopsis "Cross platform game development library")
75 (description "Simple DirectMedia Layer is a cross-platform development
76library designed to provide low level access to audio, keyboard, mouse,
77joystick, and graphics hardware.")
78 (home-page "http://libsdl.org/")
79 (license lgpl2.1)))
80
81(define sdl2
82 (package (inherit sdl)
83 (name "sdl2")
84 (version "2.0.0")
85 (source (origin
86 (method url-fetch)
87 (uri
88 (string-append "http://libsdl.org/release/SDL2-"
89 version ".tar.gz"))
90 (sha256
91 (base32
92 "0y3in99brki7vc2mb4c0w39v70mf4h341mblhh8nmq4h7lawhskg"))))
93 (license bsd-3)))
c3c516ea
DT
94
95(define libmikmod
96 (package
97 (name "libmikmod")
98 (version "3.3.3")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "mirror://sourceforge/mikmod/libmikmod/"
102 version "/libmikmod-" version ".tar.gz"))
103 (sha256
104 (base32
105 "0dr4kgvhq9wf2riibh178c2al996spwwak6zffpv5n5bqmw29w3r"))))
106 (build-system gnu-build-system)
107 (inputs `(("alsa-lib" ,alsa-lib)
108 ("libx11" ,libx11)))
109 (synopsis "Library for module sound formats.")
110 (description
111 "MikMod is able to play a wide range of module formats, as well as
112digital sound files. It can take advantage of particular features of your
113system, such as sound redirection over the network.")
114 (license lgpl2.1)
115 (home-page "http://mikmod.sourceforge.net/")))
5cf3bcd4
DT
116
117(define sdl-gfx
118 (package
119 (name "sdl-gfx")
120 (version "2.0.24")
121 (source (origin
122 (method url-fetch)
123 (uri
124 (string-append "http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-"
125 version ".tar.gz"))
126 (sha256
127 (base32
128 "064islldm4r42lgj9fr4kbk66r7jmmakk9745hhyb1kmw71kib9h"))))
129 (build-system gnu-build-system)
130 (propagated-inputs `(("sdl" ,sdl)))
5cf3bcd4
DT
131 (synopsis "SDL graphics primitives library")
132 (description "SDL_gfx provides graphics drawing primitives, rotozoom and
133other supporting functions for SDL.")
134 (home-page "http://www.ferzkopp.net/joomla/software-mainmenu-14/4-ferzkopps-linux-software/19-sdlgfx")
135 (license zlib)))
136
137(define sdl-image
138 (package
139 (name "sdl-image")
140 (version "1.2.12")
141 (source (origin
142 (method url-fetch)
143 (uri
144 (string-append "http://www.libsdl.org/projects/SDL_image/release/SDL_image-"
145 version ".tar.gz"))
146 (sha256
147 (base32
148 "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b"))))
149 (build-system gnu-build-system)
150 ;; FIXME: Add webp
151 (inputs `(("libpng" ,libpng)
152 ("libjpeg" ,libjpeg)
153 ("libtiff" ,libtiff)
154 ("pkg-config" ,pkg-config)))
155 (propagated-inputs `(("sdl" ,sdl)))
156 (synopsis "SDL image loading library")
157 (description "SDL_image is an image file loading library for SDL that
158supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF,
159WEBP, XCF, XPM, and XV.")
160 (home-page "www.libsdl.org/projects/SDL_image/")
161 (license zlib)))
162
163(define sdl-mixer
164 (package
165 (name "sdl-mixer")
166 (version "1.2.12")
167 (source (origin
168 (method url-fetch)
169 (uri
170 (string-append "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-"
171 version ".tar.gz"))
172 (sha256
173 (base32
174 "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n"))))
175 (build-system gnu-build-system)
176 ;; no check target
177 ;; use libmad instead of smpeg
178 (arguments `(#:tests? #f
179 #:configure-flags '("--enable-music-mp3-mad-gpl")))
180 (inputs `(("libvorbis" ,libvorbis)
181 ("libflac" ,flac)
182 ("libmad" ,libmad)
183 ("libmikmod" ,libmikmod)))
184 ;; FIXME: Add libfluidsynth
185 (propagated-inputs `(("sdl" ,sdl)))
186 (synopsis "SDL multi-channel audio mixer library")
187 (description "SDL_mixer is a multi-channel audio mixer library for SDL.
188It supports any number of simultaneously playing channels of 16 bit stereo
189audio, plus a single channel of music. Supported format include FLAC, MOD,
190MIDI, Ogg Vorbis, and MP3.")
191 (home-page "www.libsdl.org/projects/SDL_mixer/")
192 (license zlib)))
193
194(define sdl-net
195 (package
196 (name "sdl-net")
197 (version "1.2.8")
198 (source (origin
199 (method url-fetch)
200 (uri
201 (string-append "http://www.libsdl.org/projects/SDL_net/release/SDL_net-"
202 version ".tar.gz"))
203 (sha256
204 (base32
205 "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz"))))
206 (build-system gnu-build-system)
207 (propagated-inputs `(("sdl" ,sdl)))
208 (inputs `(("pkg-config" ,pkg-config)))
209 (synopsis "SDL networking library")
210 (description "SDL_net is a small, cross-platform networking library for
211SDL.")
212 (home-page "www.libsdl.org/projects/SDL_net/")
213 (license zlib)))
214
215(define sdl-ttf
216 (package
217 (name "sdl-ttf")
218 (version "2.0.11")
219 (source (origin
220 (method url-fetch)
221 (uri
222 (string-append "http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-"
223 version ".tar.gz"))
224 (sha256
225 (base32
226 "1dydxd4f5kb1288i5n5568kdk2q7f8mqjr7i7sd33nplxjaxhk3j"))))
227 (build-system gnu-build-system)
228 (propagated-inputs `(("sdl" ,sdl)))
229 (inputs `(("freetype" ,font:freetype)
5cf3bcd4
DT
230 ("mesa" ,mesa)
231 ("pkg-config" ,pkg-config)))
232 (synopsis "SDL TrueType font library")
233 (description "SDL_ttf is a TrueType font rendering library for SDL.")
234 (home-page "www.libsdl.org/projects/SDL_ttf/")
235 (license zlib)))