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 ;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages glib)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages backup)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages docbook)
41 #:use-module (gnu packages documentation)
42 #:use-module (gnu packages enlightenment)
43 #:use-module (gnu packages file)
44 #:use-module (gnu packages flex)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages gnome)
47 #:use-module (gnu packages gperf)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages libffi)
50 #:use-module (gnu packages linux)
51 #:use-module (gnu packages m4)
52 #:use-module (gnu packages nettle)
53 #:use-module (gnu packages pcre)
54 #:use-module (gnu packages package-management)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages perl-check)
57 #:use-module (gnu packages popt)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages python-xyz)
61 #:use-module (gnu packages selinux)
62 #:use-module (gnu packages web)
63 #:use-module (gnu packages xml)
64 #:use-module (gnu packages xorg)
65 #:use-module (guix build-system gnu)
66 #:use-module (guix build-system cmake)
67 #:use-module (guix build-system meson)
68 #:use-module (guix build-system perl)
69 #:use-module (guix build-system python)
70 #:use-module (guix download)
71 #:use-module ((guix licenses) #:prefix license:)
72 #:use-module (guix packages)
73 #:use-module (guix utils)
74 #:use-module ((srfi srfi-1) #:hide (zip))
76 ;; Export variables up-front to allow circular dependency with the 'xorg'
94 (replacement dbus/fixed)
98 "https://dbus.freedesktop.org/releases/dbus/dbus-"
102 "107ckxaff1cv4q6kmfdi2fb1nlsv03312a7kf6lb4biglhpjv8jl"))
103 (patches (search-patches "dbus-helper-search-path.patch"))))
104 (build-system gnu-build-system)
108 ;; Install the system bus socket under /var.
109 "--localstatedir=/var"
111 ;; Install the session bus socket under /tmp.
112 "--with-session-socket-dir=/tmp"
114 ;; Build shared libraries only.
117 ;; Use /etc/dbus-1 for system-wide config.
118 ;; Look for configuration file under
119 ;; /etc/dbus-1. This is notably required by
120 ;; 'dbus-daemon-launch-helper', which looks for
121 ;; the 'system.conf' file in that place,
122 ;; regardless of what '--config-file' was
123 ;; passed to 'dbus-daemon' on the command line;
124 ;; see <https://bugs.freedesktop.org/show_bug.cgi?id=92458>.
127 (modify-phases %standard-phases
130 ;; Don't try to create /var and /etc.
132 "localstatedir=/tmp/dummy"
133 "sysconfdir=/tmp/dummy"
136 `(("pkg-config" ,pkg-config)
137 ;; Dependencies to generate the doc.
138 ("docbook-xml" ,docbook-xml-4.4)
139 ("docbook-xsl" ,docbook-xsl)
142 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
144 ("yelp-tools" ,yelp-tools)))
147 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
150 (outputs '("out" "doc")) ;22 MiB of HTML doc
151 (home-page "https://www.freedesktop.org/wiki/Software/dbus/")
152 (synopsis "Message bus for inter-process communication (IPC)")
154 "D-Bus is a message bus system, a simple way for applications to
155 talk to one another. In addition to interprocess communication, D-Bus
156 helps coordinate process lifecycle; it makes it simple and reliable to
157 code a \"single instance\" application or daemon, and to launch
158 applications and daemons on demand when their services are needed.
160 D-Bus supplies both a system daemon (for events such as \"new hardware
161 device added\" or \"printer queue changed\") and a
162 per-user-login-session daemon (for general IPC needs among user
163 applications). Also, the message bus is built on top of a general
164 one-to-one message passing framework, which can be used by any two apps
165 to communicate directly (without going through the message bus
166 daemon). Currently the communicating applications are on one computer,
167 or through unencrypted TCP/IP suitable for use behind a firewall with
168 shared NFS home directories.")
169 (license license:gpl2+))) ; or Academic Free License 2.1
171 ;; Replacement package to fix CVE-2020-12049.
176 (inherit (package-source dbus))
177 (patches (append (search-patches "dbus-CVE-2020-12049.patch")
178 (origin-patches (package-source dbus))))))))
186 (uri (string-append "mirror://gnome/sources/"
187 name "/" (string-take version 4) "/"
188 name "-" version ".tar.xz"))
191 "174bsmbmcvaw69ff9g60q5sx0fn23rkhqcwqz17h5s7sprps4kqh"))
192 (patches (search-patches "glib-tests-timer.patch"))
193 (modules '((guix build utils)))
196 (substitute* "tests/spawn-test.c"
199 (build-system meson-build-system)
200 (outputs '("out" ; everything
201 "bin")) ; glib-mkenums, gtester, etc.; depends on Python
203 `(("pcre" ,pcre) ; in the Requires.private field of glib-2.0.pc
204 ("libffi" ,libffi) ; in the Requires.private field of gobject-2.0.pc
205 ;; These are in the Requires.private field of gio-2.0.pc
206 ("util-linux" ,util-linux "lib") ;for libmount
207 ("libselinux" ,libselinux)
210 `(("gettext" ,gettext-minimal)
211 ("m4" ,m4) ; for installing m4 macros
212 ("dbus" ,dbus) ; for GDBus tests
213 ("pkg-config" ,pkg-config)
214 ("python" ,python-wrapper)
215 ("perl" ,perl) ; needed by GIO tests
216 ("tzdata" ,tzdata-for-tests))) ; for tests/gdatetime.c
218 `(#:disallowed-references (,tzdata-for-tests)
220 (modify-phases %standard-phases
221 (add-after 'unpack 'patch-dbus-launch-path
222 (lambda* (#:key inputs #:allow-other-keys)
223 (let ((dbus (assoc-ref inputs "dbus")))
224 (substitute* "gio/gdbusaddress.c"
225 (("command_line = g_strdup_printf \\(\"dbus-launch")
226 (string-append "command_line = g_strdup_printf (\""
227 dbus "/bin/dbus-launch")))
229 (add-after 'unpack 'patch-gio-launch-desktop
230 (lambda* (#:key outputs #:allow-other-keys)
231 (let ((out (assoc-ref outputs "out")))
232 ;; See also <https://gitlab.gnome.org/GNOME/glib/issues/1633>
233 ;; for another future fix.
234 (substitute* "gio/gdesktopappinfo.c"
235 (("gio-launch-desktop")
236 (string-append out "/libexec/gio-launch-desktop")))
238 (add-before 'build 'pre-build
239 (lambda* (#:key inputs outputs #:allow-other-keys)
240 ;; For tests/gdatetime.c.
242 (string-append (assoc-ref inputs "tzdata")
245 ;; Some tests want write access there.
246 (setenv "HOME" (getcwd))
247 (setenv "XDG_CACHE_HOME" (getcwd))
249 (add-after 'unpack 'disable-failing-tests
252 (lambda (test-file test-paths)
253 (define pattern+procs
254 (map (lambda (test-path)
256 ;; XXX: only works for single line statements.
257 (format #f "g_test_add_func.*\"~a\".*" test-path)
260 (substitute test-file pattern+procs)))
262 '(("glib/tests/thread.c"
263 (;; prlimit(2) returns ENOSYS on Linux 2.6.32-5-xen-amd64
264 ;; as found on hydra.gnu.org, and strace(1) doesn't
268 ;; This tries to find programs in FHS directories.
269 ("glib/tests/utils.c"
270 ("/utils/find-program"))
272 ;; This fails because "glib/tests/echo-script" cannot be
274 ("glib/tests/spawn-singlethread.c"
275 ("/gthread/spawn-script"))
277 ("glib/tests/timer.c"
278 (;; fails if compiler optimizations are enabled, which they
282 ("gio/tests/gapplication.c"
283 (;; XXX: proven to be unreliable. See:
284 ;; <https://bugs.debian.org/756273>
285 ;; <http://bugs.gnu.org/18445>
288 ;; XXX: fails randomly for unknown reason. See:
289 ;; <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00215.html>
290 "/gapplication/local-actions"))
292 ("gio/tests/contenttype.c"
293 (;; XXX: requires shared-mime-info.
295 "/contenttype/guess_svg_from_data"
296 "/contenttype/subtype"
299 "/contenttype/symbolic-icon"
300 "/contenttype/tree"))
302 ("gio/tests/appinfo.c"
303 (;; XXX: requires update-desktop-database.
304 "/appinfo/associations"))
306 ("gio/tests/desktop-app-info.c"
307 (;; XXX: requires update-desktop-database.
308 "/desktop-app-info/delete"
309 "/desktop-app-info/default"
310 "/desktop-app-info/fallback"
311 "/desktop-app-info/lastused"
312 "/desktop-app-info/search"))
314 ("gio/tests/gdbus-peer.c"
315 (;; Requires /etc/machine-id.
316 "/gdbus/codegen-peer-to-peer"))
318 ("gio/tests/gdbus-address-get-session.c"
319 (;; Requires /etc/machine-id.
320 "/gdbus/x11-autolaunch"))
322 ("gio/tests/gsocketclient-slow.c"
323 (;; These tests tries to resolve "localhost", and fails.
324 "/socket-client/happy-eyeballs/slow"
325 "/socket-client/happy-eyeballs/cancellation/delayed"))
328 (for-each (lambda (x) (apply disable x)) failing-tests)
332 (setenv "MESON_TESTTHREADS"
333 (number->string (parallel-job-count)))
334 ;; Do not run tests marked as "flaky".
335 (invoke "meson" "test" "--no-suite" "flaky")))
336 ;; TODO: meson does not permit the bindir to be outside of prefix.
337 ;; See https://github.com/mesonbuild/meson/issues/2561
338 ;; We can remove this once meson is patched.
339 (add-after 'install 'move-executables
340 (lambda* (#:key outputs #:allow-other-keys)
341 (let ((out (assoc-ref outputs "out"))
342 (bin (assoc-ref outputs "bin")))
344 (rename-file (string-append out "/bin")
345 (string-append bin "/bin"))
346 ;; This one is an implementation detail of glib.
347 ;; It is wrong that that's in "/bin" in the first place,
348 ;; but that's what upstream is doing right now.
349 ;; See <https://gitlab.gnome.org/GNOME/glib/issues/1633>.
350 (mkdir (string-append out "/libexec"))
351 (rename-file (string-append bin "/bin/gio-launch-desktop")
352 (string-append out "/libexec/gio-launch-desktop"))
353 ;; Do not refer to "bindir", which points to "${prefix}/bin".
354 ;; We don't patch "bindir" to point to "$bin/bin", because that
355 ;; would create a reference cycle between the "out" and "bin"
357 (substitute* (list (string-append out "/lib/pkgconfig/gio-2.0.pc")
358 (string-append out "/lib/pkgconfig/glib-2.0.pc"))
359 (("bindir=\\$\\{prefix\\}/bin") "")
360 (("=\\$\\{bindir\\}/") "="))
362 ;; TODO: see above for explanation.
363 ;; #:configure-flags (list (string-append "--bindir="
364 ;; (assoc-ref %outputs "bin")
368 ;; This variable is not really "owned" by GLib, but several related
369 ;; packages refer to it: gobject-introspection's tools use it as a search
370 ;; path for .gir files, and it's also a search path for schemas produced
371 ;; by 'glib-compile-schemas'.
372 (list (search-path-specification
373 (variable "XDG_DATA_DIRS")
375 ;; To load extra gio modules from glib-networking, etc.
376 (search-path-specification
377 (variable "GIO_EXTRA_MODULES")
378 (files '("lib/gio/modules")))))
379 (search-paths native-search-paths)
380 (properties '((hidden? . #t)))
382 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
384 "GLib provides data structure handling for C, portability wrappers,
385 and interfaces for such runtime functionality as an event loop, threads,
386 dynamic loading, and an object system.")
387 (home-page "https://developer.gnome.org/glib/")
388 (license license:lgpl2.1+)))
390 (define-public glib-with-documentation
391 ;; glib's doc must be built in a separate package since it requires gtk-doc,
392 ;; which in turn depends on glib.
395 (properties (alist-delete 'hidden? (package-properties glib)))
396 (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference
398 `(("gtk-doc" ,gtk-doc) ; for the doc
399 ("docbook-xml" ,docbook-xml)
401 ,@(package-native-inputs glib)))
403 (substitute-keyword-arguments (package-arguments glib)
404 ((#:configure-flags flags ''())
405 `(cons "-Dgtk_doc=true" ,flags))
407 `(modify-phases ,phases
408 (add-after 'install 'move-doc
409 (lambda* (#:key outputs #:allow-other-keys)
410 (let ((out (assoc-ref outputs "out"))
411 (doc (assoc-ref outputs "doc"))
412 (html (string-append "/share/gtk-doc")))
413 (copy-recursively (string-append out html)
414 (string-append doc html))
415 (delete-file-recursively (string-append out html))
418 (define gobject-introspection
420 (name "gobject-introspection")
424 (uri (string-append "mirror://gnome/sources/"
425 "gobject-introspection/" (version-major+minor version)
426 "/gobject-introspection-" version ".tar.xz"))
428 (base32 "18lhglg9v6y83lhqzyifc1z0wrlawzrhzzxx0a3h1g7xaz97xvmi"))
429 (patches (search-patches
430 "gobject-introspection-cc.patch"
431 "gobject-introspection-girepository.patch"
432 "gobject-introspection-absolute-shlib-path.patch"))))
433 (build-system meson-build-system)
436 (modify-phases %standard-phases
437 (add-after 'unpack 'do-not-use-/usr/bin/env
439 (substitute* "tools/g-ir-tool-template.in"
441 (string-append "#!" (which "python3"))))
447 ("python" ,python-wrapper)
450 `(("glib" ,glib "bin")
451 ("pkg-config" ,pkg-config)))
453 `(;; In practice, GIR users will need libffi when using
454 ;; gobject-introspection.
457 (list (search-path-specification
458 (variable "GI_TYPELIB_PATH")
459 (files '("lib/girepository-1.0")))))
460 (search-paths native-search-paths)
461 (home-page "https://wiki.gnome.org/GObjectIntrospection")
462 (synopsis "Generate interface introspection data for GObject libraries")
464 "GObject introspection is a middleware layer between C libraries (using
465 GObject) and language bindings. The C library can be scanned at compile time
466 and generate a metadata file, in addition to the actual native C library. Then
467 at runtime, language bindings can read this metadata and automatically provide
468 bindings to call into the C library.")
469 ; Some bits are distributed under the LGPL2+, others under the GPL2+
470 (license license:gpl2+)))
478 (uri (string-append "https://launchpad.net/intltool/trunk/"
479 version "/+download/intltool-"
481 (patches (search-patches "intltool-perl-compatibility.patch"))
484 "1karx4sb7bnm2j67q0q74hspkfn6lqprpy5r99vkn5bb36a4viv7"))))
485 (build-system gnu-build-system)
489 `(;; Propagate gettext because users expect it to be there, and so does
490 ;; the `intltool-update' script.
491 ("gettext" ,gettext-minimal)
493 ("perl-xml-parser" ,perl-xml-parser)
497 (modify-phases %standard-phases
498 (add-after 'unpack 'patch-file-references
499 (lambda* (#:key inputs #:allow-other-keys)
500 (let ((file (assoc-ref inputs "file")))
501 (substitute* "intltool-update.in"
502 (("`file") (string-append "`" file "/bin/file")))
504 (home-page "https://launchpad.net/intltool/+download")
505 (synopsis "Tools to centralise translations of different file formats")
507 "Intltool is a set of tools to centralise translations of many different
508 file formats using GNU gettext-compatible PO files.
510 The intltool collection can be used to do these things:
512 Extract translatable strings from various source files (.xml.in,
513 glade, .desktop.in, .server.in, .oaf.in).
515 Collect the extracted strings together with messages from traditional
516 source files (.c, .h) in po/$(PACKAGE).pot.
518 Merge back the translations from .po files into .xml, .desktop and
519 oaf files. This merge step will happen at build resp. installation time.")
520 (license license:gpl2+)))
528 (uri (string-append "http://files.itstool.org/itstool/itstool-"
532 "1acjgf8zlyk7qckdk19iqaca4jcmywd7vxjbcs1mm6kaf8icqcv2"))))
533 (build-system gnu-build-system)
535 `(("libxml2" ,libxml2)
536 ("python-libxml2" ,python-libxml2)
540 (modify-phases %standard-phases
541 (add-after 'install 'wrap-program
542 (lambda* (#:key outputs #:allow-other-keys)
543 (let ((prog (string-append (assoc-ref outputs "out")
546 `("PYTHONPATH" = (,(getenv "PYTHONPATH"))))
548 (home-page "http://www.itstool.org")
549 (synopsis "Tool to translate XML documents with PO files")
551 "ITS Tool allows you to translate your XML documents with PO files, using
552 rules from the W3C Internationalization Tag Set (ITS) to determine what to
553 translate and how to separate it into PO file messages.
555 PO files are the standard translation format for GNU and other Unix-like
556 systems. They present translatable information as discrete messages, allowing
557 each message to be translated independently. In contrast to whole-page
558 translation, translating with a message-based format like PO means you can
559 easily track changes to the source document down to the paragraph. When new
560 strings are added or existing strings are modified, you only need to update the
561 corresponding messages.
563 ITS Tool is designed to make XML documents translatable through PO files by
564 applying standard ITS rules, as well as extension rules specific to ITS Tool.
565 ITS also provides an industry standard way for authors to override translation
566 information in their documents, such as whether a particular element should be
568 (license license:gpl3+)))
577 (string-append "https://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
581 "09g8swvc95bk1z6j8sw463p2v0dqmgm2zjfndf7i8sbcyq67dr3w"))))
582 (build-system gnu-build-system)
583 (propagated-inputs ; according to dbus-glib-1.pc
589 `(("glib" ,glib "bin")
590 ("pkg-config" ,pkg-config)))
591 (home-page "https://dbus.freedesktop.org/doc/dbus-glib/")
592 (synopsis "D-Bus GLib bindings")
594 "GLib bindings for D-Bus. The package is obsolete and superseded
595 by GDBus included in Glib.")
596 (license license:gpl2))) ; or Academic Free License 2.1
604 (uri (string-append "mirror://gnome/sources/libsigc++/"
605 (version-major+minor version) "/"
606 name "-" version ".tar.xz"))
609 "11j7j1jv4z58d9s7jvl42fnqa1dzl4idgil9r45cjv1w673dys0b"))))
610 (build-system gnu-build-system)
611 (native-inputs `(("pkg-config" ,pkg-config)
613 (home-page "https://libsigcplusplus.github.io/libsigcplusplus/")
614 (synopsis "Type-safe callback system for standard C++")
616 "Libsigc++ implements a type-safe callback system for standard C++. It
617 allows you to define signals and to connect those signals to any callback
618 function, either global or a member function, regardless of whether it is
621 It also contains adaptor classes for connection of dissimilar callbacks and
622 has an ease of use unmatched by other C++ callback libraries.")
623 (license license:lgpl2.1+)))
631 (uri (string-append "mirror://gnome/sources/glibmm/"
632 (version-major+minor version)
633 "/glibmm-" version ".tar.xz"))
636 "1ziwx6r7k7wbvg4qq1rgrv8zninapgrmhn1hs6926a3krh9ryr9n"))))
637 (build-system gnu-build-system)
640 (modify-phases %standard-phases
641 (add-before 'build 'pre-build
643 ;; This test uses /etc/fstab as an example file to read
644 ;; from; choose a better example.
645 (substitute* "tests/giomm_simple/main.cc"
647 (string-append (getcwd)
648 "/tests/giomm_simple/main.cc")))
650 ;; This test does a DNS lookup, and then expects to be able
651 ;; to open a TLS session; just skip it.
652 (substitute* "tests/giomm_tls_client/main.cc"
656 (native-inputs `(("pkg-config" ,pkg-config)
657 ("glib" ,glib "bin")))
659 `(("libsigc++" ,libsigc++)
661 (home-page "https://gtkmm.org/")
662 (synopsis "C++ interface to the GLib library")
664 "Glibmm provides a C++ programming interface to the part of GLib that are
666 (license license:lgpl2.1+)))
668 (define-public glibmm-2.64
677 (string-append "mirror://gnome/sources/glibmm/"
678 (version-major+minor version)
679 "/glibmm-" version ".tar.xz"))
681 (base32 "1v6lp23fr2qh4zshcnm28sn29j3nzgsvcqj2nhmrnvamipjq4lm7"))))
683 `(("libsigc++" ,libsigc++)
686 (define-public python2-pygobject-2
688 (name "python2-pygobject")
689 ;; This was the last version to declare the 2.0 platform number, i.e. its
690 ;; pkg-config files were named pygobject-2.0.pc
695 (uri (string-append "mirror://gnome/sources/pygobject/"
696 (version-major+minor version)
697 "/pygobject-" version ".tar.xz"))
700 "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv"))
701 (patches (search-patches
702 "python2-pygobject-2-gi-info-type-error-domain.patch"))))
703 (build-system gnu-build-system)
706 ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
707 ("pkg-config" ,pkg-config)
708 ("dbus" ,dbus))) ;for tests
710 `(("python" ,python-2)
712 ("python2-pycairo" ,python2-pycairo)
713 ("gobject-introspection" ,gobject-introspection)))
715 `(("libffi" ,libffi))) ;mentioned in pygobject-2.0.pc
717 `(#:tests? #f ;segfaults during tests
718 #:configure-flags '("LIBS=-lcairo-gobject")))
719 (home-page "https://pypi.org/project/PyGObject/")
720 (synopsis "Python bindings for GObject")
722 "Python bindings for GLib, GObject, and GIO.")
723 (license license:lgpl2.1+)))
725 (define-public python-pygobject
727 (name "python-pygobject")
732 (uri (string-append "mirror://gnome/sources/pygobject/"
733 (version-major+minor version)
734 "/pygobject-" version ".tar.xz"))
737 "06i7ynnbvgpz0gw09zsjbvhgcp5qz4yzdifw27qjwdazg2mckql7"))
738 (modules '((guix build utils)))
741 ;; We disable these tests in a snippet so that they are inherited
742 ;; by the Python 2 variant which is built differently.
743 (with-directory-excursion "tests"
744 ;; FIXME: These tests require Gdk and/or Gtk 4.
745 (for-each delete-file
746 '("test_atoms.py" "test_overrides_gtk.py"))
748 (build-system meson-build-system)
750 `(("glib-bin" ,glib "bin")
751 ("pkg-config" ,pkg-config)
752 ("python-pytest" ,python-pytest)))
755 ("python-pycairo" ,python-pycairo)
756 ("gobject-introspection" ,gobject-introspection)))
758 ;; pygobject-3.0.pc refers to all these.
761 ;; For finding typelib files, since gobject-introscpetion isn't propagated.
762 (native-search-paths (package-native-search-paths gobject-introspection))
763 (home-page "https://live.gnome.org/PyGObject")
764 (synopsis "Python bindings for GObject")
766 "Python bindings for GLib, GObject, and GIO.")
767 (license license:lgpl2.1+)
768 (properties `((python2-variant . ,(delay python2-pygobject))))))
770 (define-public python2-pygobject
771 (package (inherit (strip-python2-variant python-pygobject))
772 (name "python2-pygobject")
774 ;; Note: We use python-build-system here, because Meson only supports
775 ;; Python 3, and needs PYTHONPATH etc set up correctly, which makes it
776 ;; difficult to use for Python 2 projects.
777 (build-system python-build-system)
781 (modify-phases %standard-phases
782 (add-after 'unpack 'delete-broken-tests
784 ;; FIXME: this test freezes and times out.
785 (delete-file "tests/test_mainloop.py")
786 ;; FIXME: this test fails with this kind of error:
787 ;; AssertionError: <Handlers.SIG_IGN: 1> != <built-in function default_int_handler
788 (delete-file "tests/test_ossig.py")
791 `(("python-pycairo" ,python2-pycairo)
792 ("gobject-introspection" ,gobject-introspection)))
794 `(("glib-bin" ,glib "bin")
795 ("pkg-config" ,pkg-config)
796 ("python-pytest" ,python2-pytest)))))
798 (define-public perl-glib
805 "mirror://cpan/authors/id/X/XA/XAOC/Glib-"
809 "1q5075d6v2g5sm675hyzrcpxsrh09z83crfci8b0wl3jwmnz0frg"))))
810 (build-system perl-build-system)
812 `(("perl-extutils-depends" ,perl-extutils-depends)
813 ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
816 (home-page "https://metacpan.org/release/Glib")
817 (synopsis "Perl wrappers for the GLib utility and Object libraries")
818 (description "This module provides perl access to GLib and GLib's GObject
819 libraries. GLib is a portability and utility library; GObject provides a
820 generic type system with inheritance and a powerful signal system. Together
821 these libraries are used as the foundation for many of the libraries that make
822 up the Gnome environment, and are used in many unrelated projects.")
823 (license license:lgpl2.1+)))
825 (define telepathy-glib
827 (name "telepathy-glib")
834 "https://telepathy.freedesktop.org/releases/telepathy-glib/"
835 "telepathy-glib-" version ".tar.gz"))
838 "1symyzbjmxvksn2ifdkk50lafjm2llf2sbmky062gq2pz3cg23cy"))
841 (search-patch "telepathy-glib-channel-memory-leak.patch")
842 ;; Don't use the same test name for multiple tests.
843 ;; <https://bugs.freedesktop.org/show_bug.cgi?id=92245>
846 (uri "https://bugs.freedesktop.org/attachment.cgi?id=118608")
847 (file-name (string-append "telepathy-glib-duplicate-tests.patch"))
850 "0z261fwrszxb28ccg3hsg9rizig4s84zvwmx6y31a4pyv7bvs5w3")))))))
851 (build-system gnu-build-system)
853 '(#:configure-flags '("--enable-vala-bindings")
855 ;; '../tools/glib-*.py' generate files but the target dependencies are
856 ;; (presumably) not fully specified in the makefile, leading to
857 ;; parallel build errors like:
859 ;; EOFError: EOF read where object expected
860 ;; make[2]: *** [Makefile:1906: _gen/register-dbus-glib-marshallers-body.h] Error 1
863 (modify-phases %standard-phases
864 (add-after 'unpack 'disable-failing-tests
866 ;; None of the tests below are able to find the org.gtk.vfs.Daemon
867 ;; service file provided by gvfs.
868 (substitute* "tests/dbus/Makefile.in"
869 (("test-contacts\\$\\(EXEEXT\\)") "")
870 (("test-file-transfer-channel\\$\\(EXEEXT\\)") "")
871 (("test-stream-tube\\$\\(EXEEXT\\)") ""))
874 `(("glib" ,glib "bin") ; uses glib-mkenums
875 ("gobject-introspection" ,gobject-introspection)
876 ("pkg-config" ,pkg-config)
879 ("xsltproc" ,libxslt)))
881 ;; There are all in the Requires.private field of telepathy-glib.pc.
883 ("dbus-glib" ,dbus-glib)
885 (home-page "https://telepathy.freedesktop.org/wiki/")
886 (synopsis "GLib Real-time communications framework over D-Bus")
887 (description "Telepathy is a flexible, modular communications framework
888 that enables real-time communication over D-Bus via pluggable protocol
889 backends. Telepathy is a communications service that can be accessed by
890 many applications simultaneously.
892 This package provides the library for GLib applications.")
893 (license license:lgpl2.1+)))
895 (define-public dbus-c++
903 "mirror://sourceforge/dbus-cplusplus/dbus-c%2B%2B/"
904 version "/libdbus-c%2B%2B-" version ".tar.gz"))
905 (file-name (string-append name "-" version ".tar.gz"))
906 (patches (search-patches "dbus-c++-gcc-compat.patch"
907 "dbus-c++-threading-mutex.patch"))
910 "0qafmy2i6dzx4n1dqp6pygyy6gjljnb7hwjcj2z11c1wgclsq4dw"))))
911 (build-system gnu-build-system)
913 `(("dbus" ,dbus))) ;mentioned in the pkg-config file
919 `(("pkg-config" ,pkg-config)))
921 `(;; The 'configure' machinery fails to detect that it needs -lpthread.
922 #:configure-flags (list "LDFLAGS=-lpthread")
924 (modify-phases %standard-phases
925 (add-before 'configure 'add-missing-header
927 (substitute* "include/dbus-c++/eventloop-integration.h"
928 (("#include <errno.h>")
929 "#include <errno.h>\n#include <unistd.h>"))
931 (synopsis "D-Bus API for C++")
932 (description "This package provides D-Bus client API bindings for the C++
933 programming language. It also contains the utility
934 @command{dbuscxx-xml2cpp}.")
935 (home-page "https://sourceforge.net/projects/dbus-cplusplus/")
936 (license license:lgpl2.1+)))
938 (define-public dbus-cxx
944 (uri (string-append "mirror://sourceforge/dbus-cxx/dbus-cxx/"
945 version "/dbus-cxx-" version ".tar.gz"))
948 "1acsgpkd9v7b9jdc79ijmh9dbdfrzgkwkaff518i3zpk7y6g5mzw"))))
949 (build-system cmake-build-system)
951 `(#:configure-flags '("-DENABLE_TESTS=ON"
953 "-DENABLE_GLIBMM=ON")))
954 (inputs `(("dbus" ,dbus)
955 ("libsigc++" ,libsigc++)
960 (native-inputs `(("pkg-config" ,pkg-config)
962 (synopsis "C++ wrapper for dbus")
963 (description "Dbus-cxx is a C++ wrapper for dbus.\n
964 It exposes the C API to allow direct manipulation and
965 relies on sigc++ to provide an Oriented Object interface.\n
966 This package provide 2 utils:
968 @item @command{dbus-cxx-xml2cpp} to generate proxy and adapter
969 @item @command{dbus-cxx-introspect} to introspect a dbus interface
972 Some codes examples can be find at:
973 @url{https://dbus-cxx.github.io/examples.html}")
974 (home-page "https://dbus-cxx.github.io/")
975 (license license:gpl3)))
977 (define-public appstream-glib
979 (name "appstream-glib")
983 (uri (string-append "https://people.freedesktop.org/~hughsient/"
984 "appstream-glib/releases/"
985 "appstream-glib-" version ".tar.xz"))
988 "00j0kkgf224nzmrha72g8pd72mymhph7vaisj35i4ffy7cpd47na"))))
989 (build-system meson-build-system)
991 `(("gettext" ,gettext-minimal)
992 ("glib:bin" ,glib "bin") ; for glib-compile-resources
993 ("pkg-config" ,pkg-config)))
995 `(("gcab" ,gcab) ; for .pc file
996 ("gdk-pixbuf" ,gdk-pixbuf) ; for .pc file
997 ("libuuid" ,util-linux "lib"))) ; for .pc file
1002 ("json-glib" ,json-glib)
1003 ("libarchive" ,libarchive)
1004 ("libsoup" ,libsoup)))
1007 (list "-Ddep11=false"
1008 "-Dintrospection=false" ; avoid g-ir-scanner dependency
1012 (modify-phases %standard-phases
1013 (add-after 'unpack 'patch-tests
1015 (substitute* "libappstream-glib/as-self-test.c"
1016 (("g_test_add_func.*as_test_store_local_appdata_func);") ""))
1018 (home-page "https://github.com/hughsie/appstream-glib")
1019 (synopsis "Library for reading and writing AppStream metadata")
1020 (description "This library provides objects and helper methods to help
1021 reading and writing @uref{https://www.freedesktop.org/wiki/Distributions/AppStream,AppStream}
1023 (license license:lgpl2.1+)))
1025 (define perl-net-dbus
1027 (name "perl-net-dbus")
1032 (uri (string-append "mirror://cpan/authors/id/D/DA/DANBERR/Net-DBus-"
1036 "0sg2w147b9r9ykfzjs7y9qxry73xkjnhnk4qf95kfv79p5nnk4c3"))))
1037 (build-system perl-build-system)
1039 `(("pkg-config" ,pkg-config)
1040 ("perl-test-pod" ,perl-test-pod)
1041 ("perl-test-pod-coverage" ,perl-test-pod-coverage)))
1045 `(("perl-xml-twig" ,perl-xml-twig)))
1046 (home-page "https://metacpan.org/release/Net-DBus")
1047 (synopsis "Extension for the DBus bindings")
1048 (description "@code{Net::DBus} provides a Perl XS API to the DBus
1049 inter-application messaging system. The Perl API covers the core base level
1050 of the DBus APIs, not concerning itself yet with the GLib or QT wrappers.")
1051 (license license:perl-license)))
1053 (define perl-net-dbus-glib
1055 (name "perl-net-dbus-glib")
1060 (uri (string-append "mirror://cpan/authors/id/D/DA/DANBERR/"
1061 "Net-DBus-GLib-" version ".tar.gz"))
1064 "1z4mbv8z0rad604xahijpg5szzi8qak07hbahh230z4jf96fkxvj"))))
1065 (build-system perl-build-system)
1067 `(("pkg-config" ,pkg-config)))
1069 `(("dbus-glib" ,dbus-glib)))
1070 (home-page "https://metacpan.org/release/Net-DBus-GLib")
1071 (synopsis "Perl extension for the DBus GLib bindings")
1072 (description "This package provides an extension to the @code{Net::DBus}
1073 module allowing integration with the GLib mainloop. To integrate with the
1074 main loop, simply get a connection to the bus via the methods in
1075 @code{Net::DBus::GLib} rather than the usual @code{Net::DBus} module. Every
1076 other API remains the same.")
1077 (license license:gpl2+)))
1079 (define-public template-glib
1081 (name "template-glib")
1085 (uri (string-append "mirror://gnome/sources/" name "/"
1086 (version-major+minor version) "/"
1087 name "-" version ".tar.xz"))
1090 "1z9xkin5fyfh071ma9y045jcw83hgx33dfbjraw6cxk0qdmfysr1"))))
1091 (build-system meson-build-system)
1093 `(#:configure-flags '("-D" "enable_gtk_doc=true")))
1095 `(("gettext" ,gettext-minimal)
1097 ("gobject-introspection" ,gobject-introspection)))
1101 ("glib:bin" ,glib "bin") ;; For glib-mkenums
1102 ("gtk-doc" ,gtk-doc)
1103 ("pkg-config" ,pkg-config)
1105 (home-page "https://gitlab.gnome.org/GNOME/template-glib")
1106 (synopsis "Library for template expansion")
1108 "Template-GLib is a library to help you generate text based on a template and
1109 user defined state. Template-GLib does not use a language runtime, so it is
1110 safe to use from any GObject-Introspectable language.
1112 Template-GLib allows you to access properties on GObjects as well as call
1113 simple methods via GObject-Introspection.")
1114 (license license:lgpl2.1+)))
1116 (define-public xdg-dbus-proxy
1118 (name "xdg-dbus-proxy")
1122 (uri (string-append "https://github.com/flatpak/xdg-dbus-proxy"
1123 "/releases/download/" version
1124 "/xdg-dbus-proxy-" version ".tar.xz"))
1127 "03sj1h0c2l08xa8phw013fnxr4fgav7l2mkjhzf9xk3dykwxcj8p"))))
1128 (build-system gnu-build-system)
1130 `(("pkg-config" ,pkg-config)
1135 ;; These are required to build the manual.
1136 ("docbook-xml" ,docbook-xml-4.3)
1137 ("docbook-xsl" ,docbook-xsl)
1138 ("libxml2" ,libxml2)
1139 ("xsltproc" ,libxslt)))
1142 (home-page "https://github.com/flatpak/xdg-dbus-proxy")
1143 (synopsis "D-Bus connection proxy")
1145 "xdg-dbus-proxy is a filtering proxy for D-Bus connections. It can be
1146 used to create D-Bus sockets inside a Linux container that forwards requests
1147 to the host system, optionally with filters applied.")
1148 (license license:lgpl2.1+)))
1150 (define-public dbus-test-runner
1152 (name "dbus-test-runner")
1157 "https://launchpad.net/dbus-test-runner/"
1158 (version-major+minor version) "/" version
1159 "/+download/dbus-test-runner-" version ".tar.gz"))
1162 "0xnbay58xn0hav208mdsg8dd176w57dcpw1q2k0g5fh9v7xk4nk4"))))
1163 (build-system gnu-build-system)
1166 (modify-phases %standard-phases
1167 (add-before 'configure 'fix-test-paths
1168 ;; add missing space
1169 (lambda* (#:key outputs #:allow-other-keys)
1170 (substitute* "Makefile.in"
1171 (("#!/bin/bash") (string-append "#!" (which "bash"))))
1172 (substitute* "tests/Makefile.in"
1173 (("/bin/sh") (which "sh"))
1174 (("#!/bin/bash") (string-append "#!" (which "bash")))
1175 (("echo cat") (string-append "echo " (which "cat")))
1176 (("/bin/true") (which "true")))
1181 ("dbus-glib" ,dbus-glib)))
1183 `(("glib:bin" ,glib "bin")
1184 ("intltool" ,intltool)
1185 ("pkg-config" ,pkg-config)
1186 ;; following used for tests
1188 ("python-dbusmock" ,python-dbusmock)
1189 ("xvfb" ,xorg-server-for-tests)))
1190 (home-page "https://launchpad.net/dbus-test-runner")
1191 (synopsis "Run a executables under a new DBus session for testing")
1192 (description "A small little utility to run a couple of executables under a
1193 new DBus session for testing.")
1194 (license license:gpl3)))