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