gnu: Add freeglut, glu, and FTGL.
[jackhill/guix/guix.git] / gnu / packages / glib.scm
... / ...
CommitLineData
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages glib)
22 #:use-module ((guix licenses)
23 #:renamer (symbol-prefix-proc 'license:))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages bison)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages flex)
32 #:use-module ((gnu packages gettext)
33 #:renamer (symbol-prefix-proc 'guix:))
34 #:use-module (gnu packages gtk)
35 #:use-module (gnu packages libffi)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages xml)
40 #:use-module (gnu packages bash)
41 #:use-module (gnu packages file)
42 #:use-module (gnu packages xorg)
43
44 ;; Export variables up-front to allow circular dependency with the 'xorg'
45 ;; module.
46 #:export (dbus
47 glib
48 dbus-glib
49 intltool
50 itstool))
51
52(define dbus
53 (package
54 (name "dbus")
55 (version "1.6.4")
56 (source (origin
57 (method url-fetch)
58 (uri
59 (string-append "http://dbus.freedesktop.org/releases/dbus/dbus-"
60 version ".tar.gz"))
61 (sha256
62 (base32
63 "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz"))))
64 (build-system gnu-build-system)
65 (arguments
66 '(#:configure-flags (list ;; Install the system bus socket under /var.
67 "--localstatedir=/var"
68
69 ;; XXX: Fix the following to allow system-wide
70 ;; config.
71 ;; "--sysconfdir=/etc"
72
73 "--with-session-socket-dir=/tmp")
74 #:patches (list (assoc-ref %build-inputs "patch/localstatedir"))))
75 (inputs
76 `(("expat" ,expat)
77 ("pkg-config" ,pkg-config)
78 ("patch/localstatedir"
79 ,(search-patch "dbus-localstatedir.patch"))
80
81 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
82 ;; '--autolaunch'.
83 ("libx11" ,libx11)))
84
85 (home-page "http://dbus.freedesktop.org/")
86 (synopsis "Message bus for inter-process communication (IPC)")
87 (description
88 "D-Bus is a message bus system, a simple way for applications to
89talk to one another. In addition to interprocess communication, D-Bus
90helps coordinate process lifecycle; it makes it simple and reliable to
91code a \"single instance\" application or daemon, and to launch
92applications and daemons on demand when their services are needed.
93
94D-Bus supplies both a system daemon (for events such as \"new hardware
95device added\" or \"printer queue changed\") and a
96per-user-login-session daemon (for general IPC needs among user
97applications). Also, the message bus is built on top of a general
98one-to-one message passing framework, which can be used by any two apps
99to communicate directly (without going through the message bus
100daemon). Currently the communicating applications are on one computer,
101or through unencrypted TCP/IP suitable for use behind a firewall with
102shared NFS home directories.")
103 (license license:gpl2+))) ; or Academic Free License 2.1
104
105(define glib
106 (package
107 (name "glib")
108 (version "2.38.0")
109 (source (origin
110 (method url-fetch)
111 (uri (string-append "mirror://gnome/sources/"
112 name "/" (string-take version 4) "/"
113 name "-" version ".tar.xz"))
114 (sha256
115 (base32 "0cpzqadqk6z6bmb79p04pykxc8x57rvshh33414cnk41bvgaf4vm"))))
116 (build-system gnu-build-system)
117 (outputs '("out" ; everything
118 "doc")) ; 20 MiB of GTK-Doc reference
119 (inputs
120 `(("coreutils" ,coreutils)
121 ("gettext" ,guix:gettext)
122 ("libffi" ,libffi)
123 ("pkg-config" ,pkg-config)
124 ("python" ,python-wrapper)
125 ("zlib" ,zlib)
126 ("perl" ,perl) ; needed by GIO tests
127 ("dbus" ,dbus) ; for GDBus tests
128 ("bash" ,bash)
129 ("tzdata" ,tzdata) ; for tests/gdatetime.c
130
131 ("patch/tests-homedir"
132 ,(search-patch "glib-tests-homedir.patch"))
133 ("patch/tests-desktop"
134 ,(search-patch "glib-tests-desktop.patch"))
135 ("patch/tests-prlimit"
136 ,(search-patch "glib-tests-prlimit.patch"))))
137 (arguments
138 '(#:patches (list (assoc-ref %build-inputs "patch/tests-homedir")
139 (assoc-ref %build-inputs "patch/tests-desktop")
140 (assoc-ref %build-inputs "patch/tests-prlimit"))
141 #:phases (alist-cons-before
142 'build 'pre-build
143 (lambda* (#:key inputs outputs #:allow-other-keys)
144 ;; For tests/gdatetime.c.
145 (setenv "TZDIR"
146 (string-append (assoc-ref inputs "tzdata")
147 "/share/zoneinfo"))
148
149 ;; Some tests want write access there.
150 (setenv "XDG_CACHE_HOME" (getcwd))
151
152 (substitute* '("glib/gspawn.c"
153 "glib/tests/utils.c"
154 "tests/spawn-test.c")
155 (("/bin/sh")
156 (string-append (assoc-ref inputs "bash") "/bin/sh"))))
157 %standard-phases)
158
159 ;; Note: `--docdir' and `--htmldir' are not honored, so work around it.
160 #:configure-flags (list (string-append "--with-html-dir="
161 (assoc-ref %outputs "doc")
162 "/share/gtk-doc"))))
163 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
164 (description
165 "GLib provides data structure handling for C, portability wrappers,
166and interfaces for such runtime functionality as an event loop, threads,
167dynamic loading, and an object system.")
168 (home-page "http://developer.gnome.org/glib/")
169 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
170
171(define-public gobject-introspection
172 (package
173 (name "gobject-introspection")
174 (version "1.38.0")
175 (source (origin
176 (method url-fetch)
177 (uri (string-append "http://ftp.gnome.org/pub/GNOME/sources/"
178 "gobject-introspection/"
179 (substring version 0 (string-rindex version #\.))
180 "/gobject-introspection-"
181 version ".tar.xz"))
182 (sha256
183 (base32 "0wvxyvgajmms2bb6k3pf1rdpnd79xdxamykzvxzmcyn1ag9yax9m"))))
184 (build-system gnu-build-system)
185 (inputs
186 `(("bison" ,bison)
187 ("cairo" ,cairo)
188 ("flex" ,flex)
189 ("glib" ,glib)
190 ("libffi" ,libffi)
191 ("pkg-config" ,pkg-config)
192 ("python-2" ,python-2)))
193 (arguments
194 `(#:phases
195 (alist-replace
196 'configure
197 (lambda* (#:key #:allow-other-keys #:rest args)
198 (let ((configure (assoc-ref %standard-phases 'configure)))
199 ;; giscanner/sourcescanner.py looks for 'CC', let's set it here.
200 (setenv "CC" "gcc")
201 (apply configure args)))
202 %standard-phases)))
203 (home-page "https://wiki.gnome.org/GObjectIntrospection")
204 (synopsis "Generate interface introspection data for GObject libraries")
205 (description
206 "GObject introspection is a middleware layer between C libraries (using
207GObject) and language bindings. The C library can be scanned at compile time
208and generate a metadata file, in addition to the actual native C library. Then
209at runtime, language bindings can read this metadata and automatically provide
210bindings to call into the C library.")
211 ; Some bits are distributed under the LGPL2+, others under the GPL2+
212 (license license:gpl2+)))
213
214(define intltool
215 (package
216 (name "intltool")
217 (version "0.50.2")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append "https://launchpad.net/intltool/trunk/"
221 version "/+download/intltool-"
222 version ".tar.gz"))
223 (sha256
224 (base32
225 "01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7"))))
226 (build-system gnu-build-system)
227 (propagated-inputs
228 `(;; Propagate gettext because users expect it to be there, and so does
229 ;; the `intltool-update' script.
230 ("gettext" ,guix:gettext)
231
232 ;; `file' is used by `intltool-update' too.
233 ("file" ,file)
234
235 ("perl-xml-parser" ,perl-xml-parser)
236 ("perl" ,perl)))
237 (home-page "https://launchpad.net/intltool/+download")
238 (synopsis "Tools to centralise translations of different file formats")
239 (description
240 "intltool is a set of tools to centralise translations of many different
241file formats using GNU gettext-compatible PO files.
242
243The intltool collection can be used to do these things:
244
245 Extract translatable strings from various source files (.xml.in,
246 glade, .desktop.in, .server.in, .oaf.in).
247
248 Collect the extracted strings together with messages from traditional
249 source files (.c, .h) in po/$(PACKAGE).pot.
250
251 Merge back the translations from .po files into .xml, .desktop and
252 oaf files. This merge step will happen at build resp. installation time.")
253 (license license:gpl2+)))
254
255(define itstool
256 (package
257 (name "itstool")
258 (version "1.2.0")
259 (source (origin
260 (method url-fetch)
261 (uri (string-append "http://files.itstool.org/itstool/itstool-"
262 version ".tar.bz2"))
263 (sha256
264 (base32
265 "1akq75aflihm3y7js8biy7b5mw2g11vl8yq90gydnwlwp0zxdzj6"))))
266 (build-system gnu-build-system)
267 (propagated-inputs
268 `(("libxml2" ,libxml2)
269 ("python-2" ,python-2)))
270 (home-page "http://www.itstool.org")
271 (synopsis "Tool to translate XML documents with PO files")
272 (description
273 "ITS Tool allows you to translate your XML documents with PO files, using
274rules from the W3C Internationalization Tag Set (ITS) to determine what to
275translate and how to separate it into PO file messages.
276
277PO files are the standard translation format for GNU and other Unix-like
278systems. They present translatable information as discrete messages, allowing
279each message to be translated independently. In contrast to whole-page
280translation, translating with a message-based format like PO means you can
281easily track changes to the source document down to the paragraph. When new
282strings are added or existing strings are modified, you only need to update the
283corresponding messages.
284
285ITS Tool is designed to make XML documents translatable through PO files by
286applying standard ITS rules, as well as extension rules specific to ITS Tool.
287ITS also provides an industry standard way for authors to override translation
288information in their documents, such as whether a particular element should be
289translated.")
290 (license license:gpl3+)))
291
292(define dbus-glib
293 (package
294 (name "dbus-glib")
295 (version "0.100.2")
296 (source (origin
297 (method url-fetch)
298 (uri
299 (string-append "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
300 version ".tar.gz"))
301 (sha256
302 (base32
303 "1ibav91yg70f2l3l18cr0hf4mna1h9d4mrg0c60w4l8zjbd45fx5"))))
304 (build-system gnu-build-system)
305 (inputs
306 `(("dbus" ,dbus)
307 ("expat" ,expat)
308 ("glib" ,glib)
309 ("pkg-config" ,pkg-config)))
310 (home-page "http://dbus.freedesktop.org/doc/dbus-glib/")
311 (synopsis "D-Bus GLib bindings")
312 (description
313 "GLib bindings for D-Bus. The package is obsolete and superseded
314by GDBus included in Glib.")
315 (license license:gpl2))) ; or Academic Free License 2.1