gnu: libgcrypt: Ungraft.
[jackhill/guix/guix.git] / gnu / packages / sdl.scm
CommitLineData
c3c516ea 1;;; GNU Guix --- Functional package management for GNU
e0101b54 2;;; Copyright © 2013, 2015, 2017 David Thompson <dthompson2@worcester.edu>
9cb3036f 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
df05d80a 4;;; Copyright © 2015, 2017 Sou Bunnbu <iyzsong@member.fsf.org>
40e94665 5;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
8df1ee3f 6;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
39f2433c 7;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
750db2eb 8;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
e5b77ccf 9;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
c3c516ea
DT
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages sdl)
6813f70a 27 #:use-module (ice-9 match)
8df1ee3f
EF
28 #:use-module (srfi srfi-1)
29 #:use-module (srfi srfi-26)
c3c516ea 30 #:use-module (gnu packages)
890024c5 31 #:use-module ((guix licenses) #:hide (freetype))
c3c516ea
DT
32 #:use-module (guix packages)
33 #:use-module (guix download)
39f2433c 34 #:use-module (guix utils)
c3c516ea 35 #:use-module (guix build-system gnu)
d6f74baf 36 #:use-module (guix build-system trivial)
a313e085 37 #:use-module (gnu packages audio)
543bd0ee 38 #:use-module (gnu packages fcitx)
890024c5 39 #:use-module (gnu packages fontutils)
39f2433c 40 #:use-module (gnu packages freedesktop)
e0101b54 41 #:use-module (gnu packages glib)
bcc046fc 42 #:use-module (gnu packages guile)
e0101b54 43 #:use-module (gnu packages ibus)
e55354b8 44 #:use-module (gnu packages image)
c3c516ea 45 #:use-module (gnu packages linux)
5cf3bcd4 46 #:use-module (gnu packages mp3)
8bf8d7c7
DT
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages pulseaudio)
200726ed 49 #:use-module (gnu packages gl)
39f2433c 50 #:use-module (gnu packages xdisorg)
54ff0b7d 51 #:use-module (gnu packages xiph)
c3c516ea 52 #:use-module (gnu packages xorg)
0160458b 53 #:export (sdl-union))
8bf8d7c7 54
0160458b 55(define-public sdl
8bf8d7c7
DT
56 (package
57 (name "sdl")
58 (version "1.2.15")
59 (source (origin
60 (method url-fetch)
61 (uri
5d5790ce 62 (string-append "https://libsdl.org/release/SDL-"
8bf8d7c7
DT
63 version ".tar.gz"))
64 (sha256
65 (base32
9cb3036f 66 "005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn"))
fc1adab1 67 (patches (search-patches "sdl-libx11-1.6.patch"))))
8bf8d7c7 68 (build-system gnu-build-system)
22f33e61 69 (arguments
666aa995 70 '(;; Explicitly link against shared libraries instead of dlopening them.
83bb3a3e
SB
71 ;; For X11, ALSA, and PulseAudio.
72 ;; OpenGL library is still dlopened at runtime.
73 #:configure-flags '("--disable-alsa-shared"
74 "--disable-pulseaudio-shared"
07780c71
SB
75 "--disable-x11-shared"
76 ;; Explicitly link with mesa.
77 ;; This add mesa to libsdl's RUNPATH, to make dlopen
78 ;; finding the libGL from mesa at runtime.
79 "LDFLAGS=-lGL")
22f33e61
LC
80
81 #:tests? #f)) ; no check target
558a5122
LC
82 (propagated-inputs
83 ;; SDL headers include X11 headers.
666aa995
SB
84 `(("libx11" ,libx11)
85 ("libcap" ,libcap))) ; 'libSDL.la' contain `-lcap'.
22f33e61 86 (native-inputs `(("pkg-config" ,pkg-config)))
558a5122 87 (inputs `(("libxrandr" ,libxrandr)
8bf8d7c7 88 ("mesa" ,mesa)
83bb3a3e 89 ("glu" ,glu)
8bf8d7c7 90 ("alsa-lib" ,alsa-lib)
8bf8d7c7 91 ("pulseaudio" ,pulseaudio)))
38033318 92 (outputs '("out" "debug"))
8bf8d7c7
DT
93 (synopsis "Cross platform game development library")
94 (description "Simple DirectMedia Layer is a cross-platform development
95library designed to provide low level access to audio, keyboard, mouse,
96joystick, and graphics hardware.")
5d5790ce 97 (home-page "https://libsdl.org/")
8bf8d7c7
DT
98 (license lgpl2.1)))
99
0160458b 100(define-public sdl2
8bf8d7c7
DT
101 (package (inherit sdl)
102 (name "sdl2")
f4009ade 103 (version "2.0.8")
8bf8d7c7
DT
104 (source (origin
105 (method url-fetch)
106 (uri
5d5790ce 107 (string-append "https://libsdl.org/release/SDL2-"
8bf8d7c7
DT
108 version ".tar.gz"))
109 (sha256
110 (base32
f4009ade 111 "1v4js1gkr75hzbxzhwzzif0sf9g07234sd23x1vdaqc661bprizd"))))
39f2433c
RH
112 (arguments
113 (substitute-keyword-arguments (package-arguments sdl)
114 ((#:configure-flags flags)
115 `(append '("--disable-wayland-shared")
116 ,flags))))
e0101b54
DT
117 (inputs
118 ;; SDL2 needs to be built with ibus support otherwise some systems
119 ;; experience a bug where input events are doubled.
120 ;;
121 ;; For more information, see: https://dev.solus-project.com/T1721
122 (append `(("dbus" ,dbus)
543bd0ee 123 ("fcitx" ,fcitx) ; helps with CJK input
e0101b54 124 ("glib" ,glib)
39f2433c 125 ("ibus" ,ibus)
c695fb76
TGR
126 ("libxkbcommon" ,libxkbcommon)
127 ("wayland" ,wayland)
128 ("wayland-protocols" ,wayland-protocols))
e0101b54 129 (package-inputs sdl)))
8bf8d7c7 130 (license bsd-3)))
c3c516ea 131
0160458b 132(define-public libmikmod
c3c516ea
DT
133 (package
134 (name "libmikmod")
7d876afd 135 (version "3.3.10")
c3c516ea
DT
136 (source (origin
137 (method url-fetch)
1934769b
MW
138 (uri (list
139 (string-append "mirror://sourceforge/mikmod/libmikmod/"
140 version "/libmikmod-" version ".tar.gz")
141 ;; Older versions are sometimes moved to:
142 (string-append "mirror://sourceforge/mikmod/"
143 "outdated_versions/libmikmod/"
144 version "/libmikmod-" version ".tar.gz")))
c3c516ea
DT
145 (sha256
146 (base32
7d876afd 147 "0j7g4jpa2zgzw7x6s3rldypa7zlwjvn97rwx0sylx1iihhlzbcq0"))))
c3c516ea 148 (build-system gnu-build-system)
03920078
LC
149 (arguments
150 ;; By default, libmikmod tries to dlopen libasound etc., which won't work
151 ;; unless the right libalsa happens to be in $LD_LIBRARY_PATH. Pass
152 ;; '--disable-dl' to avoid that.
153 '(#:configure-flags '("--disable-dl")))
9e771e3b 154 (synopsis "Library for module sound formats")
c3c516ea
DT
155 (description
156 "MikMod is able to play a wide range of module formats, as well as
35b9e423 157digital sound files. It can take advantage of particular features of your
c3c516ea
DT
158system, such as sound redirection over the network.")
159 (license lgpl2.1)
160 (home-page "http://mikmod.sourceforge.net/")))
5cf3bcd4 161
0160458b 162(define-public sdl-gfx
5cf3bcd4
DT
163 (package
164 (name "sdl-gfx")
b5ceea9f 165 (version "2.0.26")
5cf3bcd4
DT
166 (source (origin
167 (method url-fetch)
168 (uri
169 (string-append "http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-"
170 version ".tar.gz"))
171 (sha256
172 (base32
b5ceea9f 173 "0ijljhs0v99dj6y27hc10z6qchyp8gdp4199y6jzngy6dzxlzsvw"))))
5cf3bcd4 174 (build-system gnu-build-system)
38033318 175 (outputs '("out" "debug"))
8df1ee3f
EF
176 (arguments
177 `(,@(if (any (cute string-prefix? <> (or (%current-system)
178 (%current-target-system)))
179 '("x86_64" "i686"))
180 ;; mmx is supported only on Intel processors.
181 '()
182 '(#:configure-flags '("--disable-mmx")))))
5cf3bcd4 183 (propagated-inputs `(("sdl" ,sdl)))
5cf3bcd4
DT
184 (synopsis "SDL graphics primitives library")
185 (description "SDL_gfx provides graphics drawing primitives, rotozoom and
186other supporting functions for SDL.")
187 (home-page "http://www.ferzkopp.net/joomla/software-mainmenu-14/4-ferzkopps-linux-software/19-sdlgfx")
8df1ee3f 188 (license zlib)))
5cf3bcd4 189
0160458b 190(define-public sdl-image
5cf3bcd4
DT
191 (package
192 (name "sdl-image")
193 (version "1.2.12")
194 (source (origin
195 (method url-fetch)
196 (uri
5d5790ce 197 (string-append "https://www.libsdl.org/projects/SDL_image/release/SDL_image-"
5cf3bcd4
DT
198 version ".tar.gz"))
199 (sha256
200 (base32
201 "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b"))))
202 (build-system gnu-build-system)
38033318 203 (outputs '("out" "debug"))
7c3e60fb
SB
204 (arguments
205 ;; Explicitly link against shared libraries instead of dlopening them.
206 '(#:configure-flags '("--disable-jpg-shared"
207 "--disable-png-shared"
208 "--disable-tif-shared"
209 "--disable-webp-shared")))
586b6d4d 210 (native-inputs `(("pkg-config" ,pkg-config)))
586b6d4d
DT
211 ;; libjpeg, libpng, and libtiff are propagated inputs because the
212 ;; SDL_image headers include the headers of these libraries. SDL is a
213 ;; propagated input because the pkg-config file refers to SDL's pkg-config
214 ;; file.
215 (propagated-inputs `(("sdl" ,sdl)
216 ("libjpeg" ,libjpeg)
217 ("libpng" ,libpng)
6a51e95b
DT
218 ("libtiff" ,libtiff)
219 ("libwebp" ,libwebp)))
5cf3bcd4
DT
220 (synopsis "SDL image loading library")
221 (description "SDL_image is an image file loading library for SDL that
222supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF,
223WEBP, XCF, XPM, and XV.")
5d5790ce 224 (home-page "https://www.libsdl.org/projects/SDL_image/")
5cf3bcd4
DT
225 (license zlib)))
226
0160458b 227(define-public sdl-mixer
5cf3bcd4
DT
228 (package
229 (name "sdl-mixer")
230 (version "1.2.12")
231 (source (origin
232 (method url-fetch)
233 (uri
5d5790ce 234 (string-append "https://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-"
5cf3bcd4
DT
235 version ".tar.gz"))
236 (sha256
237 (base32
238 "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n"))))
239 (build-system gnu-build-system)
38033318 240 (outputs '("out" "debug"))
5cf3bcd4
DT
241 ;; no check target
242 ;; use libmad instead of smpeg
3ff73390 243 ;; explicitly link against shared libraries instead of dlopening them
5cf3bcd4 244 (arguments `(#:tests? #f
3ff73390
SB
245 #:configure-flags '("--enable-music-mp3-mad-gpl"
246 "--disable-music-mod-shared"
247 "--disable-music-fluidsynth-shared"
248 "--disable-music-ogg-shared"
249 "--disable-music-flac-shared"
250 "--disable-music-mp3-shared")))
5cf3bcd4
DT
251 (inputs `(("libvorbis" ,libvorbis)
252 ("libflac" ,flac)
253 ("libmad" ,libmad)
a313e085
DT
254 ("libmikmod" ,libmikmod)
255 ("libmodplug" ,libmodplug)))
5cf3bcd4
DT
256 ;; FIXME: Add libfluidsynth
257 (propagated-inputs `(("sdl" ,sdl)))
258 (synopsis "SDL multi-channel audio mixer library")
259 (description "SDL_mixer is a multi-channel audio mixer library for SDL.
260It supports any number of simultaneously playing channels of 16 bit stereo
261audio, plus a single channel of music. Supported format include FLAC, MOD,
262MIDI, Ogg Vorbis, and MP3.")
5d5790ce 263 (home-page "https://www.libsdl.org/projects/SDL_mixer/")
5cf3bcd4
DT
264 (license zlib)))
265
0160458b 266(define-public sdl-net
5cf3bcd4
DT
267 (package
268 (name "sdl-net")
269 (version "1.2.8")
270 (source (origin
271 (method url-fetch)
272 (uri
5d5790ce 273 (string-append "https://www.libsdl.org/projects/SDL_net/release/SDL_net-"
5cf3bcd4
DT
274 version ".tar.gz"))
275 (sha256
276 (base32
277 "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz"))))
278 (build-system gnu-build-system)
279 (propagated-inputs `(("sdl" ,sdl)))
41eb1198 280 (native-inputs `(("pkg-config" ,pkg-config)))
38033318 281 (outputs '("out" "debug"))
5cf3bcd4
DT
282 (synopsis "SDL networking library")
283 (description "SDL_net is a small, cross-platform networking library for
284SDL.")
5d5790ce 285 (home-page "https://www.libsdl.org/projects/SDL_net/")
5cf3bcd4
DT
286 (license zlib)))
287
0160458b 288(define-public sdl-ttf
5cf3bcd4
DT
289 (package
290 (name "sdl-ttf")
291 (version "2.0.11")
292 (source (origin
293 (method url-fetch)
294 (uri
5d5790ce 295 (string-append "https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-"
5cf3bcd4
DT
296 version ".tar.gz"))
297 (sha256
298 (base32
299 "1dydxd4f5kb1288i5n5568kdk2q7f8mqjr7i7sd33nplxjaxhk3j"))))
300 (build-system gnu-build-system)
301 (propagated-inputs `(("sdl" ,sdl)))
890024c5 302 (inputs `(("freetype" ,freetype)
41eb1198
LC
303 ("mesa" ,mesa)))
304 (native-inputs `(("pkg-config" ,pkg-config)))
38033318 305 (outputs '("out" "debug"))
5cf3bcd4
DT
306 (synopsis "SDL TrueType font library")
307 (description "SDL_ttf is a TrueType font rendering library for SDL.")
5d5790ce 308 (home-page "https://www.libsdl.org/projects/SDL_ttf/")
5cf3bcd4 309 (license zlib)))
d6f74baf 310
40e94665
AK
311(define* (sdl-union #:optional (packages (list sdl sdl-gfx sdl-net sdl-ttf
312 sdl-image sdl-mixer)))
313 "Return 'sdl-union' package which is a union of PACKAGES.
314If PACKAGES are not specified, all SDL packages are used."
d6f74baf
DT
315 (package
316 (name "sdl-union")
317 (version (package-version sdl))
318 (source #f)
319 (build-system trivial-build-system)
320 (arguments
321 '(#:modules ((guix build union))
322 #:builder (begin
323 (use-modules (ice-9 match)
324 (guix build union))
325 (match %build-inputs
326 (((names . directories) ...)
327 (union-build (assoc-ref %outputs "out")
e3cfef22
MW
328 directories)
329 #t)))))
40e94665
AK
330 (inputs (map (lambda (package)
331 (list (package-name package) package))
332 packages))
333 (synopsis "Union of SDL libraries")
d6f74baf
DT
334 (description
335 "A union of SDL and its extension libraries. A union is required because
336sdl-config assumes that all of the headers and libraries are in the same
337directory.")
338 (home-page (package-home-page sdl))
339 (license (package-license sdl))))
bcc046fc 340
6813f70a
DT
341(define (propagated-inputs-with-sdl2 package)
342 "Replace the \"sdl\" propagated input of PACKAGE with SDL2."
343 (map (match-lambda
344 (("sdl" _)
345 `("sdl2" ,sdl2))
346 (other other))
347 (package-propagated-inputs package)))
348
349(define-public sdl2-image
350 (package (inherit sdl-image)
351 (name "sdl2-image")
e5bea952 352 (version "2.0.3")
6813f70a
DT
353 (source (origin
354 (method url-fetch)
355 (uri
5d5790ce 356 (string-append "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-"
6813f70a
DT
357 version ".tar.gz"))
358 (sha256
359 (base32
e5bea952 360 "0s13dmakn21q6yw8avl67d4zkxzl1wap6l5nwf6cvzrmlxfw441m"))))
6813f70a
DT
361 (propagated-inputs
362 (propagated-inputs-with-sdl2 sdl-image))))
363
855e2939
DT
364(define-public sdl2-mixer
365 (package (inherit sdl-mixer)
366 (name "sdl2-mixer")
750db2eb 367 (version "2.0.2")
855e2939
DT
368 (source (origin
369 (method url-fetch)
370 (uri
371 (string-append "http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-"
372 version ".tar.gz"))
efd75ade 373 (modules '((guix build utils)))
6cbee49d
MW
374 (snippet '(begin
375 ;; Remove bundled libraries.
376 (delete-file-recursively "external")
377 #t))
855e2939
DT
378 (sha256
379 (base32
750db2eb 380 "1fw3kkqi5346ai5if4pxrcbhs5c4vv3a4smgz6fl6kyaxwkmwqaf"))))
855e2939
DT
381 (propagated-inputs
382 (propagated-inputs-with-sdl2 sdl-mixer))))
383
d3f6a1de
DT
384(define-public sdl2-ttf
385 (package (inherit sdl-ttf)
386 (name "sdl2-ttf")
8d506323 387 (version "2.0.14")
d3f6a1de
DT
388 (source (origin
389 (method url-fetch)
390 (uri
5d5790ce 391 (string-append "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-"
d3f6a1de 392 version ".tar.gz"))
8d506323 393 (modules '((guix build utils)))
6cbee49d
MW
394 (snippet (begin
395 ;; Remove bundled libraries.
396 '(delete-file-recursively "external")
397 #t))
d3f6a1de
DT
398 (sha256
399 (base32
8d506323 400 "0xljwcpvd2knrjdfag5b257xqayplz55mqlszrqp0kpnphh5xnrl"))))
d3f6a1de
DT
401 (propagated-inputs
402 (propagated-inputs-with-sdl2 sdl-ttf))))
403
bcc046fc
DT
404(define-public guile-sdl
405 (package
406 (name "guile-sdl")
af87a551 407 (version "0.5.2")
bcc046fc
DT
408 (source (origin
409 (method url-fetch)
410 (uri
411 (string-append "mirror://gnu/guile-sdl/guile-sdl-"
412 version ".tar.xz"))
413 (sha256
414 (base32
af87a551 415 "0cjgs012a9922hn6xqwj66w6qmfs3nycnm56hyykx5n3g5p7ag01"))))
bcc046fc
DT
416 (build-system gnu-build-system)
417 (native-inputs
418 `(("pkg-config" ,pkg-config)
419 ;; Required by test suite.
420 ("xorg-server" ,xorg-server)
421 ("libjpeg" ,libjpeg)))
422 (inputs
8380a181 423 `(("guile" ,guile-2.2)
40e94665 424 ("sdl-union" ,(sdl-union))))
bcc046fc
DT
425 (arguments
426 '(#:configure-flags
427 (list (string-append "--with-sdl-prefix="
428 (assoc-ref %build-inputs "sdl-union")))
4fa3f796
LC
429 #:modules ((ice-9 popen)
430 (guix build utils)
431 (guix build gnu-build-system))
432
bcc046fc 433 #:parallel-build? #f ; parallel build fails
4fa3f796 434
bcc046fc 435 #:phases
dc1d3cde
KK
436 (modify-phases %standard-phases
437 (add-before 'configure 'fix-env-and-patch
438 (lambda* (#:key inputs #:allow-other-keys)
439 (setenv "GUILE_AUTO_COMPILE" "0")
440 ;; SDL_image needs to dlopen libjpeg in the test suite.
441 (setenv "LD_LIBRARY_PATH"
442 (string-append (assoc-ref inputs "libjpeg") "/lib"))
4fa3f796
LC
443
444 ;; Change the site directory /site/X.Y like Guile expects.
dc1d3cde 445 (substitute* "build-aux/guile-baux/re-prefixed-site-dirs"
4fa3f796
LC
446 (("\"/site\"")
447 (let ((effective
448 (read
449 (open-pipe* OPEN_READ
450 "guile" "-c"
451 "(write (effective-version))"))))
452 (string-append "\"/site/" effective "\""))))
af87a551 453
dc1d3cde
KK
454 ;; Skip tests that rely on sound support, which is unavailable in
455 ;; the build environment.
456 (substitute* "test/Makefile.in"
457 (("HAVE_MIXER = .*$")
458 "HAVE_MIXER = 0\n"))
459 #t))
460 (add-before 'check 'start-xorg-server
461 (lambda* (#:key inputs #:allow-other-keys)
462 ;; The test suite requires a running X server.
463 (system (format #f "~a/bin/Xvfb :1 &"
464 (assoc-ref inputs "xorg-server")))
465 (setenv "DISPLAY" ":1")
8380a181
LC
466 #t))
467 (add-before 'check 'skip-cursor-test
468 (lambda _
469 ;; XXX: This test sometimes enters an endless loop, and sometimes
470 ;; crashes with:
471 ;; guile: xcb_io.c:147: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.
472 ;; Skip it.
473 (substitute* "test/cursor.scm"
474 (("\\(SDL:init .*" all)
475 (string-append "(exit 77) ;" all "\n")))
dc1d3cde 476 #t)))))
bcc046fc
DT
477 (synopsis "Guile interface for SDL (Simple DirectMedia Layer)")
478 (description "Guile-SDL is a set of bindings to the Simple DirectMedia
479Layer (SDL). With them, Guile programmers can have easy access to graphics,
480sound and device input (keyboards, joysticks, mice, etc.).")
6fd52309 481 (home-page "https://www.gnu.org/software/guile-sdl/")
bcc046fc 482 (license gpl3+)))
df05d80a
SB
483
484(define-public guile-sdl2
485 (package
486 (name "guile-sdl2")
487 (version "0.2.0")
488 (source (origin
489 (method url-fetch)
490 (uri (string-append
491 "https://files.dthompson.us/guile-sdl2/guile-sdl2-"
492 version ".tar.gz"))
493 (sha256
494 (base32
495 "0yq9lsl17cdvj77padvpk3jcw2g6g0pck9jrchc7n2767rrc012b"))))
496 (build-system gnu-build-system)
497 (arguments
498 '(#:make-flags '("GUILE_AUTO_COMPILE=0")
499 #:configure-flags
500 (list (string-append "--with-libsdl2-prefix="
501 (assoc-ref %build-inputs "sdl2"))
502 (string-append "--with-libsdl2-image-prefix="
503 (assoc-ref %build-inputs "sdl2-image"))
504 (string-append "--with-libsdl2-ttf-prefix="
505 (assoc-ref %build-inputs "sdl2-ttf"))
506 (string-append "--with-libsdl2-mixer-prefix="
e5b77ccf
RW
507 (assoc-ref %build-inputs "sdl2-mixer")))
508 #:phases
509 (modify-phases %standard-phases
510 (add-after 'configure 'patch-makefile
511 (lambda _
512 ;; Install compiled Guile files in the expected place.
513 (substitute* '("Makefile")
514 (("^godir = .*$")
515 "godir = $(moddir)\n"))
516 #t)))))
df05d80a 517 (native-inputs
37b9be58 518 `(("guile" ,guile-2.2)
df05d80a
SB
519 ("pkg-config" ,pkg-config)))
520 (inputs
521 `(("sdl2" ,sdl2)
522 ("sdl2-image" ,sdl2-image)
523 ("sdl2-mixer" ,sdl2-mixer)
524 ("sdl2-ttf" ,sdl2-ttf)))
525 (synopsis "Guile bindings for SDL2")
526 (home-page "https://dthompson.us/projects/guile-sdl2.html")
527 (description
528 "Guile-SDL2 provides Guile Scheme bindings for the SDL2 C shared library.
529The bindings are written in pure Scheme using Guile's foreign function
530interface.")
531 (license lgpl3+)))