1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 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, 2016, 2017 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages glib)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix utils)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system python)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages backup)
34 #:use-module (gnu packages bison)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages enlightenment)
37 #:use-module (gnu packages flex)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages gnome)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages libffi)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages nettle)
44 #:use-module (gnu packages pcre)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages xml)
49 #:use-module (gnu packages bash)
50 #:use-module (gnu packages file)
51 #:use-module (gnu packages xml)
52 #:use-module (gnu packages xorg)
53 #:use-module (gnu packages m4)
55 ;; Export variables up-front to allow circular dependency with the 'xorg'
74 "https://dbus.freedesktop.org/releases/dbus/dbus-"
78 "0jjirhw6xwz2ffmbg5kr79108l8i1bdaw7szc67n3qpkygaxsjb0"))
79 (patches (search-patches "dbus-helper-search-path.patch"))))
80 (build-system gnu-build-system)
84 ;; Install the system bus socket under /var.
85 "--localstatedir=/var"
87 ;; Install the session bus socket under /tmp.
88 "--with-session-socket-dir=/tmp"
90 ;; Use /etc/dbus-1 for system-wide config.
91 ;; Look for configuration file under
92 ;; /etc/dbus-1. This is notably required by
93 ;; 'dbus-daemon-launch-helper', which looks for
94 ;; the 'system.conf' file in that place,
95 ;; regardless of what '--config-file' was
96 ;; passed to 'dbus-daemon' on the command line;
97 ;; see <https://bugs.freedesktop.org/show_bug.cgi?id=92458>.
100 (modify-phases %standard-phases
103 ;; Don't try to create /var and /etc.
105 "localstatedir=/tmp/dummy"
106 "sysconfdir=/tmp/dummy"
109 `(("pkg-config" ,pkg-config)))
113 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
117 (home-page "http://dbus.freedesktop.org/")
118 (synopsis "Message bus for inter-process communication (IPC)")
120 "D-Bus is a message bus system, a simple way for applications to
121 talk to one another. In addition to interprocess communication, D-Bus
122 helps coordinate process lifecycle; it makes it simple and reliable to
123 code a \"single instance\" application or daemon, and to launch
124 applications and daemons on demand when their services are needed.
126 D-Bus supplies both a system daemon (for events such as \"new hardware
127 device added\" or \"printer queue changed\") and a
128 per-user-login-session daemon (for general IPC needs among user
129 applications). Also, the message bus is built on top of a general
130 one-to-one message passing framework, which can be used by any two apps
131 to communicate directly (without going through the message bus
132 daemon). Currently the communicating applications are on one computer,
133 or through unencrypted TCP/IP suitable for use behind a firewall with
134 shared NFS home directories.")
135 (license license:gpl2+))) ; or Academic Free License 2.1
143 (uri (string-append "mirror://gnome/sources/"
144 name "/" (string-take version 4) "/"
145 name "-" version ".tar.xz"))
148 "1l65kab6jr9zlllgbjcbvrbgah3sdd577fpw4pdb2j195ag5s3ph"))
149 (patches (search-patches "glib-tests-timer.patch"))))
150 (build-system gnu-build-system)
151 (outputs '("out" ; everything
152 "bin" ; glib-mkenums, gtester, etc.; depends on Python
153 "doc")) ; 20 MiB of GTK-Doc reference
155 `(("pcre" ,pcre))) ; in the Requires.private field of glib-2.0.pc
157 `(("coreutils" ,coreutils)
158 ("util-linux" ,util-linux) ; for libmount
162 `(("gettext" ,gettext-minimal)
163 ("dbus" ,dbus) ; for GDBus tests
164 ("pkg-config" ,pkg-config)
165 ("python" ,python-wrapper)
166 ("perl" ,perl) ; needed by GIO tests
168 ("tzdata" ,tzdata-2017a))) ; for tests/gdatetime.c
170 `(#:disallowed-references (,tzdata-2017a)
172 (modify-phases %standard-phases
173 (add-before 'build 'pre-build
174 (lambda* (#:key inputs outputs #:allow-other-keys)
175 ;; For tests/gdatetime.c.
177 (string-append (assoc-ref inputs "tzdata")
180 ;; Some tests want write access there.
181 (setenv "HOME" (getcwd))
182 (setenv "XDG_CACHE_HOME" (getcwd))
184 (substitute* '("glib/gspawn.c"
186 "tests/spawn-test.c")
188 (string-append (assoc-ref inputs "bash") "/bin/sh")))))
189 (add-before 'check 'disable-failing-tests
192 (lambda (test-file test-paths)
193 (define pattern+procs
194 (map (lambda (test-path)
196 ;; XXX: only works for single line statements.
197 (format #f "g_test_add_func.*\"~a\".*" test-path)
200 (substitute test-file pattern+procs)))
202 '(("glib/tests/thread.c"
203 (;; prlimit(2) returns ENOSYS on Linux 2.6.32-5-xen-amd64
204 ;; as found on hydra.gnu.org, and strace(1) doesn't
208 ("glib/tests/timer.c"
209 (;; fails if compiler optimizations are enabled, which they
213 ("gio/tests/gapplication.c"
214 (;; XXX: proven to be unreliable. See:
215 ;; <https://bugs.debian.org/756273>
216 ;; <http://bugs.gnu.org/18445>
219 ;; XXX: fails randomly for unknown reason. See:
220 ;; <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00215.html>
221 "/gapplication/local-actions"))
223 ("gio/tests/contenttype.c"
224 (;; XXX: requires shared-mime-info.
226 "/contenttype/subtype"
229 "/contenttype/symbolic-icon"
230 "/contenttype/tree"))
232 ("gio/tests/appinfo.c"
233 (;; XXX: requires update-desktop-database.
234 "/appinfo/associations"))
236 ("gio/tests/desktop-app-info.c"
237 (;; XXX: requires update-desktop-database.
238 "/desktop-app-info/delete"
239 "/desktop-app-info/default"
240 "/desktop-app-info/fallback"
241 "/desktop-app-info/lastused"
242 "/desktop-app-info/search"))
244 ("gio/tests/gdbus-peer.c"
245 (;; Requires /etc/machine-id.
246 "/gdbus/codegen-peer-to-peer"))
248 ("gio/tests/gdbus-unix-addresses.c"
249 (;; Requires /etc/machine-id.
250 "/gdbus/x11-autolaunch"))
252 ("glib/tests/gdatetime.c"
253 (;; Assumes that the Brasilian time zone is named 'BRT',
254 ;; which is no longer true as of tzdata-2017a.
255 "/GDateTime/new_full")))))
256 (and-map (lambda (x) (apply disable x)) failing-tests)))))
258 ;; Note: `--docdir' and `--htmldir' are not honored, so work around it.
259 #:configure-flags (list (string-append "--with-html-dir="
260 (assoc-ref %outputs "doc")
261 "/share/gtk-doc/html"))
263 ;; In 'gio/tests', 'gdbus-test-codegen-generated.h' is #included in a
264 ;; file that gets compiled possibly before it has been fully generated.
265 #:parallel-tests? #f))
268 ;; This variable is not really "owned" by GLib, but several related
269 ;; packages refer to it: gobject-introspection's tools use it as a search
270 ;; path for .gir files, and it's also a search path for schemas produced
271 ;; by 'glib-compile-schemas'.
272 (list (search-path-specification
273 (variable "XDG_DATA_DIRS")
275 ;; To load extra gio modules from glib-networking, etc.
276 (search-path-specification
277 (variable "GIO_EXTRA_MODULES")
278 (files '("lib/gio/modules")))))
279 (search-paths native-search-paths)
281 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
283 "GLib provides data structure handling for C, portability wrappers,
284 and interfaces for such runtime functionality as an event loop, threads,
285 dynamic loading, and an object system.")
286 (home-page "https://developer.gnome.org/glib/")
287 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
289 (define gobject-introspection
291 (name "gobject-introspection")
295 (uri (string-append "mirror://gnome/sources/"
296 "gobject-introspection/" (version-major+minor version)
297 "/gobject-introspection-" version ".tar.xz"))
299 (base32 "1x5gkyrglv3dn9b4fsgw6asqgjw1wj7qc37g9pyac6pyaa6w7l1f"))
300 (modules '((guix build utils)))
302 '(substitute* "tools/g-ir-tool-template.in"
303 (("#!/usr/bin/env @PYTHON@") "#!@PYTHON@")))
304 (patches (search-patches
305 "gobject-introspection-cc.patch"
306 "gobject-introspection-girepository.patch"
307 "gobject-introspection-absolute-shlib-path.patch"))))
308 (build-system gnu-build-system)
313 ("python-2" ,python-2)))
315 `(("glib" ,glib "bin")
316 ("pkg-config" ,pkg-config)))
318 `(;; In practice, GIR users will need libffi when using
319 ;; gobject-introspection.
322 (list (search-path-specification
323 (variable "GI_TYPELIB_PATH")
324 (files '("lib/girepository-1.0")))))
325 (search-paths native-search-paths)
327 `(;; The patch 'gobject-introspection-absolute-shlib-path.patch' causes
328 ;; some tests to fail.
330 (home-page "https://wiki.gnome.org/GObjectIntrospection")
331 (synopsis "Generate interface introspection data for GObject libraries")
333 "GObject introspection is a middleware layer between C libraries (using
334 GObject) and language bindings. The C library can be scanned at compile time
335 and generate a metadata file, in addition to the actual native C library. Then
336 at runtime, language bindings can read this metadata and automatically provide
337 bindings to call into the C library.")
338 ; Some bits are distributed under the LGPL2+, others under the GPL2+
339 (license license:gpl2+)))
347 (uri (string-append "https://launchpad.net/intltool/trunk/"
348 version "/+download/intltool-"
350 (patches (search-patches "intltool-perl-compatibility.patch"))
353 "1karx4sb7bnm2j67q0q74hspkfn6lqprpy5r99vkn5bb36a4viv7"))))
354 (build-system gnu-build-system)
358 `(;; Propagate gettext because users expect it to be there, and so does
359 ;; the `intltool-update' script.
360 ("gettext" ,gettext-minimal)
362 ("perl-xml-parser" ,perl-xml-parser)
365 `(#:phases (alist-cons-after
366 'unpack 'patch-file-references
367 (lambda* (#:key inputs #:allow-other-keys)
368 (let ((file (assoc-ref inputs "file")))
369 (substitute* "intltool-update.in"
370 (("`file") (string-append "`" file "/bin/file")))))
372 (home-page "https://launchpad.net/intltool/+download")
373 (synopsis "Tools to centralise translations of different file formats")
375 "Intltool is a set of tools to centralise translations of many different
376 file formats using GNU gettext-compatible PO files.
378 The intltool collection can be used to do these things:
380 Extract translatable strings from various source files (.xml.in,
381 glade, .desktop.in, .server.in, .oaf.in).
383 Collect the extracted strings together with messages from traditional
384 source files (.c, .h) in po/$(PACKAGE).pot.
386 Merge back the translations from .po files into .xml, .desktop and
387 oaf files. This merge step will happen at build resp. installation time.")
388 (license license:gpl2+)))
396 (uri (string-append "http://files.itstool.org/itstool/itstool-"
400 "0fh34wi52i0qikgvlmrcpf1vx6gc1xqdad4539l4d9hikfsrz45z"))))
401 (build-system gnu-build-system)
403 `(("libxml2" ,libxml2)
404 ("python2-libxml2" ,python2-libxml2)
405 ("python-2" ,python-2)))
408 (modify-phases %standard-phases
410 'install 'wrap-program
411 (lambda* (#:key outputs #:allow-other-keys)
412 (let ((prog (string-append (assoc-ref outputs "out")
415 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))))))))
416 (home-page "http://www.itstool.org")
417 (synopsis "Tool to translate XML documents with PO files")
419 "ITS Tool allows you to translate your XML documents with PO files, using
420 rules from the W3C Internationalization Tag Set (ITS) to determine what to
421 translate and how to separate it into PO file messages.
423 PO files are the standard translation format for GNU and other Unix-like
424 systems. They present translatable information as discrete messages, allowing
425 each message to be translated independently. In contrast to whole-page
426 translation, translating with a message-based format like PO means you can
427 easily track changes to the source document down to the paragraph. When new
428 strings are added or existing strings are modified, you only need to update the
429 corresponding messages.
431 ITS Tool is designed to make XML documents translatable through PO files by
432 applying standard ITS rules, as well as extension rules specific to ITS Tool.
433 ITS also provides an industry standard way for authors to override translation
434 information in their documents, such as whether a particular element should be
436 (license license:gpl3+)))
445 (string-append "https://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
449 "0b307hw9j41npzr6niw1bs6ryp87m5yafg492gqwvsaj4dz0qd4z"))))
450 (build-system gnu-build-system)
451 (propagated-inputs ; according to dbus-glib-1.pc
457 `(("glib" ,glib "bin")
458 ("pkg-config" ,pkg-config)))
459 (home-page "http://dbus.freedesktop.org/doc/dbus-glib/")
460 (synopsis "D-Bus GLib bindings")
462 "GLib bindings for D-Bus. The package is obsolete and superseded
463 by GDBus included in Glib.")
464 (license license:gpl2))) ; or Academic Free License 2.1
472 (uri (string-append "mirror://gnome/sources/libsigc++/"
473 (version-major+minor version) "/"
474 name "-" version ".tar.xz"))
477 "10cd54l4zihss9qxfhd2iip2k7mr292k37i54r2cpgv0c8sdchzq"))))
478 (build-system gnu-build-system)
479 (native-inputs `(("pkg-config" ,pkg-config)
481 (home-page "http://libsigc.sourceforge.net/")
482 (synopsis "Type-safe callback system for standard C++")
484 "Libsigc++ implements a type-safe callback system for standard C++. It
485 allows you to define signals and to connect those signals to any callback
486 function, either global or a member function, regardless of whether it is
489 It also contains adaptor classes for connection of dissimilar callbacks and
490 has an ease of use unmatched by other C++ callback libraries.")
491 (license license:lgpl2.1+)))
499 (uri (string-append "mirror://gnome/sources/glibmm/"
500 (version-major+minor version)
501 "/glibmm-" version ".tar.xz"))
504 "1926b3adx903hzvdp8glblsgjyadzqnwgkj8hg605d4wv98m1n0z"))))
505 (build-system gnu-build-system)
507 `(#:phases (alist-cons-before
510 ;; This test uses /etc/fstab as an example file to read
511 ;; from; choose a better example.
512 (substitute* "tests/giomm_simple/main.cc"
514 (string-append (getcwd)
515 "/tests/giomm_simple/main.cc")))
517 ;; This test does a DNS lookup, and then expects to be able
518 ;; to open a TLS session; just skip it.
519 (substitute* "tests/giomm_tls_client/main.cc"
523 (native-inputs `(("pkg-config" ,pkg-config)
524 ("glib" ,glib "bin")))
526 `(("libsigc++" ,libsigc++)
528 (home-page "http://gtkmm.org/")
529 (synopsis "C++ interface to the GLib library")
531 "Glibmm provides a C++ programming interface to the part of GLib that are
533 (license license:lgpl2.1+)))
535 (define-public python2-pygobject-2
537 (name "python2-pygobject")
538 ;; This was the last version to declare the 2.0 platform number, i.e. its
539 ;; pkg-config files were named pygobject-2.0.pc
544 (uri (string-append "mirror://gnome/sources/pygobject/"
545 (version-major+minor version)
546 "/pygobject-" version ".tar.xz"))
549 "1f5dfxjnil2glfwxnqr14d2cjfbkghsbsn8n04js2c2icr7iv2pv"))
550 (patches (search-patches
551 "python2-pygobject-2-gi-info-type-error-domain.patch"))))
552 (build-system gnu-build-system)
555 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
556 ("pkg-config" ,pkg-config)
557 ("dbus" ,dbus))) ;for tests
559 `(("python" ,python-2)
561 ("python2-pycairo" ,python2-pycairo)
562 ("gobject-introspection" ,gobject-introspection)))
564 `(("libffi" ,libffi))) ;mentioned in pygobject-2.0.pc
566 `(#:tests? #f ;segfaults during tests
567 #:configure-flags '("LIBS=-lcairo-gobject")))
568 (home-page "https://pypi.python.org/pypi/PyGObject")
569 (synopsis "Python bindings for GObject")
571 "Python bindings for GLib, GObject, and GIO.")
572 (license license:lgpl2.1+)))
574 (define-public python-pygobject
576 (name "python-pygobject")
581 (uri (string-append "mirror://gnome/sources/pygobject/"
582 (version-major+minor version)
583 "/pygobject-" version ".tar.xz"))
586 "1zdzznrj2s1gsrv2z4r0n88fzba8zjc1n2r313xi77lhl1daja56"))))
587 (build-system gnu-build-system)
590 ;for tests: dbus-run-session and glib-compile-schemas
592 ("glib-bin" ,glib "bin")
593 ("pkg-config" ,pkg-config)))
596 ("python-pycairo" ,python-pycairo)
597 ("gobject-introspection" ,gobject-introspection)))
599 ;; pygobject-3.0.pc refers to all these.
602 ;; For finding typelib files, since gobject-introscpetion isn't propagated.
603 (native-search-paths (package-native-search-paths gobject-introspection))
604 (home-page "https://live.gnome.org/PyGObject")
605 (synopsis "Python bindings for GObject")
607 "Python bindings for GLib, GObject, and GIO.")
608 (license license:lgpl2.1+)
609 (properties `((python2-variant . ,(delay python2-pygobject))))))
611 (define-public python2-pygobject
612 (package (inherit (strip-python2-variant python-pygobject))
613 (name "python2-pygobject")
615 `(("python" ,python-2)
616 ("python-pycairo" ,python2-pycairo)
617 ("gobject-introspection" ,gobject-introspection)))))
619 (define telepathy-glib
621 (name "telepathy-glib")
628 "https://telepathy.freedesktop.org/releases/telepathy-glib/"
629 "telepathy-glib-" version ".tar.gz"))
632 "1symyzbjmxvksn2ifdkk50lafjm2llf2sbmky062gq2pz3cg23cy"))
635 ;; Don't use the same test name for multiple tests.
636 ;; <https://bugs.freedesktop.org/show_bug.cgi?id=92245>
639 (uri "https://bugs.freedesktop.org/attachment.cgi?id=118608")
640 (file-name (string-append "telepathy-glib-duplicate-tests.patch"))
643 "0z261fwrszxb28ccg3hsg9rizig4s84zvwmx6y31a4pyv7bvs5w3")))))))
644 (build-system gnu-build-system)
646 '(#:configure-flags '("--enable-vala-bindings")))
648 `(("glib" ,glib "bin") ; uses glib-mkenums
649 ("gobject-introspection" ,gobject-introspection)
650 ("pkg-config" ,pkg-config)
653 ("xsltproc" ,libxslt)))
655 ;; There are all in the Requires.private field of telepathy-glib.pc.
657 ("dbus-glib" ,dbus-glib)
659 (home-page "http://telepathy.freedesktop.org/wiki/")
660 (synopsis "GLib Real-time communications framework over D-Bus")
661 (description "Telepathy is a flexible, modular communications framework
662 that enables real-time communication over D-Bus via pluggable protocol
663 backends. Telepathy is a communications service that can be accessed by
664 many applications simultaneously.
666 This package provides the library for GLib applications.")
667 (license license:lgpl2.1+)))
669 (define-public dbus-c++
677 "mirror://sourceforge/dbus-cplusplus/dbus-c%2B%2B/"
678 version "/libdbus-c%2B%2B-" version ".tar.gz"))
679 (file-name (string-append name "-" version ".tar.gz"))
682 "0qafmy2i6dzx4n1dqp6pygyy6gjljnb7hwjcj2z11c1wgclsq4dw"))))
683 (build-system gnu-build-system)
685 `(("dbus" ,dbus))) ;mentioned in the pkg-config file
691 `(("pkg-config" ,pkg-config)))
693 `(;; The 'configure' machinery fails to detect that it needs -lpthread.
694 #:configure-flags (list "LDFLAGS=-lpthread")
696 (modify-phases %standard-phases
697 (add-before 'configure 'add-missing-header
699 (substitute* "include/dbus-c++/eventloop-integration.h"
700 (("#include <errno.h>")
701 "#include <errno.h>\n#include <unistd.h>")))))))
702 (synopsis "D-Bus API for C++")
703 (description "This package provides D-Bus client API bindings for the C++
704 programming langauage. It also contains the utility
705 @command{dbuscxx-xml2cpp}.")
706 (home-page "https://sourceforge.net/projects/dbus-cplusplus/")
707 (license license:lgpl2.1+)))
709 (define-public appstream-glib
711 (name "appstream-glib")
715 (uri (string-append "https://people.freedesktop.org/~hughsient/"
716 "appstream-glib/releases/"
717 "appstream-glib-" version ".tar.xz"))
720 "08mrf4k0jhnpdd4fig2grmi2vbxkgdhrwk0d0zq0j1wp5ip7arwp"))))
721 (build-system gnu-build-system)
723 `(("pkg-config" ,pkg-config)))
725 `(("gdk-pixbuf" ,gdk-pixbuf)
728 ("json-glib" ,json-glib)
729 ("libarchive" ,libarchive)
732 ("util-linux" ,util-linux)))
735 '("--disable-firmware" "--disable-dep11")
737 (modify-phases %standard-phases
738 (add-after 'unpack 'patch-tests
740 (substitute* "libappstream-glib/as-self-test.c"
741 (("g_test_add_func.*as_test_store_local_appdata_func);") "")
742 (("g_test_add_func.*as_test_store_speed_appdata_func);") "")
743 (("g_test_add_func.*as_test_store_speed_desktop_func);") ""))
745 (home-page "https://github.com/hughsie/appstream-glib")
746 (synopsis "Library for reading and writing AppStream metadata")
747 (description "This library provides objects and helper methods to help
748 reading and writing @uref{https://www.freedesktop.org/wiki/Distributions/AppStream,AppStream}
750 (license license:lgpl2.1+)))