nar: Read archive signatures as Latin-1 strings.
[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>
11163131 5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
3889a82e
NK
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
943f33a3 22(define-module (gnu packages glib)
b5b73a82 23 #:use-module ((guix licenses) #:prefix license:)
3889a82e
NK
24 #:use-module (guix packages)
25 #:use-module (guix download)
a1de06b6 26 #:use-module (guix utils)
3889a82e 27 #:use-module (guix build-system gnu)
943f33a3
LC
28 #:use-module (gnu packages)
29 #:use-module (gnu packages base)
9ceb630c 30 #:use-module (gnu packages bison)
943f33a3 31 #:use-module (gnu packages compression)
9ceb630c 32 #:use-module (gnu packages flex)
1dba6407 33 #:use-module (gnu packages gettext)
9ceb630c 34 #:use-module (gnu packages gtk)
943f33a3 35 #:use-module (gnu packages libffi)
d6b8cb5c 36 #:use-module (gnu packages perl)
943f33a3
LC
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
7bc5cc2b 39 #:use-module (gnu packages xml)
5aa601a3 40 #:use-module (gnu packages bash)
80370441 41 #:use-module (gnu packages file)
a1de06b6 42 #:use-module (gnu packages which)
80370441 43 #:use-module (gnu packages xorg)
a5a7d374 44 #:use-module (gnu packages m4)
943f33a3 45
80370441
LC
46 ;; Export variables up-front to allow circular dependency with the 'xorg'
47 ;; module.
48 #:export (dbus
49 glib
6ac6a6b9 50 gobject-introspection
80370441
LC
51 dbus-glib
52 intltool
a5a7d374
LC
53 itstool
54 libsigc++
55 glibmm))
80370441
LC
56
57(define dbus
943f33a3
LC
58 (package
59 (name "dbus")
11163131 60 (version "1.8.12")
943f33a3
LC
61 (source (origin
62 (method url-fetch)
63 (uri
64 (string-append "http://dbus.freedesktop.org/releases/dbus/dbus-"
65 version ".tar.gz"))
66 (sha256
67 (base32
11163131 68 "07jhcalg00i2rx5zrgk73rg0vm7lzi5q5z2gscrbl999ipr2h569"))
01eafd38 69 (patches (list (search-patch "dbus-localstatedir.patch")))))
943f33a3 70 (build-system gnu-build-system)
8eaa8a3b
LC
71 (arguments
72 '(#:configure-flags (list ;; Install the system bus socket under /var.
73 "--localstatedir=/var"
74
75 ;; XXX: Fix the following to allow system-wide
76 ;; config.
77 ;; "--sysconfdir=/etc"
78
8fa9ff20
LC
79 "--with-session-socket-dir=/tmp")
80 #:phases (alist-cons-after
81 'install 'post-install
82 (lambda* (#:key outputs #:allow-other-keys)
83 ;; 'dbus-launch' bails out if the 'session.d' directory
84 ;; below is missing, so create it along with its companion.
85 (let ((out (assoc-ref outputs "out")))
86 (mkdir (string-append out "/etc/dbus-1/session.d"))
87 (mkdir (string-append out "/etc/dbus-1/system.d"))
88 #t))
89 %standard-phases)))
708be46b
LC
90 (native-inputs
91 `(("pkg-config" ,pkg-config)))
943f33a3 92 (inputs
d6b8cb5c 93 `(("expat" ,expat)
80370441
LC
94
95 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
96 ;; '--autolaunch'.
97 ("libx11" ,libx11)))
98
943f33a3
LC
99 (home-page "http://dbus.freedesktop.org/")
100 (synopsis "Message bus for inter-process communication (IPC)")
101 (description
102 "D-Bus is a message bus system, a simple way for applications to
35b9e423 103talk to one another. In addition to interprocess communication, D-Bus
943f33a3
LC
104helps coordinate process lifecycle; it makes it simple and reliable to
105code a \"single instance\" application or daemon, and to launch
106applications and daemons on demand when their services are needed.
107
108D-Bus supplies both a system daemon (for events such as \"new hardware
109device added\" or \"printer queue changed\") and a
110per-user-login-session daemon (for general IPC needs among user
35b9e423 111applications). Also, the message bus is built on top of a general
943f33a3
LC
112one-to-one message passing framework, which can be used by any two apps
113to communicate directly (without going through the message bus
35b9e423 114daemon). Currently the communicating applications are on one computer,
943f33a3
LC
115or through unencrypted TCP/IP suitable for use behind a firewall with
116shared NFS home directories.")
d6b8cb5c 117 (license license:gpl2+))) ; or Academic Free License 2.1
3889a82e 118
80370441 119(define glib
3889a82e
NK
120 (package
121 (name "glib")
ee28fc64 122 (version "2.42.1")
3889a82e
NK
123 (source (origin
124 (method url-fetch)
785db4d8 125 (uri (string-append "mirror://gnome/sources/"
d274f499 126 name "/" (string-take version 4) "/"
943f33a3 127 name "-" version ".tar.xz"))
3889a82e 128 (sha256
f47f6761 129 (base32
ee28fc64 130 "16pqvikrps1fvwwqvk0qi4a13mfg7gw6w5qfhk7bhi8f51jhhgwg"))
01eafd38
LC
131 (patches (list (search-patch "glib-tests-homedir.patch")
132 (search-patch "glib-tests-desktop.patch")
ca9ea1a8 133 (search-patch "glib-tests-prlimit.patch")
36d2a3af
LC
134 (search-patch "glib-tests-timer.patch")
135 (search-patch "glib-tests-gapplication.patch")))))
3889a82e 136 (build-system gnu-build-system)
426adbe8
LC
137 (outputs '("out" ; everything
138 "bin" ; glib-mkenums, gtester, etc.; depends on Python
139 "doc")) ; 20 MiB of GTK-Doc reference
3889a82e
NK
140 (inputs
141 `(("coreutils" ,coreutils)
3889a82e 142 ("libffi" ,libffi)
c4c4cc05
JD
143 ("zlib" ,zlib)
144 ("tzdata" ,tzdata))) ; for tests/gdatetime.c
145 (native-inputs
59bad04f 146 `(("gettext" ,gnu-gettext)
c4c4cc05 147 ("dbus" ,dbus) ; for GDBus tests
3889a82e 148 ("pkg-config" ,pkg-config)
ee3e314b 149 ("python" ,python-wrapper)
943f33a3 150 ("perl" ,perl) ; needed by GIO tests
c4c4cc05 151 ("bash" ,bash)))
943f33a3 152 (arguments
01eafd38 153 '(#:phases (alist-cons-before
943f33a3
LC
154 'build 'pre-build
155 (lambda* (#:key inputs outputs #:allow-other-keys)
7bc5cc2b
LC
156 ;; For tests/gdatetime.c.
157 (setenv "TZDIR"
158 (string-append (assoc-ref inputs "tzdata")
159 "/share/zoneinfo"))
160
161 ;; Some tests want write access there.
162 (setenv "XDG_CACHE_HOME" (getcwd))
163
943f33a3
LC
164 (substitute* '("glib/gspawn.c"
165 "glib/tests/utils.c"
166 "tests/spawn-test.c")
7bc5cc2b 167 (("/bin/sh")
ee28fc64
MW
168 (string-append (assoc-ref inputs "bash") "/bin/sh")))
169
170 ;; Disable a test that requires dbus.
171 (substitute* "gio/tests/gdbus-serialization.c"
172 (("g_test_add_func \\(\"/gdbus/message-serialize/double-array\", test_double_array\\);" all)
173 (string-append "/* " all " */"))))
943f33a3
LC
174 %standard-phases)
175
176 ;; Note: `--docdir' and `--htmldir' are not honored, so work around it.
177 #:configure-flags (list (string-append "--with-html-dir="
178 (assoc-ref %outputs "doc")
00585a55
LC
179 "/share/gtk-doc"))
180
181 ;; In 'gio/tests', 'gdbus-test-codegen-generated.h' is #included in a
182 ;; file that gets compiled possibly before it has been fully generated.
183 #:parallel-tests? #f))
ce2df078
LC
184
185 (native-search-paths
186 ;; This variable is not really "owned" by GLib, but several related
187 ;; packages refer to it: gobject-introspection's tools use it as a search
188 ;; path for .gir files, and it's also a search path for schemas produced
189 ;; by 'glib-compile-schemas'.
190 (list (search-path-specification
191 (variable "XDG_DATA_DIRS")
af070955 192 (files '("share")))))
ce2df078
LC
193 (search-paths native-search-paths)
194
f50d2669 195 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
3889a82e
NK
196 (description
197 "GLib provides data structure handling for C, portability wrappers,
198and interfaces for such runtime functionality as an event loop, threads,
199dynamic loading, and an object system.")
200 (home-page "http://developer.gnome.org/glib/")
d6b8cb5c 201 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
71eb5c10 202
6ac6a6b9 203(define gobject-introspection
9ceb630c
CR
204 (package
205 (name "gobject-introspection")
6c2cf86e 206 (version "1.38.0")
9ceb630c
CR
207 (source (origin
208 (method url-fetch)
209 (uri (string-append "http://ftp.gnome.org/pub/GNOME/sources/"
6c2cf86e
FB
210 "gobject-introspection/"
211 (substring version 0 (string-rindex version #\.))
212 "/gobject-introspection-"
213 version ".tar.xz"))
9ceb630c 214 (sha256
6c2cf86e
FB
215 (base32 "0wvxyvgajmms2bb6k3pf1rdpnd79xdxamykzvxzmcyn1ag9yax9m"))
216 (patches (list (search-patch "gobject-introspection-cc.patch")))))
9ceb630c
CR
217 (build-system gnu-build-system)
218 (inputs
219 `(("bison" ,bison)
220 ("cairo" ,cairo)
221 ("flex" ,flex)
222 ("glib" ,glib)
9ceb630c
CR
223 ("pkg-config" ,pkg-config)
224 ("python-2" ,python-2)))
426adbe8
LC
225 (native-inputs
226 `(("glib" ,glib "bin")))
af949e8e
CR
227 (propagated-inputs
228 `(;; In practice, GIR users will need libffi when using
229 ;; gobject-introspection.
230 ("libffi" ,libffi)))
5a4753a6
FB
231 (native-search-paths
232 (list (search-path-specification
233 (variable "GI_TYPELIB_PATH")
af070955 234 (files '("lib/girepository-1.0")))))
5a4753a6 235 (search-paths native-search-paths)
9ceb630c 236 (arguments
6c2cf86e 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")
4b1b3877 343 (version "0.102")
24b5c463
AE
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
4b1b3877 351 "177j5p2vrvpmzk2xrrj6akn73kvpbvnmsjvlmca9l55qbdcfsr39"))))
24b5c463
AE
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")
3d6befa4 396 (version "2.42.0")
a5a7d374
LC
397 (source (origin
398 (method url-fetch)
3d6befa4
MW
399 (uri (string-append "mirror://gnome/sources/glibmm/"
400 (version-major+minor version)
401 "/glibmm-" version ".tar.xz"))
a5a7d374
LC
402 (sha256
403 (base32
3d6befa4 404 "15rk3az8jh3rdwlc3lxjljbnh60drj3ka9574zd39lkqfgcq6l4q"))))
a5a7d374
LC
405 (build-system gnu-build-system)
406 (arguments
407 `(#:phases (alist-cons-before
408 'build 'pre-build
409 (lambda _
410 ;; This test uses /etc/fstab as an example file to read
411 ;; from; choose a better example.
412 (substitute* "tests/giomm_simple/main.cc"
413 (("/etc/fstab")
414 (string-append (getcwd)
415 "/tests/giomm_simple/main.cc")))
416
417 ;; This test does a DNS lookup, and then expects to be able
418 ;; to open a TLS session; just skip it.
419 (substitute* "tests/giomm_tls_client/main.cc"
420 (("Gio::init.*$")
421 "return 77;\n")))
422 %standard-phases)))
41eb1198
LC
423 (native-inputs `(("pkg-config" ,pkg-config)
424 ("glib" ,glib "bin")))
a5a7d374
LC
425 (propagated-inputs
426 `(("libsigc++" ,libsigc++)
427 ("glib" ,glib)))
428 (home-page "http://gtkmm.org/")
429 (synopsis "C++ interface to the GLib library")
430 (description
35b9e423 431 "Glibmm provides a C++ programming interface to the part of GLib that are
a5a7d374
LC
432useful for C++.")
433 (license license:lgpl2.1+)))
a1de06b6
EB
434
435(define-public python2-pygobject-2
436 (package
437 (name "python2-pygobject")
438 ;; This was the last version to declare the 2.0 platform number, i.e. its
439 ;; pkg-config files were named pygobject-2.0.pc
440 (version "2.28.6")
441 (source
442 (origin
443 (method url-fetch)
444 (uri (string-append "mirror://gnome/sources/pygobject/"
445 (version-major+minor version)
446 "/pygobject-" version ".tar.xz"))
447 (sha256
448 (base32
449 "1f5dfxjnil2glfwxnqr14d2cjfbkghsbsn8n04js2c2icr7iv2pv"))
450 (patches
451 (list (search-patch
452 "python2-pygobject-2-gi-info-type-error-domain.patch")))))
453 (build-system gnu-build-system)
454 (native-inputs
455 `(("which" ,which)
456 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
457 ("pkg-config" ,pkg-config)
458 ("dbus" ,dbus))) ;for tests
459 (inputs
460 `(("python" ,python-2)
461 ("glib" ,glib)
462 ("python2-py2cairo" ,python2-py2cairo)
463 ("gobject-introspection" ,gobject-introspection)))
464 (propagated-inputs
465 `(("libffi" ,libffi))) ;mentioned in pygobject-2.0.pc
466 (arguments
467 `(#:tests? #f ;segfaults during tests
468 #:configure-flags '("LIBS=-lcairo-gobject")))
469 (home-page "https://pypi.python.org/pypi/PyGObject")
470 (synopsis "Python bindings for GObject")
471 (description
472 "Python bindings for GLib, GObject, and GIO.")
473 (license license:lgpl2.1+)))
474
475(define-public python-pygobject
476 (package
477 (name "python-pygobject")
478 (version "3.12.2") ;last version that works with
479 ;gobject-introspection 1.38
480 (source
481 (origin
482 (method url-fetch)
483 (uri (string-append "mirror://gnome/sources/pygobject/"
484 (version-major+minor version)
485 "/pygobject-" version ".tar.xz"))
486 (sha256
487 (base32
488 "08m5yad1hjdax4g39w6lgjk4124mcwpa8fc5iyvb8nygk8s3syky"))))
489 ;; 3.14.0: 0m1d75iwxa6k1xbkn6c6yq5r10pxnf7i5c2a5yvwsnab7ylzz7kp
490 (build-system gnu-build-system)
491 (native-inputs
492 `(("which" ,which)
493 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
494 ("pkg-config" ,pkg-config)))
495 (inputs
496 `(("python" ,python)
497 ("glib" ,glib)
498 ("python-pycairo" ,python-pycairo)
499 ("gobject-introspection" ,gobject-introspection)
500 ("libffi" ,libffi)))
501 (arguments
502 ;; TODO: failing tests: test_native_calls_async
503 ;; test_native_calls_async_errors test_native_calls_sync
504 ;; test_native_calls_sync_errors test_python_calls_async
505 ;; test_python_calls_async_error test_python_calls_async_error_result
506 ;; test_python_calls_sync test_python_calls_sync_errors
507 ;; test_python_calls_sync_noargs test_callback_user_data_middle_none
508 ;; test_callback_user_data_middle_single
509 ;; test_callback_user_data_middle_tuple
510 '(#:tests? #f))
511 (home-page "https://pypi.python.org/pypi/PyGObject")
512 (synopsis "Python bindings for GObject")
513 (description
514 "Python bindings for GLib, GObject, and GIO.")
515 (license license:lgpl2.1+)))