gnu: ubridge: Update to 0.9.18.
[jackhill/guix/guix.git] / gnu / packages / glib.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019 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, 2018 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
8 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
10 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
12 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
13 ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
14 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
15 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
16 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages glib)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages backup)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages bison)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages docbook)
40 #:use-module (gnu packages documentation)
41 #:use-module (gnu packages enlightenment)
42 #:use-module (gnu packages file)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages gnome)
46 #:use-module (gnu packages gperf)
47 #:use-module (gnu packages gtk)
48 #:use-module (gnu packages libffi)
49 #:use-module (gnu packages linux)
50 #:use-module (gnu packages m4)
51 #:use-module (gnu packages nettle)
52 #:use-module (gnu packages pcre)
53 #:use-module (gnu packages package-management)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages perl-check)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages python-xyz)
59 #:use-module (gnu packages selinux)
60 #:use-module (gnu packages web)
61 #:use-module (gnu packages xml)
62 #:use-module (gnu packages xorg)
63 #:use-module (guix build-system gnu)
64 #:use-module (guix build-system meson)
65 #:use-module (guix build-system perl)
66 #:use-module (guix build-system python)
67 #:use-module (guix download)
68 #:use-module ((guix licenses) #:prefix license:)
69 #:use-module (guix packages)
70 #:use-module (guix utils)
71 #:use-module (srfi srfi-1)
72
73 ;; Export variables up-front to allow circular dependency with the 'xorg'
74 ;; module.
75 #:export (dbus
76 glib
77 gobject-introspection
78 dbus-glib
79 intltool
80 itstool
81 libsigc++
82 glibmm
83 telepathy-glib
84 perl-net-dbus
85 perl-net-dbus-glib))
86
87 (define dbus
88 (package
89 (name "dbus")
90 (version "1.12.16")
91 (source (origin
92 (method url-fetch)
93 (uri (string-append
94 "https://dbus.freedesktop.org/releases/dbus/dbus-"
95 version ".tar.gz"))
96 (sha256
97 (base32
98 "107ckxaff1cv4q6kmfdi2fb1nlsv03312a7kf6lb4biglhpjv8jl"))
99 (patches (search-patches "dbus-helper-search-path.patch"))))
100 (build-system gnu-build-system)
101 (arguments
102 '(#:configure-flags
103 (list
104 ;; Install the system bus socket under /var.
105 "--localstatedir=/var"
106
107 ;; Install the session bus socket under /tmp.
108 "--with-session-socket-dir=/tmp"
109
110 ;; Build shared libraries only.
111 "--disable-static"
112
113 ;; Use /etc/dbus-1 for system-wide config.
114 ;; Look for configuration file under
115 ;; /etc/dbus-1. This is notably required by
116 ;; 'dbus-daemon-launch-helper', which looks for
117 ;; the 'system.conf' file in that place,
118 ;; regardless of what '--config-file' was
119 ;; passed to 'dbus-daemon' on the command line;
120 ;; see <https://bugs.freedesktop.org/show_bug.cgi?id=92458>.
121 "--sysconfdir=/etc")
122 #:phases
123 (modify-phases %standard-phases
124 (replace 'install
125 (lambda _
126 ;; Don't try to create /var and /etc.
127 (invoke "make"
128 "localstatedir=/tmp/dummy"
129 "sysconfdir=/tmp/dummy"
130 "install"))))))
131 (native-inputs
132 `(("pkg-config" ,pkg-config)
133 ;; Dependencies to generate the doc.
134 ("docbook-xml" ,docbook-xml-4.4)
135 ("docbook-xsl" ,docbook-xsl)
136 ("doxygen" ,doxygen)
137 ("xmlto" ,xmlto)
138 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
139 ("libxslt" ,libxslt)
140 ("yelp-tools" ,yelp-tools)))
141 (inputs
142 `(("expat" ,expat)
143 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
144 ;; '--autolaunch'.
145 ("libx11" ,libx11)))
146 (outputs '("out" "doc")) ;22 MiB of HTML doc
147 (home-page "https://www.freedesktop.org/wiki/Software/dbus/")
148 (synopsis "Message bus for inter-process communication (IPC)")
149 (description
150 "D-Bus is a message bus system, a simple way for applications to
151 talk to one another. In addition to interprocess communication, D-Bus
152 helps coordinate process lifecycle; it makes it simple and reliable to
153 code a \"single instance\" application or daemon, and to launch
154 applications and daemons on demand when their services are needed.
155
156 D-Bus supplies both a system daemon (for events such as \"new hardware
157 device added\" or \"printer queue changed\") and a
158 per-user-login-session daemon (for general IPC needs among user
159 applications). Also, the message bus is built on top of a general
160 one-to-one message passing framework, which can be used by any two apps
161 to communicate directly (without going through the message bus
162 daemon). Currently the communicating applications are on one computer,
163 or through unencrypted TCP/IP suitable for use behind a firewall with
164 shared NFS home directories.")
165 (license license:gpl2+))) ; or Academic Free License 2.1
166
167 (define glib
168 (package
169 (name "glib")
170 (version "2.62.6")
171 (source (origin
172 (method url-fetch)
173 (uri (string-append "mirror://gnome/sources/"
174 name "/" (string-take version 4) "/"
175 name "-" version ".tar.xz"))
176 (sha256
177 (base32
178 "174bsmbmcvaw69ff9g60q5sx0fn23rkhqcwqz17h5s7sprps4kqh"))
179 (patches (search-patches "glib-tests-timer.patch"))
180 (modules '((guix build utils)))
181 (snippet
182 '(begin
183 (substitute* "tests/spawn-test.c"
184 (("/bin/sh") "sh"))
185 #t))))
186 (build-system meson-build-system)
187 (outputs '("out" ; everything
188 "bin")) ; glib-mkenums, gtester, etc.; depends on Python
189 (propagated-inputs
190 `(("pcre" ,pcre) ; in the Requires.private field of glib-2.0.pc
191 ("libffi" ,libffi) ; in the Requires.private field of gobject-2.0.pc
192 ;; These are in the Requires.private field of gio-2.0.pc
193 ("util-linux" ,util-linux "lib") ;for libmount
194 ("libselinux" ,libselinux)
195 ("zlib" ,zlib)))
196 (native-inputs
197 `(("gettext" ,gettext-minimal)
198 ("m4" ,m4) ; for installing m4 macros
199 ("dbus" ,dbus) ; for GDBus tests
200 ("pkg-config" ,pkg-config)
201 ("python" ,python-wrapper)
202 ("perl" ,perl) ; needed by GIO tests
203 ("tzdata" ,tzdata-for-tests))) ; for tests/gdatetime.c
204 (arguments
205 `(#:disallowed-references (,tzdata-for-tests)
206 #:phases
207 (modify-phases %standard-phases
208 (add-after 'unpack 'patch-dbus-launch-path
209 (lambda* (#:key inputs #:allow-other-keys)
210 (let ((dbus (assoc-ref inputs "dbus")))
211 (substitute* "gio/gdbusaddress.c"
212 (("command_line = g_strdup_printf \\(\"dbus-launch")
213 (string-append "command_line = g_strdup_printf (\""
214 dbus "/bin/dbus-launch")))
215 #t)))
216 (add-after 'unpack 'patch-gio-launch-desktop
217 (lambda* (#:key outputs #:allow-other-keys)
218 (let ((out (assoc-ref outputs "out")))
219 ;; See also <https://gitlab.gnome.org/GNOME/glib/issues/1633>
220 ;; for another future fix.
221 (substitute* "gio/gdesktopappinfo.c"
222 (("gio-launch-desktop")
223 (string-append out "/libexec/gio-launch-desktop")))
224 #t)))
225 (add-before 'build 'pre-build
226 (lambda* (#:key inputs outputs #:allow-other-keys)
227 ;; For tests/gdatetime.c.
228 (setenv "TZDIR"
229 (string-append (assoc-ref inputs "tzdata")
230 "/share/zoneinfo"))
231
232 ;; Some tests want write access there.
233 (setenv "HOME" (getcwd))
234 (setenv "XDG_CACHE_HOME" (getcwd))
235 #t))
236 (add-after 'unpack 'disable-failing-tests
237 (lambda _
238 (let ((disable
239 (lambda (test-file test-paths)
240 (define pattern+procs
241 (map (lambda (test-path)
242 (cons
243 ;; XXX: only works for single line statements.
244 (format #f "g_test_add_func.*\"~a\".*" test-path)
245 (const "")))
246 test-paths))
247 (substitute test-file pattern+procs)))
248 (failing-tests
249 '(("glib/tests/thread.c"
250 (;; prlimit(2) returns ENOSYS on Linux 2.6.32-5-xen-amd64
251 ;; as found on hydra.gnu.org, and strace(1) doesn't
252 ;; recognize it.
253 "/thread/thread4"))
254
255 ;; This tries to find programs in FHS directories.
256 ("glib/tests/utils.c"
257 ("/utils/find-program"))
258
259 ;; This fails because "glib/tests/echo-script" cannot be
260 ;; found.
261 ("glib/tests/spawn-singlethread.c"
262 ("/gthread/spawn-script"))
263
264 ("glib/tests/timer.c"
265 (;; fails if compiler optimizations are enabled, which they
266 ;; are by default.
267 "/timer/stop"))
268
269 ("gio/tests/gapplication.c"
270 (;; XXX: proven to be unreliable. See:
271 ;; <https://bugs.debian.org/756273>
272 ;; <http://bugs.gnu.org/18445>
273 "/gapplication/quit"
274
275 ;; XXX: fails randomly for unknown reason. See:
276 ;; <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00215.html>
277 "/gapplication/local-actions"))
278
279 ("gio/tests/contenttype.c"
280 (;; XXX: requires shared-mime-info.
281 "/contenttype/guess"
282 "/contenttype/guess_svg_from_data"
283 "/contenttype/subtype"
284 "/contenttype/list"
285 "/contenttype/icon"
286 "/contenttype/symbolic-icon"
287 "/contenttype/tree"))
288
289 ("gio/tests/appinfo.c"
290 (;; XXX: requires update-desktop-database.
291 "/appinfo/associations"))
292
293 ("gio/tests/desktop-app-info.c"
294 (;; XXX: requires update-desktop-database.
295 "/desktop-app-info/delete"
296 "/desktop-app-info/default"
297 "/desktop-app-info/fallback"
298 "/desktop-app-info/lastused"
299 "/desktop-app-info/search"))
300
301 ("gio/tests/gdbus-peer.c"
302 (;; Requires /etc/machine-id.
303 "/gdbus/codegen-peer-to-peer"))
304
305 ("gio/tests/gdbus-address-get-session.c"
306 (;; Requires /etc/machine-id.
307 "/gdbus/x11-autolaunch"))
308
309 ("gio/tests/gsocketclient-slow.c"
310 (;; These tests tries to resolve "localhost", and fails.
311 "/socket-client/happy-eyeballs/slow"
312 "/socket-client/happy-eyeballs/cancellation/delayed"))
313
314 )))
315 (for-each (lambda (x) (apply disable x)) failing-tests)
316 #t)))
317 (replace 'check
318 (lambda _
319 (setenv "MESON_TESTTHREADS"
320 (number->string (parallel-job-count)))
321 ;; Do not run tests marked as "flaky".
322 (invoke "meson" "test" "--no-suite" "flaky")))
323 ;; TODO: meson does not permit the bindir to be outside of prefix.
324 ;; See https://github.com/mesonbuild/meson/issues/2561
325 ;; We can remove this once meson is patched.
326 (add-after 'install 'move-executables
327 (lambda* (#:key outputs #:allow-other-keys)
328 (let ((out (assoc-ref outputs "out"))
329 (bin (assoc-ref outputs "bin")))
330 (mkdir-p bin)
331 (rename-file (string-append out "/bin")
332 (string-append bin "/bin"))
333 ;; This one is an implementation detail of glib.
334 ;; It is wrong that that's in "/bin" in the first place,
335 ;; but that's what upstream is doing right now.
336 ;; See <https://gitlab.gnome.org/GNOME/glib/issues/1633>.
337 (mkdir (string-append out "/libexec"))
338 (rename-file (string-append bin "/bin/gio-launch-desktop")
339 (string-append out "/libexec/gio-launch-desktop"))
340 ;; Do not refer to "bindir", which points to "${prefix}/bin".
341 ;; We don't patch "bindir" to point to "$bin/bin", because that
342 ;; would create a reference cycle between the "out" and "bin"
343 ;; outputs.
344 (substitute* (list (string-append out "/lib/pkgconfig/gio-2.0.pc")
345 (string-append out "/lib/pkgconfig/glib-2.0.pc"))
346 (("bindir=\\$\\{prefix\\}/bin") "")
347 (("=\\$\\{bindir\\}/") "="))
348 #t))))))
349 ;; TODO: see above for explanation.
350 ;; #:configure-flags (list (string-append "--bindir="
351 ;; (assoc-ref %outputs "bin")
352 ;; "/bin"))
353
354 (native-search-paths
355 ;; This variable is not really "owned" by GLib, but several related
356 ;; packages refer to it: gobject-introspection's tools use it as a search
357 ;; path for .gir files, and it's also a search path for schemas produced
358 ;; by 'glib-compile-schemas'.
359 (list (search-path-specification
360 (variable "XDG_DATA_DIRS")
361 (files '("share")))
362 ;; To load extra gio modules from glib-networking, etc.
363 (search-path-specification
364 (variable "GIO_EXTRA_MODULES")
365 (files '("lib/gio/modules")))))
366 (search-paths native-search-paths)
367 (properties '((hidden? . #t)))
368
369 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
370 (description
371 "GLib provides data structure handling for C, portability wrappers,
372 and interfaces for such runtime functionality as an event loop, threads,
373 dynamic loading, and an object system.")
374 (home-page "https://developer.gnome.org/glib/")
375 (license license:lgpl2.1+)))
376
377 (define-public glib-with-documentation
378 ;; glib's doc must be built in a separate package since it requires gtk-doc,
379 ;; which in turn depends on glib.
380 (package
381 (inherit glib)
382 (properties (alist-delete 'hidden? (package-properties glib)))
383 (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference
384 (native-inputs
385 `(("gtk-doc" ,gtk-doc) ; for the doc
386 ("docbook-xml" ,docbook-xml)
387 ("libxml2" ,libxml2)
388 ,@(package-native-inputs glib)))
389 (arguments
390 (substitute-keyword-arguments (package-arguments glib)
391 ((#:configure-flags flags ''())
392 `(cons "-Dgtk_doc=true" ,flags))
393 ((#:phases phases)
394 `(modify-phases ,phases
395 (add-after 'install 'move-doc
396 (lambda* (#:key outputs #:allow-other-keys)
397 (let ((out (assoc-ref outputs "out"))
398 (doc (assoc-ref outputs "doc"))
399 (html (string-append "/share/gtk-doc")))
400 (copy-recursively (string-append out html)
401 (string-append doc html))
402 (delete-file-recursively (string-append out html))
403 #t)))))))))
404
405 (define gobject-introspection
406 (package
407 (name "gobject-introspection")
408 (version "1.62.0")
409 (source (origin
410 (method url-fetch)
411 (uri (string-append "mirror://gnome/sources/"
412 "gobject-introspection/" (version-major+minor version)
413 "/gobject-introspection-" version ".tar.xz"))
414 (sha256
415 (base32 "18lhglg9v6y83lhqzyifc1z0wrlawzrhzzxx0a3h1g7xaz97xvmi"))
416 (patches (search-patches
417 "gobject-introspection-cc.patch"
418 "gobject-introspection-girepository.patch"
419 "gobject-introspection-absolute-shlib-path.patch"))))
420 (build-system meson-build-system)
421 (arguments
422 `(#:phases
423 (modify-phases %standard-phases
424 (add-after 'unpack 'do-not-use-/usr/bin/env
425 (lambda _
426 (substitute* "tools/g-ir-tool-template.in"
427 (("#!@PYTHON_CMD@")
428 (string-append "#!" (which "python3"))))
429 #t)))))
430 (inputs
431 `(("bison" ,bison)
432 ("flex" ,flex)
433 ("glib" ,glib)
434 ("python" ,python-wrapper)
435 ("zlib" ,zlib)))
436 (native-inputs
437 `(("glib" ,glib "bin")
438 ("pkg-config" ,pkg-config)))
439 (propagated-inputs
440 `(;; In practice, GIR users will need libffi when using
441 ;; gobject-introspection.
442 ("libffi" ,libffi)))
443 (native-search-paths
444 (list (search-path-specification
445 (variable "GI_TYPELIB_PATH")
446 (files '("lib/girepository-1.0")))))
447 (search-paths native-search-paths)
448 (home-page "https://wiki.gnome.org/GObjectIntrospection")
449 (synopsis "Generate interface introspection data for GObject libraries")
450 (description
451 "GObject introspection is a middleware layer between C libraries (using
452 GObject) and language bindings. The C library can be scanned at compile time
453 and generate a metadata file, in addition to the actual native C library. Then
454 at runtime, language bindings can read this metadata and automatically provide
455 bindings to call into the C library.")
456 ; Some bits are distributed under the LGPL2+, others under the GPL2+
457 (license license:gpl2+)))
458
459 (define intltool
460 (package
461 (name "intltool")
462 (version "0.51.0")
463 (source (origin
464 (method url-fetch)
465 (uri (string-append "https://launchpad.net/intltool/trunk/"
466 version "/+download/intltool-"
467 version ".tar.gz"))
468 (patches (search-patches "intltool-perl-compatibility.patch"))
469 (sha256
470 (base32
471 "1karx4sb7bnm2j67q0q74hspkfn6lqprpy5r99vkn5bb36a4viv7"))))
472 (build-system gnu-build-system)
473 (inputs
474 `(("file" ,file)))
475 (propagated-inputs
476 `(;; Propagate gettext because users expect it to be there, and so does
477 ;; the `intltool-update' script.
478 ("gettext" ,gettext-minimal)
479
480 ("perl-xml-parser" ,perl-xml-parser)
481 ("perl" ,perl)))
482 (arguments
483 `(#:phases
484 (modify-phases %standard-phases
485 (add-after 'unpack 'patch-file-references
486 (lambda* (#:key inputs #:allow-other-keys)
487 (let ((file (assoc-ref inputs "file")))
488 (substitute* "intltool-update.in"
489 (("`file") (string-append "`" file "/bin/file")))
490 #t))))))
491 (home-page "https://launchpad.net/intltool/+download")
492 (synopsis "Tools to centralise translations of different file formats")
493 (description
494 "Intltool is a set of tools to centralise translations of many different
495 file formats using GNU gettext-compatible PO files.
496
497 The intltool collection can be used to do these things:
498
499 Extract translatable strings from various source files (.xml.in,
500 glade, .desktop.in, .server.in, .oaf.in).
501
502 Collect the extracted strings together with messages from traditional
503 source files (.c, .h) in po/$(PACKAGE).pot.
504
505 Merge back the translations from .po files into .xml, .desktop and
506 oaf files. This merge step will happen at build resp. installation time.")
507 (license license:gpl2+)))
508
509 (define itstool
510 (package
511 (name "itstool")
512 (version "2.0.6")
513 (source (origin
514 (method url-fetch)
515 (uri (string-append "http://files.itstool.org/itstool/itstool-"
516 version ".tar.bz2"))
517 (sha256
518 (base32
519 "1acjgf8zlyk7qckdk19iqaca4jcmywd7vxjbcs1mm6kaf8icqcv2"))))
520 (build-system gnu-build-system)
521 (inputs
522 `(("libxml2" ,libxml2)
523 ("python-libxml2" ,python-libxml2)
524 ("python" ,python)))
525 (arguments
526 '(#:phases
527 (modify-phases %standard-phases
528 (add-after 'install 'wrap-program
529 (lambda* (#:key outputs #:allow-other-keys)
530 (let ((prog (string-append (assoc-ref outputs "out")
531 "/bin/itstool")))
532 (wrap-program prog
533 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
534 #t))))))
535 (home-page "http://www.itstool.org")
536 (synopsis "Tool to translate XML documents with PO files")
537 (description
538 "ITS Tool allows you to translate your XML documents with PO files, using
539 rules from the W3C Internationalization Tag Set (ITS) to determine what to
540 translate and how to separate it into PO file messages.
541
542 PO files are the standard translation format for GNU and other Unix-like
543 systems. They present translatable information as discrete messages, allowing
544 each message to be translated independently. In contrast to whole-page
545 translation, translating with a message-based format like PO means you can
546 easily track changes to the source document down to the paragraph. When new
547 strings are added or existing strings are modified, you only need to update the
548 corresponding messages.
549
550 ITS Tool is designed to make XML documents translatable through PO files by
551 applying standard ITS rules, as well as extension rules specific to ITS Tool.
552 ITS also provides an industry standard way for authors to override translation
553 information in their documents, such as whether a particular element should be
554 translated.")
555 (license license:gpl3+)))
556
557 (define dbus-glib
558 (package
559 (name "dbus-glib")
560 (version "0.110")
561 (source (origin
562 (method url-fetch)
563 (uri
564 (string-append "https://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
565 version ".tar.gz"))
566 (sha256
567 (base32
568 "09g8swvc95bk1z6j8sw463p2v0dqmgm2zjfndf7i8sbcyq67dr3w"))))
569 (build-system gnu-build-system)
570 (propagated-inputs ; according to dbus-glib-1.pc
571 `(("dbus" ,dbus)
572 ("glib" ,glib)))
573 (inputs
574 `(("expat" ,expat)))
575 (native-inputs
576 `(("glib" ,glib "bin")
577 ("pkg-config" ,pkg-config)))
578 (home-page "https://dbus.freedesktop.org/doc/dbus-glib/")
579 (synopsis "D-Bus GLib bindings")
580 (description
581 "GLib bindings for D-Bus. The package is obsolete and superseded
582 by GDBus included in Glib.")
583 (license license:gpl2))) ; or Academic Free License 2.1
584
585 (define libsigc++
586 (package
587 (name "libsigc++")
588 (version "2.10.3")
589 (source (origin
590 (method url-fetch)
591 (uri (string-append "mirror://gnome/sources/libsigc++/"
592 (version-major+minor version) "/"
593 name "-" version ".tar.xz"))
594 (sha256
595 (base32
596 "11j7j1jv4z58d9s7jvl42fnqa1dzl4idgil9r45cjv1w673dys0b"))))
597 (build-system gnu-build-system)
598 (native-inputs `(("pkg-config" ,pkg-config)
599 ("m4" ,m4)))
600 (home-page "https://libsigcplusplus.github.io/libsigcplusplus/")
601 (synopsis "Type-safe callback system for standard C++")
602 (description
603 "Libsigc++ implements a type-safe callback system for standard C++. It
604 allows you to define signals and to connect those signals to any callback
605 function, either global or a member function, regardless of whether it is
606 static or virtual.
607
608 It also contains adaptor classes for connection of dissimilar callbacks and
609 has an ease of use unmatched by other C++ callback libraries.")
610 (license license:lgpl2.1+)))
611
612 (define glibmm
613 (package
614 (name "glibmm")
615 (version "2.62.0")
616 (source (origin
617 (method url-fetch)
618 (uri (string-append "mirror://gnome/sources/glibmm/"
619 (version-major+minor version)
620 "/glibmm-" version ".tar.xz"))
621 (sha256
622 (base32
623 "1ziwx6r7k7wbvg4qq1rgrv8zninapgrmhn1hs6926a3krh9ryr9n"))))
624 (build-system gnu-build-system)
625 (arguments
626 `(#:phases
627 (modify-phases %standard-phases
628 (add-before 'build 'pre-build
629 (lambda _
630 ;; This test uses /etc/fstab as an example file to read
631 ;; from; choose a better example.
632 (substitute* "tests/giomm_simple/main.cc"
633 (("/etc/fstab")
634 (string-append (getcwd)
635 "/tests/giomm_simple/main.cc")))
636
637 ;; This test does a DNS lookup, and then expects to be able
638 ;; to open a TLS session; just skip it.
639 (substitute* "tests/giomm_tls_client/main.cc"
640 (("Gio::init.*$")
641 "return 77;\n"))
642 #t)))))
643 (native-inputs `(("pkg-config" ,pkg-config)
644 ("glib" ,glib "bin")))
645 (propagated-inputs
646 `(("libsigc++" ,libsigc++)
647 ("glib" ,glib)))
648 (home-page "https://gtkmm.org/")
649 (synopsis "C++ interface to the GLib library")
650 (description
651 "Glibmm provides a C++ programming interface to the part of GLib that are
652 useful for C++.")
653 (license license:lgpl2.1+)))
654
655 (define-public python2-pygobject-2
656 (package
657 (name "python2-pygobject")
658 ;; This was the last version to declare the 2.0 platform number, i.e. its
659 ;; pkg-config files were named pygobject-2.0.pc
660 (version "2.28.7")
661 (source
662 (origin
663 (method url-fetch)
664 (uri (string-append "mirror://gnome/sources/pygobject/"
665 (version-major+minor version)
666 "/pygobject-" version ".tar.xz"))
667 (sha256
668 (base32
669 "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv"))
670 (patches (search-patches
671 "python2-pygobject-2-gi-info-type-error-domain.patch"))))
672 (build-system gnu-build-system)
673 (native-inputs
674 `(("which" ,which)
675 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
676 ("pkg-config" ,pkg-config)
677 ("dbus" ,dbus))) ;for tests
678 (inputs
679 `(("python" ,python-2)
680 ("glib" ,glib)
681 ("python2-pycairo" ,python2-pycairo)
682 ("gobject-introspection" ,gobject-introspection)))
683 (propagated-inputs
684 `(("libffi" ,libffi))) ;mentioned in pygobject-2.0.pc
685 (arguments
686 `(#:tests? #f ;segfaults during tests
687 #:configure-flags '("LIBS=-lcairo-gobject")))
688 (home-page "https://pypi.org/project/PyGObject/")
689 (synopsis "Python bindings for GObject")
690 (description
691 "Python bindings for GLib, GObject, and GIO.")
692 (license license:lgpl2.1+)))
693
694 (define-public python-pygobject
695 (package
696 (name "python-pygobject")
697 (version "3.34.0")
698 (source
699 (origin
700 (method url-fetch)
701 (uri (string-append "mirror://gnome/sources/pygobject/"
702 (version-major+minor version)
703 "/pygobject-" version ".tar.xz"))
704 (sha256
705 (base32
706 "06i7ynnbvgpz0gw09zsjbvhgcp5qz4yzdifw27qjwdazg2mckql7"))
707 (modules '((guix build utils)))
708 (snippet
709 '(begin
710 ;; We disable these tests in a snippet so that they are inherited
711 ;; by the Python 2 variant which is built differently.
712 (with-directory-excursion "tests"
713 ;; FIXME: These tests require Gdk and/or Gtk 4.
714 (for-each delete-file
715 '("test_atoms.py" "test_overrides_gtk.py"))
716 #t)))))
717 (build-system meson-build-system)
718 (native-inputs
719 `(("glib-bin" ,glib "bin")
720 ("pkg-config" ,pkg-config)
721 ("python-pytest" ,python-pytest)))
722 (inputs
723 `(("python" ,python)
724 ("python-pycairo" ,python-pycairo)
725 ("gobject-introspection" ,gobject-introspection)))
726 (propagated-inputs
727 ;; pygobject-3.0.pc refers to all these.
728 `(("glib" ,glib)
729 ("libffi" ,libffi)))
730 ;; For finding typelib files, since gobject-introscpetion isn't propagated.
731 (native-search-paths (package-native-search-paths gobject-introspection))
732 (home-page "https://live.gnome.org/PyGObject")
733 (synopsis "Python bindings for GObject")
734 (description
735 "Python bindings for GLib, GObject, and GIO.")
736 (license license:lgpl2.1+)
737 (properties `((python2-variant . ,(delay python2-pygobject))))))
738
739 (define-public python2-pygobject
740 (package (inherit (strip-python2-variant python-pygobject))
741 (name "python2-pygobject")
742
743 ;; Note: We use python-build-system here, because Meson only supports
744 ;; Python 3, and needs PYTHONPATH etc set up correctly, which makes it
745 ;; difficult to use for Python 2 projects.
746 (build-system python-build-system)
747 (arguments
748 `(#:python ,python-2
749 #:phases
750 (modify-phases %standard-phases
751 (add-after 'unpack 'delete-broken-tests
752 (lambda _
753 ;; FIXME: this test freezes and times out.
754 (delete-file "tests/test_mainloop.py")
755 ;; FIXME: this test fails with this kind of error:
756 ;; AssertionError: <Handlers.SIG_IGN: 1> != <built-in function default_int_handler
757 (delete-file "tests/test_ossig.py")
758 #t)))))
759 (inputs
760 `(("python-pycairo" ,python2-pycairo)
761 ("gobject-introspection" ,gobject-introspection)))
762 (native-inputs
763 `(("glib-bin" ,glib "bin")
764 ("pkg-config" ,pkg-config)
765 ("python-pytest" ,python2-pytest)))))
766
767 (define-public perl-glib
768 (package
769 (name "perl-glib")
770 (version "1.3292")
771 (source (origin
772 (method url-fetch)
773 (uri (string-append
774 "mirror://cpan/authors/id/X/XA/XAOC/Glib-"
775 version ".tar.gz"))
776 (sha256
777 (base32
778 "1q5075d6v2g5sm675hyzrcpxsrh09z83crfci8b0wl3jwmnz0frg"))))
779 (build-system perl-build-system)
780 (native-inputs
781 `(("perl-extutils-depends" ,perl-extutils-depends)
782 ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
783 (inputs
784 `(("glib" ,glib)))
785 (home-page "https://metacpan.org/release/Glib")
786 (synopsis "Perl wrappers for the GLib utility and Object libraries")
787 (description "This module provides perl access to GLib and GLib's GObject
788 libraries. GLib is a portability and utility library; GObject provides a
789 generic type system with inheritance and a powerful signal system. Together
790 these libraries are used as the foundation for many of the libraries that make
791 up the Gnome environment, and are used in many unrelated projects.")
792 (license license:lgpl2.1+)))
793
794 (define telepathy-glib
795 (package
796 (name "telepathy-glib")
797 (version "0.24.1")
798 (source
799 (origin
800 (method url-fetch)
801 (uri
802 (string-append
803 "https://telepathy.freedesktop.org/releases/telepathy-glib/"
804 "telepathy-glib-" version ".tar.gz"))
805 (sha256
806 (base32
807 "1symyzbjmxvksn2ifdkk50lafjm2llf2sbmky062gq2pz3cg23cy"))
808 (patches
809 (list
810 (search-patch "telepathy-glib-channel-memory-leak.patch")
811 ;; Don't use the same test name for multiple tests.
812 ;; <https://bugs.freedesktop.org/show_bug.cgi?id=92245>
813 (origin
814 (method url-fetch)
815 (uri "https://bugs.freedesktop.org/attachment.cgi?id=118608")
816 (file-name (string-append "telepathy-glib-duplicate-tests.patch"))
817 (sha256
818 (base32
819 "0z261fwrszxb28ccg3hsg9rizig4s84zvwmx6y31a4pyv7bvs5w3")))))))
820 (build-system gnu-build-system)
821 (arguments
822 '(#:configure-flags '("--enable-vala-bindings")
823
824 ;; '../tools/glib-*.py' generate files but the target dependencies are
825 ;; (presumably) not fully specified in the makefile, leading to
826 ;; parallel build errors like:
827 ;;
828 ;; EOFError: EOF read where object expected
829 ;; make[2]: *** [Makefile:1906: _gen/register-dbus-glib-marshallers-body.h] Error 1
830 #:parallel-build? #f
831 #:phases
832 (modify-phases %standard-phases
833 (add-after 'unpack 'disable-failing-tests
834 (lambda _
835 ;; None of the tests below are able to find the org.gtk.vfs.Daemon
836 ;; service file provided by gvfs.
837 (substitute* "tests/dbus/Makefile.in"
838 (("test-contacts\\$\\(EXEEXT\\)") "")
839 (("test-file-transfer-channel\\$\\(EXEEXT\\)") "")
840 (("test-stream-tube\\$\\(EXEEXT\\)") ""))
841 #t)))))
842 (native-inputs
843 `(("glib" ,glib "bin") ; uses glib-mkenums
844 ("gobject-introspection" ,gobject-introspection)
845 ("pkg-config" ,pkg-config)
846 ("python" ,python-2)
847 ("vala" ,vala)
848 ("xsltproc" ,libxslt)))
849 (propagated-inputs
850 ;; There are all in the Requires.private field of telepathy-glib.pc.
851 `(("dbus" ,dbus)
852 ("dbus-glib" ,dbus-glib)
853 ("glib" ,glib)))
854 (home-page "https://telepathy.freedesktop.org/wiki/")
855 (synopsis "GLib Real-time communications framework over D-Bus")
856 (description "Telepathy is a flexible, modular communications framework
857 that enables real-time communication over D-Bus via pluggable protocol
858 backends. Telepathy is a communications service that can be accessed by
859 many applications simultaneously.
860
861 This package provides the library for GLib applications.")
862 (license license:lgpl2.1+)))
863
864 (define-public dbus-c++
865 (package
866 (name "dbus-c++")
867 (version "0.9.0")
868 (source (origin
869 (method url-fetch)
870 (uri
871 (string-append
872 "mirror://sourceforge/dbus-cplusplus/dbus-c%2B%2B/"
873 version "/libdbus-c%2B%2B-" version ".tar.gz"))
874 (file-name (string-append name "-" version ".tar.gz"))
875 (patches (search-patches "dbus-c++-gcc-compat.patch"
876 "dbus-c++-threading-mutex.patch"))
877 (sha256
878 (base32
879 "0qafmy2i6dzx4n1dqp6pygyy6gjljnb7hwjcj2z11c1wgclsq4dw"))))
880 (build-system gnu-build-system)
881 (propagated-inputs
882 `(("dbus" ,dbus))) ;mentioned in the pkg-config file
883 (inputs
884 `(("efl" ,efl)
885 ("expat" ,expat)
886 ("glib" ,glib)))
887 (native-inputs
888 `(("pkg-config" ,pkg-config)))
889 (arguments
890 `(;; The 'configure' machinery fails to detect that it needs -lpthread.
891 #:configure-flags (list "LDFLAGS=-lpthread")
892 #:phases
893 (modify-phases %standard-phases
894 (add-before 'configure 'add-missing-header
895 (lambda _
896 (substitute* "include/dbus-c++/eventloop-integration.h"
897 (("#include <errno.h>")
898 "#include <errno.h>\n#include <unistd.h>"))
899 #t)))))
900 (synopsis "D-Bus API for C++")
901 (description "This package provides D-Bus client API bindings for the C++
902 programming language. It also contains the utility
903 @command{dbuscxx-xml2cpp}.")
904 (home-page "https://sourceforge.net/projects/dbus-cplusplus/")
905 (license license:lgpl2.1+)))
906
907 (define-public appstream-glib
908 (package
909 (name "appstream-glib")
910 (version "0.7.17")
911 (source (origin
912 (method url-fetch)
913 (uri (string-append "https://people.freedesktop.org/~hughsient/"
914 "appstream-glib/releases/"
915 "appstream-glib-" version ".tar.xz"))
916 (sha256
917 (base32
918 "0jg58m1p5xfrh8zkpqhhg00nqs727z5i1qy6sb0a3vyc98fyk9vw"))))
919 (build-system meson-build-system)
920 (native-inputs
921 `(("gettext" ,gettext-minimal)
922 ("glib:bin" ,glib "bin") ; for glib-compile-resources
923 ("pkg-config" ,pkg-config)))
924 (propagated-inputs
925 `(("gcab" ,gcab) ; for .pc file
926 ("gdk-pixbuf" ,gdk-pixbuf) ; for .pc file
927 ("libuuid" ,util-linux "lib"))) ; for .pc file
928 (inputs
929 `(("glib" ,glib)
930 ("gperf" ,gperf)
931 ("gtk+" ,gtk+)
932 ("json-glib" ,json-glib)
933 ("libarchive" ,libarchive)
934 ("libsoup" ,libsoup)))
935 (arguments
936 `(#:configure-flags
937 (list "-Ddep11=false"
938 "-Dintrospection=false" ; avoid g-ir-scanner dependency
939 "-Drpm=false"
940 "-Dstemmer=false")
941 #:phases
942 (modify-phases %standard-phases
943 (add-after 'unpack 'patch-tests
944 (lambda _
945 (substitute* "libappstream-glib/as-self-test.c"
946 (("g_test_add_func.*as_test_store_local_appdata_func);") ""))
947 #t)))))
948 (home-page "https://github.com/hughsie/appstream-glib")
949 (synopsis "Library for reading and writing AppStream metadata")
950 (description "This library provides objects and helper methods to help
951 reading and writing @uref{https://www.freedesktop.org/wiki/Distributions/AppStream,AppStream}
952 metadata.")
953 (license license:lgpl2.1+)))
954
955 (define perl-net-dbus
956 (package
957 (name "perl-net-dbus")
958 (version "1.1.0")
959 (source
960 (origin
961 (method url-fetch)
962 (uri (string-append "mirror://cpan/authors/id/D/DA/DANBERR/Net-DBus-"
963 version ".tar.gz"))
964 (sha256
965 (base32
966 "0sg2w147b9r9ykfzjs7y9qxry73xkjnhnk4qf95kfv79p5nnk4c3"))))
967 (build-system perl-build-system)
968 (native-inputs
969 `(("pkg-config" ,pkg-config)
970 ("perl-test-pod" ,perl-test-pod)
971 ("perl-test-pod-coverage" ,perl-test-pod-coverage)))
972 (inputs
973 `(("dbus" ,dbus)))
974 (propagated-inputs
975 `(("perl-xml-twig" ,perl-xml-twig)))
976 (home-page "https://metacpan.org/release/Net-DBus")
977 (synopsis "Extension for the DBus bindings")
978 (description "@code{Net::DBus} provides a Perl XS API to the DBus
979 inter-application messaging system. The Perl API covers the core base level
980 of the DBus APIs, not concerning itself yet with the GLib or QT wrappers.")
981 (license license:perl-license)))
982
983 (define perl-net-dbus-glib
984 (package
985 (name "perl-net-dbus-glib")
986 (version "0.33.0")
987 (source
988 (origin
989 (method url-fetch)
990 (uri (string-append "mirror://cpan/authors/id/D/DA/DANBERR/"
991 "Net-DBus-GLib-" version ".tar.gz"))
992 (sha256
993 (base32
994 "1z4mbv8z0rad604xahijpg5szzi8qak07hbahh230z4jf96fkxvj"))))
995 (build-system perl-build-system)
996 (native-inputs
997 `(("pkg-config" ,pkg-config)))
998 (inputs
999 `(("dbus-glib" ,dbus-glib)))
1000 (home-page "https://metacpan.org/release/Net-DBus-GLib")
1001 (synopsis "Perl extension for the DBus GLib bindings")
1002 (description "This package provides an extension to the @code{Net::DBus}
1003 module allowing integration with the GLib mainloop. To integrate with the
1004 main loop, simply get a connection to the bus via the methods in
1005 @code{Net::DBus::GLib} rather than the usual @code{Net::DBus} module. Every
1006 other API remains the same.")
1007 (license license:gpl2+)))
1008
1009 (define-public template-glib
1010 (package
1011 (name "template-glib")
1012 (version "3.32.0")
1013 (source (origin
1014 (method url-fetch)
1015 (uri (string-append "mirror://gnome/sources/" name "/"
1016 (version-major+minor version) "/"
1017 name "-" version ".tar.xz"))
1018 (sha256
1019 (base32
1020 "1g0zx0sxpw8kqp7p3sgl9kngaqrg9xl6cir24nrahks0vgsk98rr"))))
1021 (build-system meson-build-system)
1022 (arguments
1023 `(#:configure-flags '("-D" "enable_gtk_doc=true")))
1024 (inputs
1025 `(("gettext" ,gettext-minimal)
1026 ("glib" ,glib)
1027 ("gobject-introspection" ,gobject-introspection)))
1028 (native-inputs
1029 `(("bison" ,bison)
1030 ("flex" ,flex)
1031 ("glib:bin" ,glib "bin") ;; For glib-mkenums
1032 ("gtk-doc" ,gtk-doc)
1033 ("pkg-config" ,pkg-config)
1034 ("vala" ,vala)))
1035 (home-page "https://gitlab.gnome.org/GNOME/template-glib")
1036 (synopsis "Library for template expansion")
1037 (description
1038 "Template-GLib is a library to help you generate text based on a template and
1039 user defined state. Template-GLib does not use a language runtime, so it is
1040 safe to use from any GObject-Introspectable language.
1041
1042 Template-GLib allows you to access properties on GObjects as well as call
1043 simple methods via GObject-Introspection.")
1044 (license license:lgpl2.1+)))
1045
1046 (define-public xdg-dbus-proxy
1047 (package
1048 (name "xdg-dbus-proxy")
1049 (version "0.1.2")
1050 (source (origin
1051 (method url-fetch)
1052 (uri (string-append "https://github.com/flatpak/xdg-dbus-proxy"
1053 "/releases/download/" version
1054 "/xdg-dbus-proxy-" version ".tar.xz"))
1055 (sha256
1056 (base32
1057 "03sj1h0c2l08xa8phw013fnxr4fgav7l2mkjhzf9xk3dykwxcj8p"))))
1058 (build-system gnu-build-system)
1059 (native-inputs
1060 `(("pkg-config" ,pkg-config)
1061
1062 ;; For tests.
1063 ("dbus" ,dbus)
1064
1065 ;; These are required to build the manual.
1066 ("docbook-xml" ,docbook-xml-4.3)
1067 ("docbook-xsl" ,docbook-xsl)
1068 ("libxml2" ,libxml2)
1069 ("xsltproc" ,libxslt)))
1070 (inputs
1071 `(("glib" ,glib)))
1072 (home-page "https://github.com/flatpak/xdg-dbus-proxy")
1073 (synopsis "D-Bus connection proxy")
1074 (description
1075 "xdg-dbus-proxy is a filtering proxy for D-Bus connections. It can be
1076 used to create D-Bus sockets inside a Linux container that forwards requests
1077 to the host system, optionally with filters applied.")
1078 (license license:lgpl2.1+)))
1079
1080 (define-public dbus-test-runner
1081 (package
1082 (name "dbus-test-runner")
1083 (version "19.04.0")
1084 (source (origin
1085 (method url-fetch)
1086 (uri (string-append
1087 "https://launchpad.net/dbus-test-runner/"
1088 (version-major+minor version) "/" version
1089 "/+download/dbus-test-runner-" version ".tar.gz"))
1090 (sha256
1091 (base32
1092 "0xnbay58xn0hav208mdsg8dd176w57dcpw1q2k0g5fh9v7xk4nk4"))))
1093 (build-system gnu-build-system)
1094 (arguments
1095 `(#:phases
1096 (modify-phases %standard-phases
1097 (add-before 'configure 'fix-test-paths
1098 ;; add missing space
1099 (lambda* (#:key outputs #:allow-other-keys)
1100 (substitute* "Makefile.in"
1101 (("#!/bin/bash") (string-append "#!" (which "bash"))))
1102 (substitute* "tests/Makefile.in"
1103 (("/bin/sh") (which "sh"))
1104 (("#!/bin/bash") (string-append "#!" (which "bash")))
1105 (("echo cat") (string-append "echo " (which "cat")))
1106 (("/bin/true") (which "true")))
1107 #t)))))
1108 (inputs
1109 `(("gtk+" ,gtk+)
1110 ("glib" ,glib)
1111 ("dbus-glib" ,dbus-glib)))
1112 (native-inputs
1113 `(("glib:bin" ,glib "bin")
1114 ("intltool" ,intltool)
1115 ("pkg-config" ,pkg-config)
1116 ;; following used for tests
1117 ("python" ,python)
1118 ("python-dbusmock" ,python-dbusmock)
1119 ("xvfb" ,xorg-server-for-tests)))
1120 (home-page "https://launchpad.net/dbus-test-runner")
1121 (synopsis "Run a executables under a new DBus session for testing")
1122 (description "A small little utility to run a couple of executables under a
1123 new DBus session for testing.")
1124 (license license:gpl3)))