derivations: 'graft-derivation' correctly handles multiple-output sources.
[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 25 #:use-module ((gnu packages fontutils) #:prefix font:)
e55354b8 26 #:use-module (gnu packages image)
c3c516ea 27 #:use-module (gnu packages linux)
5cf3bcd4 28 #:use-module (gnu packages mp3)
8bf8d7c7
DT
29 #:use-module (gnu packages pkg-config)
30 #:use-module (gnu packages pulseaudio)
200726ed 31 #:use-module (gnu packages gl)
54ff0b7d 32 #:use-module (gnu packages xiph)
c3c516ea 33 #:use-module (gnu packages xorg)
8bf8d7c7
DT
34 #:export (sdl
35 sdl2
5cf3bcd4
DT
36 libmikmod
37 sdl-gfx
38 sdl-image
39 sdl-mixer
40 sdl-net
41 sdl-ttf))
8bf8d7c7
DT
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)
22f33e61
LC
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
558a5122
LC
64 (propagated-inputs
65 ;; SDL headers include X11 headers.
66 `(("libx11" ,libx11)))
22f33e61 67 (native-inputs `(("pkg-config" ,pkg-config)))
558a5122 68 (inputs `(("libxrandr" ,libxrandr)
8bf8d7c7
DT
69 ("mesa" ,mesa)
70 ("alsa-lib" ,alsa-lib)
8bf8d7c7
DT
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)))
c3c516ea
DT
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)))
9e771e3b 107 (synopsis "Library for module sound formats")
c3c516ea
DT
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/")))
5cf3bcd4
DT
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)))
5cf3bcd4
DT
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(define sdl-image
136 (package
137 (name "sdl-image")
138 (version "1.2.12")
139 (source (origin
140 (method url-fetch)
141 (uri
142 (string-append "http://www.libsdl.org/projects/SDL_image/release/SDL_image-"
143 version ".tar.gz"))
144 (sha256
145 (base32
146 "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b"))))
147 (build-system gnu-build-system)
586b6d4d 148 (native-inputs `(("pkg-config" ,pkg-config)))
5cf3bcd4 149 ;; FIXME: Add webp
586b6d4d
DT
150 ;;
151 ;; libjpeg, libpng, and libtiff are propagated inputs because the
152 ;; SDL_image headers include the headers of these libraries. SDL is a
153 ;; propagated input because the pkg-config file refers to SDL's pkg-config
154 ;; file.
155 (propagated-inputs `(("sdl" ,sdl)
156 ("libjpeg" ,libjpeg)
157 ("libpng" ,libpng)
158 ("libtiff" ,libtiff)))
5cf3bcd4
DT
159 (synopsis "SDL image loading library")
160 (description "SDL_image is an image file loading library for SDL that
161supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF,
162WEBP, XCF, XPM, and XV.")
163 (home-page "www.libsdl.org/projects/SDL_image/")
164 (license zlib)))
165
166(define sdl-mixer
167 (package
168 (name "sdl-mixer")
169 (version "1.2.12")
170 (source (origin
171 (method url-fetch)
172 (uri
173 (string-append "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-"
174 version ".tar.gz"))
175 (sha256
176 (base32
177 "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n"))))
178 (build-system gnu-build-system)
179 ;; no check target
180 ;; use libmad instead of smpeg
181 (arguments `(#:tests? #f
182 #:configure-flags '("--enable-music-mp3-mad-gpl")))
183 (inputs `(("libvorbis" ,libvorbis)
184 ("libflac" ,flac)
185 ("libmad" ,libmad)
186 ("libmikmod" ,libmikmod)))
187 ;; FIXME: Add libfluidsynth
188 (propagated-inputs `(("sdl" ,sdl)))
189 (synopsis "SDL multi-channel audio mixer library")
190 (description "SDL_mixer is a multi-channel audio mixer library for SDL.
191It supports any number of simultaneously playing channels of 16 bit stereo
192audio, plus a single channel of music. Supported format include FLAC, MOD,
193MIDI, Ogg Vorbis, and MP3.")
194 (home-page "www.libsdl.org/projects/SDL_mixer/")
195 (license zlib)))
196
197(define sdl-net
198 (package
199 (name "sdl-net")
200 (version "1.2.8")
201 (source (origin
202 (method url-fetch)
203 (uri
204 (string-append "http://www.libsdl.org/projects/SDL_net/release/SDL_net-"
205 version ".tar.gz"))
206 (sha256
207 (base32
208 "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz"))))
209 (build-system gnu-build-system)
210 (propagated-inputs `(("sdl" ,sdl)))
211 (inputs `(("pkg-config" ,pkg-config)))
212 (synopsis "SDL networking library")
213 (description "SDL_net is a small, cross-platform networking library for
214SDL.")
215 (home-page "www.libsdl.org/projects/SDL_net/")
216 (license zlib)))
217
218(define sdl-ttf
219 (package
220 (name "sdl-ttf")
221 (version "2.0.11")
222 (source (origin
223 (method url-fetch)
224 (uri
225 (string-append "http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-"
226 version ".tar.gz"))
227 (sha256
228 (base32
229 "1dydxd4f5kb1288i5n5568kdk2q7f8mqjr7i7sd33nplxjaxhk3j"))))
230 (build-system gnu-build-system)
231 (propagated-inputs `(("sdl" ,sdl)))
232 (inputs `(("freetype" ,font:freetype)
5cf3bcd4
DT
233 ("mesa" ,mesa)
234 ("pkg-config" ,pkg-config)))
235 (synopsis "SDL TrueType font library")
236 (description "SDL_ttf is a TrueType font rendering library for SDL.")
237 (home-page "www.libsdl.org/projects/SDL_ttf/")
238 (license zlib)))