gnu: glib: Update to 2.62.4.
[jackhill/guix/guix.git] / gnu / packages / glib.scm
index 62f0943..2bcd9fb 100644 (file)
         ;; Install the session bus socket under /tmp.
         "--with-session-socket-dir=/tmp"
 
+        ;; Build shared libraries only.
+        "--disable-static"
+
         ;; Use /etc/dbus-1 for system-wide config.
         ;; Look for configuration file under
         ;; /etc/dbus-1.  This is notably required by
@@ -162,7 +165,7 @@ shared NFS home directories.")
 (define glib
   (package
    (name "glib")
-   (version "2.60.6")
+   (version "2.62.4")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnome/sources/"
@@ -170,7 +173,7 @@ shared NFS home directories.")
                                 name "-" version ".tar.xz"))
             (sha256
              (base32
-              "0v7vpx2md1gn0wwiirn7g4bhf2csfvcr03y96q2zv97ain6sp3zz"))
+              "1g2vj9lyh032kcwij7avx5d6a99rcsnkd07sbl9i55zsfw6h712c"))
             (patches (search-patches "glib-tests-timer.patch"))
             (modules '((guix build utils)))
             (snippet
@@ -185,11 +188,9 @@ shared NFS home directories.")
     `(("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)  ; for libmount
+      ("util-linux" ,util-linux "lib")  ;for libmount
       ("libselinux" ,libselinux)
       ("zlib" ,zlib)))
-   (inputs
-    `(("coreutils" ,coreutils)))
    (native-inputs
     `(("gettext" ,gettext-minimal)
       ("m4" ,m4) ; for installing m4 macros
@@ -199,7 +200,8 @@ shared NFS home directories.")
       ("perl" ,perl)                              ; needed by GIO tests
       ("tzdata" ,tzdata-for-tests)))                  ; for tests/gdatetime.c
    (arguments
-    `(#:phases
+    `(#:disallowed-references (,tzdata-for-tests)
+      #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-dbus-launch-path
           (lambda* (#:key inputs #:allow-other-keys)
@@ -209,6 +211,15 @@ shared NFS home directories.")
                  (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)))
         (add-before 'build 'pre-build
           (lambda* (#:key inputs outputs #:allow-other-keys)
             ;; For tests/gdatetime.c.
@@ -289,7 +300,7 @@ shared NFS home directories.")
                       (;; Requires /etc/machine-id.
                        "/gdbus/codegen-peer-to-peer"))
 
-                     ("gio/tests/gdbus-unix-addresses.c"
+                     ("gio/tests/gdbus-address-get-session.c"
                       (;; Requires /etc/machine-id.
                        "/gdbus/x11-autolaunch"))
 
@@ -317,6 +328,13 @@ shared NFS home directories.")
               (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"
@@ -344,6 +362,7 @@ shared NFS home directories.")
            (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
@@ -353,6 +372,34 @@ dynamic loading, and an object system.")
    (home-page "https://developer.gnome.org/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)))
+    (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)
+       ("libxml2" ,libxml2)
+       ,@(package-native-inputs glib)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments glib)
+       ((#:configure-flags flags ''())
+        `(cons "-Dgtk_doc=true" ,flags))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (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))
+                 #t)))))))))
+
 (define gobject-introspection
   (package
     (name "gobject-introspection")
@@ -505,16 +552,6 @@ information in their documents, such as whether a particular element should be
 translated.")
     (license license:gpl3+)))
 
-(define-public itstool/fixed
-  ;; This variant fixes a python-libxml2 crash when processing UTF-8
-  ;; sequences: <https://bugs.gnu.org/37468>.  Since the issue is quite rare,
-  ;; create this variant here to avoid a full rebuild.
-  (package/inherit
-   itstool
-   (inputs
-    `(("python-libxml2" ,python-libxml2/fixed)
-      ,@(alist-delete "python-libxml2" (package-inputs itstool))))))
-
 (define dbus-glib
   (package
     (name "dbus-glib")
@@ -716,6 +753,33 @@ useful for C++.")
        ("pkg-config" ,pkg-config)
        ("python-pytest" ,python2-pytest)))))
 
+;; Newer version of this core-updates package, for Lollypop.
+(define-public python-pygobject-3.34
+  (package/inherit
+   python-pygobject
+   (version "3.34.0")
+   (source
+    (origin
+      (method url-fetch)
+      (uri (string-append "mirror://gnome/sources/pygobject/"
+                          (version-major+minor version)
+                          "/pygobject-" version ".tar.xz"))
+      (sha256
+       (base32 "06i7ynnbvgpz0gw09zsjbvhgcp5qz4yzdifw27qjwdazg2mckql7"))))
+   (build-system meson-build-system)
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'delete-broken-tests
+          (lambda _
+            (with-directory-excursion "tests"
+              (for-each
+               delete-file
+               ;; FIXME: these tests require Gdk and/or Gtk 4.
+               '("test_atoms.py"
+                 "test_overrides_gtk.py")))
+            #t)))))))
+
 (define-public perl-glib
   (package
     (name "perl-glib")
@@ -853,6 +917,7 @@ programming language.  It also contains the utility
               (uri (string-append "https://people.freedesktop.org/~hughsient/"
                                   "appstream-glib/releases/"
                                   "appstream-glib-" version ".tar.xz"))
+              (patches (search-patches "appstream-glib-2020.patch"))
               (sha256
                (base32
                 "14jr1psx5kxywdprgbqn79w309yz8lrqlsq7288hfrf87gbr1wh4"))))
@@ -864,7 +929,7 @@ programming language.  It also contains the utility
     (propagated-inputs
      `(("gcab" ,gcab) ; for .pc file
        ("gdk-pixbuf" ,gdk-pixbuf) ; for .pc file
-       ("util-linux" ,util-linux))) ; for .pc file
+       ("libuuid" ,util-linux "lib"))) ; for .pc file
     (inputs
      `(("glib" ,glib)
        ("gperf" ,gperf)