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