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