projects/guix·blob javascript-team · refs

1534 lines · 61.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013-2016, 2019-2021, 2025 Ludovic Courtès <[email protected]>
3;;; Copyright © 2013, 2015 Andreas Enge <[email protected]>
4;;; Copyright © 2013 Nikita Karetnikov <[email protected]>
5;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2021 Mark H Weaver <[email protected]>
6;;; Copyright © 2016, 2020, 2021, 2023, 2024 Efraim Flashner <[email protected]>
7;;; Copyright © 2016 Lukas Gradl <[email protected]>
8;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <[email protected]>
9;;; Copyright © 2017 Petter <[email protected]>
10;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <[email protected]>
11;;; Copyright © 2018 Alex Vong <[email protected]>
12;;; Copyright © 2019-2023, 2025 Maxim Cournoyer <[email protected]>
13;;; Copyright © 2019 Giacomo Leidi <[email protected]>
14;;; Copyright © 2019, 2020, 2021 Marius Bakke <[email protected]>
15;;; Copyright © 2020 Nicolò Balzarotti <[email protected]>
16;;; Copyright © 2020 Florian Pelz <[email protected]>
17;;; Copyright © 2020, 2023, 2025 Janneke Nieuwenhuizen <[email protected]>
18;;; Copyright © 2020 Arthur Margerit <[email protected]>
19;;; Copyright © 2021 Maxime Devos <[email protected]>
20;;; Copyright © 2022 Petr Hodina <[email protected]>
21;;; Copyright © 2023 Saku Laesvuori <[email protected]>
22;;; Copyright © 2024 Zheng Junjie <[email protected]>
23;;; Copyright © 2024 Remco van 't Veer <[email protected]>
24;;; Copyright © 2024 dan <[email protected]>
25;;; Copyright © 2025 John Kehayias <[email protected]>
26;;;
27;;; This file is part of GNU Guix.
28;;;
29;;; GNU Guix is free software; you can redistribute it and/or modify it
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
34;;; GNU Guix is distributed in the hope that it will be useful, but
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42(define-module (gnu packages glib)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages backup)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bash)
48 #:use-module (gnu packages bison)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages cpp)
53 #:use-module (gnu packages curl)
54 #:use-module (gnu packages docbook)
55 #:use-module (gnu packages documentation)
56 #:use-module (gnu packages elf)
57 #:use-module (gnu packages enlightenment)
58 #:use-module (gnu packages file)
59 #:use-module (gnu packages compiler-tools)
60 #:use-module (gnu packages freedesktop)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages gnome)
63 #:use-module (gnu packages graphviz)
64 #:use-module (gnu packages gperf)
65 #:use-module (gnu packages gtk)
66 #:use-module (gnu packages libffi)
67 #:use-module (gnu packages libunwind)
68 #:use-module (gnu packages linux)
69 #:use-module (gnu packages m4)
70 #:use-module (gnu packages nettle)
71 #:use-module (gnu packages pcre)
72 #:use-module (gnu packages package-management)
73 #:use-module (gnu packages perl)
74 #:use-module (gnu packages perl-check)
75 #:use-module (gnu packages popt)
76 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages pretty-print)
78 #:use-module (gnu packages python)
79 #:use-module (gnu packages python-build)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages sqlite)
82 #:use-module (gnu packages web)
83 #:use-module (gnu packages xml)
84 #:use-module (gnu packages xorg)
85 #:use-module (guix build-system gnu)
86 #:use-module (guix build-system cmake)
87 #:use-module (guix build-system meson)
88 #:use-module (guix build-system perl)
89 #:use-module (guix build-system pyproject)
90 #:use-module (guix download)
91 #:use-module (guix git-download)
92 #:use-module ((guix licenses) #:prefix license:)
93 #:use-module (guix packages)
94 #:use-module (guix utils)
95 #:use-module (guix gexp)
96 #:use-module (srfi srfi-26)
97 #:use-module ((srfi srfi-1) #:hide (zip))
98
99 ;; Export variables up-front to allow circular dependency with the 'xorg'
100 ;; module.
101 #:export (dbus
102 glib
103 gobject-introspection
104 dbus-glib
105 intltool
106 itstool
107 libsigc++
108 glibmm
109 telepathy-glib
110 perl-net-dbus
111 perl-net-dbus-glib))
112
113(define dbus
114 (package
115 (name "dbus")
116 (version "1.16.2")
117 (source (origin
118 (method url-fetch)
119 (uri (string-append
120 "https://dbus.freedesktop.org/releases/dbus/dbus-"
121 version ".tar.xz"))
122 (sha256
123 (base32
124 "1qmppvb4nf23nvdr1hnywl43ab4ckblrqzn0nb77pzkan6ja38hb"))
125 (patches (search-patches "dbus-helper-search-path.patch"))))
126 (build-system meson-build-system)
127 (arguments
128 (list
129 #:configure-flags
130 #~(list
131 ;; Install the system bus socket under /var.
132 "-Dlocalstatedir=/var"
133
134 ;; Install the session bus socket under /tmp.
135 "-Dsession_socket_dir=/tmp"
136
137 ;; Use /etc/dbus-1 for system-wide config.
138 ;; Look for configuration file under
139 ;; /etc/dbus-1. This is notably required by
140 ;; 'dbus-daemon-launch-helper', which looks for
141 ;; the 'system.conf' file in that place,
142 ;; regardless of what '--config-file' was
143 ;; passed to 'dbus-daemon' on the command line;
144 ;; see <https://bugs.freedesktop.org/show_bug.cgi?id=92458>.
145 "-Dsysconfdir=/etc")
146 #:phases
147 #~(modify-phases %standard-phases
148 (replace 'install
149 (lambda _
150 ;; Don't try to create /var and /etc.
151 (invoke "meson"
152 "install"
153 "--destdir=/tmp/dummy")
154 (copy-recursively (string-append "/tmp/dummy/" #$output)
155 #$output)
156 (mkdir-p (string-append #$output:doc "/share"))
157 (rename-file (string-append #$output "/share/doc")
158 (string-append #$output:doc "/share/doc")))))))
159 (native-inputs
160 ;; Some dependencies are required to generate the documentation. Also,
161 ;; quoting NEWS for 1.16.2: “Autotools-generated files are no longer
162 ;; included in the tarball release.”
163 (list docbook-xml-4.4
164 docbook-xsl
165 doxygen
166 libtool
167 libxslt
168 which
169 python
170 xmlto
171 yelp-tools
172 pkg-config))
173 (inputs
174 (list expat
175 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
176 ;; '--autolaunch'.
177 libx11))
178 (outputs '("out" "doc")) ;22 MiB of HTML doc
179 (home-page "https://www.freedesktop.org/wiki/Software/dbus/")
180 (synopsis "Message bus for inter-process communication (IPC)")
181 (description
182 "D-Bus is a message bus system, a simple way for applications to
183talk to one another. In addition to interprocess communication, D-Bus
184helps coordinate process lifecycle; it makes it simple and reliable to
185code a \"single instance\" application or daemon, and to launch
186applications and daemons on demand when their services are needed.
187
188D-Bus supplies both a system daemon (for events such as \"new hardware
189device added\" or \"printer queue changed\") and a
190per-user-login-session daemon (for general IPC needs among user
191applications). Also, the message bus is built on top of a general
192one-to-one message passing framework, which can be used by any two apps
193to communicate directly (without going through the message bus
194daemon). Currently the communicating applications are on one computer,
195or through unencrypted TCP/IP suitable for use behind a firewall with
196shared NFS home directories.")
197 (license license:gpl2+))) ; or Academic Free License 2.1
198
199;;; This variant is used for the Jami service: it provides an entry point to
200;;; further customize the configuration of the D-Bus instance run by the
201;;; jami-dbus-session service.
202(define-public dbus-for-jami
203 (hidden-package
204 (package/inherit dbus
205 (name "dbus-for-jami")
206 (arguments
207 (substitute-keyword-arguments arguments
208 ((#:phases phases)
209 #~(modify-phases #$phases
210 (add-after 'unpack 'customize-config
211 (lambda _
212 (substitute* "bus/session.conf.in"
213 (("@SYSCONFDIR_FROM_PKGDATADIR@/dbus-1/session-local.conf")
214 "/var/run/jami/session-local.conf")))))))))))
215
216(define-public dbus-1.15.0
217 ;; Dbus 1.15.2 has a breaking change.
218 (hidden-package
219 (package/inherit dbus
220 (version "1.15.0")
221 (source (origin
222 (method url-fetch)
223 (uri (string-append
224 "https://dbus.freedesktop.org/releases/dbus/dbus-"
225 version ".tar.xz"))
226 (sha256
227 (base32
228 "02k4zm5h24clwp4csp2r3xp2lxib31jlk3xkgdj2c0njkb5whwsh"))
229 (patches (search-patches "dbus-helper-search-path.patch")))))))
230
231;;; The reason this is not enabled in the regular dbus package is because it
232;;; impacts the performance of D-Bus (including its library) as a whole, even
233;;; when the DBUS_VERBOSE environment variable is not set.
234(define-public dbus-verbose
235 (package/inherit dbus
236 (name "dbus-verbose")
237 (arguments (substitute-keyword-arguments arguments
238 ((#:configure-flags flags '())
239 #~(cons "-Dverbose_mode=true" #$flags))))
240 (synopsis "D-Bus with verbose mode enabled for debugging")
241 (description "This variant D-Bus package is built with verbose mode, which
242eases debugging of D-Bus services by printing various debug information when
243the @code{DBUS_VERBOSE} environment variable is set to @samp{1}. For more
244information, refer to the @samp{dbus-daemon(1)} man page.")))
245
246(define glib-minimal
247 (package
248 (name "glib")
249 (version "2.86.5")
250 (source
251 (origin
252 (method url-fetch)
253 (uri
254 (string-append "mirror://gnome/sources/"
255 name "/" (string-take version 4) "/"
256 name "-" version ".tar.xz"))
257 (sha256
258 (base32 "0pwd0cgcf9l7bfx69yzsqrqn7d5w77n9mxzgvc204g4bpd3sk1ff"))
259 (patches
260 (search-patches "glib-appinfo-watch.patch"
261 "glib-skip-failing-test.patch"))
262 (modules '((guix build utils)))
263 (snippet
264 '(begin
265 (substitute* "glib/tests/spawn-test.c"
266 (("/bin/sh") "sh"))))))
267 (build-system meson-build-system)
268 (outputs '("out" ;libraries, locales, etc
269 "static" ;static libraries
270 "bin" ;executables; depends on Python
271 "debug"))
272 (arguments
273 (list
274 #:disallowed-references
275 (cons (this-package-native-input "tzdata")
276 ;; Verify glib-mkenums, gtester, ... use the cross-compiled
277 ;; python.
278 (if (%current-target-system)
279 (map (cut gexp-input <> #:native? #t)
280 `(,(this-package-native-input "python")
281 ,(this-package-native-input "python-wrapper")))
282 '()))
283 #:configure-flags #~(list "--default-library=both"
284 "-Dman-pages=disabled"
285 "-Dselinux=disabled"
286 (string-append "--bindir="
287 #$output:bin "/bin"))
288 #:phases
289 #~(modify-phases %standard-phases
290 (add-after 'unpack 'set-G_TEST_SRCDIR
291 (lambda _
292 (setenv "G_TEST_SRCDIR" (string-append (getcwd) "/gio/tests"))))
293 ;; Needed to pass the test phase on slower ARM and i686 machines.
294 (add-after 'unpack 'increase-test-timeout
295 (lambda _
296 (substitute* "meson.build"
297 (("(test_timeout.*) = ([[:digit:]]+)" all first second)
298 (string-append first " = " second "0")))))
299 (add-after 'unpack 'disable-failing-tests
300 (lambda _
301 (with-directory-excursion "glib/tests"
302 (substitute* '("unix.c" "utils.c")
303 (("[ \t]*g_test_add_func.*;") "")))
304 (with-directory-excursion "gio/tests"
305 (substitute* '("contenttype.c"
306 "gdbus-address-get-session.c"
307 "gdbus-server-auth.c"
308 "gdbus-peer.c"
309 "appinfo.c"
310 "desktop-app-info.c")
311 (("[ \t]*g_test_add_func.*;") ""))
312 (unless (which "update-desktop-database")
313 (substitute* "file.c"
314 (("[ \t]*g_test_add_func.*query-default-handler.*;") "")))
315 (substitute* '("portal-support-snap.c")
316 (("g_test_init .*")
317 "return EXIT_SUCCESS;")))
318
319 #$@(if (target-x86-32?)
320 ;; Comment out parts of timer.c that fail on i686 due to
321 ;; excess precision when building with GCC 10:
322 ;; <https://gitlab.gnome.org/GNOME/glib/-/issues/820>.
323 '((substitute* "glib/tests/timer.c"
324 (("^ g_assert_cmpuint \\(micros.*" all)
325 (string-append "//" all "\n"))
326 (("^ g_assert_cmpfloat \\(elapsed, ==.*" all)
327 (string-append "//" all "\n"))))
328 '())
329 #$@(if (target-ppc32?)
330 ;; assertion failed (last_thread_id <= thread_id): (3 <= 2)
331 #~((substitute* "glib/tests/thread-pool-slow.c"
332 (("^ g_assert_cmpint \\(last_thread_id.*" all)
333 (string-append "//" all "\n"))))
334 #~())
335 #$@(if (system-hurd?)
336 '((with-directory-excursion "gio/tests"
337 ;; FAIL
338 (substitute* '("filenamecompleter.c"
339 "testfilemonitor.c")
340 (("return (g_test_run)" all call)
341 (string-append "return 0;// " call))
342 (("[ \t]*g_test_add_func.*;") ""))
343 ;; Fails to identify / as a mountpoint
344 (substitute* "live-g-file.c"
345 (("g_assert_true \\(is_mountpoint\\);") "")))
346 (with-directory-excursion "glib/tests"
347 ;; pthread_mutex_lock: EINVAL
348 (substitute* "gwakeuptest.c"
349 (("[ \t]*g_test_add_func.*;") ""))))
350 '())))
351 ;; Python references are not being patched in patch-phase of build,
352 ;; despite using python-wrapper as input. So we patch them manually.
353 ;;
354 ;; These python scripts are both used during build and installed,
355 ;; so at first, use a python from 'native-inputs', not 'inputs'. When
356 ;; cross-compiling, the 'patch-shebangs' phase will replace
357 ;; the native python with a python from 'inputs'.
358 (add-after 'unpack 'patch-python-references
359 (lambda* (#:key native-inputs inputs #:allow-other-keys)
360 (substitute* '("gio/gdbus-2.0/codegen/gdbus-codegen.in"
361 "glib/gtester-report.in"
362 "gobject/glib-genmarshal.in"
363 "gobject/glib-mkenums.in")
364 (("@PYTHON@")
365 (search-input-file (or native-inputs inputs)
366 (string-append
367 "/bin/python"
368 #$(version-major+minor
369 (package-version python))))))))
370 (add-before 'check 'pre-check
371 (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
372 ;; For tests/gdatetime.c.
373 (setenv "TZDIR"
374 (search-input-directory (or native-inputs inputs)
375 "share/zoneinfo"))
376 ;; Some tests want write access there.
377 (setenv "HOME" (getcwd))
378 (setenv "XDG_CACHE_HOME" (getcwd))))
379 (add-after 'install 'move-static-libraries
380 (lambda _
381 (mkdir-p (string-append #$output:static "/lib"))
382 (for-each (lambda (a)
383 (rename-file a (string-append #$output:static "/lib/"
384 (basename a))))
385 (find-files #$output "\\.a$"))))
386 (add-after 'install 'patch-pkg-config-files
387 (lambda* (#:key outputs #:allow-other-keys)
388 ;; Do not refer to "bindir", which points to "${prefix}/bin".
389 ;; We don't patch "bindir" to point to "$bin/bin", because that
390 ;; would create a reference cycle between the "out" and "bin"
391 ;; outputs.
392 (substitute* (map (lambda (f) (search-input-file outputs f))
393 (list "lib/pkgconfig/gio-2.0.pc"
394 "lib/pkgconfig/glib-2.0.pc"
395 "lib/pkgconfig/girepository-2.0.pc"))
396 (("^bindir=.*")
397 "")
398 (("=\\$\\{bindir\\}/")
399 "=")))))))
400 (native-inputs
401 (list dbus
402 gettext-minimal
403 m4 ;for installing m4 macros
404 perl ;needed by GIO tests
405 pkg-config
406 python ;for 'patch-python-references
407 python-wrapper
408 tzdata-for-tests)) ;for tests/gdatetime.c
409 (inputs
410 (list
411 ;; "python", "python-wrapper" and "bash-minimal"
412 ;; are for the 'patch-shebangs' phase, to make
413 ;; sure the installed scripts end up with a correct shebang
414 ;; when cross-compiling.
415 bash-minimal
416 python
417 python-wrapper))
418 (propagated-inputs
419 (list libffi ; in the Requires.private field of gobject-2.0.pc
420 pcre2 ; in the Requires.private field of glib-2.0.pc
421 `(,util-linux "lib") ;for libmount
422 zlib)) ; in the Requires.private field of glib-2.0.pc
423 (native-search-paths
424 ;; This variable is not really "owned" by GLib, but several related
425 ;; packages refer to it: gobject-introspection's tools use it as a search
426 ;; path for .gir files, and it's also a search path for schemas produced
427 ;; by 'glib-compile-schemas'.
428 (list
429 (search-path-specification
430 (variable "XDG_DATA_DIRS")
431 (files '("share")))
432 ;; To load extra gio modules from glib-networking, etc.
433 (search-path-specification
434 (variable "GIO_EXTRA_MODULES")
435 (files '("lib/gio/modules")))))
436 (search-paths native-search-paths)
437 (synopsis "Low-level core library for GNOME projects")
438 (description "GLib provides the core application building blocks for
439libraries and applications written in C. It provides the core object system
440used in GNOME, the main loop implementation, and a large set of utility
441functions for strings and common data structures.")
442 (home-page "https://wiki.gnome.org/Projects/GLib")
443 (license license:lgpl2.1+)
444 (properties '((hidden? . #t)))))
445
446(define glib
447 (let ((base glib-minimal))
448 (package/inherit base
449 (native-inputs
450 (modify-inputs native-inputs
451 (prepend gobject-introspection-minimal)))
452 (arguments
453 (substitute-keyword-arguments arguments
454 ((#:phases phases)
455 #~(modify-phases #$phases
456 ;; GI tests require installed libraries
457 (delete 'check)
458 (add-after 'install 'check
459 (assoc-ref #$phases 'check)))))))))
460
461(define-public glib-with-documentation
462 ;; glib's doc must be built in a separate package since it requires gtk-doc,
463 ;; which in turn depends on glib.
464 (let ((base glib))
465 (package/inherit base
466 (properties (alist-delete 'hidden? (package-properties base)))
467 (outputs (cons "doc" (package-outputs base)))
468 (native-inputs
469 (modify-inputs native-inputs
470 (append gi-docgen python-docutils)))
471 (arguments
472 (substitute-keyword-arguments arguments
473 ((#:configure-flags flags ''())
474 #~(cons "-Ddocumentation=true"
475 (delete "-Dman-pages=disabled" #$flags)))
476 ((#:phases phases)
477 #~(modify-phases #$phases
478 (add-after 'install 'move-doc
479 (lambda _
480 (let ((doc "/share/doc"))
481 (mkdir-p (string-append #$output:doc "/share"))
482 (rename-file
483 (string-append #$output doc)
484 (string-append #$output:doc doc))))))))))))
485
486(define (python-extension-suffix python triplet)
487 "Determine the suffix for C extensions for PYTHON when compiled
488for TRIPLET."
489 ;; python uses strings like 'x86_64-linux-gnu' instead of
490 ;; 'x86_64-unknown-linux-gnu'.
491 (define normalised-system
492 (string-replace-substring triplet "-unknown-" "-"))
493 (define major.minor (version-major+minor (package-version python)))
494 (define majorminor (string-delete #\. major.minor))
495 (string-append
496 ;; If guix' python package used "--with-pydebug", a #\d would
497 ;; need to be added, likewise "--with-pymalloc" and "--with-wide-unicode"
498 ;; would require a #\m and #\u, see cpython's configure.ac.
499 ".cpython-" majorminor "-" normalised-system
500 (if (target-mingw? triplet)
501 ".dll"
502 ".so")))
503
504(define (correct-library-name-phase python name)
505 "Return a G-exp evaluating to a phase renaming the python extension NAME
506from what Meson thinks its name should be to what python expects its name
507to be. NAME must not include the platform-specific suffix. This can only
508be used when cross-compiling."
509 #~(lambda _
510 (define name #$name)
511 (define native-suffix
512 #$(python-extension-suffix python
513 (nix-system->gnu-triplet (%current-system))))
514 (define target-suffix
515 #$(python-extension-suffix python (%current-target-system)))
516 (define native-name
517 (string-append name native-suffix))
518 (define target-name
519 (string-append name target-suffix))
520 (rename-file native-name target-name)))
521
522(define gobject-introspection-minimal
523 (package
524 (name "gobject-introspection")
525 (version "1.86.0")
526 (source (origin
527 (method url-fetch)
528 (uri (string-append "mirror://gnome/sources/"
529 "gobject-introspection/" (version-major+minor version)
530 "/gobject-introspection-" version ".tar.xz"))
531 (sha256
532 (base32 "1bmrq0cksa7x5ldds22a9gfkk41i7ch2wp7rrwmc7bfyrqzil3cj"))
533 (patches (search-patches
534 "gobject-introspection-cc.patch"
535 "gobject-introspection-girepository.patch"
536 "gobject-introspection-absolute-shlib-path.patch"))))
537 (build-system meson-build-system)
538 (arguments
539 `(,@(if (%current-target-system)
540 `(#:configure-flags
541 '("-Dgi_cross_use_prebuilt_gi=true"
542 ;; Building introspection data requires running binaries
543 ;; for ‘host’ on ‘build’, so don't do that.
544 ;;
545 ;; TODO: it would be nice to have introspection data anyways
546 ;; as discussed here: https://issues.guix.gnu.org/50201#60.
547 "-Dbuild_introspection_data=false"))
548 '())
549 #:modules
550 ((guix build meson-build-system)
551 (guix build utils)
552 (ice-9 match)
553 (srfi srfi-1)
554 (srfi srfi-26))
555 #:phases
556 ,#~
557 (modify-phases %standard-phases
558 #$@(if (%current-target-system)
559 ;; 'typelibs' is undefined.
560 `((add-after 'unpack 'set-typelibs
561 (lambda _
562 (substitute* "meson.build"
563 (("\\bsources: typelibs\\b")
564 "sources: []")))))
565 '())
566 (add-after 'unpack 'do-not-use-/usr/bin/env
567 (lambda _
568 (substitute* "tools/g-ir-tool-template.in"
569 (("#!@PYTHON_CMD@")
570 (string-append "#!" (which "python3"))))))
571 ;; Copy the site-packages procedure rather than importing them to
572 ;; maintain pyproject/glib-or-gtk build-systems'independence.
573 (add-after 'install 'wrap
574 (lambda* (#:key inputs outputs #:allow-other-keys)
575 (define (search-input-directories pred dir)
576 (filter pred
577 (map (match-lambda
578 ((name . directory)
579 (string-append directory "/" dir)))
580 inputs)))
581 (let* ((version #$(version-major+minor
582 (package-version
583 (this-package-input "python"))))
584 (site-path (string-append "lib/python" version
585 "/site-packages"))
586 ;; Remove meson, but keep the rest.
587 (pred (lambda (dir)
588 (and (directory-exists? dir)
589 (string-contains dir "python-"))))
590 (paths (search-input-directories pred site-path)))
591 (for-each
592 (cute wrap-program <>
593 `("GUIX_PYTHONPATH" ":" prefix
594 (,(string-join paths ":"))))
595 ;; These require access to python-setuptools site-packages.
596 (list (search-input-file outputs "/bin/g-ir-annotation-tool")
597 (search-input-file outputs "/bin/g-ir-scanner"))))))
598 #$@(if (%current-target-system)
599 ;; Meson gives python extensions an incorrect name, see
600 ;; <https://github.com/mesonbuild/meson/issues/7049>.
601 #~((add-after 'install 'rename-library
602 #$(correct-library-name-phase
603 (this-package-input "python")
604 #~(string-append #$output
605 "/lib/gobject-introspection/giscanner"
606 "/_giscanner"))))
607 #~()))))
608 (native-inputs
609 (cons*
610 bison
611 flex
612 (list glib-minimal "bin")
613 pkg-config
614 (if (%current-target-system)
615 (list python)
616 (list))))
617 (inputs
618 (list python zlib))
619 (propagated-inputs
620 (list glib-minimal
621 ;; In practice, GIR users will need libffi when using
622 ;; gobject-introspection.
623 libffi
624 python-setuptools-bootstrap))
625 (native-search-paths
626 (list
627 (search-path-specification
628 (variable "GI_TYPELIB_PATH")
629 (files '("lib/girepository-1.0")))))
630 (search-paths native-search-paths)
631 (synopsis "GObject introspection tools and libraries")
632 (description "GObject introspection is a middleware layer between
633C libraries (using GObject) and language bindings. The C library can be scanned
634at compile time and generate metadata files, in addition to the actual native
635C library. Then language bindings can read this metadata and automatically
636provide bindings to call into the C library.")
637 (home-page "https://wiki.gnome.org/Projects/GObjectIntrospection")
638 (license
639 (list
640 ;; For library.
641 license:lgpl2.0+
642 ;; For tools.
643 license:gpl2+))))
644
645(define gobject-introspection
646 (let ((base gobject-introspection-minimal))
647 (package/inherit base
648 (native-inputs
649 (modify-inputs native-inputs
650 (replace "glib" glib)))
651 (propagated-inputs
652 (modify-inputs propagated-inputs
653 (replace "glib" glib)
654 ;; Note: The label stays the same despite the name change.
655 (replace "python-setuptools-bootstrap" python-setuptools))))))
656
657(define intltool
658 (package
659 (name "intltool")
660 (version "0.51.0")
661 (source (origin
662 (method url-fetch)
663 (uri (string-append "https://launchpad.net/intltool/trunk/"
664 version "/+download/intltool-"
665 version ".tar.gz"))
666 (patches (search-patches "intltool-perl-compatibility.patch"))
667 (sha256
668 (base32
669 "1karx4sb7bnm2j67q0q74hspkfn6lqprpy5r99vkn5bb36a4viv7"))))
670 (build-system gnu-build-system)
671 (inputs
672 (list file))
673 (propagated-inputs
674 `(;; Propagate gettext because users expect it to be there, and so does
675 ;; the `intltool-update' script.
676 ("gettext" ,gettext-minimal)
677
678 ("perl-xml-parser" ,perl-xml-parser)
679 ("perl" ,perl)))
680 (arguments
681 `(#:phases
682 (modify-phases %standard-phases
683 (add-after 'unpack 'patch-file-references
684 (lambda* (#:key inputs #:allow-other-keys)
685 (let ((file (assoc-ref inputs "file")))
686 (substitute* "intltool-update.in"
687 (("`file") (string-append "`" file "/bin/file")))
688 #t))))))
689 (home-page "https://launchpad.net/intltool/+download")
690 (synopsis "Tools to centralise translations of different file formats")
691 (description
692 "Intltool is a set of tools to centralise translations of many different
693file formats using GNU gettext-compatible PO files.
694
695The intltool collection can be used to do these things:
696
697 Extract translatable strings from various source files (.xml.in,
698 glade, .desktop.in, .server.in, .oaf.in).
699
700 Collect the extracted strings together with messages from traditional
701 source files (.c, .h) in po/$(PACKAGE).pot.
702
703 Merge back the translations from .po files into .xml, .desktop and
704 oaf files. This merge step will happen at build resp. installation time.")
705 (license license:gpl2+)))
706
707(define itstool
708 (package
709 (name "itstool")
710 (version "2.0.7")
711 (source (origin
712 (method url-fetch)
713 (uri (string-append "http://files.itstool.org/itstool/itstool-"
714 version ".tar.bz2"))
715 (sha256
716 (base32
717 "1jl7gsr7aclb9nvqazr039m86y7f7ivfhl2pixcrbfqjkb97r6kb"))))
718 (build-system gnu-build-system)
719 (inputs
720 (list bash-minimal libxml2 python))
721 (arguments
722 (list
723 #:phases
724 #~(modify-phases %standard-phases
725 (add-after 'install 'wrap-program
726 (lambda _
727 (wrap-program (string-append #$output "/bin/itstool")
728 `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")))))))))
729 (home-page "https://itstool.org")
730 (synopsis "Tool to translate XML documents with PO files")
731 (description
732 "ITS Tool allows you to translate your XML documents with PO files, using
733rules from the W3C Internationalization Tag Set (ITS) to determine what to
734translate and how to separate it into PO file messages.
735
736PO files are the standard translation format for GNU and other Unix-like
737systems. They present translatable information as discrete messages, allowing
738each message to be translated independently. In contrast to whole-page
739translation, translating with a message-based format like PO means you can
740easily track changes to the source document down to the paragraph. When new
741strings are added or existing strings are modified, you only need to update the
742corresponding messages.
743
744ITS Tool is designed to make XML documents translatable through PO files by
745applying standard ITS rules, as well as extension rules specific to ITS Tool.
746ITS also provides an industry standard way for authors to override translation
747information in their documents, such as whether a particular element should be
748translated.")
749 (license license:gpl3+)))
750
751(define dbus-glib
752 (package
753 (name "dbus-glib")
754 (version "0.112")
755 (source (origin
756 (method url-fetch)
757 (uri
758 (string-append "https://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
759 version ".tar.gz"))
760 (sha256
761 (base32
762 "0fhlkdqyzbh89bdslwsfc5fbdvkiv6g840ami4rnwa6dvz60smbx"))))
763 (build-system gnu-build-system)
764 (arguments
765 (if (%current-target-system)
766 `(#:configure-flags
767 ;; Run a native 'dbus-binding-tool' instead of a cross-compiled
768 ;; 'dbus-binding-tool' when cross-compiling.
769 ,#~(list
770 (string-append
771 "--with-dbus-binding-tool="
772 #+(file-append this-package "/bin/dbus-binding-tool"))))
773 '()))
774 (propagated-inputs ; according to dbus-glib-1.pc
775 (list dbus glib))
776 (inputs
777 (list expat))
778 (native-inputs
779 (list `(,glib "bin") pkg-config))
780 (home-page "https://dbus.freedesktop.org/doc/dbus-glib/")
781 (synopsis "D-Bus GLib bindings")
782 (description
783 "GLib bindings for D-Bus. The package is obsolete and superseded
784by GDBus included in Glib.")
785 (license license:gpl2))) ; or Academic Free License 2.1
786
787(define-public libaccounts-glib
788 (package
789 (name "libaccounts-glib")
790 (version "1.27")
791 (source (origin
792 (method git-fetch)
793 (uri (git-reference
794 (url "https://gitlab.com/accounts-sso/libaccounts-glib")
795 (commit (string-append "VERSION_" version))))
796 (file-name (git-file-name name version))
797 (sha256
798 (base32
799 "0j181yw0jpw3bkq45hg0vhha5nyjjcssvfjj0y92311bkz15rf4q"))))
800 (build-system meson-build-system)
801 (arguments
802 (list
803 #:tests? #f ;one test fails.
804 #:imported-modules (append %meson-build-system-modules
805 %pyproject-build-system-modules)
806 #:modules '(((guix build pyproject-build-system) #:prefix py:)
807 (guix build meson-build-system)
808 (guix build utils))
809 ;; don't try installing to python store path.
810 #:configure-flags
811 #~(list (string-append "-Dpy-overrides-dir="
812 (py:site-packages %build-inputs %outputs)
813 "/gi/overrides"))
814 #:phases
815 #~(modify-phases %standard-phases
816 (replace 'check
817 (lambda* (#:key tests? #:allow-other-keys)
818 (when tests?
819 (invoke "dbus-run-session" "--" "meson" "test"
820 "--print-errorlogs")))))))
821 (native-inputs (list dbus
822 `(,glib "bin")
823 gobject-introspection
824 gtk-doc
825 pkg-config
826 vala))
827 (inputs (list check python python-pygobject))
828 (propagated-inputs (list glib libxml2 sqlite))
829 (home-page "https://accounts-sso.gitlab.io/")
830 (synopsis "Accounts SSO (Single Sign-On) management library for GLib
831applications")
832 (description
833 "Accounts SSO is a framework for application developers who
834wish to acquire, use and store web account details and credentials. It
835handles the authentication process of an account and securely stores the
836credentials and service-specific settings.")
837 (license license:lgpl2.1+)))
838
839(define libsigc++
840 (package
841 (name "libsigc++")
842 (version "3.6.0")
843 (source (origin
844 (method url-fetch)
845 (uri (string-append "mirror://gnome/sources/libsigc++/"
846 (version-major+minor version) "/"
847 name "-" version ".tar.xz"))
848 (sha256
849 (base32
850 "05qf10lp5vxsi5fbzdphqhbzmys12mxvg4gh14p9zqynvwvkpln3"))))
851 (build-system meson-build-system)
852 (outputs '("out" "doc"))
853 (arguments
854 (list #:configure-flags #~(list "-Dbuild-documentation=true")
855 #:phases #~(modify-phases %standard-phases
856 (add-after 'install 'move-doc
857 (lambda _
858 (mkdir-p (string-append #$output:doc "/share"))
859 (rename-file
860 (string-append #$output "/share/doc")
861 (string-append #$output:doc "/share/doc")))))))
862 (native-inputs
863 (list docbook-xml-4.1.2
864 docbook-xsl
865 graphviz
866 doxygen
867 m4
868 mm-common
869 perl
870 pkg-config
871 libxml2
872 libxslt))
873 (inputs (list boost))
874 (home-page "https://libsigcplusplus.github.io/libsigcplusplus/")
875 (synopsis "Type-safe callback system for standard C++")
876 (description
877 "Libsigc++ implements a type-safe callback system for standard C++. It
878allows you to define signals and to connect those signals to any callback
879function, either global or a member function, regardless of whether it is
880static or virtual. It also contains adaptor classes for connection of
881dissimilar callbacks and has an ease of use unmatched by other C++ callback
882libraries.")
883 (license license:lgpl3+)))
884
885(define-public libsigc++-2
886 (package
887 (inherit libsigc++)
888 (name "libsigc++")
889 (version "2.9.3")
890 (source
891 (origin
892 (method url-fetch)
893 (uri
894 (string-append "mirror://gnome/sources/libsigc++/"
895 (version-major+minor version)
896 "/libsigc++-" version ".tar.xz"))
897 (sha256
898 (base32 "0zq963d0sss82q62fdfjs7l9iwbdch51albck18cb631ml0v7y8b"))))
899 (build-system gnu-build-system)
900 (arguments
901 (list #:phases
902 #~(modify-phases %standard-phases
903 (add-after 'install 'move-doc
904 (lambda _
905 (mkdir-p (string-append #$output:doc "/share"))
906 (rename-file
907 (string-append #$output "/share/doc")
908 (string-append #$output:doc "/share/doc")))))))))
909
910(define glibmm
911 (package
912 (name "glibmm")
913 (version "2.86.0")
914 (source (origin
915 (method url-fetch)
916 (uri (string-append "mirror://gnome/sources/glibmm/"
917 (version-major+minor version)
918 "/glibmm-" version ".tar.xz"))
919 (sha256
920 (base32
921 "09kq13ab45764mw2zp1ncwikci2nmnwzskkpj29nfv84vbvfkh1r"))))
922 (build-system meson-build-system)
923 (outputs '("out" "doc"))
924 (arguments
925 (list
926 #:configure-flags #~(list "-Dbuild-documentation=true")
927 #:phases
928 #~(modify-phases %standard-phases
929 (add-after 'unpack 'disable-failing-tests
930 (lambda _
931 (substitute* "tests/meson.build"
932 ;; This test uses /etc/fstab as an example file to read from;
933 ;; disable it.
934 (("[ \t]*.*giomm_simple.*$") "")
935 ;; This test does a DNS lookup, and then expects to be able to
936 ;; open a TLS session; just skip it.
937 (("[ \t]*.*giomm_tls_client.*$") ""))))
938 (add-after 'install 'move-doc
939 (lambda _
940 (mkdir-p (string-append #$output:doc "/share"))
941 (rename-file
942 (string-append #$output "/share/doc")
943 (string-append #$output:doc "/share/doc")))))))
944 (native-inputs
945 (list graphviz
946 doxygen
947 `(,glib "bin")
948 m4
949 mm-common
950 perl
951 pkg-config
952 libxslt))
953 (propagated-inputs
954 (list libsigc++ glib))
955 (home-page "https://gtkmm.org/")
956 (synopsis "C++ interface to the GLib library")
957 (description
958 "Glibmm provides a C++ programming interface to the part of GLib that are
959useful for C++.")
960 (license license:lgpl2.1+)))
961
962(define-public glibmm-2.76
963 (package
964 (inherit glibmm)
965 (name "glibmm")
966 (version "2.76.0")
967 (source (origin
968 (method url-fetch)
969 (uri (string-append "mirror://gnome/sources/glibmm/"
970 (version-major+minor version)
971 "/glibmm-" version ".tar.xz"))
972 (sha256
973 (base32
974 "1cia8vrpwzn8zwalws42mga5hi965840m5s8dvfzv55xx86dhdw6"))))))
975
976 (define-public glibmm-2.66
977 (package
978 (inherit glibmm)
979 (name "glibmm")
980 (version "2.66.6")
981 (source
982 (origin
983 (method url-fetch)
984 (uri
985 (string-append "mirror://gnome/sources/glibmm/"
986 (version-major+minor version)
987 "/glibmm-" version ".tar.xz"))
988 (sha256
989 (base32 "0bqm9vqwhas69q6n89wd2xgxvrlkpxra13dzsx8m67hqk0jp8n2k"))))
990 (propagated-inputs
991 (modify-inputs propagated-inputs
992 (replace "libsigc++" libsigc++-2)))))
993
994(define-public python-pygobject
995 (package
996 (name "python-pygobject")
997 (version "3.54.5")
998 (source
999 (origin
1000 (method url-fetch)
1001 (uri (string-append "mirror://gnome/sources/pygobject/"
1002 (version-major+minor version)
1003 "/pygobject-" version ".tar.gz"))
1004 (sha256
1005 (base32
1006 "11dm5yi80v143dn21bayqxb53w67hk1lishmrw35c97m91inyrdn"))))
1007 (build-system meson-build-system)
1008 ;; The tests require mutter, which would introduce a circular dependency.
1009 (arguments (list #:tests? #f))
1010 (native-inputs (list `(,glib "bin") pkg-config))
1011 (inputs (list python python-pycairo gobject-introspection))
1012 (propagated-inputs (list glib libffi)) ;required in pygobject-3.0.pc
1013 ;; For finding typelib files, since gobject-introscpetion isn't propagated.
1014 (native-search-paths (package-native-search-paths gobject-introspection))
1015 (home-page "https://pygobject.gnome.org/")
1016 (synopsis "Python bindings for GObject")
1017 (description
1018 "Python bindings for GLib, GObject, and GIO.")
1019 (properties
1020 '((upstream-name . "pygobject")))
1021 (license license:lgpl2.1+)))
1022
1023(define-public python-pygobject-3.50
1024 (package
1025 (inherit python-pygobject)
1026 (version "3.50.2")
1027 (source
1028 (origin
1029 (method url-fetch)
1030 (uri (string-append "mirror://gnome/sources/pygobject/"
1031 (version-major+minor version)
1032 "/pygobject-" version ".tar.gz"))
1033 (sha256
1034 (base32
1035 "1zx7jz9s1qnn52k3kzbz5ykffr9pm3c8hvpwzm4vcz5pm9hbirpc"))))))
1036
1037(define-public perl-glib
1038 (package
1039 (name "perl-glib")
1040 (version "1.3294")
1041 (source (origin
1042 (method url-fetch)
1043 (uri (string-append
1044 "mirror://cpan/authors/id/X/XA/XAOC/Glib-"
1045 version ".tar.gz"))
1046 (sha256
1047 (base32
1048 "1fsw9sjfz1irlhnsk5n1xpb181vvq1dsxrw5vrsp066cdflga5fp"))))
1049 (build-system perl-build-system)
1050 (native-inputs
1051 (list perl-extutils-depends perl-extutils-pkgconfig))
1052 (propagated-inputs
1053 (list glib))
1054 (home-page "https://metacpan.org/release/Glib")
1055 (synopsis "Perl wrappers for the GLib utility and Object libraries")
1056 (description "This module provides perl access to GLib and GLib's GObject
1057libraries. GLib is a portability and utility library; GObject provides a
1058generic type system with inheritance and a powerful signal system. Together
1059these libraries are used as the foundation for many of the libraries that make
1060up the Gnome environment, and are used in many unrelated projects.")
1061 (license license:lgpl2.1+)))
1062
1063(define-public perl-glib-object-introspection
1064 (package
1065 (name "perl-glib-object-introspection")
1066 (version "0.051")
1067 (source
1068 (origin
1069 (method url-fetch)
1070 (uri (string-append "mirror://cpan/authors/id/X/XA/XAOC/"
1071 "Glib-Object-Introspection-" version ".tar.gz"))
1072 (sha256
1073 (base32 "12802l87mx65lswiwlc394fkb74cmsqn88n2qy119b40rhfn2sb5"))))
1074 (build-system perl-build-system)
1075 (native-inputs
1076 (list perl-extutils-depends perl-extutils-pkgconfig))
1077 (propagated-inputs
1078 (list gobject-introspection perl-cairo-gobject perl-glib))
1079 (home-page "https://metacpan.org/dist/Glib-Object-Introspection")
1080 (synopsis "Dynamically create Perl language bindings")
1081 (description "Glib::Object::Introspection uses the gobject-introspection and
1082libffi projects to dynamically create Perl bindings for a wide variety of
1083libraries. Examples include gtk+, webkit, libsoup and many more.")
1084 (license license:lgpl2.1+)))
1085
1086(define-public telepathy-glib
1087 (package
1088 (name "telepathy-glib")
1089 (version "0.24.2")
1090 (source
1091 (origin
1092 (method url-fetch)
1093 (uri
1094 (string-append
1095 "https://telepathy.freedesktop.org/releases/telepathy-glib/"
1096 "telepathy-glib-" version ".tar.gz"))
1097 (patches (search-patches "telepathy-glib-fix-test.patch"))
1098 (sha256
1099 (base32
1100 "1w3kja8j3gz2apal79bi3hq44xk5g78aphrqbw983l6df7bp98xh"))))
1101 (build-system gnu-build-system)
1102 (arguments
1103 (list
1104 #:configure-flags
1105 #~(list
1106 "CFLAGS=-g -O2 -Wno-error=incompatible-pointer-types"
1107 "--enable-vala-bindings")
1108
1109 ;; '../tools/glib-*.py' generate files but the target dependencies are
1110 ;; (presumably) not fully specified in the makefile, leading to
1111 ;; parallel build errors like:
1112 ;;
1113 ;; EOFError: EOF read where object expected
1114 ;; make[2]: *** [Makefile:1906: _gen/register-dbus-glib-marshallers-body.h] Error 1
1115 #:parallel-build? #f
1116 ;; When spawned in parallel, the dbus daemons may fail to shut down
1117 ;; cleanly. This issue appears to have been closed upstream due to low
1118 ;; information, but still continues to haunt folks. See also
1119 ;; <https://gitlab.freedesktop.org/telepathy/telepathy-glib/-/issues/134>.
1120 #:parallel-tests? #f
1121 #:phases
1122 #~(modify-phases %standard-phases
1123 (add-after 'unpack 'disable-failing-tests
1124 (lambda _
1125 ;; None of the tests below are able to find the org.gtk.vfs.Daemon
1126 ;; service file provided by gvfs.
1127 (substitute* "tests/dbus/Makefile.in"
1128 (("test-contacts\\$\\(EXEEXT\\)") "")
1129 (("test-file-transfer-channel\\$\\(EXEEXT\\)") "")
1130 (("test-stream-tube\\$\\(EXEEXT\\)") "")))))))
1131 (native-inputs
1132 (list `(,glib "bin") ; uses glib-mkenums
1133 gobject-introspection
1134 pkg-config
1135 python-minimal-wrapper
1136 vala
1137 libxslt))
1138 (propagated-inputs
1139 ;; There are all in the Requires.private field of telepathy-glib.pc.
1140 (list dbus dbus-glib glib))
1141 (home-page "https://telepathy.freedesktop.org/wiki/")
1142 (synopsis "GLib Real-time communications framework over D-Bus")
1143 (description "Telepathy is a flexible, modular communications framework
1144that enables real-time communication over D-Bus via pluggable protocol
1145backends. Telepathy is a communications service that can be accessed by
1146many applications simultaneously.
1147
1148This package provides the library for GLib applications.")
1149 (license license:lgpl2.1+)))
1150
1151(define-public dbus-cxx
1152 (package
1153 (name "dbus-cxx")
1154 (version "2.4.0")
1155 (source (origin
1156 (method git-fetch)
1157 (uri (git-reference
1158 (url "https://github.com/dbus-cxx/dbus-cxx")
1159 (commit version)))
1160 (file-name (git-file-name name version))
1161 (sha256
1162 (base32
1163 "0c9q2bjs4m66zq0qysyip8fnkvvjpj46rkjcvw15nhmfhzbq16ag"))
1164 (modules '((guix build utils)))
1165 (snippet '(delete-file-recursively "tools/libcppgenerate"))))
1166 (build-system cmake-build-system)
1167 (arguments
1168 (list #:configure-flags #~(list "-DENABLE_TOOLS=ON"
1169 "-DENABLE_GLIB_SUPPORT=ON"
1170 "-DTOOLS_BUNDLED_CPPGENERATE=OFF")
1171 ;; There is no /etc/machine-id file in the build environment.
1172 #:test-exclude "test-machine-uuid-method"))
1173 ;; These are propagated due to being referenced in headers and pkg-config
1174 ;; .pc files.
1175 (propagated-inputs (list glib libsigc++))
1176 (inputs (list dbus expat libcppgenerate popt))
1177 (native-inputs (list pkg-config))
1178 (synopsis "C++ wrapper for dbus")
1179 (description "Dbus-cxx is a C++ wrapper for dbus.\n
1180It exposes the C API to allow direct manipulation and
1181relies on sigc++ to provide an Oriented Object interface.\n
1182This package provide 2 utils:
1183@enumerate
1184@item @command{dbus-cxx-xml2cpp} to generate proxy and adapter
1185@item @command{dbus-cxx-introspect} to introspect a dbus interface
1186@end enumerate
1187
1188Some codes examples can be find at:
1189@url{https://dbus-cxx.github.io/examples.html}")
1190 (home-page "https://dbus-cxx.github.io/")
1191 (license (list license:lgpl3+ license:bsd-3)))) ;dual licensed
1192
1193(define-public sdbus-c++
1194 (package
1195 (name "sdbus-c++")
1196 (version "2.1.0")
1197 (source (origin
1198 (method git-fetch)
1199 (uri (git-reference
1200 (url "https://github.com/Kistler-Group/sdbus-cpp")
1201 (commit (string-append "v" version))))
1202 (file-name (git-file-name name version))
1203 (sha256
1204 (base32
1205 "1rnrc196kr2byypbh8lc6r9p590183knnza5n75l587v39ndly16"))))
1206 (build-system cmake-build-system)
1207 (arguments
1208 (list
1209 ;; Avoid the integration test, which requires a system bus.
1210 #:configure-flags #~(list "-DSDBUSCPP_BUILD_CODEGEN=ON"
1211 "-DSDBUSCPP_BUILD_TESTS=ON"
1212 ;; Do not install tests.
1213 "-DSDBUSCPP_TESTS_INSTALL_PATH=/tmp"
1214 "-DCMAKE_VERBOSE_MAKEFILE=ON")
1215 #:modules '((guix build cmake-build-system)
1216 ((guix build gnu-build-system) #:prefix gnu:)
1217 (guix build utils))
1218 #:phases
1219 #~(modify-phases %standard-phases
1220 (add-after 'unpack 'do-not-install-tests
1221 (lambda _
1222 (substitute* "tests/CMakeLists.txt"
1223 (("/etc/dbus-1/system.d") "/tmp"))))
1224 (replace 'check
1225 (lambda* (#:rest args)
1226 (apply (assoc-ref gnu:%standard-phases 'check)
1227 #:test-target "sdbus-c++-unit-tests" args))))))
1228 (native-inputs (list googletest pkg-config))
1229 (inputs (list expat))
1230 (propagated-inputs (list elogind)) ;required by sdbus-c++.pc
1231 (home-page "https://github.com/Kistler-Group/sdbus-cpp")
1232 (synopsis "High-level C++ D-Bus library")
1233 (description "@code{sdbus-c++} is a high-level C++ D-Bus library designed
1234to provide easy-to-use yet powerful API in modern C++. It adds another layer
1235of abstraction on top of @code{sd-bus}, the C D-Bus implementation by systemd.")
1236 (license license:lgpl2.1+)))
1237
1238(define-public appstream-glib
1239 (package
1240 (name "appstream-glib")
1241 (version "0.8.3")
1242 (source (origin
1243 (method url-fetch)
1244 (uri (string-append "https://people.freedesktop.org/~hughsient/"
1245 "appstream-glib/releases/"
1246 "appstream-glib-" version ".tar.xz"))
1247 (sha256
1248 (base32
1249 "04fgm19p4qf970dvj5phk1bml8zwai1wc78mmghsdz30qmj40xc4"))))
1250 (build-system meson-build-system)
1251 (native-inputs
1252 (list gettext-minimal
1253 `(,glib "bin") ;for glib-compile-resources
1254 gsettings-desktop-schemas ;for ‘org.gnome.system.proxy’
1255 pkg-config))
1256 (propagated-inputs
1257 (list gcab ;for .pc file
1258 gdk-pixbuf ;same
1259 `(,util-linux "lib"))) ;libuuid, for .pc file
1260 (inputs
1261 (list curl
1262 gperf
1263 gtk+
1264 json-glib
1265 libarchive
1266 glib))
1267 (arguments
1268 (list
1269 #:configure-flags
1270 #~(list "-Ddep11=false"
1271 "-Dintrospection=false" ; avoid g-ir-scanner dependency
1272 "-Drpm=false")
1273 #:phases
1274 #~(modify-phases %standard-phases
1275 (add-after 'unpack 'patch-tests
1276 (lambda _
1277 (substitute* "libappstream-glib/as-self-test.c"
1278 (("g_test_add_func.*as_test_store_local_appdata_func);") ""))))
1279 (add-before 'check 'set-home
1280 (lambda _
1281 ;; Some tests want write access there.
1282 (setenv "HOME" "/tmp"))))))
1283 (home-page "https://github.com/hughsie/appstream-glib")
1284 (synopsis "Library for reading and writing AppStream metadata")
1285 (description
1286 "This library provides objects and helper methods to help
1287reading and writing
1288@uref{https://www.freedesktop.org/wiki/Distributions/AppStream,AppStream}
1289metadata.")
1290 (license license:lgpl2.1+)))
1291
1292(define perl-net-dbus
1293 (package
1294 (name "perl-net-dbus")
1295 (version "1.2.0")
1296 (source
1297 (origin
1298 (method url-fetch)
1299 (uri (string-append "mirror://cpan/authors/id/D/DA/DANBERR/Net-DBus-"
1300 version ".tar.gz"))
1301 (sha256
1302 (base32
1303 "1g0w8i5scmh7kfy9mmvv8q326627qf38z26mvczmn8x1yjgar8g7"))))
1304 (build-system perl-build-system)
1305 (native-inputs
1306 (list pkg-config perl-test-pod perl-test-pod-coverage))
1307 (inputs
1308 (list dbus))
1309 (propagated-inputs
1310 (list perl-xml-twig))
1311 (home-page "https://metacpan.org/release/Net-DBus")
1312 (synopsis "Extension for the DBus bindings")
1313 (description "@code{Net::DBus} provides a Perl XS API to the DBus
1314inter-application messaging system. The Perl API covers the core base level
1315of the DBus APIs, not concerning itself yet with the GLib or QT wrappers.")
1316 (license license:perl-license)))
1317
1318(define perl-net-dbus-glib
1319 (package
1320 (name "perl-net-dbus-glib")
1321 (version "0.33.0")
1322 (source
1323 (origin
1324 (method url-fetch)
1325 (uri (string-append "mirror://cpan/authors/id/D/DA/DANBERR/"
1326 "Net-DBus-GLib-" version ".tar.gz"))
1327 (sha256
1328 (base32
1329 "1z4mbv8z0rad604xahijpg5szzi8qak07hbahh230z4jf96fkxvj"))))
1330 (build-system perl-build-system)
1331 (native-inputs
1332 (list pkg-config))
1333 (inputs
1334 (list dbus-glib))
1335 (home-page "https://metacpan.org/release/Net-DBus-GLib")
1336 (synopsis "Perl extension for the DBus GLib bindings")
1337 (description "This package provides an extension to the @code{Net::DBus}
1338module allowing integration with the GLib mainloop. To integrate with the
1339main loop, simply get a connection to the bus via the methods in
1340@code{Net::DBus::GLib} rather than the usual @code{Net::DBus} module. Every
1341other API remains the same.")
1342 (license license:gpl2+)))
1343
1344(define-public template-glib
1345 (package
1346 (name "template-glib")
1347 (version "3.40.0")
1348 (source (origin
1349 (method url-fetch)
1350 (uri (string-append "mirror://gnome/sources/" name "/"
1351 (version-major+minor version) "/"
1352 name "-" version ".tar.xz"))
1353 (sha256
1354 (base32
1355 "1mfgrz01an5jlvrwn49s8dgll6yxz8jchnn5dbv6vk14dhpyqcz5"))))
1356 (build-system meson-build-system)
1357 (inputs (list gettext-minimal glib))
1358 (native-inputs
1359 (list bison
1360 flex
1361 `(,glib "bin") ;for glib-mkenums
1362 gobject-introspection ;for g-ir-scanner
1363 pkg-config
1364 vala))
1365 (home-page "https://gitlab.gnome.org/GNOME/template-glib")
1366 (synopsis "Library for template expansion")
1367 (description
1368 "Template-GLib is a library to help you generate text based on a template and
1369user defined state. Template-GLib does not use a language runtime, so it is
1370safe to use from any GObject-Introspectable language.
1371
1372Template-GLib allows you to access properties on GObjects as well as call
1373simple methods via GObject-Introspection.")
1374 (license license:lgpl2.1+)))
1375
1376(define-public xdg-dbus-proxy
1377 (package
1378 (name "xdg-dbus-proxy")
1379 (version "0.1.9")
1380 (source (origin
1381 (method url-fetch)
1382 (uri (string-append "https://github.com/flatpak/xdg-dbus-proxy"
1383 "/releases/download/" version
1384 "/xdg-dbus-proxy-" version ".tar.xz"))
1385 (sha256
1386 (base32
1387 "1vfw251lzs6p10k5dkq97fm3z247aj21wccxf35b6fzchsjxsl2l"))))
1388 (build-system meson-build-system)
1389 (native-inputs
1390 (list pkg-config
1391 ;; For tests.
1392 dbus
1393 ;; These are required to build the manual.
1394 docbook-xml-4.3
1395 docbook-xsl
1396 libxml2
1397 libxslt))
1398 (inputs
1399 (list glib))
1400 (home-page "https://github.com/flatpak/xdg-dbus-proxy")
1401 (synopsis "D-Bus connection proxy")
1402 (description
1403 "xdg-dbus-proxy is a filtering proxy for D-Bus connections. It can be
1404used to create D-Bus sockets inside a Linux container that forwards requests
1405to the host system, optionally with filters applied.")
1406 (license license:lgpl2.1+)))
1407
1408(define-public dbus-test-runner
1409 (package
1410 (name "dbus-test-runner")
1411 (version "19.04.0")
1412 (source (origin
1413 (method url-fetch)
1414 (uri (string-append
1415 "https://launchpad.net/dbus-test-runner/"
1416 (version-major+minor version) "/" version
1417 "/+download/dbus-test-runner-" version ".tar.gz"))
1418 (sha256
1419 (base32
1420 "0xnbay58xn0hav208mdsg8dd176w57dcpw1q2k0g5fh9v7xk4nk4"))))
1421 (build-system gnu-build-system)
1422 (arguments
1423 (list
1424 #:phases
1425 #~(modify-phases %standard-phases
1426 (add-before 'configure 'fix-test-paths
1427 (lambda* (#:key inputs #:allow-other-keys)
1428 (substitute* "Makefile.in"
1429 (("#!/bin/bah")
1430 (string-append "#!" (search-input-file inputs "bin/bash"))))
1431 (substitute* "tests/Makefile.in"
1432 (("/bin/sh") (search-input-file inputs "bin/sh"))
1433 (("#!/bin/bash")
1434 (string-append "#!" (search-input-file inputs "bin/bash")))
1435 (("echo cat")
1436 (string-append "echo " (search-input-file inputs "bin/cat")))
1437 (("/bin/true") (search-input-file inputs "bin/true"))))))))
1438 (inputs
1439 (list gtk+ glib dbus-glib))
1440 (native-inputs
1441 (list `(,glib "bin")
1442 intltool
1443 pkg-config
1444 ;; following used for tests
1445 python
1446 python-dbusmock
1447 xorg-server-for-tests))
1448 (home-page "https://launchpad.net/dbus-test-runner")
1449 (synopsis "Run a executables under a new DBus session for testing")
1450 (description "A small little utility to run a couple of executables under a
1451new DBus session for testing.")
1452 (license license:gpl3)))
1453
1454(define-public libdex
1455 (package
1456 (name "libdex")
1457 (version "1.0.0")
1458 (source
1459 (origin
1460 (method url-fetch)
1461 (uri (string-append "mirror://gnome/sources/" name "/"
1462 (version-major+minor version) "/"
1463 name "-" version ".tar.xz"))
1464 (sha256
1465 (base32 "0pbz41dpp1mw1gkzw598p4qahsvnaqijwhhh5vhi8vkrndfmr3vv"))))
1466 (build-system meson-build-system)
1467 (arguments
1468 (list #:configure-flags #~'("-D" "docs=true")))
1469 (native-inputs
1470 (list gobject-introspection
1471 gi-docgen
1472 pkg-config
1473 vala))
1474 (inputs
1475 (list glib
1476 libsoup))
1477 (home-page "https://gitlab.gnome.org/GNOME/libdex")
1478 (synopsis "Library for future-based programming with glib")
1479 (description
1480 "Dex provides Future-based programming for GLib-based applications.
1481
1482It both integrates with and brings new features for application and library
1483authors who want to manage concurrent code.
1484
1485Dex also provides Fibers which allow writing synchronous looking code in C
1486that uses asynchronous and future-based APIs.")
1487 (license license:lgpl2.1+)))
1488
1489(define-public cppgir
1490 (package
1491 (name "cppgir")
1492 (version "2.0")
1493 (source
1494 (origin
1495 (method git-fetch)
1496 (uri
1497 (git-reference
1498 (url "https://gitlab.com/mnauw/cppgir")
1499 (commit (string-append "v" version))))
1500 (file-name (git-file-name name version))
1501 (sha256
1502 (base32 "0cj4myqzb28hgb7zlxlba9y8n4ysxkvv2y9wy6f7ps58mr18h7bl"))))
1503 (build-system cmake-build-system)
1504 (arguments
1505 (list
1506 #:tests? #f ; fail with GLib-CRITICAL errors
1507 #:configure-flags
1508 #~(list "-DINTERNAL_EXPECTED=OFF")))
1509 (inputs (list boost fmt expected-lite))
1510 (home-page "https://gitlab.com/mnauw/cppgir")
1511 (synopsis "C++ bindings generator for GObject introspection")
1512 (description "cppgir processes @file{.gir} files derived from GObject
1513introspection annotations into a set of C++ files defining suitable
1514namespaces, classes and other types that together form a C++ binding.")
1515 (license license:expat)))
1516
1517;; telegram-desktop requires a more recent version of cppgir
1518(define-public cppgir-for-telegram-desktop
1519 (let ((commit "2a7d9cef68202a29d5e8a679ce9519c76eb26dc3")
1520 (revision "1"))
1521 (package
1522 (inherit cppgir)
1523 (name "cppgir-for-telegram-desktop")
1524 (version (git-version "2.0" revision commit))
1525 (source
1526 (origin
1527 (method git-fetch)
1528 (uri
1529 (git-reference
1530 (url "https://gitlab.com/mnauw/cppgir")
1531 (commit commit)))
1532 (file-name (git-file-name name version))
1533 (sha256
1534 (base32 "1zi4zfzk0cnyz3ahynr1ann1hdxkgfy6mxqpryvdywbx12fag92f")))))))