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