gnu: qemu: Remove dependency on Samba.
[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 pkg-config)
32 #:use-module (gnu packages pulseaudio)
33 #:use-module (gnu packages gl)
34 #:use-module (gnu packages xiph)
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
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
66 (propagated-inputs
67 ;; SDL headers include X11 headers.
68 `(("libx11" ,libx11)))
69 (native-inputs `(("pkg-config" ,pkg-config)))
70 (inputs `(("libxrandr" ,libxrandr)
71 ("mesa" ,mesa)
72 ("alsa-lib" ,alsa-lib)
73 ("pulseaudio" ,pulseaudio)))
74 (synopsis "Cross platform game development library")
75 (description "Simple DirectMedia Layer is a cross-platform development
76 library designed to provide low level access to audio, keyboard, mouse,
77 joystick, 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)))
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
112 digital sound files. It can take advantage of particular features of your
113 system, such as sound redirection over the network.")
114 (license lgpl2.1)
115 (home-page "http://mikmod.sourceforge.net/")))
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)))
131 (synopsis "SDL graphics primitives library")
132 (description "SDL_gfx provides graphics drawing primitives, rotozoom and
133 other 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 (native-inputs `(("pkg-config" ,pkg-config)))
151 ;; FIXME: Add webp
152 ;;
153 ;; libjpeg, libpng, and libtiff are propagated inputs because the
154 ;; SDL_image headers include the headers of these libraries. SDL is a
155 ;; propagated input because the pkg-config file refers to SDL's pkg-config
156 ;; file.
157 (propagated-inputs `(("sdl" ,sdl)
158 ("libjpeg" ,libjpeg)
159 ("libpng" ,libpng)
160 ("libtiff" ,libtiff)))
161 (synopsis "SDL image loading library")
162 (description "SDL_image is an image file loading library for SDL that
163 supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF,
164 WEBP, XCF, XPM, and XV.")
165 (home-page "www.libsdl.org/projects/SDL_image/")
166 (license zlib)))
167
168 (define sdl-mixer
169 (package
170 (name "sdl-mixer")
171 (version "1.2.12")
172 (source (origin
173 (method url-fetch)
174 (uri
175 (string-append "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-"
176 version ".tar.gz"))
177 (sha256
178 (base32
179 "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n"))))
180 (build-system gnu-build-system)
181 ;; no check target
182 ;; use libmad instead of smpeg
183 (arguments `(#:tests? #f
184 #:configure-flags '("--enable-music-mp3-mad-gpl")))
185 (inputs `(("libvorbis" ,libvorbis)
186 ("libflac" ,flac)
187 ("libmad" ,libmad)
188 ("libmikmod" ,libmikmod)))
189 ;; FIXME: Add libfluidsynth
190 (propagated-inputs `(("sdl" ,sdl)))
191 (synopsis "SDL multi-channel audio mixer library")
192 (description "SDL_mixer is a multi-channel audio mixer library for SDL.
193 It supports any number of simultaneously playing channels of 16 bit stereo
194 audio, plus a single channel of music. Supported format include FLAC, MOD,
195 MIDI, Ogg Vorbis, and MP3.")
196 (home-page "www.libsdl.org/projects/SDL_mixer/")
197 (license zlib)))
198
199 (define sdl-net
200 (package
201 (name "sdl-net")
202 (version "1.2.8")
203 (source (origin
204 (method url-fetch)
205 (uri
206 (string-append "http://www.libsdl.org/projects/SDL_net/release/SDL_net-"
207 version ".tar.gz"))
208 (sha256
209 (base32
210 "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz"))))
211 (build-system gnu-build-system)
212 (propagated-inputs `(("sdl" ,sdl)))
213 (inputs `(("pkg-config" ,pkg-config)))
214 (synopsis "SDL networking library")
215 (description "SDL_net is a small, cross-platform networking library for
216 SDL.")
217 (home-page "www.libsdl.org/projects/SDL_net/")
218 (license zlib)))
219
220 (define sdl-ttf
221 (package
222 (name "sdl-ttf")
223 (version "2.0.11")
224 (source (origin
225 (method url-fetch)
226 (uri
227 (string-append "http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-"
228 version ".tar.gz"))
229 (sha256
230 (base32
231 "1dydxd4f5kb1288i5n5568kdk2q7f8mqjr7i7sd33nplxjaxhk3j"))))
232 (build-system gnu-build-system)
233 (propagated-inputs `(("sdl" ,sdl)))
234 (inputs `(("freetype" ,font:freetype)
235 ("mesa" ,mesa)
236 ("pkg-config" ,pkg-config)))
237 (synopsis "SDL TrueType font library")
238 (description "SDL_ttf is a TrueType font rendering library for SDL.")
239 (home-page "www.libsdl.org/projects/SDL_ttf/")
240 (license zlib)))