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