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