guix: lint: Make exception for package name starting description.
[jackhill/guix/guix.git] / gnu / packages / glib.scm
... / ...
CommitLineData
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 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) #:prefix license:)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages bison)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages flex)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages libffi)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages xml)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages file)
40 #:use-module (gnu packages xorg)
41 #:use-module (gnu packages m4)
42
43 ;; Export variables up-front to allow circular dependency with the 'xorg'
44 ;; module.
45 #:export (dbus
46 glib
47 gobject-introspection
48 dbus-glib
49 intltool
50 itstool
51 libsigc++
52 glibmm))
53
54(define dbus
55 (package
56 (name "dbus")
57 (version "1.8.8")
58 (source (origin
59 (method url-fetch)
60 (uri
61 (string-append "http://dbus.freedesktop.org/releases/dbus/dbus-"
62 version ".tar.gz"))
63 (sha256
64 (base32
65 "1zfi5grrlryppgrl23im82cqw6l9fk1wlc2ayvzx0yd994v2dayz"))
66 (patches (list (search-patch "dbus-localstatedir.patch")))))
67 (build-system gnu-build-system)
68 (arguments
69 '(#:configure-flags (list ;; Install the system bus socket under /var.
70 "--localstatedir=/var"
71
72 ;; XXX: Fix the following to allow system-wide
73 ;; config.
74 ;; "--sysconfdir=/etc"
75
76 "--with-session-socket-dir=/tmp")
77 #:phases (alist-cons-after
78 'install 'post-install
79 (lambda* (#:key outputs #:allow-other-keys)
80 ;; 'dbus-launch' bails out if the 'session.d' directory
81 ;; below is missing, so create it along with its companion.
82 (let ((out (assoc-ref outputs "out")))
83 (mkdir (string-append out "/etc/dbus-1/session.d"))
84 (mkdir (string-append out "/etc/dbus-1/system.d"))
85 #t))
86 %standard-phases)))
87 (native-inputs
88 `(("pkg-config" ,pkg-config)))
89 (inputs
90 `(("expat" ,expat)
91
92 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
93 ;; '--autolaunch'.
94 ("libx11" ,libx11)))
95
96 (home-page "http://dbus.freedesktop.org/")
97 (synopsis "Message bus for inter-process communication (IPC)")
98 (description
99 "D-Bus is a message bus system, a simple way for applications to
100talk to one another. In addition to interprocess communication, D-Bus
101helps coordinate process lifecycle; it makes it simple and reliable to
102code a \"single instance\" application or daemon, and to launch
103applications and daemons on demand when their services are needed.
104
105D-Bus supplies both a system daemon (for events such as \"new hardware
106device added\" or \"printer queue changed\") and a
107per-user-login-session daemon (for general IPC needs among user
108applications). Also, the message bus is built on top of a general
109one-to-one message passing framework, which can be used by any two apps
110to communicate directly (without going through the message bus
111daemon). Currently the communicating applications are on one computer,
112or through unencrypted TCP/IP suitable for use behind a firewall with
113shared NFS home directories.")
114 (license license:gpl2+))) ; or Academic Free License 2.1
115
116(define glib
117 (package
118 (name "glib")
119 (version "2.40.0")
120 (source (origin
121 (method url-fetch)
122 (uri (string-append "mirror://gnome/sources/"
123 name "/" (string-take version 4) "/"
124 name "-" version ".tar.xz"))
125 (sha256
126 (base32 "1d98mbqjmc34s8095lkw1j1bwvnnkw9581yfvjaikjvfjsaz29qd"))
127 (patches (list (search-patch "glib-tests-homedir.patch")
128 (search-patch "glib-tests-desktop.patch")
129 (search-patch "glib-tests-prlimit.patch")
130 (search-patch "glib-tests-timer.patch")))))
131 (build-system gnu-build-system)
132 (outputs '("out" ; everything
133 "bin" ; glib-mkenums, gtester, etc.; depends on Python
134 "doc")) ; 20 MiB of GTK-Doc reference
135 (inputs
136 `(("coreutils" ,coreutils)
137 ("libffi" ,libffi)
138 ("zlib" ,zlib)
139 ("tzdata" ,tzdata))) ; for tests/gdatetime.c
140 (native-inputs
141 `(("gettext" ,gnu-gettext)
142 ("dbus" ,dbus) ; for GDBus tests
143 ("pkg-config" ,pkg-config)
144 ("python" ,python-wrapper)
145 ("perl" ,perl) ; needed by GIO tests
146 ("bash" ,bash)))
147 (arguments
148 '(#:phases (alist-cons-before
149 'build 'pre-build
150 (lambda* (#:key inputs outputs #:allow-other-keys)
151 ;; For tests/gdatetime.c.
152 (setenv "TZDIR"
153 (string-append (assoc-ref inputs "tzdata")
154 "/share/zoneinfo"))
155
156 ;; Some tests want write access there.
157 (setenv "XDG_CACHE_HOME" (getcwd))
158
159 (substitute* '("glib/gspawn.c"
160 "glib/tests/utils.c"
161 "tests/spawn-test.c")
162 (("/bin/sh")
163 (string-append (assoc-ref inputs "bash") "/bin/sh"))))
164 %standard-phases)
165
166 ;; Note: `--docdir' and `--htmldir' are not honored, so work around it.
167 #:configure-flags (list (string-append "--with-html-dir="
168 (assoc-ref %outputs "doc")
169 "/share/gtk-doc"))
170
171 ;; In 'gio/tests', 'gdbus-test-codegen-generated.h' is #included in a
172 ;; file that gets compiled possibly before it has been fully generated.
173 #:parallel-tests? #f))
174
175 (native-search-paths
176 ;; This variable is not really "owned" by GLib, but several related
177 ;; packages refer to it: gobject-introspection's tools use it as a search
178 ;; path for .gir files, and it's also a search path for schemas produced
179 ;; by 'glib-compile-schemas'.
180 (list (search-path-specification
181 (variable "XDG_DATA_DIRS")
182 (directories '("share")))))
183 (search-paths native-search-paths)
184
185 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
186 (description
187 "GLib provides data structure handling for C, portability wrappers,
188and interfaces for such runtime functionality as an event loop, threads,
189dynamic loading, and an object system.")
190 (home-page "http://developer.gnome.org/glib/")
191 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
192
193(define gobject-introspection
194 (package
195 (name "gobject-introspection")
196 (version "1.38.0")
197 (source (origin
198 (method url-fetch)
199 (uri (string-append "http://ftp.gnome.org/pub/GNOME/sources/"
200 "gobject-introspection/"
201 (substring version 0 (string-rindex version #\.))
202 "/gobject-introspection-"
203 version ".tar.xz"))
204 (sha256
205 (base32 "0wvxyvgajmms2bb6k3pf1rdpnd79xdxamykzvxzmcyn1ag9yax9m"))
206 (patches (list (search-patch "gobject-introspection-cc.patch")))))
207 (build-system gnu-build-system)
208 (inputs
209 `(("bison" ,bison)
210 ("cairo" ,cairo)
211 ("flex" ,flex)
212 ("glib" ,glib)
213 ("pkg-config" ,pkg-config)
214 ("python-2" ,python-2)))
215 (native-inputs
216 `(("glib" ,glib "bin")))
217 (propagated-inputs
218 `(;; In practice, GIR users will need libffi when using
219 ;; gobject-introspection.
220 ("libffi" ,libffi)))
221 (arguments
222 `(#:phases
223 (alist-cons-before
224 'configure 'patch-paths
225 (lambda _
226 (substitute* "giscanner/sourcescanner.py"
227 (("GUIX_GCC_PATH") (which "gcc"))))
228 %standard-phases)))
229 (home-page "https://wiki.gnome.org/GObjectIntrospection")
230 (synopsis "Generate interface introspection data for GObject libraries")
231 (description
232 "GObject introspection is a middleware layer between C libraries (using
233GObject) and language bindings. The C library can be scanned at compile time
234and generate a metadata file, in addition to the actual native C library. Then
235at runtime, language bindings can read this metadata and automatically provide
236bindings to call into the C library.")
237 ; Some bits are distributed under the LGPL2+, others under the GPL2+
238 (license license:gpl2+)))
239
240(define intltool
241 (package
242 (name "intltool")
243 (version "0.50.2")
244 (source (origin
245 (method url-fetch)
246 (uri (string-append "https://launchpad.net/intltool/trunk/"
247 version "/+download/intltool-"
248 version ".tar.gz"))
249 (sha256
250 (base32
251 "01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7"))))
252 (build-system gnu-build-system)
253 (propagated-inputs
254 `(;; Propagate gettext because users expect it to be there, and so does
255 ;; the `intltool-update' script.
256 ("gettext" ,gnu-gettext)
257
258 ;; `file' is used by `intltool-update' too.
259 ("file" ,file)
260
261 ("perl-xml-parser" ,perl-xml-parser)
262 ("perl" ,perl)))
263 (home-page "https://launchpad.net/intltool/+download")
264 (synopsis "Tools to centralise translations of different file formats")
265 (description
266 "intltool is a set of tools to centralise translations of many different
267file formats using GNU gettext-compatible PO files.
268
269The intltool collection can be used to do these things:
270
271 Extract translatable strings from various source files (.xml.in,
272 glade, .desktop.in, .server.in, .oaf.in).
273
274 Collect the extracted strings together with messages from traditional
275 source files (.c, .h) in po/$(PACKAGE).pot.
276
277 Merge back the translations from .po files into .xml, .desktop and
278 oaf files. This merge step will happen at build resp. installation time.")
279 (license license:gpl2+)))
280
281(define itstool
282 (package
283 (name "itstool")
284 (version "1.2.0")
285 (source (origin
286 (method url-fetch)
287 (uri (string-append "http://files.itstool.org/itstool/itstool-"
288 version ".tar.bz2"))
289 (sha256
290 (base32
291 "1akq75aflihm3y7js8biy7b5mw2g11vl8yq90gydnwlwp0zxdzj6"))))
292 (build-system gnu-build-system)
293 (propagated-inputs
294 `(("libxml2" ,libxml2)
295 ("python-2" ,python-2)))
296 (home-page "http://www.itstool.org")
297 (synopsis "Tool to translate XML documents with PO files")
298 (description
299 "ITS Tool allows you to translate your XML documents with PO files, using
300rules from the W3C Internationalization Tag Set (ITS) to determine what to
301translate and how to separate it into PO file messages.
302
303PO files are the standard translation format for GNU and other Unix-like
304systems. They present translatable information as discrete messages, allowing
305each message to be translated independently. In contrast to whole-page
306translation, translating with a message-based format like PO means you can
307easily track changes to the source document down to the paragraph. When new
308strings are added or existing strings are modified, you only need to update the
309corresponding messages.
310
311ITS Tool is designed to make XML documents translatable through PO files by
312applying standard ITS rules, as well as extension rules specific to ITS Tool.
313ITS also provides an industry standard way for authors to override translation
314information in their documents, such as whether a particular element should be
315translated.")
316 (license license:gpl3+)))
317
318(define dbus-glib
319 (package
320 (name "dbus-glib")
321 (version "0.100.2")
322 (source (origin
323 (method url-fetch)
324 (uri
325 (string-append "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
326 version ".tar.gz"))
327 (sha256
328 (base32
329 "1ibav91yg70f2l3l18cr0hf4mna1h9d4mrg0c60w4l8zjbd45fx5"))))
330 (build-system gnu-build-system)
331 (inputs
332 `(("dbus" ,dbus)
333 ("expat" ,expat)
334 ("glib" ,glib)))
335 (native-inputs
336 `(("glib" ,glib "bin")
337 ("pkg-config" ,pkg-config)))
338 (home-page "http://dbus.freedesktop.org/doc/dbus-glib/")
339 (synopsis "D-Bus GLib bindings")
340 (description
341 "GLib bindings for D-Bus. The package is obsolete and superseded
342by GDBus included in Glib.")
343 (license license:gpl2))) ; or Academic Free License 2.1
344
345(define libsigc++
346 (package
347 (name "libsigc++")
348 (version "2.3.1")
349 (source (origin
350 (method url-fetch)
351 (uri (string-append "mirror://gnome/sources/libsigc++/2.3/libsigc++-"
352 version ".tar.xz"))
353 (sha256
354 (base32
355 "14q3sq6d43f6wfcmwhw4v1aal4ba0h5x9v6wkxy2dnqznd95il37"))))
356 (build-system gnu-build-system)
357 (inputs `(("pkg-config" ,pkg-config)))
358 (native-inputs `(("m4" ,m4)))
359 (home-page "http://libsigc.sourceforge.net/")
360 (synopsis "Type-safe callback system for standard C++")
361 (description
362 "libsigc++ implements a type-safe callback system for standard C++. It
363allows you to define signals and to connect those signals to any callback
364function, either global or a member function, regardless of whether it is
365static or virtual.
366
367It also contains adaptor classes for connection of dissimilar callbacks and
368has an ease of use unmatched by other C++ callback libraries.")
369 (license license:lgpl2.1+)))
370
371(define glibmm
372 (package
373 (name "glibmm")
374 (version "2.37.7")
375 (source (origin
376 (method url-fetch)
377 (uri (string-append "mirror://gnome/sources/glibmm/2.37/glibmm-"
378 version ".tar.xz"))
379 (sha256
380 (base32
381 "0mms4yl5izsya1135772z4jkb184ss86x0wlg6dm7yvwxvb6bjlw"))))
382 (build-system gnu-build-system)
383 (arguments
384 `(#:phases (alist-cons-before
385 'build 'pre-build
386 (lambda _
387 ;; This test uses /etc/fstab as an example file to read
388 ;; from; choose a better example.
389 (substitute* "tests/giomm_simple/main.cc"
390 (("/etc/fstab")
391 (string-append (getcwd)
392 "/tests/giomm_simple/main.cc")))
393
394 ;; This test does a DNS lookup, and then expects to be able
395 ;; to open a TLS session; just skip it.
396 (substitute* "tests/giomm_tls_client/main.cc"
397 (("Gio::init.*$")
398 "return 77;\n")))
399 %standard-phases)))
400 (inputs `(("pkg-config" ,pkg-config)
401 ("glib" ,glib "bin")))
402 (propagated-inputs
403 `(("libsigc++" ,libsigc++)
404 ("glib" ,glib)))
405 (home-page "http://gtkmm.org/")
406 (synopsis "C++ interface to the GLib library")
407 (description
408 "glibmm provides a C++ programming interface to the part of GLib that are
409useful for C++.")
410 (license license:lgpl2.1+)))