Bump version to 0.1.2.
[guile-sdl2.git] / README
1 -*- mode: org -*-
2
3 Guile-SDL2 provides Guile Scheme bindings for the SDL2 C shared
4 library. The bindings are written in pure Scheme by using Guile's
5 foreign function interface.
6
7 In addition to the SDL2 core library, bindings are also provided for
8 SDL2_image, SDL2_mixer, and SDL2_ttf.
9
10 * Requirements
11
12 Guile-SDL2 currently depends on the following packages:
13
14 - GNU Guile >= 2.0.9
15 - SDL2 >= 2.0.0
16 - SDL2_image >= 2.0.0
17 - SDL2_mixer >= 2.0.0
18 - SDL2_ttf >= 2.0.0
19 - GNU Make
20 - GNU pkg-config
21
22 When building from a Git checkout, the following additional packages
23 are required:
24
25 - GNU Autoconf
26 - GNU Automake
27
28 * Installing
29
30 Guile-sdl2 uses the standard GNU build system, so installation
31 requires the usual incantations:
32
33 #+BEGIN_SRC sh
34 ./configure
35 make
36 make install
37 #+END_SRC
38
39 To turn off non-core library bindings, the following configure flags
40 may be used:
41
42 #+BEGIN_SRC sh
43 ./configure --with-libsdl2-image=no \
44 --with-libsdl2-mixer=no \
45 --with-libsdl2-ttf=no
46 #+END_SRC
47
48 When building from a Git checkout, the following spell is necessary
49 before running any of the above commands:
50
51 #+BEGIN_SRC sh
52 ./bootstrap
53 #+END_SRC
54
55 GNU Guix users may install the current development snapshot
56 described in =guix.scm= with the following command:
57
58 #+BEGIN_SRC sh
59 guix package -f guix.scm
60 #+END_SRC
61
62 * Usage
63
64 Guile-SDL2 provides modules in the =(sdl2 ...)= namespace, roughly
65 organized how the SDL2 C header files are organized. See the
66 =examples= directory for practical examples.
67
68 Low-level bindings are available in the =(sdl2 bindings ...)=
69 namespace, but these are not recommended for normal usage.
70
71 Additionally, SDL2 extension library bindings are available in the
72 following modules:
73
74 - SDL2_image: =(sdl2 image)=
75 - SDL2_mixer: =(sdl2 mixer)=
76 - SDL2_ttf: =(sdl2 ttf)=
77
78 * Developing
79
80 To build the source code from a Git checkout, run the following:
81
82 #+BEGIN_SRC sh
83 ./bootstrap
84 ./configure
85 make
86 #+END_SRC
87
88 To start a Guile REPL with a pre-configured load path for using
89 guile-sdl2, use the =pre-inst-env= script:
90
91 #+BEGIN_SRC sh
92 ./pre-inst-env guile
93 #+END_SRC
94
95 GNU Guix users may create a development environment with all of the
96 necessary dependencies by running the following command:
97
98 #+BEGIN_SRC sh
99 guix environment -l guix.scm
100 #+END_SRC
101
102 In order to configure the proper library locations for Guix-based
103 builds, the configure script should be invoked like so:
104
105 #+BEGIN_SRC sh
106 ./configure --with-libsdl2-prefix=$(guix build sdl2) \
107 --with-libsdl2-image-prefix=$(guix build sdl2-image) \
108 --with-libsdl2-ttf-prefix=$(guix build sdl2-ttf) \
109 --with-libsdl2-mixer-prefix=$(guix build sdl2-mixer)
110 #+END_SRC
111
112 * Contact
113
114 Bug reports and patches may be sent to <davet@gnu.org>.
115
116 The maintainer of this library hangs out in the #guile channel on
117 irc.freenode.net, so help and general discussion may also be found
118 there.