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 "01rba8mp8kqvmy6ibdmi806kjr3m14swnskqk02gyhykxxl54ybz"))
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 ;; XXX: Fix the following to allow system-wide
77 ;; "--sysconfdir=/etc"
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"))
91 `(("pkg-config" ,pkg-config)))
95 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
99 (home-page "http://dbus.freedesktop.org/")
100 (synopsis "Message bus for inter-process communication (IPC)")
102 "D-Bus is a message bus system, a simple way for applications to
103 talk to one another. In addition to interprocess communication, D-Bus
104 helps coordinate process lifecycle; it makes it simple and reliable to
105 code a \"single instance\" application or daemon, and to launch
106 applications and daemons on demand when their services are needed.
108 D-Bus supplies both a system daemon (for events such as \"new hardware
109 device added\" or \"printer queue changed\") and a
110 per-user-login-session daemon (for general IPC needs among user
111 applications). Also, the message bus is built on top of a general
112 one-to-one message passing framework, which can be used by any two apps
113 to communicate directly (without going through the message bus
114 daemon). Currently the communicating applications are on one computer,
115 or through unencrypted TCP/IP suitable for use behind a firewall with
116 shared NFS home directories.")
117 (license license:gpl2+))) ; or Academic Free License 2.1
125 (uri (string-append "mirror://gnome/sources/"
126 name "/" (string-take version 4) "/"
127 name "-" version ".tar.xz"))
130 "1fgmjv3yzxgbks31h42201x2izpw0sd84h8dfw0si3x00sqn5lzj"))
131 (patches (list (search-patch "glib-tests-homedir.patch")
132 (search-patch "glib-tests-desktop.patch")
133 (search-patch "glib-tests-prlimit.patch")
134 (search-patch "glib-tests-timer.patch")
135 (search-patch "glib-tests-gapplication.patch")))))
136 (build-system gnu-build-system)
137 (outputs '("out" ; everything
138 "bin" ; glib-mkenums, gtester, etc.; depends on Python
139 "doc")) ; 20 MiB of GTK-Doc reference
141 `(("coreutils" ,coreutils)
144 ("tzdata" ,tzdata))) ; for tests/gdatetime.c
146 `(("gettext" ,gnu-gettext)
147 ("dbus" ,dbus) ; for GDBus tests
148 ("pkg-config" ,pkg-config)
149 ("python" ,python-wrapper)
150 ("perl" ,perl) ; needed by GIO tests
153 '(#:phases (alist-cons-before
155 (lambda* (#:key inputs outputs #:allow-other-keys)
156 ;; For tests/gdatetime.c.
158 (string-append (assoc-ref inputs "tzdata")
161 ;; Some tests want write access there.
162 (setenv "XDG_CACHE_HOME" (getcwd))
164 (substitute* '("glib/gspawn.c"
166 "tests/spawn-test.c")
168 (string-append (assoc-ref inputs "bash") "/bin/sh")))
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 " */"))))
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")
179 "/share/gtk-doc/html"))
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))
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")
193 ;; To load extra gio modules from glib-networking, etc.
194 (search-path-specification
195 (variable "GIO_EXTRA_MODULES")
196 (files '("lib/gio/modules")))))
197 (search-paths native-search-paths)
199 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
201 "GLib provides data structure handling for C, portability wrappers,
202 and interfaces for such runtime functionality as an event loop, threads,
203 dynamic loading, and an object system.")
204 (home-page "http://developer.gnome.org/glib/")
205 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
207 (define gobject-introspection
209 (name "gobject-introspection")
213 (uri (string-append "mirror://gnome/sources/"
214 "gobject-introspection/" (version-major+minor version)
215 "/gobject-introspection-" version ".tar.xz"))
217 (base32 "1b972qg2yb51sdavfvb6kc19akwc15c1bwnbg81vadxamql2q33g"))
219 (search-patch "gobject-introspection-cc.patch")
221 "gobject-introspection-girepository.patch")
223 "gobject-introspection-absolute-shlib-path.patch")))))
224 (build-system gnu-build-system)
230 ("pkg-config" ,pkg-config)
231 ("python-2" ,python-2)))
233 `(("glib" ,glib "bin")))
235 `(;; In practice, GIR users will need libffi when using
236 ;; gobject-introspection.
239 (list (search-path-specification
240 (variable "GI_TYPELIB_PATH")
241 (files '("lib/girepository-1.0")))))
242 (search-paths native-search-paths)
244 `(;; The patch 'gobject-introspection-absolute-shlib-path.patch' causes
245 ;; some tests to fail.
247 (home-page "https://wiki.gnome.org/GObjectIntrospection")
248 (synopsis "Generate interface introspection data for GObject libraries")
250 "GObject introspection is a middleware layer between C libraries (using
251 GObject) and language bindings. The C library can be scanned at compile time
252 and generate a metadata file, in addition to the actual native C library. Then
253 at runtime, language bindings can read this metadata and automatically provide
254 bindings to call into the C library.")
255 ; Some bits are distributed under the LGPL2+, others under the GPL2+
256 (license license:gpl2+)))
264 (uri (string-append "https://launchpad.net/intltool/trunk/"
265 version "/+download/intltool-"
269 "01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7"))))
270 (build-system gnu-build-system)
274 `(;; Propagate gettext because users expect it to be there, and so does
275 ;; the `intltool-update' script.
276 ("gettext" ,gnu-gettext)
278 ("perl-xml-parser" ,perl-xml-parser)
281 `(#:phases (alist-cons-after
282 'unpack 'patch-file-references
283 (lambda* (#:key inputs #:allow-other-keys)
284 (let ((file (assoc-ref inputs "file")))
285 (substitute* "intltool-update.in"
286 (("`file") (string-append "`" file "/bin/file")))))
288 (home-page "https://launchpad.net/intltool/+download")
289 (synopsis "Tools to centralise translations of different file formats")
291 "Intltool is a set of tools to centralise translations of many different
292 file formats using GNU gettext-compatible PO files.
294 The intltool collection can be used to do these things:
296 Extract translatable strings from various source files (.xml.in,
297 glade, .desktop.in, .server.in, .oaf.in).
299 Collect the extracted strings together with messages from traditional
300 source files (.c, .h) in po/$(PACKAGE).pot.
302 Merge back the translations from .po files into .xml, .desktop and
303 oaf files. This merge step will happen at build resp. installation time.")
304 (license license:gpl2+)))
312 (uri (string-append "http://files.itstool.org/itstool/itstool-"
316 "0fh34wi52i0qikgvlmrcpf1vx6gc1xqdad4539l4d9hikfsrz45z"))))
317 (build-system gnu-build-system)
319 `(("libxml2" ,libxml2)
320 ("python-2" ,python-2)))
321 (home-page "http://www.itstool.org")
322 (synopsis "Tool to translate XML documents with PO files")
324 "ITS Tool allows you to translate your XML documents with PO files, using
325 rules from the W3C Internationalization Tag Set (ITS) to determine what to
326 translate and how to separate it into PO file messages.
328 PO files are the standard translation format for GNU and other Unix-like
329 systems. They present translatable information as discrete messages, allowing
330 each message to be translated independently. In contrast to whole-page
331 translation, translating with a message-based format like PO means you can
332 easily track changes to the source document down to the paragraph. When new
333 strings are added or existing strings are modified, you only need to update the
334 corresponding messages.
336 ITS Tool is designed to make XML documents translatable through PO files by
337 applying standard ITS rules, as well as extension rules specific to ITS Tool.
338 ITS also provides an industry standard way for authors to override translation
339 information in their documents, such as whether a particular element should be
341 (license license:gpl3+)))
350 (string-append "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
354 "1xi1v1msz75qs0s4lkyf1psrksdppa3hwkg0mznc6gpw5flg3hdz"))))
355 (build-system gnu-build-system)
356 (propagated-inputs ; according to dbus-glib-1.pc
362 `(("glib" ,glib "bin")
363 ("pkg-config" ,pkg-config)))
364 (home-page "http://dbus.freedesktop.org/doc/dbus-glib/")
365 (synopsis "D-Bus GLib bindings")
367 "GLib bindings for D-Bus. The package is obsolete and superseded
368 by GDBus included in Glib.")
369 (license license:gpl2))) ; or Academic Free License 2.1
377 (uri (string-append "mirror://gnome/sources/libsigc++/"
378 (version-major+minor version) "/"
379 name "-" version ".tar.xz"))
382 "1v0rvkzglzmf67y9nkcppwjwi68j1cy5yhldvcq7xrv8594l612l"))))
383 (build-system gnu-build-system)
384 (native-inputs `(("pkg-config" ,pkg-config)
386 (home-page "http://libsigc.sourceforge.net/")
387 (synopsis "Type-safe callback system for standard C++")
389 "Libsigc++ implements a type-safe callback system for standard C++. It
390 allows you to define signals and to connect those signals to any callback
391 function, either global or a member function, regardless of whether it is
394 It also contains adaptor classes for connection of dissimilar callbacks and
395 has an ease of use unmatched by other C++ callback libraries.")
396 (license license:lgpl2.1+)))
404 (uri (string-append "mirror://gnome/sources/glibmm/"
405 (version-major+minor version)
406 "/glibmm-" version ".tar.xz"))
409 "1a1fczy7hcpn24fglyn4i79f4yjc8s50is70q03mb294bm1c02hv"))))
410 (build-system gnu-build-system)
412 `(#:phases (alist-cons-before
415 ;; This test uses /etc/fstab as an example file to read
416 ;; from; choose a better example.
417 (substitute* "tests/giomm_simple/main.cc"
419 (string-append (getcwd)
420 "/tests/giomm_simple/main.cc")))
422 ;; This test does a DNS lookup, and then expects to be able
423 ;; to open a TLS session; just skip it.
424 (substitute* "tests/giomm_tls_client/main.cc"
428 (native-inputs `(("pkg-config" ,pkg-config)
429 ("glib" ,glib "bin")))
431 `(("libsigc++" ,libsigc++)
433 (home-page "http://gtkmm.org/")
434 (synopsis "C++ interface to the GLib library")
436 "Glibmm provides a C++ programming interface to the part of GLib that are
438 (license license:lgpl2.1+)))
440 (define-public python2-pygobject-2
442 (name "python2-pygobject")
443 ;; This was the last version to declare the 2.0 platform number, i.e. its
444 ;; pkg-config files were named pygobject-2.0.pc
449 (uri (string-append "mirror://gnome/sources/pygobject/"
450 (version-major+minor version)
451 "/pygobject-" version ".tar.xz"))
454 "1f5dfxjnil2glfwxnqr14d2cjfbkghsbsn8n04js2c2icr7iv2pv"))
457 "python2-pygobject-2-gi-info-type-error-domain.patch")))))
458 (build-system gnu-build-system)
461 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
462 ("pkg-config" ,pkg-config)
463 ("dbus" ,dbus))) ;for tests
465 `(("python" ,python-2)
467 ("python2-pycairo" ,python2-pycairo)
468 ("gobject-introspection" ,gobject-introspection)))
470 `(("libffi" ,libffi))) ;mentioned in pygobject-2.0.pc
472 `(#:tests? #f ;segfaults during tests
473 #:configure-flags '("LIBS=-lcairo-gobject")))
474 (home-page "https://pypi.python.org/pypi/PyGObject")
475 (synopsis "Python bindings for GObject")
477 "Python bindings for GLib, GObject, and GIO.")
478 (license license:lgpl2.1+)))
480 (define-public python-pygobject
482 (name "python-pygobject")
487 (uri (string-append "mirror://gnome/sources/pygobject/"
488 (version-major+minor version)
489 "/pygobject-" version ".tar.xz"))
492 "1hqyma73w0lnjcgx68kawhnq84aq92xlkdqphrlc2ppia38dm5kx"))))
493 (build-system gnu-build-system)
496 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
497 ("pkg-config" ,pkg-config)))
501 ("python-pycairo" ,python-pycairo)
502 ("gobject-introspection" ,gobject-introspection)
505 ;; TODO: failing tests: test_native_calls_async
506 ;; test_native_calls_async_errors test_native_calls_sync
507 ;; test_native_calls_sync_errors test_python_calls_async
508 ;; test_python_calls_async_error test_python_calls_async_error_result
509 ;; test_python_calls_sync test_python_calls_sync_errors
510 ;; test_python_calls_sync_noargs test_callback_user_data_middle_none
511 ;; test_callback_user_data_middle_single
512 ;; test_callback_user_data_middle_tuple
514 (home-page "https://live.gnome.org/PyGObject")
515 (synopsis "Python bindings for GObject")
517 "Python bindings for GLib, GObject, and GIO.")
518 (license license:lgpl2.1+)))
520 (define-public python2-pygobject
521 (package (inherit python-pygobject)
522 (name "python2-pygobject")
524 `(("python" ,python-2)
526 ("python-pycairo" ,python2-pycairo)
527 ("gobject-introspection" ,gobject-introspection)
528 ("libffi" ,libffi)))))
530 (define telepathy-glib
532 (name "telepathy-glib")
539 "http://telepathy.freedesktop.org/releases/telepathy-glib/"
540 "telepathy-glib-" version ".tar.gz"))
543 "1symyzbjmxvksn2ifdkk50lafjm2llf2sbmky062gq2pz3cg23cy"))))
544 (build-system gnu-build-system)
546 `(("glib" ,glib "bin") ; uses glib-mkenums
547 ("pkg-config" ,pkg-config)
548 ("python" ,python-2)))
551 ("dbus-glib" ,dbus-glib)
553 ("gobject-introspection" ,gobject-introspection)
554 ("libxslt" ,libxslt)))
555 (home-page "http://telepathy.freedesktop.org/wiki/")
556 (synopsis "GLib Real-time communications framework over D-Bus")
557 (description "Telepathy is a flexible, modular communications framework
558 that enables real-time communication over D-Bus via pluggable protocol
559 backends. Telepathy is a communications service that can be accessed by
560 many applications simultaneously.
562 This package provides the library for GLib applications.")
563 (license license:lgpl2.1+)))