glib.scm 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
  4. ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
  5. ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2021 Mark H Weaver <mhw@netris.org>
  6. ;;; Copyright © 2016, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  7. ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
  8. ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
  9. ;;; Copyright © 2017 Petter <petter@mykolab.ch>
  10. ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  11. ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
  12. ;;; Copyright © 2019, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  13. ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
  14. ;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
  15. ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
  16. ;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
  17. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  18. ;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
  19. ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
  20. ;;;
  21. ;;; This file is part of GNU Guix.
  22. ;;;
  23. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  24. ;;; under the terms of the GNU General Public License as published by
  25. ;;; the Free Software Foundation; either version 3 of the License, or (at
  26. ;;; your option) any later version.
  27. ;;;
  28. ;;; GNU Guix is distributed in the hope that it will be useful, but
  29. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  30. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  31. ;;; GNU General Public License for more details.
  32. ;;;
  33. ;;; You should have received a copy of the GNU General Public License
  34. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  35. (define-module (gnu packages glib)
  36. #:use-module (gnu packages)
  37. #:use-module (gnu packages backup)
  38. #:use-module (gnu packages base)
  39. #:use-module (gnu packages bash)
  40. #:use-module (gnu packages bison)
  41. #:use-module (gnu packages boost)
  42. #:use-module (gnu packages check)
  43. #:use-module (gnu packages compression)
  44. #:use-module (gnu packages docbook)
  45. #:use-module (gnu packages documentation)
  46. #:use-module (gnu packages elf)
  47. #:use-module (gnu packages enlightenment)
  48. #:use-module (gnu packages file)
  49. #:use-module (gnu packages flex)
  50. #:use-module (gnu packages gettext)
  51. #:use-module (gnu packages gnome)
  52. #:use-module (gnu packages graphviz)
  53. #:use-module (gnu packages gperf)
  54. #:use-module (gnu packages gtk)
  55. #:use-module (gnu packages libffi)
  56. #:use-module (gnu packages linux)
  57. #:use-module (gnu packages m4)
  58. #:use-module (gnu packages nettle)
  59. #:use-module (gnu packages pcre)
  60. #:use-module (gnu packages package-management)
  61. #:use-module (gnu packages perl)
  62. #:use-module (gnu packages perl-check)
  63. #:use-module (gnu packages popt)
  64. #:use-module (gnu packages pkg-config)
  65. #:use-module (gnu packages python)
  66. #:use-module (gnu packages python-xyz)
  67. #:use-module (gnu packages web)
  68. #:use-module (gnu packages xml)
  69. #:use-module (gnu packages xorg)
  70. #:use-module (guix build-system gnu)
  71. #:use-module (guix build-system cmake)
  72. #:use-module (guix build-system meson)
  73. #:use-module (guix build-system perl)
  74. #:use-module (guix build-system python)
  75. #:use-module (guix download)
  76. #:use-module ((guix licenses) #:prefix license:)
  77. #:use-module (guix packages)
  78. #:use-module (guix utils)
  79. #:use-module (guix gexp)
  80. #:use-module (srfi srfi-26)
  81. #:use-module ((srfi srfi-1) #:hide (zip))
  82. ;; Export variables up-front to allow circular dependency with the 'xorg'
  83. ;; module.
  84. #:export (dbus
  85. glib
  86. gobject-introspection
  87. dbus-glib
  88. intltool
  89. itstool
  90. libsigc++
  91. glibmm
  92. telepathy-glib
  93. perl-net-dbus
  94. perl-net-dbus-glib))
  95. (define dbus
  96. (package
  97. (name "dbus")
  98. (version "1.12.20")
  99. (source (origin
  100. (method url-fetch)
  101. (uri (string-append
  102. "https://dbus.freedesktop.org/releases/dbus/dbus-"
  103. version ".tar.gz"))
  104. (sha256
  105. (base32
  106. "1zp5gpx61v1cpqf2zwb1cidhp9xylvw49d3zydkxqk6b1qa20xpp"))
  107. (patches (search-patches "dbus-helper-search-path.patch"))))
  108. (build-system gnu-build-system)
  109. (arguments
  110. '(#:configure-flags
  111. (list
  112. ;; Install the system bus socket under /var.
  113. "--localstatedir=/var"
  114. ;; Install the session bus socket under /tmp.
  115. "--with-session-socket-dir=/tmp"
  116. ;; Build shared libraries only.
  117. "--disable-static"
  118. ;; Use /etc/dbus-1 for system-wide config.
  119. ;; Look for configuration file under
  120. ;; /etc/dbus-1. This is notably required by
  121. ;; 'dbus-daemon-launch-helper', which looks for
  122. ;; the 'system.conf' file in that place,
  123. ;; regardless of what '--config-file' was
  124. ;; passed to 'dbus-daemon' on the command line;
  125. ;; see <https://bugs.freedesktop.org/show_bug.cgi?id=92458>.
  126. "--sysconfdir=/etc")
  127. #:phases
  128. (modify-phases %standard-phases
  129. (replace 'install
  130. (lambda _
  131. ;; Don't try to create /var and /etc.
  132. (invoke "make"
  133. "localstatedir=/tmp/dummy"
  134. "sysconfdir=/tmp/dummy"
  135. "install"))))))
  136. (native-inputs
  137. `(("pkg-config" ,pkg-config)
  138. ;; Dependencies to generate the doc.
  139. ("docbook-xml" ,docbook-xml-4.4)
  140. ("docbook-xsl" ,docbook-xsl)
  141. ("doxygen" ,doxygen)
  142. ("xmlto" ,xmlto)
  143. ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
  144. ("libxslt" ,libxslt)
  145. ("yelp-tools" ,yelp-tools)))
  146. (inputs
  147. `(("expat" ,expat)
  148. ;; Add a dependency on libx11 so that 'dbus-launch' has support for
  149. ;; '--autolaunch'.
  150. ("libx11" ,libx11)))
  151. (outputs '("out" "doc")) ;22 MiB of HTML doc
  152. (home-page "https://www.freedesktop.org/wiki/Software/dbus/")
  153. (synopsis "Message bus for inter-process communication (IPC)")
  154. (description
  155. "D-Bus is a message bus system, a simple way for applications to
  156. talk to one another. In addition to interprocess communication, D-Bus
  157. helps coordinate process lifecycle; it makes it simple and reliable to
  158. code a \"single instance\" application or daemon, and to launch
  159. applications and daemons on demand when their services are needed.
  160. D-Bus supplies both a system daemon (for events such as \"new hardware
  161. device added\" or \"printer queue changed\") and a
  162. per-user-login-session daemon (for general IPC needs among user
  163. applications). Also, the message bus is built on top of a general
  164. one-to-one message passing framework, which can be used by any two apps
  165. to communicate directly (without going through the message bus
  166. daemon). Currently the communicating applications are on one computer,
  167. or through unencrypted TCP/IP suitable for use behind a firewall with
  168. shared NFS home directories.")
  169. (license license:gpl2+))) ; or Academic Free License 2.1
  170. (define glib
  171. (package
  172. (name "glib")
  173. (version "2.68.3")
  174. (source
  175. (origin
  176. (method url-fetch)
  177. (uri
  178. (string-append "mirror://gnome/sources/"
  179. name "/" (string-take version 4) "/"
  180. name "-" version ".tar.xz"))
  181. (sha256
  182. (base32 "0f1iprj7v0b5wn9njj39dkl25g6filfs7i4ybk20jq821k1a7qg7"))
  183. (patches
  184. (search-patches "glib-appinfo-watch.patch"
  185. "glib-skip-failing-test.patch"))
  186. (modules '((guix build utils)))
  187. (snippet
  188. '(begin
  189. (substitute* "tests/spawn-test.c"
  190. (("/bin/sh") "sh"))
  191. #t))))
  192. (build-system meson-build-system)
  193. (outputs '("out" ;libraries, locales, etc
  194. "static" ;static libraries
  195. "bin")) ;executables; depends on Python
  196. (arguments
  197. `(#:disallowed-references
  198. (,tzdata-for-tests
  199. ;; Verify glib-mkenums, gtester, ... use the cross-compiled
  200. ;; python.
  201. ,@(if (%current-target-system)
  202. (map (cut gexp-input <> #:native? #t)
  203. `(,(this-package-native-input "python")
  204. ,(this-package-native-input "python-wrapper")))
  205. '()))
  206. #:configure-flags '("--default-library=both"
  207. "-Dman=true"
  208. "-Dselinux=disabled")
  209. #:phases
  210. (modify-phases %standard-phases
  211. ;; Needed to pass the test phase on slower ARM and i686 machines.
  212. (add-after 'unpack 'increase-test-timeout
  213. (lambda _
  214. (substitute* "meson.build"
  215. (("(test_timeout.*) = ([[:digit:]]+)" all first second)
  216. (string-append first " = " second "0")))))
  217. (add-after 'unpack 'disable-failing-tests
  218. (lambda _
  219. (with-directory-excursion "glib/tests"
  220. (substitute* '("unix.c" "utils.c")
  221. (("[ \t]*g_test_add_func.*;") "")))
  222. (with-directory-excursion "gio/tests"
  223. (substitute* '("contenttype.c" "gdbus-address-get-session.c"
  224. "gdbus-peer.c" "appinfo.c" "desktop-app-info.c")
  225. (("[ \t]*g_test_add_func.*;") "")))
  226. ,@(if (let ((system (or (%current-target-system)
  227. (%current-system))))
  228. (or (string-prefix? "i686-" system)
  229. (string-prefix? "i586-" system)))
  230. ;; Add the 'volatile' qualifier for doubles to avoid excess
  231. ;; precision, which leads to test failures:
  232. ;; <https://gitlab.gnome.org/GNOME/glib/-/issues/820>.
  233. '((substitute* "glib/tests/timer.c"
  234. (("gdouble elapsed")
  235. "volatile gdouble elapsed")))
  236. '())
  237. #t))
  238. ;; Python references are not being patched in patch-phase of build,
  239. ;; despite using python-wrapper as input. So we patch them manually.
  240. ;;
  241. ;; These python scripts are both used during build and installed,
  242. ;; so at first, use a python from 'native-inputs', not 'inputs'. When
  243. ;; cross-compiling, the 'patch-shebangs' phase will replace
  244. ;; the native python with a python from 'inputs'.
  245. (add-after 'unpack 'patch-python-references
  246. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  247. (substitute* '("gio/gdbus-2.0/codegen/gdbus-codegen.in"
  248. "glib/gtester-report.in"
  249. "gobject/glib-genmarshal.in"
  250. "gobject/glib-mkenums.in")
  251. (("@PYTHON@")
  252. (search-input-file (or native-inputs inputs)
  253. (string-append
  254. "/bin/python"
  255. ,(version-major+minor
  256. (package-version python))))))))
  257. (add-before 'check 'pre-check
  258. (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
  259. ;; For tests/gdatetime.c.
  260. (setenv "TZDIR"
  261. (search-input-directory (or native-inputs inputs)
  262. "share/zoneinfo"))
  263. ;; Some tests want write access there.
  264. (setenv "HOME" (getcwd))
  265. (setenv "XDG_CACHE_HOME" (getcwd))
  266. #t))
  267. (add-after 'install 'move-static-libraries
  268. (lambda* (#:key outputs #:allow-other-keys)
  269. (let ((out (assoc-ref outputs "out"))
  270. (static (assoc-ref outputs "static")))
  271. (mkdir-p (string-append static "/lib"))
  272. (for-each (lambda (file)
  273. (link file (string-append static "/lib/"
  274. (basename file)))
  275. (delete-file file))
  276. (find-files (string-append out "/lib") "\\.a$")))))
  277. ;; Meson does not permit the bindir to be outside of prefix.
  278. (add-after 'install 'move-bin
  279. (lambda* (#:key outputs #:allow-other-keys)
  280. (let* ((out (assoc-ref outputs "out"))
  281. (bin (assoc-ref outputs "bin")))
  282. (mkdir-p bin)
  283. (rename-file
  284. (string-append out "/bin")
  285. (string-append bin "/bin"))
  286. ;; Do not refer to "bindir", which points to "${prefix}/bin".
  287. ;; We don't patch "bindir" to point to "$bin/bin", because that
  288. ;; would create a reference cycle between the "out" and "bin"
  289. ;; outputs.
  290. (substitute*
  291. (list
  292. (string-append out "/lib/pkgconfig/gio-2.0.pc")
  293. (string-append out "/lib/pkgconfig/glib-2.0.pc"))
  294. (("bindir=\\$\\{prefix\\}/bin") "")
  295. (("=\\$\\{bindir\\}/") "="))
  296. #t))))))
  297. (native-inputs
  298. `(("docbook-xsl" ,docbook-xsl)
  299. ("gettext" ,gettext-minimal)
  300. ("m4" ,m4) ; for installing m4 macros
  301. ("perl" ,perl) ; needed by GIO tests
  302. ("pkg-config" ,pkg-config)
  303. ("python" ,python) ; For 'patch-python-references
  304. ("python-wrapper" ,python-wrapper)
  305. ("tzdata" ,tzdata-for-tests) ; for tests/gdatetime.c
  306. ("xmllint" ,libxml2)
  307. ("xsltproc" ,libxslt)))
  308. (inputs
  309. `(("bash-completion" ,bash-completion)
  310. ;; "python", "python-wrapper" and "bash-minimal"
  311. ;; are for the 'patch-shebangs' phase, to make
  312. ;; sure the installed scripts end up with a correct shebang
  313. ;; when cross-compiling.
  314. ("python" ,python)
  315. ("python-wrapper" ,python-wrapper)
  316. ("bash-minimal" ,bash-minimal)
  317. ("dbus" ,dbus)
  318. ("libelf" ,libelf)))
  319. (propagated-inputs
  320. `(("libffi" ,libffi) ; in the Requires.private field of gobject-2.0.pc
  321. ("pcre" ,pcre) ; in the Requires.private field of glib-2.0.pc
  322. ("util-linux" ,util-linux "lib") ;for libmount
  323. ("zlib" ,zlib))) ; in the Requires.private field of glib-2.0.pc
  324. (native-search-paths
  325. ;; This variable is not really "owned" by GLib, but several related
  326. ;; packages refer to it: gobject-introspection's tools use it as a search
  327. ;; path for .gir files, and it's also a search path for schemas produced
  328. ;; by 'glib-compile-schemas'.
  329. (list
  330. (search-path-specification
  331. (variable "XDG_DATA_DIRS")
  332. (files '("share")))
  333. ;; To load extra gio modules from glib-networking, etc.
  334. (search-path-specification
  335. (variable "GIO_EXTRA_MODULES")
  336. (files '("lib/gio/modules")))))
  337. (search-paths native-search-paths)
  338. (synopsis "Low-level core library for GNOME projects")
  339. (description "GLib provides the core application building blocks for
  340. libraries and applications written in C. It provides the core object system
  341. used in GNOME, the main loop implementation, and a large set of utility
  342. functions for strings and common data structures.")
  343. (home-page "https://wiki.gnome.org/Projects/GLib")
  344. (license license:lgpl2.1+)))
  345. (define-public glib-with-documentation
  346. ;; glib's doc must be built in a separate package since it requires gtk-doc,
  347. ;; which in turn depends on glib.
  348. (package/inherit glib
  349. ;; (properties (alist-delete 'hidden? (package-properties glib)))
  350. (properties '((hidden? . #t)))
  351. (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference
  352. (native-inputs
  353. `(("docbook-xml-4.2" ,docbook-xml-4.2)
  354. ("docbook-xml-4.5" ,docbook-xml)
  355. ("gtk-doc" ,gtk-doc) ; for the doc
  356. ("libxml2" ,libxml2)
  357. ,@(package-native-inputs glib)))
  358. (arguments
  359. (substitute-keyword-arguments (package-arguments glib)
  360. ((#:configure-flags flags ''())
  361. `(cons "-Dgtk_doc=true" ,flags))
  362. ((#:phases phases)
  363. `(modify-phases ,phases
  364. (add-after 'unpack 'patch-docbook-xml
  365. (lambda* (#:key inputs #:allow-other-keys)
  366. (with-directory-excursion "docs"
  367. (substitute* (find-files "." "\\.xml$")
  368. (("http://www.oasis-open.org/docbook/xml/4\\.5/")
  369. (string-append (assoc-ref inputs "docbook-xml-4.5")
  370. "/xml/dtd/docbook/"))
  371. (("http://www.oasis-open.org/docbook/xml/4\\.2/")
  372. (string-append (assoc-ref inputs "docbook-xml-4.2")
  373. "/xml/dtd/docbook/"))))
  374. #t))
  375. (add-after 'install 'move-doc
  376. (lambda* (#:key outputs #:allow-other-keys)
  377. (let* ((out (assoc-ref outputs "out"))
  378. (doc (assoc-ref outputs "doc"))
  379. (html (string-append "/share/gtk-doc")))
  380. (mkdir-p (string-append doc "/share"))
  381. (rename-file
  382. (string-append out html)
  383. (string-append doc html))
  384. #t)))))))))
  385. (define (python-extension-suffix python triplet)
  386. "Determine the suffix for C extensions for PYTHON when compiled
  387. for TRIPLET."
  388. ;; python uses strings like 'x86_64-linux-gnu' instead of
  389. ;; 'x86_64-unknown-linux-gnu'.
  390. (define normalised-system
  391. (string-replace-substring triplet "-unknown-" "-"))
  392. (define major.minor (version-major+minor (package-version python)))
  393. (define majorminor (string-delete #\. major.minor))
  394. (string-append
  395. ;; If guix' python package used "--with-pydebug", a #\d would
  396. ;; need to be added, likewise "--with-pymalloc" and "--with-wide-unicode"
  397. ;; would require a #\m and #\u, see cpython's configure.ac.
  398. ".cpython-" majorminor "-" normalised-system
  399. (if (target-mingw? triplet)
  400. ".dll"
  401. ".so")))
  402. (define (correct-library-name-phase python name)
  403. "Return a G-exp evaluating to a phase renaming the python extension NAME
  404. from what Meson thinks its name should be to what python expects its name
  405. to be. NAME must not include the platform-specific suffix. This can only
  406. be used when cross-compiling."
  407. #~(lambda _
  408. (define name #$name)
  409. (define native-suffix
  410. #$(python-extension-suffix python
  411. (nix-system->gnu-triplet (%current-system))))
  412. (define target-suffix
  413. #$(python-extension-suffix python (%current-target-system)))
  414. (define native-name
  415. (string-append name native-suffix))
  416. (define target-name
  417. (string-append name target-suffix))
  418. (rename-file native-name target-name)))
  419. (define gobject-introspection
  420. (package
  421. (name "gobject-introspection")
  422. (version "1.66.1")
  423. (source (origin
  424. (method url-fetch)
  425. (uri (string-append "mirror://gnome/sources/"
  426. "gobject-introspection/" (version-major+minor version)
  427. "/gobject-introspection-" version ".tar.xz"))
  428. (sha256
  429. (base32 "078n0q7b6z682mf4irclrksm73cyixq295mqnqifl9plwmgaai6x"))
  430. (patches (search-patches
  431. "gobject-introspection-cc.patch"
  432. "gobject-introspection-girepository.patch"
  433. "gobject-introspection-absolute-shlib-path.patch"))))
  434. (build-system meson-build-system)
  435. (arguments
  436. `(,@(if (%current-target-system)
  437. `(#:configure-flags
  438. '("-Dgi_cross_use_prebuilt_gi=true"
  439. ;; Building introspection data requires running binaries
  440. ;; for ‘host’ on ‘build’, so don't do that.
  441. ;;
  442. ;; TODO: it would be nice to have introspection data anyways.
  443. ;; Would copying the introspection data from a native
  444. ;; 'gobject-introspection' work, or is introspection data
  445. ;; architecture-dependent?
  446. "-Dbuild_introspection_data=false"))
  447. '())
  448. #:phases
  449. ,#~
  450. (modify-phases %standard-phases
  451. #$@(if (%current-target-system)
  452. ;; 'typelibs' is undefined.
  453. `((add-after 'unpack 'set-typelibs
  454. (lambda _
  455. (substitute* "meson.build"
  456. (("\\bsources: typelibs\\b")
  457. "sources: []")))))
  458. '())
  459. (add-after 'unpack 'do-not-use-/usr/bin/env
  460. (lambda _
  461. (substitute* "tools/g-ir-tool-template.in"
  462. (("#!@PYTHON_CMD@")
  463. (string-append "#!" (which "python3"))))
  464. #t))
  465. #$@(if (%current-target-system)
  466. ;; Meson gives python extensions an incorrect name, see
  467. ;; <https://github.com/mesonbuild/meson/issues/7049>.
  468. #~((add-after 'install 'rename-library
  469. #$(correct-library-name-phase
  470. (this-package-input "python")
  471. #~(string-append #$output
  472. "/lib/gobject-introspection/giscanner"
  473. "/_giscanner"))))
  474. #~()))))
  475. (native-inputs
  476. `(("glib" ,glib "bin")
  477. ("pkg-config" ,pkg-config)
  478. ;; TODO(core-updates): Unconditionally place "flex" and "bison"
  479. ;; in 'native-inputs'.
  480. ,@(if (%current-target-system)
  481. `(("bison" ,bison)
  482. ("flex" ,flex))
  483. '())))
  484. (inputs
  485. `(,@(if (%current-target-system)
  486. `(("python" ,python))
  487. `(("bison" ,bison)
  488. ("flex" ,flex)
  489. ("python" ,python-wrapper)))
  490. ("zlib" ,zlib)))
  491. (propagated-inputs
  492. `(("glib" ,glib)
  493. ;; In practice, GIR users will need libffi when using
  494. ;; gobject-introspection.
  495. ("libffi" ,libffi)))
  496. (native-search-paths
  497. (list
  498. (search-path-specification
  499. (variable "GI_TYPELIB_PATH")
  500. (files '("lib/girepository-1.0")))))
  501. (search-paths native-search-paths)
  502. (synopsis "GObject introspection tools and libraries")
  503. (description "GObject introspection is a middleware layer between
  504. C libraries (using GObject) and language bindings. The C library can be scanned
  505. at compile time and generate metadata files, in addition to the actual native
  506. C library. Then language bindings can read this metadata and automatically
  507. provide bindings to call into the C library.")
  508. (home-page "https://wiki.gnome.org/Projects/GObjectIntrospection")
  509. (license
  510. (list
  511. ;; For library.
  512. license:lgpl2.0+
  513. ;; For tools.
  514. license:gpl2+))))
  515. (define intltool
  516. (package
  517. (name "intltool")
  518. (version "0.51.0")
  519. (source (origin
  520. (method url-fetch)
  521. (uri (string-append "https://launchpad.net/intltool/trunk/"
  522. version "/+download/intltool-"
  523. version ".tar.gz"))
  524. (patches (search-patches "intltool-perl-compatibility.patch"))
  525. (sha256
  526. (base32
  527. "1karx4sb7bnm2j67q0q74hspkfn6lqprpy5r99vkn5bb36a4viv7"))))
  528. (build-system gnu-build-system)
  529. (inputs
  530. `(("file" ,file)))
  531. (propagated-inputs
  532. `(;; Propagate gettext because users expect it to be there, and so does
  533. ;; the `intltool-update' script.
  534. ("gettext" ,gettext-minimal)
  535. ("perl-xml-parser" ,perl-xml-parser)
  536. ("perl" ,perl)))
  537. (arguments
  538. `(#:phases
  539. (modify-phases %standard-phases
  540. (add-after 'unpack 'patch-file-references
  541. (lambda* (#:key inputs #:allow-other-keys)
  542. (let ((file (assoc-ref inputs "file")))
  543. (substitute* "intltool-update.in"
  544. (("`file") (string-append "`" file "/bin/file")))
  545. #t))))))
  546. (home-page "https://launchpad.net/intltool/+download")
  547. (synopsis "Tools to centralise translations of different file formats")
  548. (description
  549. "Intltool is a set of tools to centralise translations of many different
  550. file formats using GNU gettext-compatible PO files.
  551. The intltool collection can be used to do these things:
  552. Extract translatable strings from various source files (.xml.in,
  553. glade, .desktop.in, .server.in, .oaf.in).
  554. Collect the extracted strings together with messages from traditional
  555. source files (.c, .h) in po/$(PACKAGE).pot.
  556. Merge back the translations from .po files into .xml, .desktop and
  557. oaf files. This merge step will happen at build resp. installation time.")
  558. (license license:gpl2+)))
  559. (define itstool
  560. (package
  561. (name "itstool")
  562. (version "2.0.6")
  563. (source (origin
  564. (method url-fetch)
  565. (uri (string-append "http://files.itstool.org/itstool/itstool-"
  566. version ".tar.bz2"))
  567. (sha256
  568. (base32
  569. "1acjgf8zlyk7qckdk19iqaca4jcmywd7vxjbcs1mm6kaf8icqcv2"))))
  570. (build-system gnu-build-system)
  571. (inputs
  572. `(("libxml2" ,libxml2)
  573. ("python-libxml2" ,python-libxml2)
  574. ("python" ,python)))
  575. (arguments
  576. '(#:phases
  577. (modify-phases %standard-phases
  578. (add-after 'install 'wrap-program
  579. (lambda* (#:key outputs #:allow-other-keys)
  580. (let ((prog (string-append (assoc-ref outputs "out")
  581. "/bin/itstool")))
  582. (wrap-program prog
  583. `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH"))))
  584. #t))))))
  585. (home-page "http://www.itstool.org")
  586. (synopsis "Tool to translate XML documents with PO files")
  587. (description
  588. "ITS Tool allows you to translate your XML documents with PO files, using
  589. rules from the W3C Internationalization Tag Set (ITS) to determine what to
  590. translate and how to separate it into PO file messages.
  591. PO files are the standard translation format for GNU and other Unix-like
  592. systems. They present translatable information as discrete messages, allowing
  593. each message to be translated independently. In contrast to whole-page
  594. translation, translating with a message-based format like PO means you can
  595. easily track changes to the source document down to the paragraph. When new
  596. strings are added or existing strings are modified, you only need to update the
  597. corresponding messages.
  598. ITS Tool is designed to make XML documents translatable through PO files by
  599. applying standard ITS rules, as well as extension rules specific to ITS Tool.
  600. ITS also provides an industry standard way for authors to override translation
  601. information in their documents, such as whether a particular element should be
  602. translated.")
  603. (license license:gpl3+)))
  604. (define dbus-glib
  605. (package
  606. (name "dbus-glib")
  607. (version "0.110")
  608. (source (origin
  609. (method url-fetch)
  610. (uri
  611. (string-append "https://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
  612. version ".tar.gz"))
  613. (sha256
  614. (base32
  615. "09g8swvc95bk1z6j8sw463p2v0dqmgm2zjfndf7i8sbcyq67dr3w"))))
  616. (build-system gnu-build-system)
  617. (arguments
  618. (if (%current-target-system)
  619. `(#:configure-flags
  620. ;; Run a native 'dbus-binding-tool' instead of a cross-compiled
  621. ;; 'dbus-binding-tool' when cross-compiling.
  622. ,#~(list
  623. (string-append
  624. "--with-dbus-binding-tool="
  625. #+(file-append this-package "/bin/dbus-binding-tool"))))
  626. '()))
  627. (propagated-inputs ; according to dbus-glib-1.pc
  628. `(("dbus" ,dbus)
  629. ("glib" ,glib)))
  630. (inputs
  631. `(("expat" ,expat)))
  632. (native-inputs
  633. `(("glib" ,glib "bin")
  634. ("pkg-config" ,pkg-config)))
  635. (home-page "https://dbus.freedesktop.org/doc/dbus-glib/")
  636. (synopsis "D-Bus GLib bindings")
  637. (description
  638. "GLib bindings for D-Bus. The package is obsolete and superseded
  639. by GDBus included in Glib.")
  640. (license license:gpl2))) ; or Academic Free License 2.1
  641. (define libsigc++
  642. (package
  643. (name "libsigc++")
  644. (version "3.0.6")
  645. (source (origin
  646. (method url-fetch)
  647. (uri (string-append "mirror://gnome/sources/libsigc++/"
  648. (version-major+minor version) "/"
  649. name "-" version ".tar.xz"))
  650. (sha256
  651. (base32
  652. "1kn57b039lg20182lnchl1ys27vf34brn43f895cal8nc7sdq3mp"))))
  653. (build-system meson-build-system)
  654. (outputs '("out" "doc"))
  655. (arguments
  656. `(#:configure-flags
  657. (list
  658. "-Dbuild-documentation=true")
  659. #:phases
  660. (modify-phases %standard-phases
  661. (add-after 'unpack 'patch-docbook-xml
  662. (lambda* (#:key inputs #:allow-other-keys)
  663. (with-directory-excursion "docs"
  664. (substitute* (find-files "." "\\.xml$")
  665. (("http://www.oasis-open.org/docbook/xml/4\\.1\\.2/")
  666. (string-append (assoc-ref inputs "docbook-xml")
  667. "/xml/dtd/docbook/"))))
  668. #t))
  669. (add-after 'install 'move-doc
  670. (lambda* (#:key outputs #:allow-other-keys)
  671. (let* ((out (assoc-ref outputs "out"))
  672. (doc (assoc-ref outputs "doc")))
  673. (mkdir-p (string-append doc "/share"))
  674. (rename-file
  675. (string-append out "/share/doc")
  676. (string-append doc "/share/doc"))
  677. #t))))))
  678. (native-inputs
  679. `(("docbook-xml" ,docbook-xml-4.1.2)
  680. ("docbook-xsl" ,docbook-xsl)
  681. ("dot" ,graphviz)
  682. ("doxygen" ,doxygen)
  683. ("m4" ,m4)
  684. ("mm-common" ,mm-common)
  685. ("perl" ,perl)
  686. ("pkg-config" ,pkg-config)
  687. ("xmllint" ,libxml2)
  688. ("xsltproc" ,libxslt)))
  689. (inputs
  690. `(("boost" ,boost)))
  691. (home-page "https://libsigcplusplus.github.io/libsigcplusplus/")
  692. (synopsis "Type-safe callback system for standard C++")
  693. (description
  694. "Libsigc++ implements a type-safe callback system for standard C++. It
  695. allows you to define signals and to connect those signals to any callback
  696. function, either global or a member function, regardless of whether it is
  697. static or virtual.
  698. It also contains adaptor classes for connection of dissimilar callbacks and
  699. has an ease of use unmatched by other C++ callback libraries.")
  700. (license license:lgpl3+)))
  701. (define-public libsigc++-2
  702. (package
  703. (inherit libsigc++)
  704. (name "libsigc++")
  705. (version "2.9.3")
  706. (source
  707. (origin
  708. (method url-fetch)
  709. (uri
  710. (string-append "mirror://gnome/sources/libsigc++/"
  711. (version-major+minor version)
  712. "/libsigc++-" version ".tar.xz"))
  713. (sha256
  714. (base32 "0zq963d0sss82q62fdfjs7l9iwbdch51albck18cb631ml0v7y8b"))))
  715. (build-system gnu-build-system)
  716. (arguments
  717. `(#:phases
  718. (modify-phases %standard-phases
  719. (add-after 'unpack 'patch-docbook-xml
  720. (lambda* (#:key inputs #:allow-other-keys)
  721. (with-directory-excursion "docs"
  722. (substitute* (find-files "." "\\.xml$")
  723. (("http://www.oasis-open.org/docbook/xml/4\\.1\\.2/")
  724. (string-append (assoc-ref inputs "docbook-xml")
  725. "/xml/dtd/docbook/"))))
  726. #t))
  727. (add-after 'install 'move-doc
  728. (lambda* (#:key outputs #:allow-other-keys)
  729. (let* ((out (assoc-ref outputs "out"))
  730. (doc (assoc-ref outputs "doc")))
  731. (mkdir-p (string-append doc "/share"))
  732. (rename-file
  733. (string-append out "/share/doc")
  734. (string-append doc "/share/doc"))
  735. #t))))))))
  736. (define glibmm
  737. (package
  738. (name "glibmm")
  739. (version "2.68.0")
  740. (source (origin
  741. (method url-fetch)
  742. (uri (string-append "mirror://gnome/sources/glibmm/"
  743. (version-major+minor version)
  744. "/glibmm-" version ".tar.xz"))
  745. (sha256
  746. (base32
  747. "0xgkyhb2876mcyyib5rk3ya9aingyj68h02nl22yvkhx35rqbwy1"))))
  748. (build-system meson-build-system)
  749. (outputs '("out" "doc"))
  750. (arguments
  751. `(#:configure-flags
  752. (list
  753. "-Dbuild-documentation=true")
  754. #:phases
  755. (modify-phases %standard-phases
  756. (add-after 'unpack 'disable-failing-tests
  757. (lambda _
  758. (substitute* "tests/meson.build"
  759. ;; This test uses /etc/fstab as an example file to read
  760. ;; from; disable it.
  761. (("[ \t]*.*giomm_simple.*$") "")
  762. ;; This test does a DNS lookup, and then expects to be able
  763. ;; to open a TLS session; just skip it.
  764. (("[ \t]*.*giomm_tls_client.*$") ""))
  765. #t))
  766. (add-after 'install 'move-doc
  767. (lambda* (#:key outputs #:allow-other-keys)
  768. (let* ((out (assoc-ref outputs "out"))
  769. (doc (assoc-ref outputs "doc")))
  770. (mkdir-p (string-append doc "/share"))
  771. (rename-file
  772. (string-append out "/share/doc")
  773. (string-append doc "/share/doc"))
  774. #t))))))
  775. (native-inputs
  776. `(("dot" ,graphviz)
  777. ("doxygen" ,doxygen)
  778. ("glib:bin" ,glib "bin")
  779. ("m4" ,m4)
  780. ("mm-common" ,mm-common)
  781. ("perl" ,perl)
  782. ("pkg-config" ,pkg-config)
  783. ("xsltproc" ,libxslt)))
  784. (propagated-inputs
  785. `(("libsigc++" ,libsigc++)
  786. ("glib" ,glib)))
  787. (home-page "https://gtkmm.org/")
  788. (synopsis "C++ interface to the GLib library")
  789. (description
  790. "Glibmm provides a C++ programming interface to the part of GLib that are
  791. useful for C++.")
  792. (license license:lgpl2.1+)))
  793. (define-public glibmm-2.64
  794. (package
  795. (inherit glibmm)
  796. (name "glibmm")
  797. (version "2.64.5")
  798. (source
  799. (origin
  800. (method url-fetch)
  801. (uri
  802. (string-append "mirror://gnome/sources/glibmm/"
  803. (version-major+minor version)
  804. "/glibmm-" version ".tar.xz"))
  805. (sha256
  806. (base32 "11m37sbx0i18cl17d0fkq0bik4bbzlb5n8kcl651jhci5ipci3sh"))))
  807. (propagated-inputs
  808. `(("libsigc++" ,libsigc++-2)
  809. ,@(package-propagated-inputs glibmm)))))
  810. (define-public python2-pygobject-2
  811. (package
  812. (name "python2-pygobject")
  813. ;; This was the last version to declare the 2.0 platform number, i.e. its
  814. ;; pkg-config files were named pygobject-2.0.pc
  815. (version "2.28.7")
  816. (source
  817. (origin
  818. (method url-fetch)
  819. (uri (string-append "mirror://gnome/sources/pygobject/"
  820. (version-major+minor version)
  821. "/pygobject-" version ".tar.xz"))
  822. (sha256
  823. (base32
  824. "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv"))
  825. (patches (search-patches "python2-pygobject-2-deprecation.patch"))))
  826. (build-system gnu-build-system)
  827. (native-inputs
  828. `(("which" ,which)
  829. ("glib-bin" ,glib "bin") ;for tests: glib-compile-schemas
  830. ("pkg-config" ,pkg-config)
  831. ("dbus" ,dbus))) ;for tests
  832. (inputs
  833. `(("python" ,python-2)
  834. ("glib" ,glib)
  835. ("python2-pycairo" ,python2-pycairo)
  836. ("gobject-introspection" ,gobject-introspection)))
  837. (propagated-inputs
  838. `(("libffi" ,libffi))) ;mentioned in pygobject-2.0.pc
  839. (arguments
  840. `(#:tests? #f ;segfaults during tests
  841. #:configure-flags '("LIBS=-lcairo-gobject")))
  842. (home-page "https://pypi.org/project/PyGObject/")
  843. (synopsis "Python bindings for GObject")
  844. (description
  845. "Python bindings for GLib, GObject, and GIO.")
  846. (license license:lgpl2.1+)))
  847. (define-public python-pygobject
  848. (package
  849. (name "python-pygobject")
  850. (version "3.40.1")
  851. (source
  852. (origin
  853. (method url-fetch)
  854. (uri (string-append "mirror://gnome/sources/pygobject/"
  855. (version-major+minor version)
  856. "/pygobject-" version ".tar.xz"))
  857. (sha256
  858. (base32
  859. "0d80g5kgf2i9cginyhalvb7ibfk9g30yilqzmcsw6h6byj8xbih0"))
  860. (modules '((guix build utils)))
  861. (snippet
  862. '(begin
  863. ;; We disable these tests in a snippet so that they are inherited
  864. ;; by the Python 2 variant which is built differently.
  865. (with-directory-excursion "tests"
  866. ;; FIXME: These tests require Gdk and/or Gtk 4.
  867. (for-each delete-file
  868. '("test_atoms.py" "test_overrides_gtk.py"))
  869. #t)))))
  870. (build-system meson-build-system)
  871. (arguments
  872. `(#:phases
  873. (modify-phases %standard-phases
  874. (replace 'check
  875. (lambda* (#:key tests? #:allow-other-keys)
  876. (when tests?
  877. ;; The default 90 seconds can be too low on slower machines.
  878. (invoke "meson" "test" "--timeout-multiplier" "5")))))))
  879. (native-inputs
  880. `(("glib-bin" ,glib "bin")
  881. ("pkg-config" ,pkg-config)
  882. ("python-pytest" ,python-pytest)))
  883. (inputs
  884. `(("python" ,python)
  885. ("python-pycairo" ,python-pycairo)
  886. ("gobject-introspection" ,gobject-introspection)))
  887. (propagated-inputs
  888. ;; pygobject-3.0.pc refers to all these.
  889. `(("glib" ,glib)
  890. ("libffi" ,libffi)))
  891. ;; For finding typelib files, since gobject-introscpetion isn't propagated.
  892. (native-search-paths (package-native-search-paths gobject-introspection))
  893. (home-page "https://live.gnome.org/PyGObject")
  894. (synopsis "Python bindings for GObject")
  895. (description
  896. "Python bindings for GLib, GObject, and GIO.")
  897. (license license:lgpl2.1+)
  898. (properties `((python2-variant . ,(delay python2-pygobject))))))
  899. (define-public python2-pygobject
  900. (let ((base (strip-python2-variant python-pygobject)))
  901. (package/inherit base
  902. (name "python2-pygobject")
  903. ;; Note: We use python-build-system here, because Meson only supports
  904. ;; Python 3, and needs PYTHONPATH etc set up correctly, which makes it
  905. ;; difficult to use for Python 2 projects.
  906. (build-system python-build-system)
  907. (arguments
  908. `(#:python ,python-2
  909. #:phases
  910. (modify-phases %standard-phases
  911. (add-after 'unpack 'delete-broken-tests
  912. (lambda _
  913. ;; FIXME: this test freezes and times out.
  914. (delete-file "tests/test_mainloop.py")
  915. ;; FIXME: this test fails with this kind of error:
  916. ;; AssertionError: <Handlers.SIG_IGN: 1> != <built-in function default_int_handler
  917. (delete-file "tests/test_ossig.py")
  918. #t)))))
  919. (inputs
  920. `(("python-pycairo" ,python2-pycairo)
  921. ("gobject-introspection" ,gobject-introspection)))
  922. (native-inputs
  923. `(("glib-bin" ,glib "bin")
  924. ("pkg-config" ,pkg-config)
  925. ("python-pytest" ,python2-pytest))))))
  926. (define-public perl-glib
  927. (package
  928. (name "perl-glib")
  929. (version "1.3292")
  930. (source (origin
  931. (method url-fetch)
  932. (uri (string-append
  933. "mirror://cpan/authors/id/X/XA/XAOC/Glib-"
  934. version ".tar.gz"))
  935. (sha256
  936. (base32
  937. "1q5075d6v2g5sm675hyzrcpxsrh09z83crfci8b0wl3jwmnz0frg"))))
  938. (build-system perl-build-system)
  939. (native-inputs
  940. `(("perl-extutils-depends" ,perl-extutils-depends)
  941. ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
  942. (propagated-inputs
  943. `(("glib" ,glib)))
  944. (home-page "https://metacpan.org/release/Glib")
  945. (synopsis "Perl wrappers for the GLib utility and Object libraries")
  946. (description "This module provides perl access to GLib and GLib's GObject
  947. libraries. GLib is a portability and utility library; GObject provides a
  948. generic type system with inheritance and a powerful signal system. Together
  949. these libraries are used as the foundation for many of the libraries that make
  950. up the Gnome environment, and are used in many unrelated projects.")
  951. (license license:lgpl2.1+)))
  952. (define-public perl-glib-object-introspection
  953. (package
  954. (name "perl-glib-object-introspection")
  955. (version "0.049")
  956. (source
  957. (origin
  958. (method url-fetch)
  959. (uri (string-append "mirror://cpan/authors/id/X/XA/XAOC/"
  960. "Glib-Object-Introspection-" version ".tar.gz"))
  961. (sha256
  962. (base32 "0mxg6pz8qfyipw0ypr54alij0c4adzg94f62702b2a6hkp5jhij6"))))
  963. (build-system perl-build-system)
  964. (native-inputs
  965. `(("perl-extutils-depends" ,perl-extutils-depends)
  966. ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
  967. (propagated-inputs
  968. `(("gobject-introspection" ,gobject-introspection)
  969. ("perl-cairo-gobject" ,perl-cairo-gobject)
  970. ("perl-glib" ,perl-glib)))
  971. (home-page "https://metacpan.org/dist/Glib-Object-Introspection")
  972. (synopsis "Dynamically create Perl language bindings")
  973. (description "Glib::Object::Introspection uses the gobject-introspection and
  974. libffi projects to dynamically create Perl bindings for a wide variety of
  975. libraries. Examples include gtk+, webkit, libsoup and many more.")
  976. (license license:lgpl2.1+)))
  977. (define telepathy-glib
  978. (package
  979. (name "telepathy-glib")
  980. (version "0.24.1")
  981. (source
  982. (origin
  983. (method url-fetch)
  984. (uri
  985. (string-append
  986. "https://telepathy.freedesktop.org/releases/telepathy-glib/"
  987. "telepathy-glib-" version ".tar.gz"))
  988. (sha256
  989. (base32
  990. "1symyzbjmxvksn2ifdkk50lafjm2llf2sbmky062gq2pz3cg23cy"))
  991. (patches
  992. (list
  993. (search-patch "telepathy-glib-channel-memory-leak.patch")
  994. ;; Don't use the same test name for multiple tests.
  995. ;; <https://bugs.freedesktop.org/show_bug.cgi?id=92245>
  996. (origin
  997. (method url-fetch)
  998. (uri "https://bugs.freedesktop.org/attachment.cgi?id=118608")
  999. (file-name (string-append "telepathy-glib-duplicate-tests.patch"))
  1000. (sha256
  1001. (base32
  1002. "0z261fwrszxb28ccg3hsg9rizig4s84zvwmx6y31a4pyv7bvs5w3")))))))
  1003. (build-system gnu-build-system)
  1004. (arguments
  1005. '(#:configure-flags '("--enable-vala-bindings")
  1006. ;; '../tools/glib-*.py' generate files but the target dependencies are
  1007. ;; (presumably) not fully specified in the makefile, leading to
  1008. ;; parallel build errors like:
  1009. ;;
  1010. ;; EOFError: EOF read where object expected
  1011. ;; make[2]: *** [Makefile:1906: _gen/register-dbus-glib-marshallers-body.h] Error 1
  1012. #:parallel-build? #f
  1013. #:phases
  1014. (modify-phases %standard-phases
  1015. (add-after 'unpack 'disable-failing-tests
  1016. (lambda _
  1017. ;; None of the tests below are able to find the org.gtk.vfs.Daemon
  1018. ;; service file provided by gvfs.
  1019. (substitute* "tests/dbus/Makefile.in"
  1020. (("test-contacts\\$\\(EXEEXT\\)") "")
  1021. (("test-file-transfer-channel\\$\\(EXEEXT\\)") "")
  1022. (("test-stream-tube\\$\\(EXEEXT\\)") ""))
  1023. #t)))))
  1024. (native-inputs
  1025. `(("glib" ,glib "bin") ; uses glib-mkenums
  1026. ("gobject-introspection" ,gobject-introspection)
  1027. ("pkg-config" ,pkg-config)
  1028. ("python" ,python-2)
  1029. ("vala" ,vala)
  1030. ("xsltproc" ,libxslt)))
  1031. (propagated-inputs
  1032. ;; There are all in the Requires.private field of telepathy-glib.pc.
  1033. `(("dbus" ,dbus)
  1034. ("dbus-glib" ,dbus-glib)
  1035. ("glib" ,glib)))
  1036. (home-page "https://telepathy.freedesktop.org/wiki/")
  1037. (synopsis "GLib Real-time communications framework over D-Bus")
  1038. (description "Telepathy is a flexible, modular communications framework
  1039. that enables real-time communication over D-Bus via pluggable protocol
  1040. backends. Telepathy is a communications service that can be accessed by
  1041. many applications simultaneously.
  1042. This package provides the library for GLib applications.")
  1043. (license license:lgpl2.1+)))
  1044. (define-public dbus-c++
  1045. (package
  1046. (name "dbus-c++")
  1047. (version "0.9.0")
  1048. (source (origin
  1049. (method url-fetch)
  1050. (uri
  1051. (string-append
  1052. "mirror://sourceforge/dbus-cplusplus/dbus-c%2B%2B/"
  1053. version "/libdbus-c%2B%2B-" version ".tar.gz"))
  1054. (file-name (string-append name "-" version ".tar.gz"))
  1055. (patches (search-patches "dbus-c++-gcc-compat.patch"
  1056. "dbus-c++-threading-mutex.patch"))
  1057. (sha256
  1058. (base32
  1059. "0qafmy2i6dzx4n1dqp6pygyy6gjljnb7hwjcj2z11c1wgclsq4dw"))))
  1060. (build-system gnu-build-system)
  1061. (propagated-inputs
  1062. `(("dbus" ,dbus))) ;mentioned in the pkg-config file
  1063. (inputs
  1064. `(("efl" ,efl)
  1065. ("expat" ,expat)
  1066. ("glib" ,glib)))
  1067. (native-inputs
  1068. `(("pkg-config" ,pkg-config)))
  1069. (arguments
  1070. `(;; The 'configure' machinery fails to detect that it needs -lpthread.
  1071. #:configure-flags (list "LDFLAGS=-lpthread")
  1072. #:phases
  1073. (modify-phases %standard-phases
  1074. (add-before 'configure 'add-missing-header
  1075. (lambda _
  1076. (substitute* "include/dbus-c++/eventloop-integration.h"
  1077. (("#include <errno.h>")
  1078. "#include <errno.h>\n#include <unistd.h>"))
  1079. #t)))))
  1080. (synopsis "D-Bus API for C++")
  1081. (description "This package provides D-Bus client API bindings for the C++
  1082. programming language. It also provides the @command{dbusxx-xml2cpp} and
  1083. @command{dbusxx-introspect} commands.")
  1084. (home-page "https://sourceforge.net/projects/dbus-cplusplus/")
  1085. (license license:lgpl2.1+)))
  1086. (define-public dbus-cxx
  1087. (package
  1088. (name "dbus-cxx")
  1089. (version "0.12.0")
  1090. (source (origin
  1091. (method url-fetch)
  1092. (uri (string-append "mirror://sourceforge/dbus-cxx/dbus-cxx/"
  1093. version "/dbus-cxx-" version ".tar.gz"))
  1094. (sha256
  1095. (base32
  1096. "1acsgpkd9v7b9jdc79ijmh9dbdfrzgkwkaff518i3zpk7y6g5mzw"))))
  1097. (build-system cmake-build-system)
  1098. (arguments
  1099. `(#:configure-flags '("-DENABLE_TESTS=ON"
  1100. "-DENABLE_TOOLS=ON"
  1101. "-DENABLE_GLIBMM=ON")))
  1102. (inputs `(("dbus" ,dbus)
  1103. ("libsigc++" ,libsigc++)
  1104. ("glibmm" ,glibmm)
  1105. ("python" ,python)
  1106. ("popt" ,popt)
  1107. ("expat" ,expat)))
  1108. (native-inputs `(("pkg-config" ,pkg-config)
  1109. ("m4" ,m4)))
  1110. (synopsis "C++ wrapper for dbus")
  1111. (description "Dbus-cxx is a C++ wrapper for dbus.\n
  1112. It exposes the C API to allow direct manipulation and
  1113. relies on sigc++ to provide an Oriented Object interface.\n
  1114. This package provide 2 utils:
  1115. @enumerate
  1116. @item @command{dbus-cxx-xml2cpp} to generate proxy and adapter
  1117. @item @command{dbus-cxx-introspect} to introspect a dbus interface
  1118. @end enumerate
  1119. Some codes examples can be find at:
  1120. @url{https://dbus-cxx.github.io/examples.html}")
  1121. (home-page "https://dbus-cxx.github.io/")
  1122. (license license:gpl3)))
  1123. (define-public appstream-glib
  1124. (package
  1125. (name "appstream-glib")
  1126. (version "0.7.18")
  1127. (source (origin
  1128. (method url-fetch)
  1129. (uri (string-append "https://people.freedesktop.org/~hughsient/"
  1130. "appstream-glib/releases/"
  1131. "appstream-glib-" version ".tar.xz"))
  1132. (sha256
  1133. (base32
  1134. "00j0kkgf224nzmrha72g8pd72mymhph7vaisj35i4ffy7cpd47na"))))
  1135. (build-system meson-build-system)
  1136. (native-inputs
  1137. `(("gettext" ,gettext-minimal)
  1138. ("gsettings" ,gsettings-desktop-schemas) ; for ‘org.gnome.system.proxy’
  1139. ("glib:bin" ,glib "bin") ; for glib-compile-resources
  1140. ("pkg-config" ,pkg-config)))
  1141. (propagated-inputs
  1142. `(("gcab" ,gcab) ; for .pc file
  1143. ("gdk-pixbuf" ,gdk-pixbuf) ; for .pc file
  1144. ("libuuid" ,util-linux "lib"))) ; for .pc file
  1145. (inputs
  1146. `(("glib" ,glib)
  1147. ("gperf" ,gperf)
  1148. ("gtk+" ,gtk+)
  1149. ("json-glib" ,json-glib)
  1150. ("libarchive" ,libarchive)
  1151. ("libsoup" ,libsoup)))
  1152. (arguments
  1153. `(#:configure-flags
  1154. (list "-Ddep11=false"
  1155. "-Dintrospection=false" ; avoid g-ir-scanner dependency
  1156. "-Drpm=false"
  1157. "-Dstemmer=false")
  1158. #:phases
  1159. (modify-phases %standard-phases
  1160. (add-after 'unpack 'patch-tests
  1161. (lambda _
  1162. (substitute* "libappstream-glib/as-self-test.c"
  1163. (("g_test_add_func.*as_test_store_local_appdata_func);") ""))
  1164. #t))
  1165. (add-before 'check 'set-home
  1166. (lambda _
  1167. ;; Some tests want write access there.
  1168. (setenv "HOME" "/tmp"))))))
  1169. (home-page "https://github.com/hughsie/appstream-glib")
  1170. (synopsis "Library for reading and writing AppStream metadata")
  1171. (description "This library provides objects and helper methods to help
  1172. reading and writing @uref{https://www.freedesktop.org/wiki/Distributions/AppStream,AppStream}
  1173. metadata.")
  1174. (license license:lgpl2.1+)))
  1175. (define perl-net-dbus
  1176. (package
  1177. (name "perl-net-dbus")
  1178. (version "1.2.0")
  1179. (source
  1180. (origin
  1181. (method url-fetch)
  1182. (uri (string-append "mirror://cpan/authors/id/D/DA/DANBERR/Net-DBus-"
  1183. version ".tar.gz"))
  1184. (sha256
  1185. (base32
  1186. "1g0w8i5scmh7kfy9mmvv8q326627qf38z26mvczmn8x1yjgar8g7"))))
  1187. (build-system perl-build-system)
  1188. (native-inputs
  1189. `(("pkg-config" ,pkg-config)
  1190. ("perl-test-pod" ,perl-test-pod)
  1191. ("perl-test-pod-coverage" ,perl-test-pod-coverage)))
  1192. (inputs
  1193. `(("dbus" ,dbus)))
  1194. (propagated-inputs
  1195. `(("perl-xml-twig" ,perl-xml-twig)))
  1196. (home-page "https://metacpan.org/release/Net-DBus")
  1197. (synopsis "Extension for the DBus bindings")
  1198. (description "@code{Net::DBus} provides a Perl XS API to the DBus
  1199. inter-application messaging system. The Perl API covers the core base level
  1200. of the DBus APIs, not concerning itself yet with the GLib or QT wrappers.")
  1201. (license license:perl-license)))
  1202. (define perl-net-dbus-glib
  1203. (package
  1204. (name "perl-net-dbus-glib")
  1205. (version "0.33.0")
  1206. (source
  1207. (origin
  1208. (method url-fetch)
  1209. (uri (string-append "mirror://cpan/authors/id/D/DA/DANBERR/"
  1210. "Net-DBus-GLib-" version ".tar.gz"))
  1211. (sha256
  1212. (base32
  1213. "1z4mbv8z0rad604xahijpg5szzi8qak07hbahh230z4jf96fkxvj"))))
  1214. (build-system perl-build-system)
  1215. (native-inputs
  1216. `(("pkg-config" ,pkg-config)))
  1217. (inputs
  1218. `(("dbus-glib" ,dbus-glib)))
  1219. (home-page "https://metacpan.org/release/Net-DBus-GLib")
  1220. (synopsis "Perl extension for the DBus GLib bindings")
  1221. (description "This package provides an extension to the @code{Net::DBus}
  1222. module allowing integration with the GLib mainloop. To integrate with the
  1223. main loop, simply get a connection to the bus via the methods in
  1224. @code{Net::DBus::GLib} rather than the usual @code{Net::DBus} module. Every
  1225. other API remains the same.")
  1226. (license license:gpl2+)))
  1227. (define-public template-glib
  1228. (package
  1229. (name "template-glib")
  1230. (version "3.34.0")
  1231. (source (origin
  1232. (method url-fetch)
  1233. (uri (string-append "mirror://gnome/sources/" name "/"
  1234. (version-major+minor version) "/"
  1235. name "-" version ".tar.xz"))
  1236. (sha256
  1237. (base32
  1238. "1z9xkin5fyfh071ma9y045jcw83hgx33dfbjraw6cxk0qdmfysr1"))))
  1239. (build-system meson-build-system)
  1240. (arguments
  1241. `(#:configure-flags '("-D" "enable_gtk_doc=true")))
  1242. (inputs
  1243. `(("gettext" ,gettext-minimal)
  1244. ("glib" ,glib)
  1245. ("gobject-introspection" ,gobject-introspection)))
  1246. (native-inputs
  1247. `(("bison" ,bison)
  1248. ("flex" ,flex)
  1249. ("glib:bin" ,glib "bin") ;; For glib-mkenums
  1250. ("gtk-doc" ,gtk-doc/stable)
  1251. ("pkg-config" ,pkg-config)
  1252. ("vala" ,vala)))
  1253. (home-page "https://gitlab.gnome.org/GNOME/template-glib")
  1254. (synopsis "Library for template expansion")
  1255. (description
  1256. "Template-GLib is a library to help you generate text based on a template and
  1257. user defined state. Template-GLib does not use a language runtime, so it is
  1258. safe to use from any GObject-Introspectable language.
  1259. Template-GLib allows you to access properties on GObjects as well as call
  1260. simple methods via GObject-Introspection.")
  1261. (license license:lgpl2.1+)))
  1262. (define-public xdg-dbus-proxy
  1263. (package
  1264. (name "xdg-dbus-proxy")
  1265. (version "0.1.2")
  1266. (source (origin
  1267. (method url-fetch)
  1268. (uri (string-append "https://github.com/flatpak/xdg-dbus-proxy"
  1269. "/releases/download/" version
  1270. "/xdg-dbus-proxy-" version ".tar.xz"))
  1271. (sha256
  1272. (base32
  1273. "03sj1h0c2l08xa8phw013fnxr4fgav7l2mkjhzf9xk3dykwxcj8p"))))
  1274. (build-system gnu-build-system)
  1275. (native-inputs
  1276. `(("pkg-config" ,pkg-config)
  1277. ;; For tests.
  1278. ("dbus" ,dbus)
  1279. ;; These are required to build the manual.
  1280. ("docbook-xml" ,docbook-xml-4.3)
  1281. ("docbook-xsl" ,docbook-xsl)
  1282. ("libxml2" ,libxml2)
  1283. ("xsltproc" ,libxslt)))
  1284. (inputs
  1285. `(("glib" ,glib)))
  1286. (home-page "https://github.com/flatpak/xdg-dbus-proxy")
  1287. (synopsis "D-Bus connection proxy")
  1288. (description
  1289. "xdg-dbus-proxy is a filtering proxy for D-Bus connections. It can be
  1290. used to create D-Bus sockets inside a Linux container that forwards requests
  1291. to the host system, optionally with filters applied.")
  1292. (license license:lgpl2.1+)))
  1293. (define-public dbus-test-runner
  1294. (package
  1295. (name "dbus-test-runner")
  1296. (version "19.04.0")
  1297. (source (origin
  1298. (method url-fetch)
  1299. (uri (string-append
  1300. "https://launchpad.net/dbus-test-runner/"
  1301. (version-major+minor version) "/" version
  1302. "/+download/dbus-test-runner-" version ".tar.gz"))
  1303. (sha256
  1304. (base32
  1305. "0xnbay58xn0hav208mdsg8dd176w57dcpw1q2k0g5fh9v7xk4nk4"))))
  1306. (build-system gnu-build-system)
  1307. (arguments
  1308. `(#:phases
  1309. (modify-phases %standard-phases
  1310. (add-before 'configure 'fix-test-paths
  1311. ;; add missing space
  1312. (lambda* (#:key outputs #:allow-other-keys)
  1313. (substitute* "Makefile.in"
  1314. (("#!/bin/bash") (string-append "#!" (which "bash"))))
  1315. (substitute* "tests/Makefile.in"
  1316. (("/bin/sh") (which "sh"))
  1317. (("#!/bin/bash") (string-append "#!" (which "bash")))
  1318. (("echo cat") (string-append "echo " (which "cat")))
  1319. (("/bin/true") (which "true")))
  1320. #t)))))
  1321. (inputs
  1322. `(("gtk+" ,gtk+)
  1323. ("glib" ,glib)
  1324. ("dbus-glib" ,dbus-glib)))
  1325. (native-inputs
  1326. `(("glib:bin" ,glib "bin")
  1327. ("intltool" ,intltool)
  1328. ("pkg-config" ,pkg-config)
  1329. ;; following used for tests
  1330. ("python" ,python)
  1331. ("python-dbusmock" ,python-dbusmock)
  1332. ("xvfb" ,xorg-server-for-tests)))
  1333. (home-page "https://launchpad.net/dbus-test-runner")
  1334. (synopsis "Run a executables under a new DBus session for testing")
  1335. (description "A small little utility to run a couple of executables under a
  1336. new DBus session for testing.")
  1337. (license license:gpl3)))