gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / glib.scm
index 9f0721b..c04bd33 100644 (file)
@@ -1,18 +1,19 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 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 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2021 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
-;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@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 © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
+;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -53,6 +54,7 @@
   #:use-module (gnu packages package-management)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages popt)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
@@ -61,6 +63,7 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
@@ -88,7 +91,6 @@
   (package
     (name "dbus")
     (version "1.12.16")
-    (replacement dbus/fixed)
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -97,7 +99,8 @@
               (sha256
                (base32
                 "107ckxaff1cv4q6kmfdi2fb1nlsv03312a7kf6lb4biglhpjv8jl"))
-              (patches (search-patches "dbus-helper-search-path.patch"))))
+              (patches (search-patches "dbus-CVE-2020-12049.patch"
+                                       "dbus-helper-search-path.patch"))))
     (build-system gnu-build-system)
     (arguments
      '(#:configure-flags
@@ -165,19 +168,11 @@ or through unencrypted TCP/IP suitable for use behind a firewall with
 shared NFS home directories.")
     (license license:gpl2+)))                     ; or Academic Free License 2.1
 
-;; Replacement package to fix CVE-2020-12049.
-(define dbus/fixed
-  (package
-    (inherit dbus)
-    (source (origin
-              (inherit (package-source dbus))
-              (patches (append (search-patches "dbus-CVE-2020-12049.patch")
-                               (origin-patches (package-source dbus))))))))
-
 (define glib
   (package
    (name "glib")
    (version "2.62.6")
+   (replacement glib/fixed)
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnome/sources/"
@@ -186,7 +181,8 @@ shared NFS home directories.")
             (sha256
              (base32
               "174bsmbmcvaw69ff9g60q5sx0fn23rkhqcwqz17h5s7sprps4kqh"))
-            (patches (search-patches "glib-tests-timer.patch"))
+            (patches (search-patches "glib-appinfo-watch.patch"
+                                     "glib-tests-timer.patch"))
             (modules '((guix build utils)))
             (snippet
              '(begin
@@ -232,6 +228,17 @@ shared NFS home directories.")
                (("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.
@@ -384,11 +391,38 @@ dynamic loading, and an object system.")
    (home-page "https://developer.gnome.org/glib/")
    (license license:lgpl2.1+)))
 
+(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))))))))
+
 (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)
+  (package/inherit glib
     (properties (alist-delete 'hidden? (package-properties glib)))
     (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference
     (native-inputs
@@ -412,21 +446,52 @@ dynamic loading, and an object system.")
                  (delete-file-recursively (string-append out 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 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"))))
+    (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"))))
     (build-system meson-build-system)
     (arguments
      `(#:phases
@@ -437,34 +502,38 @@ dynamic loading, and an object system.")
                (("#!@PYTHON_CMD@")
                 (string-append "#!" (which "python3"))))
              #t)))))
+    (native-inputs
+     `(("glib" ,glib "bin")
+       ("pkg-config" ,pkg-config)))
     (inputs
      `(("bison" ,bison)
        ("flex" ,flex)
        ("glib" ,glib)
        ("python" ,python-wrapper)
        ("zlib" ,zlib)))
-    (native-inputs
-     `(("glib" ,glib "bin")
-       ("pkg-config" ,pkg-config)))
     (propagated-inputs
      `(;; In practice, GIR users will need libffi when using
        ;; gobject-introspection.
        ("libffi" ,libffi)))
     (native-search-paths
-     (list (search-path-specification
-            (variable "GI_TYPELIB_PATH")
-            (files '("lib/girepository-1.0")))))
+     (list
+      (search-path-specification
+       (variable "GI_TYPELIB_PATH")
+       (files '("lib/girepository-1.0")))))
     (search-paths native-search-paths)
-    (home-page "https://wiki.gnome.org/GObjectIntrospection")
-    (synopsis "Generate interface introspection data for GObject libraries")
-    (description
-     "GObject introspection is a middleware layer between C libraries (using
-GObject) and language bindings.  The C library can be scanned at compile time
-and generate a metadata file, in addition to the actual native C library.  Then
-at runtime, language bindings can read this metadata and automatically provide
-bindings to call into the C library.")
-    ; Some bits are distributed under the LGPL2+, others under the GPL2+
-    (license license:gpl2+)))
+    (synopsis "GObject introspection tools and libraries")
+    (description "GObject introspection is a middleware layer between
+C libraries (using GObject) and language bindings.  The C library can be scanned
+at compile time and generate metadata files, in addition to the actual native
+C library.  Then language bindings can read this metadata and automatically
+provide bindings to call into the C library.")
+    (home-page "https://wiki.gnome.org/Projects/GObjectIntrospection")
+    (license
+     (list
+      ;; For library.
+      license:lgpl2.0+
+      ;; For tools.
+      license:gpl2+))))
 
 (define intltool
   (package
@@ -662,6 +731,24 @@ has an ease of use unmatched by other C++ callback libraries.")
 useful for C++.")
     (license license:lgpl2.1+)))
 
+ (define-public glibmm-2.64
+   (package
+    (inherit glibmm)
+    (name "glibmm")
+    (version "2.64.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://gnome/sources/glibmm/"
+                       (version-major+minor version)
+                       "/glibmm-" version ".tar.xz"))
+       (sha256
+        (base32 "1v6lp23fr2qh4zshcnm28sn29j3nzgsvcqj2nhmrnvamipjq4lm7"))))
+     (propagated-inputs
+      `(("libsigc++" ,libsigc++)
+        ("glib" ,glib)))))
+
 (define-public python2-pygobject-2
   (package
     (name "python2-pygobject")
@@ -677,8 +764,7 @@ useful for C++.")
        (sha256
         (base32
          "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv"))
-       (patches (search-patches
-                 "python2-pygobject-2-gi-info-type-error-domain.patch"))))
+       (patches (search-patches "python2-pygobject-2-deprecation.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("which" ,which)
@@ -747,32 +833,33 @@ useful for C++.")
     (properties `((python2-variant . ,(delay python2-pygobject))))))
 
 (define-public python2-pygobject
-  (package (inherit (strip-python2-variant python-pygobject))
-    (name "python2-pygobject")
+  (let ((base (strip-python2-variant python-pygobject)))
+    (package/inherit base
+      (name "python2-pygobject")
 
-    ;; Note: We use python-build-system here, because Meson only supports
-    ;; Python 3, and needs PYTHONPATH etc set up correctly, which makes it
-    ;; difficult to use for Python 2 projects.
-    (build-system python-build-system)
-    (arguments
-     `(#:python ,python-2
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'delete-broken-tests
-           (lambda _
-             ;; FIXME: this test freezes and times out.
-             (delete-file "tests/test_mainloop.py")
-             ;; FIXME: this test fails with this kind of error:
-             ;; AssertionError: <Handlers.SIG_IGN: 1> != <built-in function default_int_handler
-             (delete-file "tests/test_ossig.py")
-             #t)))))
-    (inputs
-     `(("python-pycairo" ,python2-pycairo)
-       ("gobject-introspection" ,gobject-introspection)))
-    (native-inputs
-     `(("glib-bin" ,glib "bin")
-       ("pkg-config" ,pkg-config)
-       ("python-pytest" ,python2-pytest)))))
+      ;; Note: We use python-build-system here, because Meson only supports
+      ;; Python 3, and needs PYTHONPATH etc set up correctly, which makes it
+      ;; difficult to use for Python 2 projects.
+      (build-system python-build-system)
+      (arguments
+       `(#:python ,python-2
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'delete-broken-tests
+             (lambda _
+               ;; FIXME: this test freezes and times out.
+               (delete-file "tests/test_mainloop.py")
+               ;; FIXME: this test fails with this kind of error:
+               ;; AssertionError: <Handlers.SIG_IGN: 1> != <built-in function default_int_handler
+               (delete-file "tests/test_ossig.py")
+               #t)))))
+      (inputs
+       `(("python-pycairo" ,python2-pycairo)
+         ("gobject-introspection" ,gobject-introspection)))
+      (native-inputs
+       `(("glib-bin" ,glib "bin")
+         ("pkg-config" ,pkg-config)
+         ("python-pytest" ,python2-pytest))))))
 
 (define-public perl-glib
   (package
@@ -909,15 +996,54 @@ This package provides the library for GLib applications.")
              #t)))))
     (synopsis "D-Bus API for C++")
     (description "This package provides D-Bus client API bindings for the C++
-programming language.  It also contains the utility
-@command{dbuscxx-xml2cpp}.")
+programming language.  It also provides the @command{dbusxx-xml2cpp} and
+@command{dbusxx-introspect} commands.")
     (home-page "https://sourceforge.net/projects/dbus-cplusplus/")
     (license license:lgpl2.1+)))
 
+(define-public dbus-cxx
+  (package
+    (name "dbus-cxx")
+    (version "0.12.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/dbus-cxx/dbus-cxx/"
+                                  version "/dbus-cxx-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1acsgpkd9v7b9jdc79ijmh9dbdfrzgkwkaff518i3zpk7y6g5mzw"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags '("-DENABLE_TESTS=ON"
+                           "-DENABLE_TOOLS=ON"
+                           "-DENABLE_GLIBMM=ON")))
+    (inputs `(("dbus" ,dbus)
+              ("libsigc++" ,libsigc++)
+              ("glibmm" ,glibmm)
+              ("python" ,python)
+              ("popt" ,popt)
+              ("expat" ,expat)))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("m4" ,m4)))
+    (synopsis "C++ wrapper for dbus")
+    (description "Dbus-cxx is a C++ wrapper for dbus.\n
+It exposes the C API to allow direct manipulation and
+relies on sigc++ to provide an Oriented Object interface.\n
+This package provide 2 utils:
+@enumerate
+@item @command{dbus-cxx-xml2cpp} to generate proxy and adapter
+@item @command{dbus-cxx-introspect} to introspect a dbus interface
+@end enumerate
+
+Some codes examples can be find at:
+@url{https://dbus-cxx.github.io/examples.html}")
+    (home-page "https://dbus-cxx.github.io/")
+    (license license:gpl3)))
+
 (define-public appstream-glib
   (package
     (name "appstream-glib")
-    (version "0.7.17")
+    (version "0.7.18")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://people.freedesktop.org/~hughsient/"
@@ -925,7 +1051,7 @@ programming language.  It also contains the utility
                                   "appstream-glib-" version ".tar.xz"))
               (sha256
                (base32
-                "0jg58m1p5xfrh8zkpqhhg00nqs727z5i1qy6sb0a3vyc98fyk9vw"))))
+                "00j0kkgf224nzmrha72g8pd72mymhph7vaisj35i4ffy7cpd47na"))))
     (build-system meson-build-system)
     (native-inputs
      `(("gettext" ,gettext-minimal)
@@ -1039,7 +1165,7 @@ other API remains the same.")
      `(("bison" ,bison)
        ("flex" ,flex)
        ("glib:bin" ,glib "bin") ;; For glib-mkenums
-       ("gtk-doc" ,gtk-doc)
+       ("gtk-doc" ,gtk-doc/stable)
        ("pkg-config" ,pkg-config)
        ("vala" ,vala)))
     (home-page "https://gitlab.gnome.org/GNOME/template-glib")