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