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