diff options
Diffstat (limited to 'gnu/packages/glib.scm')
-rw-r--r-- | gnu/packages/glib.scm | 818 |
1 files changed, 455 insertions, 363 deletions
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 8ed1e3a944..6373fd0da9 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2021 Mark H Weaver <mhw@netris.org> @@ -11,9 +11,12 @@ ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com> ;;; Copyright © 2019, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org> -;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com> +;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org> ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz> +;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de> +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com> +;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,16 +37,20 @@ #:use-module (gnu packages) #:use-module (gnu packages backup) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages bison) + #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) + #:use-module (gnu packages elf) #:use-module (gnu packages enlightenment) #:use-module (gnu packages file) #:use-module (gnu packages flex) #:use-module (gnu packages gettext) #:use-module (gnu packages gnome) + #:use-module (gnu packages graphviz) #:use-module (gnu packages gperf) #:use-module (gnu packages gtk) #:use-module (gnu packages libffi) @@ -58,7 +65,6 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) - #:use-module (gnu packages selinux) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) @@ -71,6 +77,8 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (srfi srfi-26) #:use-module ((srfi srfi-1) #:hide (zip)) ;; Export variables up-front to allow circular dependency with the 'xorg' @@ -90,7 +98,7 @@ (define dbus (package (name "dbus") - (version "1.12.16") + (version "1.12.20") (source (origin (method url-fetch) (uri (string-append @@ -98,9 +106,8 @@ version ".tar.gz")) (sha256 (base32 - "107ckxaff1cv4q6kmfdi2fb1nlsv03312a7kf6lb4biglhpjv8jl")) - (patches (search-patches "dbus-CVE-2020-12049.patch" - "dbus-helper-search-path.patch")))) + "1zp5gpx61v1cpqf2zwb1cidhp9xylvw49d3zydkxqk6b1qa20xpp")) + (patches (search-patches "dbus-helper-search-path.patch")))) (build-system gnu-build-system) (arguments '(#:configure-flags @@ -170,264 +177,191 @@ shared NFS home directories.") (define glib (package - (name "glib") - (version "2.62.6") - (replacement glib/fixed) - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/" - name "/" (string-take version 4) "/" - name "-" version ".tar.xz")) - (sha256 - (base32 - "174bsmbmcvaw69ff9g60q5sx0fn23rkhqcwqz17h5s7sprps4kqh")) - (patches (search-patches "glib-appinfo-watch.patch" - "glib-tests-timer.patch")) - (modules '((guix build utils))) - (snippet - '(begin - (substitute* "tests/spawn-test.c" - (("/bin/sh") "sh")) - #t)))) - (build-system meson-build-system) - (outputs '("out" ; everything - "bin")) ; glib-mkenums, gtester, etc.; depends on Python - (propagated-inputs - `(("pcre" ,pcre) ; in the Requires.private field of glib-2.0.pc - ("libffi" ,libffi) ; in the Requires.private field of gobject-2.0.pc - ;; These are in the Requires.private field of gio-2.0.pc - ("util-linux" ,util-linux "lib") ;for libmount - ("libselinux" ,libselinux) - ("zlib" ,zlib))) - (native-inputs - `(("gettext" ,gettext-minimal) - ("m4" ,m4) ; for installing m4 macros - ("dbus" ,dbus) ; for GDBus tests - ("pkg-config" ,pkg-config) - ("python" ,python-wrapper) - ("perl" ,perl) ; needed by GIO tests - ("tzdata" ,tzdata-for-tests))) ; for tests/gdatetime.c - (arguments - `(#:disallowed-references (,tzdata-for-tests) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-dbus-launch-path - (lambda* (#:key inputs #:allow-other-keys) - (let ((dbus (assoc-ref inputs "dbus"))) - (substitute* "gio/gdbusaddress.c" - (("command_line = g_strdup_printf \\(\"dbus-launch") - (string-append "command_line = g_strdup_printf (\"" - dbus "/bin/dbus-launch"))) - #t))) - (add-after 'unpack 'patch-gio-launch-desktop - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - ;; See also <https://gitlab.gnome.org/GNOME/glib/issues/1633> - ;; for another future fix. - (substitute* "gio/gdesktopappinfo.c" - (("gio-launch-desktop") - (string-append out "/libexec/gio-launch-desktop"))) - #t))) - ;; TODO: Remove the conditional in the next core-updates cycle. - ;; Needed to build glib on slower ARM nodes. - ,@(if (string-prefix? "arm" (%current-system)) - `((add-after 'unpack 'increase-test-timeout - (lambda _ - (substitute* "meson.build" - (("test_timeout = 60") - "test_timeout = 120") - (("test_timeout_slow = 120") - "test_timeout_slow = 180"))))) - '()) - (add-before 'build 'pre-build - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; For tests/gdatetime.c. - (setenv "TZDIR" - (string-append (assoc-ref inputs "tzdata") - "/share/zoneinfo")) - - ;; Some tests want write access there. - (setenv "HOME" (getcwd)) - (setenv "XDG_CACHE_HOME" (getcwd)) - #t)) - (add-after 'unpack 'disable-failing-tests - (lambda _ - (let ((disable - (lambda (test-file test-paths) - (define pattern+procs - (map (lambda (test-path) - (cons - ;; XXX: only works for single line statements. - (format #f "g_test_add_func.*\"~a\".*" test-path) - (const ""))) - test-paths)) - (substitute test-file pattern+procs))) - (failing-tests - '(("glib/tests/thread.c" - (;; prlimit(2) returns ENOSYS on Linux 2.6.32-5-xen-amd64 - ;; as found on hydra.gnu.org, and strace(1) doesn't - ;; recognize it. - "/thread/thread4")) - - ;; This tries to find programs in FHS directories. - ("glib/tests/utils.c" - ("/utils/find-program")) - - ;; This fails because "glib/tests/echo-script" cannot be - ;; found. - ("glib/tests/spawn-singlethread.c" - ("/gthread/spawn-script")) - - ("glib/tests/timer.c" - (;; fails if compiler optimizations are enabled, which they - ;; are by default. - "/timer/stop")) - - ("gio/tests/gapplication.c" - (;; XXX: proven to be unreliable. See: - ;; <https://bugs.debian.org/756273> - ;; <http://bugs.gnu.org/18445> - "/gapplication/quit" - - ;; XXX: fails randomly for unknown reason. See: - ;; <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00215.html> - "/gapplication/local-actions")) - - ("gio/tests/contenttype.c" - (;; XXX: requires shared-mime-info. - "/contenttype/guess" - "/contenttype/guess_svg_from_data" - "/contenttype/subtype" - "/contenttype/list" - "/contenttype/icon" - "/contenttype/symbolic-icon" - "/contenttype/tree")) - - ("gio/tests/appinfo.c" - (;; XXX: requires update-desktop-database. - "/appinfo/associations")) - - ("gio/tests/desktop-app-info.c" - (;; XXX: requires update-desktop-database. - "/desktop-app-info/delete" - "/desktop-app-info/default" - "/desktop-app-info/fallback" - "/desktop-app-info/lastused" - "/desktop-app-info/search")) - - ("gio/tests/gdbus-peer.c" - (;; Requires /etc/machine-id. - "/gdbus/codegen-peer-to-peer")) - - ("gio/tests/gdbus-address-get-session.c" - (;; Requires /etc/machine-id. - "/gdbus/x11-autolaunch")) - - ("gio/tests/gsocketclient-slow.c" - (;; These tests tries to resolve "localhost", and fails. - "/socket-client/happy-eyeballs/slow" - "/socket-client/happy-eyeballs/cancellation/delayed")) - - ))) - (for-each (lambda (x) (apply disable x)) failing-tests) - #t))) - (replace 'check - (lambda _ - (setenv "MESON_TESTTHREADS" - (number->string (parallel-job-count))) - ;; Do not run tests marked as "flaky". - (invoke "meson" "test" "--no-suite" "flaky"))) - ;; TODO: meson does not permit the bindir to be outside of prefix. - ;; See https://github.com/mesonbuild/meson/issues/2561 - ;; We can remove this once meson is patched. - (add-after 'install 'move-executables - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (bin (assoc-ref outputs "bin"))) - (mkdir-p bin) - (rename-file (string-append out "/bin") - (string-append bin "/bin")) - ;; This one is an implementation detail of glib. - ;; It is wrong that that's in "/bin" in the first place, - ;; but that's what upstream is doing right now. - ;; See <https://gitlab.gnome.org/GNOME/glib/issues/1633>. - (mkdir (string-append out "/libexec")) - (rename-file (string-append bin "/bin/gio-launch-desktop") - (string-append out "/libexec/gio-launch-desktop")) - ;; Do not refer to "bindir", which points to "${prefix}/bin". - ;; We don't patch "bindir" to point to "$bin/bin", because that - ;; would create a reference cycle between the "out" and "bin" - ;; outputs. - (substitute* (list (string-append out "/lib/pkgconfig/gio-2.0.pc") - (string-append out "/lib/pkgconfig/glib-2.0.pc")) - (("bindir=\\$\\{prefix\\}/bin") "") - (("=\\$\\{bindir\\}/") "=")) - #t)))))) - ;; TODO: see above for explanation. - ;; #:configure-flags (list (string-append "--bindir=" - ;; (assoc-ref %outputs "bin") - ;; "/bin")) - - (native-search-paths - ;; This variable is not really "owned" by GLib, but several related - ;; packages refer to it: gobject-introspection's tools use it as a search - ;; path for .gir files, and it's also a search path for schemas produced - ;; by 'glib-compile-schemas'. - (list (search-path-specification - (variable "XDG_DATA_DIRS") - (files '("share"))) - ;; To load extra gio modules from glib-networking, etc. - (search-path-specification - (variable "GIO_EXTRA_MODULES") - (files '("lib/gio/modules"))))) - (search-paths native-search-paths) - (properties '((hidden? . #t))) - - (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME") - (description - "GLib provides data structure handling for C, portability wrappers, -and interfaces for such runtime functionality as an event loop, threads, -dynamic loading, and an object system.") - (home-page "https://developer.gnome.org/glib/") - (license license:lgpl2.1+))) + (name "glib") + (version "2.68.3") + (source + (origin + (method url-fetch) + (uri + (string-append "mirror://gnome/sources/" + name "/" (string-take version 4) "/" + name "-" version ".tar.xz")) + (sha256 + (base32 "0f1iprj7v0b5wn9njj39dkl25g6filfs7i4ybk20jq821k1a7qg7")) + (patches + (search-patches "glib-appinfo-watch.patch" + "glib-skip-failing-test.patch")) + (modules '((guix build utils))) + (snippet + '(begin + (substitute* "tests/spawn-test.c" + (("/bin/sh") "sh")) + #t)))) + (build-system meson-build-system) + (outputs '("out" ;libraries, locales, etc + "static" ;static libraries + "bin")) ;executables; depends on Python + (arguments + `(#:disallowed-references + (,tzdata-for-tests + ;; Verify glib-mkenums, gtester, ... use the cross-compiled + ;; python. + ,@(if (%current-target-system) + (map (cut gexp-input <> #:native? #t) + `(,(this-package-native-input "python") + ,(this-package-native-input "python-wrapper"))) + '())) + #:configure-flags '("--default-library=both" + "-Dman=true" + "-Dselinux=disabled") + #:phases + (modify-phases %standard-phases + ;; Needed to pass the test phase on slower ARM and i686 machines. + (add-after 'unpack 'increase-test-timeout + (lambda _ + (substitute* "meson.build" + (("(test_timeout.*) = ([[:digit:]]+)" all first second) + (string-append first " = " second "0"))))) + (add-after 'unpack 'disable-failing-tests + (lambda _ + (with-directory-excursion "glib/tests" + (substitute* '("unix.c" "utils.c") + (("[ \t]*g_test_add_func.*;") ""))) + (with-directory-excursion "gio/tests" + (substitute* '("contenttype.c" "gdbus-address-get-session.c" + "gdbus-peer.c" "appinfo.c" "desktop-app-info.c") + (("[ \t]*g_test_add_func.*;") ""))) -(define glib/fixed - (package - (inherit glib) - (source (origin - (inherit (package-source glib)) - (patches - (append (search-patches "glib-CVE-2021-27218.patch" - "glib-CVE-2021-27219-01.patch" - "glib-CVE-2021-27219-02.patch" - "glib-CVE-2021-27219-03.patch" - "glib-CVE-2021-27219-04.patch" - "glib-CVE-2021-27219-05.patch" - "glib-CVE-2021-27219-06.patch" - "glib-CVE-2021-27219-07.patch" - "glib-CVE-2021-27219-08.patch" - "glib-CVE-2021-27219-09.patch" - "glib-CVE-2021-27219-10.patch" - "glib-CVE-2021-27219-11.patch" - "glib-CVE-2021-27219-12.patch" - "glib-CVE-2021-27219-13.patch" - "glib-CVE-2021-27219-14.patch" - "glib-CVE-2021-27219-15.patch" - "glib-CVE-2021-27219-16.patch" - "glib-CVE-2021-27219-17.patch" - "glib-CVE-2021-27219-18.patch" - "glib-CVE-2021-28153.patch") - (origin-patches (package-source glib)))))))) + ,@(if (target-x86-32?) + ;; Comment out parts of timer.c that fail on i686 due to + ;; excess precision when building with GCC 10: + ;; <https://gitlab.gnome.org/GNOME/glib/-/issues/820>. + '((substitute* "glib/tests/timer.c" + (("^ g_assert_cmpuint \\(micros.*" all) + (string-append "//" all "\n")) + (("^ g_assert_cmpfloat \\(elapsed, ==.*" all) + (string-append "//" all "\n")))) + '()) + #t)) + ;; Python references are not being patched in patch-phase of build, + ;; despite using python-wrapper as input. So we patch them manually. + ;; + ;; These python scripts are both used during build and installed, + ;; so at first, use a python from 'native-inputs', not 'inputs'. When + ;; cross-compiling, the 'patch-shebangs' phase will replace + ;; the native python with a python from 'inputs'. + (add-after 'unpack 'patch-python-references + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (substitute* '("gio/gdbus-2.0/codegen/gdbus-codegen.in" + "glib/gtester-report.in" + "gobject/glib-genmarshal.in" + "gobject/glib-mkenums.in") + (("@PYTHON@") + (search-input-file (or native-inputs inputs) + (string-append + "/bin/python" + ,(version-major+minor + (package-version python)))))))) + (add-before 'check 'pre-check + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + ;; For tests/gdatetime.c. + (setenv "TZDIR" + (search-input-directory (or native-inputs inputs) + "share/zoneinfo")) + ;; Some tests want write access there. + (setenv "HOME" (getcwd)) + (setenv "XDG_CACHE_HOME" (getcwd)) + #t)) + (add-after 'install 'move-static-libraries + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (static (assoc-ref outputs "static"))) + (mkdir-p (string-append static "/lib")) + (for-each (lambda (file) + (link file (string-append static "/lib/" + (basename file))) + (delete-file file)) + (find-files (string-append out "/lib") "\\.a$"))))) + ;; Meson does not permit the bindir to be outside of prefix. + (add-after 'install 'move-bin + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (assoc-ref outputs "bin"))) + (mkdir-p bin) + (rename-file + (string-append out "/bin") + (string-append bin "/bin")) + ;; Do not refer to "bindir", which points to "${prefix}/bin". + ;; We don't patch "bindir" to point to "$bin/bin", because that + ;; would create a reference cycle between the "out" and "bin" + ;; outputs. + (substitute* + (list + (string-append out "/lib/pkgconfig/gio-2.0.pc") + (string-append out "/lib/pkgconfig/glib-2.0.pc")) + (("bindir=\\$\\{prefix\\}/bin") "") + (("=\\$\\{bindir\\}/") "=")) + #t)))))) + (native-inputs + `(("docbook-xsl" ,docbook-xsl) + ("gettext" ,gettext-minimal) + ("m4" ,m4) ; for installing m4 macros + ("perl" ,perl) ; needed by GIO tests + ("pkg-config" ,pkg-config) + ("python" ,python) ; For 'patch-python-references + ("python-wrapper" ,python-wrapper) + ("tzdata" ,tzdata-for-tests) ; for tests/gdatetime.c + ("xmllint" ,libxml2) + ("xsltproc" ,libxslt))) + (inputs + `(("bash-completion" ,bash-completion) + ;; "python", "python-wrapper" and "bash-minimal" + ;; are for the 'patch-shebangs' phase, to make + ;; sure the installed scripts end up with a correct shebang + ;; when cross-compiling. + ("python" ,python) + ("python-wrapper" ,python-wrapper) + ("bash-minimal" ,bash-minimal) + ("dbus" ,dbus) + ("libelf" ,libelf))) + (propagated-inputs + `(("libffi" ,libffi) ; in the Requires.private field of gobject-2.0.pc + ("pcre" ,pcre) ; in the Requires.private field of glib-2.0.pc + ("util-linux" ,util-linux "lib") ;for libmount + ("zlib" ,zlib))) ; in the Requires.private field of glib-2.0.pc + (native-search-paths + ;; This variable is not really "owned" by GLib, but several related + ;; packages refer to it: gobject-introspection's tools use it as a search + ;; path for .gir files, and it's also a search path for schemas produced + ;; by 'glib-compile-schemas'. + (list + (search-path-specification + (variable "XDG_DATA_DIRS") + (files '("share"))) + ;; To load extra gio modules from glib-networking, etc. + (search-path-specification + (variable "GIO_EXTRA_MODULES") + (files '("lib/gio/modules"))))) + (search-paths native-search-paths) + (synopsis "Low-level core library for GNOME projects") + (description "GLib provides the core application building blocks for +libraries and applications written in C. It provides the core object system +used in GNOME, the main loop implementation, and a large set of utility +functions for strings and common data structures.") + (home-page "https://wiki.gnome.org/Projects/GLib") + (license license:lgpl2.1+))) (define-public glib-with-documentation ;; glib's doc must be built in a separate package since it requires gtk-doc, ;; which in turn depends on glib. (package/inherit glib - (properties (alist-delete 'hidden? (package-properties glib))) + ;; (properties (alist-delete 'hidden? (package-properties glib))) + (properties '((hidden? . #t))) (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference (native-inputs - `(("gtk-doc" ,gtk-doc) ; for the doc - ("docbook-xml" ,docbook-xml) + `(("docbook-xml-4.2" ,docbook-xml-4.2) + ("docbook-xml-4.5" ,docbook-xml) + ("gtk-doc" ,gtk-doc) ; for the doc ("libxml2" ,libxml2) ,@(package-native-inputs glib))) (arguments @@ -436,83 +370,137 @@ dynamic loading, and an object system.") `(cons "-Dgtk_doc=true" ,flags)) ((#:phases phases) `(modify-phases ,phases + (add-after 'unpack 'patch-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "docs" + (substitute* (find-files "." "\\.xml$") + (("http://www.oasis-open.org/docbook/xml/4\\.5/") + (string-append (assoc-ref inputs "docbook-xml-4.5") + "/xml/dtd/docbook/")) + (("http://www.oasis-open.org/docbook/xml/4\\.2/") + (string-append (assoc-ref inputs "docbook-xml-4.2") + "/xml/dtd/docbook/")))) + #t)) (add-after 'install 'move-doc (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (doc (assoc-ref outputs "doc")) - (html (string-append "/share/gtk-doc"))) - (copy-recursively (string-append out html) - (string-append doc html)) - (delete-file-recursively (string-append out html)) + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc")) + (html (string-append "/share/gtk-doc"))) + (mkdir-p (string-append doc "/share")) + (rename-file + (string-append out html) + (string-append doc html)) #t))))))))) -;;; TODO: Merge into glib as a 'static' output on core-updates. -(define-public glib-static - (hidden-package - (package - (inherit glib) - (name "glib-static") - (outputs '("out")) - (arguments - (substitute-keyword-arguments (package-arguments glib) - ((#:configure-flags flags ''()) - `(cons* "--default-library=static" - "-Dselinux=disabled" - "-Dman=false" - "-Dgtk_doc=false" - "-Dinternal_pcre=false" - ,flags)) - ((#:phases phases) - `(modify-phases ,phases - (delete 'move-executables) - (replace 'install - ;; Only install the static libraries. - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib"))) - (for-each (lambda (f) - (install-file f lib)) - (find-files "." "\\.a$")))))))))))) +(define (python-extension-suffix python triplet) + "Determine the suffix for C extensions for PYTHON when compiled +for TRIPLET." + ;; python uses strings like 'x86_64-linux-gnu' instead of + ;; 'x86_64-unknown-linux-gnu'. + (define normalised-system + (string-replace-substring triplet "-unknown-" "-")) + (define major.minor (version-major+minor (package-version python))) + (define majorminor (string-delete #\. major.minor)) + (string-append + ;; If guix' python package used "--with-pydebug", a #\d would + ;; need to be added, likewise "--with-pymalloc" and "--with-wide-unicode" + ;; would require a #\m and #\u, see cpython's configure.ac. + ".cpython-" majorminor "-" normalised-system + (if (target-mingw? triplet) + ".dll" + ".so"))) + +(define (correct-library-name-phase python name) + "Return a G-exp evaluating to a phase renaming the python extension NAME +from what Meson thinks its name should be to what python expects its name +to be. NAME must not include the platform-specific suffix. This can only +be used when cross-compiling." + #~(lambda _ + (define name #$name) + (define native-suffix + #$(python-extension-suffix python + (nix-system->gnu-triplet (%current-system)))) + (define target-suffix + #$(python-extension-suffix python (%current-target-system))) + (define native-name + (string-append name native-suffix)) + (define target-name + (string-append name target-suffix)) + (rename-file native-name target-name))) (define gobject-introspection (package (name "gobject-introspection") - (version "1.62.0") - (source - (origin - (method url-fetch) - (uri - (string-append "mirror://gnome/sources/" - "gobject-introspection/" (version-major+minor version) - "/gobject-introspection-" version ".tar.xz")) - (sha256 - (base32 "18lhglg9v6y83lhqzyifc1z0wrlawzrhzzxx0a3h1g7xaz97xvmi")) - (patches - (search-patches - "gobject-introspection-cc.patch" - "gobject-introspection-girepository.patch" - "gobject-introspection-absolute-shlib-path.patch")))) + (version "1.66.1") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/" + "gobject-introspection/" (version-major+minor version) + "/gobject-introspection-" version ".tar.xz")) + (sha256 + (base32 "078n0q7b6z682mf4irclrksm73cyixq295mqnqifl9plwmgaai6x")) + (patches (search-patches + "gobject-introspection-cc.patch" + "gobject-introspection-girepository.patch" + "gobject-introspection-absolute-shlib-path.patch")))) (build-system meson-build-system) (arguments - `(#:phases + `(,@(if (%current-target-system) + `(#:configure-flags + '("-Dgi_cross_use_prebuilt_gi=true" + ;; Building introspection data requires running binaries + ;; for ‘host’ on ‘build’, so don't do that. + ;; + ;; TODO: it would be nice to have introspection data anyways + ;; as discussed here: https://issues.guix.gnu.org/50201#60. + "-Dbuild_introspection_data=false")) + '()) + #:phases + ,#~ (modify-phases %standard-phases + #$@(if (%current-target-system) + ;; 'typelibs' is undefined. + `((add-after 'unpack 'set-typelibs + (lambda _ + (substitute* "meson.build" + (("\\bsources: typelibs\\b") + "sources: []"))))) + '()) (add-after 'unpack 'do-not-use-/usr/bin/env (lambda _ (substitute* "tools/g-ir-tool-template.in" (("#!@PYTHON_CMD@") (string-append "#!" (which "python3")))) - #t))))) + #t)) + #$@(if (%current-target-system) + ;; Meson gives python extensions an incorrect name, see + ;; <https://github.com/mesonbuild/meson/issues/7049>. + #~((add-after 'install 'rename-library + #$(correct-library-name-phase + (this-package-input "python") + #~(string-append #$output + "/lib/gobject-introspection/giscanner" + "/_giscanner")))) + #~())))) (native-inputs `(("glib" ,glib "bin") - ("pkg-config" ,pkg-config))) + ("pkg-config" ,pkg-config) + ;; TODO(core-updates): Unconditionally place "flex" and "bison" + ;; in 'native-inputs'. + ,@(if (%current-target-system) + `(("bison" ,bison) + ("flex" ,flex)) + '()))) (inputs - `(("bison" ,bison) - ("flex" ,flex) - ("glib" ,glib) - ("python" ,python-wrapper) + `(,@(if (%current-target-system) + `(("python" ,python)) + `(("bison" ,bison) + ("flex" ,flex) + ("python" ,python-wrapper))) ("zlib" ,zlib))) (propagated-inputs - `(;; In practice, GIR users will need libffi when using + `(("glib" ,glib) + ;; In practice, GIR users will need libffi when using ;; gobject-introspection. ("libffi" ,libffi))) (native-search-paths @@ -609,7 +597,7 @@ The intltool collection can be used to do these things: (let ((prog (string-append (assoc-ref outputs "out") "/bin/itstool"))) (wrap-program prog - `("PYTHONPATH" = (,(getenv "PYTHONPATH")))) + `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")))) #t)))))) (home-page "http://www.itstool.org") (synopsis "Tool to translate XML documents with PO files") @@ -646,6 +634,16 @@ translated.") (base32 "09g8swvc95bk1z6j8sw463p2v0dqmgm2zjfndf7i8sbcyq67dr3w")))) (build-system gnu-build-system) + (arguments + (if (%current-target-system) + `(#:configure-flags + ;; Run a native 'dbus-binding-tool' instead of a cross-compiled + ;; 'dbus-binding-tool' when cross-compiling. + ,#~(list + (string-append + "--with-dbus-binding-tool=" + #+(file-append this-package "/bin/dbus-binding-tool")))) + '())) (propagated-inputs ; according to dbus-glib-1.pc `(("dbus" ,dbus) ("glib" ,glib))) @@ -664,63 +662,149 @@ by GDBus included in Glib.") (define libsigc++ (package (name "libsigc++") - (version "2.10.3") + (version "3.0.6") (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/libsigc++/" - (version-major+minor version) "/" - name "-" version ".tar.xz")) - (sha256 - (base32 - "11j7j1jv4z58d9s7jvl42fnqa1dzl4idgil9r45cjv1w673dys0b")))) - (build-system gnu-build-system) - (native-inputs `(("pkg-config" ,pkg-config) - ("m4" ,m4))) + (method url-fetch) + (uri (string-append "mirror://gnome/sources/libsigc++/" + (version-major+minor version) "/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "1kn57b039lg20182lnchl1ys27vf34brn43f895cal8nc7sdq3mp")))) + (build-system meson-build-system) + (outputs '("out" "doc")) + (arguments + `(#:configure-flags + (list + "-Dbuild-documentation=true") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "docs" + (substitute* (find-files "." "\\.xml$") + (("http://www.oasis-open.org/docbook/xml/4\\.1\\.2/") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/")))) + #t)) + (add-after 'install 'move-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc"))) + (mkdir-p (string-append doc "/share")) + (rename-file + (string-append out "/share/doc") + (string-append doc "/share/doc")) + #t)))))) + (native-inputs + `(("docbook-xml" ,docbook-xml-4.1.2) + ("docbook-xsl" ,docbook-xsl) + ("dot" ,graphviz) + ("doxygen" ,doxygen) + ("m4" ,m4) + ("mm-common" ,mm-common) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("xmllint" ,libxml2) + ("xsltproc" ,libxslt))) + (inputs + `(("boost" ,boost))) (home-page "https://libsigcplusplus.github.io/libsigcplusplus/") (synopsis "Type-safe callback system for standard C++") (description "Libsigc++ implements a type-safe callback system for standard C++. It -allows you to define signals and to connect those signals to any callback -function, either global or a member function, regardless of whether it is -static or virtual. + allows you to define signals and to connect those signals to any callback + function, either global or a member function, regardless of whether it is + static or virtual. -It also contains adaptor classes for connection of dissimilar callbacks and -has an ease of use unmatched by other C++ callback libraries.") - (license license:lgpl2.1+))) + It also contains adaptor classes for connection of dissimilar callbacks and + has an ease of use unmatched by other C++ callback libraries.") + (license license:lgpl3+))) + + (define-public libsigc++-2 + (package + (inherit libsigc++) + (name "libsigc++") + (version "2.9.3") + (source + (origin + (method url-fetch) + (uri + (string-append "mirror://gnome/sources/libsigc++/" + (version-major+minor version) + "/libsigc++-" version ".tar.xz")) + (sha256 + (base32 "0zq963d0sss82q62fdfjs7l9iwbdch51albck18cb631ml0v7y8b")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "docs" + (substitute* (find-files "." "\\.xml$") + (("http://www.oasis-open.org/docbook/xml/4\\.1\\.2/") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/")))) + #t)) + (add-after 'install 'move-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc"))) + (mkdir-p (string-append doc "/share")) + (rename-file + (string-append out "/share/doc") + (string-append doc "/share/doc")) + #t)))))))) (define glibmm (package (name "glibmm") - (version "2.62.0") + (version "2.68.0") (source (origin - (method url-fetch) - (uri (string-append "mirror://gnome/sources/glibmm/" - (version-major+minor version) - "/glibmm-" version ".tar.xz")) - (sha256 - (base32 - "1ziwx6r7k7wbvg4qq1rgrv8zninapgrmhn1hs6926a3krh9ryr9n")))) - (build-system gnu-build-system) + (method url-fetch) + (uri (string-append "mirror://gnome/sources/glibmm/" + (version-major+minor version) + "/glibmm-" version ".tar.xz")) + (sha256 + (base32 + "0xgkyhb2876mcyyib5rk3ya9aingyj68h02nl22yvkhx35rqbwy1")))) + (build-system meson-build-system) + (outputs '("out" "doc")) (arguments - `(#:phases + `(#:configure-flags + (list + "-Dbuild-documentation=true") + #:phases (modify-phases %standard-phases - (add-before 'build 'pre-build + (add-after 'unpack 'disable-failing-tests (lambda _ - ;; This test uses /etc/fstab as an example file to read - ;; from; choose a better example. - (substitute* "tests/giomm_simple/main.cc" - (("/etc/fstab") - (string-append (getcwd) - "/tests/giomm_simple/main.cc"))) - - ;; This test does a DNS lookup, and then expects to be able - ;; to open a TLS session; just skip it. - (substitute* "tests/giomm_tls_client/main.cc" - (("Gio::init.*$") - "return 77;\n")) - #t))))) - (native-inputs `(("pkg-config" ,pkg-config) - ("glib" ,glib "bin"))) + (substitute* "tests/meson.build" + ;; This test uses /etc/fstab as an example file to read + ;; from; disable it. + (("[ \t]*.*giomm_simple.*$") "") + ;; This test does a DNS lookup, and then expects to be able + ;; to open a TLS session; just skip it. + (("[ \t]*.*giomm_tls_client.*$") "")) + #t)) + (add-after 'install 'move-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc"))) + (mkdir-p (string-append doc "/share")) + (rename-file + (string-append out "/share/doc") + (string-append doc "/share/doc")) + #t)))))) + (native-inputs + `(("dot" ,graphviz) + ("doxygen" ,doxygen) + ("glib:bin" ,glib "bin") + ("m4" ,m4) + ("mm-common" ,mm-common) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("xsltproc" ,libxslt))) (propagated-inputs `(("libsigc++" ,libsigc++) ("glib" ,glib))) @@ -735,7 +819,7 @@ useful for C++.") (package (inherit glibmm) (name "glibmm") - (version "2.64.2") + (version "2.64.5") (source (origin (method url-fetch) @@ -744,10 +828,10 @@ useful for C++.") (version-major+minor version) "/glibmm-" version ".tar.xz")) (sha256 - (base32 "1v6lp23fr2qh4zshcnm28sn29j3nzgsvcqj2nhmrnvamipjq4lm7")))) + (base32 "11m37sbx0i18cl17d0fkq0bik4bbzlb5n8kcl651jhci5ipci3sh")))) (propagated-inputs - `(("libsigc++" ,libsigc++) - ("glib" ,glib))))) + `(("libsigc++" ,libsigc++-2) + ,@(package-propagated-inputs glibmm))))) (define-public python2-pygobject-2 (package @@ -790,7 +874,7 @@ useful for C++.") (define-public python-pygobject (package (name "python-pygobject") - (version "3.34.0") + (version "3.40.1") (source (origin (method url-fetch) @@ -799,7 +883,7 @@ useful for C++.") "/pygobject-" version ".tar.xz")) (sha256 (base32 - "06i7ynnbvgpz0gw09zsjbvhgcp5qz4yzdifw27qjwdazg2mckql7")) + "0d80g5kgf2i9cginyhalvb7ibfk9g30yilqzmcsw6h6byj8xbih0")) (modules '((guix build utils))) (snippet '(begin @@ -811,6 +895,14 @@ useful for C++.") '("test_atoms.py" "test_overrides_gtk.py")) #t))))) (build-system meson-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; The default 90 seconds can be too low on slower machines. + (invoke "meson" "test" "--timeout-multiplier" "5"))))))) (native-inputs `(("glib-bin" ,glib "bin") ("pkg-config" ,pkg-config) |