1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
22 (define-module (gnu packages glib)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix utils)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages flex)
33 #:use-module (gnu packages gettext)
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 #:use-module (gnu packages m4)
45 ;; Export variables up-front to allow circular dependency with the 'xorg'
64 (string-append "http://dbus.freedesktop.org/releases/dbus/dbus-"
68 "0jwj7wlrhq5y0fwfh8k2d9rgdpfax06lj8698g6iqbwrzd2rgyqx"))
69 (patches (list (search-patch "dbus-localstatedir.patch")))))
70 (build-system gnu-build-system)
72 '(#:configure-flags (list ;; Install the system bus socket under /var.
73 "--localstatedir=/var"
75 ;; Look for configuration file under
76 ;; /etc/dbus-1. This is notably required by
77 ;; 'dbus-daemon-launch-helper', which looks for
78 ;; the 'system.conf' file in that place,
79 ;; regardless of what '--config-file' was
80 ;; passed to 'dbus-daemon' on the command line;
81 ;; see <https://bugs.freedesktop.org/show_bug.cgi?id=92458>.
84 "--with-session-socket-dir=/tmp")
85 #:phases (alist-cons-after
86 'install 'post-install
87 (lambda* (#:key outputs #:allow-other-keys)
88 ;; 'dbus-launch' bails out if the 'session.d' directory
89 ;; below is missing, so create it along with its companion.
90 (let ((out (assoc-ref outputs "out")))
91 (mkdir (string-append out "/etc/dbus-1/session.d"))
92 (mkdir (string-append out "/etc/dbus-1/system.d"))
96 `(("pkg-config" ,pkg-config)))
100 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
104 (home-page "http://dbus.freedesktop.org/")
105 (synopsis "Message bus for inter-process communication (IPC)")
107 "D-Bus is a message bus system, a simple way for applications to
108 talk to one another. In addition to interprocess communication, D-Bus
109 helps coordinate process lifecycle; it makes it simple and reliable to
110 code a \"single instance\" application or daemon, and to launch
111 applications and daemons on demand when their services are needed.
113 D-Bus supplies both a system daemon (for events such as \"new hardware
114 device added\" or \"printer queue changed\") and a
115 per-user-login-session daemon (for general IPC needs among user
116 applications). Also, the message bus is built on top of a general
117 one-to-one message passing framework, which can be used by any two apps
118 to communicate directly (without going through the message bus
119 daemon). Currently the communicating applications are on one computer,
120 or through unencrypted TCP/IP suitable for use behind a firewall with
121 shared NFS home directories.")
122 (license license:gpl2+))) ; or Academic Free License 2.1
130 (uri (string-append "mirror://gnome/sources/"
131 name "/" (string-take version 4) "/"
132 name "-" version ".tar.xz"))
135 "1d5cpb2zp5js98jjnbfn1fb96kj1j3q3fz16gkqq0zdfd4sfikmi"))
136 (patches (list (search-patch "glib-tests-homedir.patch")
137 (search-patch "glib-tests-desktop.patch")
138 (search-patch "glib-tests-prlimit.patch")
139 (search-patch "glib-tests-timer.patch")
140 (search-patch "glib-tests-gapplication.patch")))))
141 (build-system gnu-build-system)
142 (outputs '("out" ; everything
143 "bin" ; glib-mkenums, gtester, etc.; depends on Python
144 "doc")) ; 20 MiB of GTK-Doc reference
146 `(("coreutils" ,coreutils)
149 ("tzdata" ,tzdata))) ; for tests/gdatetime.c
151 `(("gettext" ,gnu-gettext)
152 ("dbus" ,dbus) ; for GDBus tests
153 ("pkg-config" ,pkg-config)
154 ("python" ,python-wrapper)
155 ("perl" ,perl) ; needed by GIO tests
158 '(#:phases (alist-cons-before
160 (lambda* (#:key inputs outputs #:allow-other-keys)
161 ;; For tests/gdatetime.c.
163 (string-append (assoc-ref inputs "tzdata")
166 ;; Some tests want write access there.
167 (setenv "XDG_CACHE_HOME" (getcwd))
169 (substitute* '("glib/gspawn.c"
171 "tests/spawn-test.c")
173 (string-append (assoc-ref inputs "bash") "/bin/sh")))
175 ;; Disable a test that requires dbus.
176 (substitute* "gio/tests/gdbus-serialization.c"
177 (("g_test_add_func \\(\"/gdbus/message-serialize/double-array\", test_double_array\\);" all)
178 (string-append "/* " all " */"))))
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")
184 "/share/gtk-doc/html"))
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))
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")
198 ;; To load extra gio modules from glib-networking, etc.
199 (search-path-specification
200 (variable "GIO_EXTRA_MODULES")
201 (files '("lib/gio/modules")))))
202 (search-paths native-search-paths)
204 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
206 "GLib provides data structure handling for C, portability wrappers,
207 and interfaces for such runtime functionality as an event loop, threads,
208 dynamic loading, and an object system.")
209 (home-page "http://developer.gnome.org/glib/")
210 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
212 (define gobject-introspection
214 (name "gobject-introspection")
218 (uri (string-append "mirror://gnome/sources/"
219 "gobject-introspection/" (version-major+minor version)
220 "/gobject-introspection-" version ".tar.xz"))
222 (base32 "1b972qg2yb51sdavfvb6kc19akwc15c1bwnbg81vadxamql2q33g"))
224 (search-patch "gobject-introspection-cc.patch")
226 "gobject-introspection-girepository.patch")
228 "gobject-introspection-absolute-shlib-path.patch")))))
229 (build-system gnu-build-system)
235 ("pkg-config" ,pkg-config)
236 ("python-2" ,python-2)))
238 `(("glib" ,glib "bin")))
240 `(;; In practice, GIR users will need libffi when using
241 ;; gobject-introspection.
244 (list (search-path-specification
245 (variable "GI_TYPELIB_PATH")
246 (files '("lib/girepository-1.0")))))
247 (search-paths native-search-paths)
249 `(;; The patch 'gobject-introspection-absolute-shlib-path.patch' causes
250 ;; some tests to fail.
252 (home-page "https://wiki.gnome.org/GObjectIntrospection")
253 (synopsis "Generate interface introspection data for GObject libraries")
255 "GObject introspection is a middleware layer between C libraries (using
256 GObject) and language bindings. The C library can be scanned at compile time
257 and generate a metadata file, in addition to the actual native C library. Then
258 at runtime, language bindings can read this metadata and automatically provide
259 bindings to call into the C library.")
260 ; Some bits are distributed under the LGPL2+, others under the GPL2+
261 (license license:gpl2+)))
269 (uri (string-append "https://launchpad.net/intltool/trunk/"
270 version "/+download/intltool-"
274 "01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7"))))
275 (build-system gnu-build-system)
279 `(;; Propagate gettext because users expect it to be there, and so does
280 ;; the `intltool-update' script.
281 ("gettext" ,gnu-gettext)
283 ("perl-xml-parser" ,perl-xml-parser)
286 `(#:phases (alist-cons-after
287 'unpack 'patch-file-references
288 (lambda* (#:key inputs #:allow-other-keys)
289 (let ((file (assoc-ref inputs "file")))
290 (substitute* "intltool-update.in"
291 (("`file") (string-append "`" file "/bin/file")))))
293 (home-page "https://launchpad.net/intltool/+download")
294 (synopsis "Tools to centralise translations of different file formats")
296 "Intltool is a set of tools to centralise translations of many different
297 file formats using GNU gettext-compatible PO files.
299 The intltool collection can be used to do these things:
301 Extract translatable strings from various source files (.xml.in,
302 glade, .desktop.in, .server.in, .oaf.in).
304 Collect the extracted strings together with messages from traditional
305 source files (.c, .h) in po/$(PACKAGE).pot.
307 Merge back the translations from .po files into .xml, .desktop and
308 oaf files. This merge step will happen at build resp. installation time.")
309 (license license:gpl2+)))
317 (uri (string-append "http://files.itstool.org/itstool/itstool-"
321 "0fh34wi52i0qikgvlmrcpf1vx6gc1xqdad4539l4d9hikfsrz45z"))))
322 (build-system gnu-build-system)
324 `(("libxml2" ,libxml2)
325 ("python2-libxml2" ,python2-libxml2)
326 ("python-2" ,python-2)))
329 (modify-phases %standard-phases
331 'install 'wrap-program
332 (lambda* (#:key outputs #:allow-other-keys)
333 (let ((prog (string-append (assoc-ref outputs "out")
336 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))))))))
337 (home-page "http://www.itstool.org")
338 (synopsis "Tool to translate XML documents with PO files")
340 "ITS Tool allows you to translate your XML documents with PO files, using
341 rules from the W3C Internationalization Tag Set (ITS) to determine what to
342 translate and how to separate it into PO file messages.
344 PO files are the standard translation format for GNU and other Unix-like
345 systems. They present translatable information as discrete messages, allowing
346 each message to be translated independently. In contrast to whole-page
347 translation, translating with a message-based format like PO means you can
348 easily track changes to the source document down to the paragraph. When new
349 strings are added or existing strings are modified, you only need to update the
350 corresponding messages.
352 ITS Tool is designed to make XML documents translatable through PO files by
353 applying standard ITS rules, as well as extension rules specific to ITS Tool.
354 ITS also provides an industry standard way for authors to override translation
355 information in their documents, such as whether a particular element should be
357 (license license:gpl3+)))
366 (string-append "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
370 "1xi1v1msz75qs0s4lkyf1psrksdppa3hwkg0mznc6gpw5flg3hdz"))))
371 (build-system gnu-build-system)
372 (propagated-inputs ; according to dbus-glib-1.pc
378 `(("glib" ,glib "bin")
379 ("pkg-config" ,pkg-config)))
380 (home-page "http://dbus.freedesktop.org/doc/dbus-glib/")
381 (synopsis "D-Bus GLib bindings")
383 "GLib bindings for D-Bus. The package is obsolete and superseded
384 by GDBus included in Glib.")
385 (license license:gpl2))) ; or Academic Free License 2.1
393 (uri (string-append "mirror://gnome/sources/libsigc++/"
394 (version-major+minor version) "/"
395 name "-" version ".tar.xz"))
398 "1v0rvkzglzmf67y9nkcppwjwi68j1cy5yhldvcq7xrv8594l612l"))))
399 (build-system gnu-build-system)
400 (native-inputs `(("pkg-config" ,pkg-config)
402 (home-page "http://libsigc.sourceforge.net/")
403 (synopsis "Type-safe callback system for standard C++")
405 "Libsigc++ implements a type-safe callback system for standard C++. It
406 allows you to define signals and to connect those signals to any callback
407 function, either global or a member function, regardless of whether it is
410 It also contains adaptor classes for connection of dissimilar callbacks and
411 has an ease of use unmatched by other C++ callback libraries.")
412 (license license:lgpl2.1+)))
420 (uri (string-append "mirror://gnome/sources/glibmm/"
421 (version-major+minor version)
422 "/glibmm-" version ".tar.xz"))
425 "1a1fczy7hcpn24fglyn4i79f4yjc8s50is70q03mb294bm1c02hv"))))
426 (build-system gnu-build-system)
428 `(#:phases (alist-cons-before
431 ;; This test uses /etc/fstab as an example file to read
432 ;; from; choose a better example.
433 (substitute* "tests/giomm_simple/main.cc"
435 (string-append (getcwd)
436 "/tests/giomm_simple/main.cc")))
438 ;; This test does a DNS lookup, and then expects to be able
439 ;; to open a TLS session; just skip it.
440 (substitute* "tests/giomm_tls_client/main.cc"
444 (native-inputs `(("pkg-config" ,pkg-config)
445 ("glib" ,glib "bin")))
447 `(("libsigc++" ,libsigc++)
449 (home-page "http://gtkmm.org/")
450 (synopsis "C++ interface to the GLib library")
452 "Glibmm provides a C++ programming interface to the part of GLib that are
454 (license license:lgpl2.1+)))
456 (define-public python2-pygobject-2
458 (name "python2-pygobject")
459 ;; This was the last version to declare the 2.0 platform number, i.e. its
460 ;; pkg-config files were named pygobject-2.0.pc
465 (uri (string-append "mirror://gnome/sources/pygobject/"
466 (version-major+minor version)
467 "/pygobject-" version ".tar.xz"))
470 "1f5dfxjnil2glfwxnqr14d2cjfbkghsbsn8n04js2c2icr7iv2pv"))
473 "python2-pygobject-2-gi-info-type-error-domain.patch")))))
474 (build-system gnu-build-system)
477 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
478 ("pkg-config" ,pkg-config)
479 ("dbus" ,dbus))) ;for tests
481 `(("python" ,python-2)
483 ("python2-pycairo" ,python2-pycairo)
484 ("gobject-introspection" ,gobject-introspection)))
486 `(("libffi" ,libffi))) ;mentioned in pygobject-2.0.pc
488 `(#:tests? #f ;segfaults during tests
489 #:configure-flags '("LIBS=-lcairo-gobject")))
490 (home-page "https://pypi.python.org/pypi/PyGObject")
491 (synopsis "Python bindings for GObject")
493 "Python bindings for GLib, GObject, and GIO.")
494 (license license:lgpl2.1+)))
496 (define-public python-pygobject
498 (name "python-pygobject")
503 (uri (string-append "mirror://gnome/sources/pygobject/"
504 (version-major+minor version)
505 "/pygobject-" version ".tar.xz"))
508 "1hqyma73w0lnjcgx68kawhnq84aq92xlkdqphrlc2ppia38dm5kx"))))
509 (build-system gnu-build-system)
512 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
513 ("pkg-config" ,pkg-config)))
517 ("python-pycairo" ,python-pycairo)
518 ("gobject-introspection" ,gobject-introspection)
521 ;; TODO: failing tests: test_native_calls_async
522 ;; test_native_calls_async_errors test_native_calls_sync
523 ;; test_native_calls_sync_errors test_python_calls_async
524 ;; test_python_calls_async_error test_python_calls_async_error_result
525 ;; test_python_calls_sync test_python_calls_sync_errors
526 ;; test_python_calls_sync_noargs test_callback_user_data_middle_none
527 ;; test_callback_user_data_middle_single
528 ;; test_callback_user_data_middle_tuple
530 (home-page "https://live.gnome.org/PyGObject")
531 (synopsis "Python bindings for GObject")
533 "Python bindings for GLib, GObject, and GIO.")
534 (license license:lgpl2.1+)))
536 (define-public python2-pygobject
537 (package (inherit python-pygobject)
538 (name "python2-pygobject")
540 `(("python" ,python-2)
542 ("python-pycairo" ,python2-pycairo)
543 ("gobject-introspection" ,gobject-introspection)
544 ("libffi" ,libffi)))))
546 (define telepathy-glib
548 (name "telepathy-glib")
555 "http://telepathy.freedesktop.org/releases/telepathy-glib/"
556 "telepathy-glib-" version ".tar.gz"))
559 "1symyzbjmxvksn2ifdkk50lafjm2llf2sbmky062gq2pz3cg23cy"))))
560 (build-system gnu-build-system)
562 `(("glib" ,glib "bin") ; uses glib-mkenums
563 ("pkg-config" ,pkg-config)
564 ("python" ,python-2)))
567 ("dbus-glib" ,dbus-glib)
569 ("gobject-introspection" ,gobject-introspection)
570 ("libxslt" ,libxslt)))
571 (home-page "http://telepathy.freedesktop.org/wiki/")
572 (synopsis "GLib Real-time communications framework over D-Bus")
573 (description "Telepathy is a flexible, modular communications framework
574 that enables real-time communication over D-Bus via pluggable protocol
575 backends. Telepathy is a communications service that can be accessed by
576 many applications simultaneously.
578 This package provides the library for GLib applications.")
579 (license license:lgpl2.1+)))