gnu: mesa: Move out of xorg.scm and into gl.scm
[jackhill/guix/guix.git] / gnu / packages / sdl.scm
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)
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)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages mp3)
31 #:use-module (gnu packages oggvorbis)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages pulseaudio)
34 #:use-module (gnu packages gl)
35 #:use-module (gnu packages xorg)
36 #:export (sdl
37 sdl2
38 libmikmod
39 sdl-gfx
40 sdl-image
41 sdl-mixer
42 sdl-net
43 sdl-ttf))
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)
58 (arguments '(#:tests? #f)) ; no check target
59 (propagated-inputs
60 ;; SDL headers include X11 headers.
61 `(("libx11" ,libx11)))
62 (inputs `(("libxrandr" ,libxrandr)
63 ("mesa" ,mesa)
64 ("alsa-lib" ,alsa-lib)
65 ("pkg-config" ,pkg-config)
66 ("pulseaudio" ,pulseaudio)))
67 (synopsis "Cross platform game development library")
68 (description "Simple DirectMedia Layer is a cross-platform development
69 library designed to provide low level access to audio, keyboard, mouse,
70 joystick, and graphics hardware.")
71 (home-page "http://libsdl.org/")
72 (license lgpl2.1)))
73
74 (define sdl2
75 (package (inherit sdl)
76 (name "sdl2")
77 (version "2.0.0")
78 (source (origin
79 (method url-fetch)
80 (uri
81 (string-append "http://libsdl.org/release/SDL2-"
82 version ".tar.gz"))
83 (sha256
84 (base32
85 "0y3in99brki7vc2mb4c0w39v70mf4h341mblhh8nmq4h7lawhskg"))))
86 (license bsd-3)))
87
88 (define libmikmod
89 (package
90 (name "libmikmod")
91 (version "3.3.3")
92 (source (origin
93 (method url-fetch)
94 (uri (string-append "mirror://sourceforge/mikmod/libmikmod/"
95 version "/libmikmod-" version ".tar.gz"))
96 (sha256
97 (base32
98 "0dr4kgvhq9wf2riibh178c2al996spwwak6zffpv5n5bqmw29w3r"))))
99 (build-system gnu-build-system)
100 (inputs `(("alsa-lib" ,alsa-lib)
101 ("libx11" ,libx11)))
102 (synopsis "Library for module sound formats.")
103 (description
104 "MikMod is able to play a wide range of module formats, as well as
105 digital sound files. It can take advantage of particular features of your
106 system, such as sound redirection over the network.")
107 (license lgpl2.1)
108 (home-page "http://mikmod.sourceforge.net/")))
109
110 (define sdl-gfx
111 (package
112 (name "sdl-gfx")
113 (version "2.0.24")
114 (source (origin
115 (method url-fetch)
116 (uri
117 (string-append "http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-"
118 version ".tar.gz"))
119 (sha256
120 (base32
121 "064islldm4r42lgj9fr4kbk66r7jmmakk9745hhyb1kmw71kib9h"))))
122 (build-system gnu-build-system)
123 (propagated-inputs `(("sdl" ,sdl)))
124 (synopsis "SDL graphics primitives library")
125 (description "SDL_gfx provides graphics drawing primitives, rotozoom and
126 other supporting functions for SDL.")
127 (home-page "http://www.ferzkopp.net/joomla/software-mainmenu-14/4-ferzkopps-linux-software/19-sdlgfx")
128 (license zlib)))
129
130 (define sdl-image
131 (package
132 (name "sdl-image")
133 (version "1.2.12")
134 (source (origin
135 (method url-fetch)
136 (uri
137 (string-append "http://www.libsdl.org/projects/SDL_image/release/SDL_image-"
138 version ".tar.gz"))
139 (sha256
140 (base32
141 "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b"))))
142 (build-system gnu-build-system)
143 ;; FIXME: Add webp
144 (inputs `(("libpng" ,libpng)
145 ("libjpeg" ,libjpeg)
146 ("libtiff" ,libtiff)
147 ("pkg-config" ,pkg-config)))
148 (propagated-inputs `(("sdl" ,sdl)))
149 (synopsis "SDL image loading library")
150 (description "SDL_image is an image file loading library for SDL that
151 supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF,
152 WEBP, XCF, XPM, and XV.")
153 (home-page "www.libsdl.org/projects/SDL_image/")
154 (license zlib)))
155
156 (define sdl-mixer
157 (package
158 (name "sdl-mixer")
159 (version "1.2.12")
160 (source (origin
161 (method url-fetch)
162 (uri
163 (string-append "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-"
164 version ".tar.gz"))
165 (sha256
166 (base32
167 "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n"))))
168 (build-system gnu-build-system)
169 ;; no check target
170 ;; use libmad instead of smpeg
171 (arguments `(#:tests? #f
172 #:configure-flags '("--enable-music-mp3-mad-gpl")))
173 (inputs `(("libvorbis" ,libvorbis)
174 ("libflac" ,flac)
175 ("libmad" ,libmad)
176 ("libmikmod" ,libmikmod)))
177 ;; FIXME: Add libfluidsynth
178 (propagated-inputs `(("sdl" ,sdl)))
179 (synopsis "SDL multi-channel audio mixer library")
180 (description "SDL_mixer is a multi-channel audio mixer library for SDL.
181 It supports any number of simultaneously playing channels of 16 bit stereo
182 audio, plus a single channel of music. Supported format include FLAC, MOD,
183 MIDI, Ogg Vorbis, and MP3.")
184 (home-page "www.libsdl.org/projects/SDL_mixer/")
185 (license zlib)))
186
187 (define sdl-net
188 (package
189 (name "sdl-net")
190 (version "1.2.8")
191 (source (origin
192 (method url-fetch)
193 (uri
194 (string-append "http://www.libsdl.org/projects/SDL_net/release/SDL_net-"
195 version ".tar.gz"))
196 (sha256
197 (base32
198 "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz"))))
199 (build-system gnu-build-system)
200 (propagated-inputs `(("sdl" ,sdl)))
201 (inputs `(("pkg-config" ,pkg-config)))
202 (synopsis "SDL networking library")
203 (description "SDL_net is a small, cross-platform networking library for
204 SDL.")
205 (home-page "www.libsdl.org/projects/SDL_net/")
206 (license zlib)))
207
208 (define sdl-ttf
209 (package
210 (name "sdl-ttf")
211 (version "2.0.11")
212 (source (origin
213 (method url-fetch)
214 (uri
215 (string-append "http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-"
216 version ".tar.gz"))
217 (sha256
218 (base32
219 "1dydxd4f5kb1288i5n5568kdk2q7f8mqjr7i7sd33nplxjaxhk3j"))))
220 (build-system gnu-build-system)
221 (propagated-inputs `(("sdl" ,sdl)))
222 (inputs `(("freetype" ,font:freetype)
223 ("mesa" ,mesa)
224 ("pkg-config" ,pkg-config)))
225 (synopsis "SDL TrueType font library")
226 (description "SDL_ttf is a TrueType font rendering library for SDL.")
227 (home-page "www.libsdl.org/projects/SDL_ttf/")
228 (license zlib)))