GNU bug report logs - #77735
[PATCH] gnu: flatpak: Fix "No GSettings schemas are installed on the system".

Previous Next

Package: guix-patches;

Reported by: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>

Date: Fri, 11 Apr 2025 11:38:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#77735: closed ([PATCH] gnu: flatpak: Fix "No GSettings
 schemas are installed on the system".)
Date: Thu, 17 Apr 2025 20:54:07 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 17 Apr 2025 22:31:51 +0200
with message-id <87tt6mzg08.fsf <at> gnu.org>
and subject line Re: [bug#77735] [PATCH] gnu: flatpak: Fix "No GSettings schemas are installed on the system".
has caused the debbugs.gnu.org bug report #77735,
regarding [PATCH] gnu: flatpak: Fix "No GSettings schemas are installed on the system".
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
77735: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77735
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Rostislav Svoboda <Rostislav.Svoboda <at> gmail.com>
Subject: [PATCH] gnu: flatpak: Fix "No GSettings schemas are installed on the
 system".
Date: Fri, 11 Apr 2025 13:36:51 +0200
* gnu/packages/package-management.scm (flatpak)[inputs]: Add
gsettings-desktop-schemas.
<#:phases>: Set GSETTINGS_SCHEMA_DIR in wrap-phase.

This fixes an error that appeared when running system-wide Flatpak
operations such as 'sudo flatpak update':

  GLib-GIO-ERROR [...] No GSettings schemas are installed on the system

The missing schemas from gsettings-desktop-schemas prevented proper GLib
configuration lookups (e.g., org.gnome.system.proxy). By setting
GSETTINGS_SCHEMA_DIR to point to gsettings-desktop-schemas' schema directory,
we ensure Flatpak can access required GLib configuration templates.

Change-Id: I9522c07b6c8ccf20a86ee966effb73eb61a2abc7
---
 gnu/packages/package-management.scm | 261 ++++++++++++++--------------
 1 file changed, 135 insertions(+), 126 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 81dcf24857..798930588b 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -2040,135 +2040,144 @@ (define-public libostree
     (license license:lgpl2.0+)))
 
 (define-public flatpak
-  (package
-    (name "flatpak")
-    (version "1.16.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
-                           version "/flatpak-" version ".tar.xz"))
-       (sha256
-        (base32 "0ajbz8ms4h5nyjr59hv9z8vaimj4f3p51v8idmy14qnbmmjwa2nb"))
-       (patches
-        (search-patches "flatpak-fix-fonts-icons.patch"
-                        "flatpak-fix-path.patch"
-                        "flatpak-fix-icon-validation.patch"
-                        "flatpak-unset-gdk-pixbuf-for-sandbox.patch"))))
-    (build-system meson-build-system)
-    (arguments
-     (list
-      #:configure-flags
-      #~(list
-         "-Dsystem_helper=disabled"
-         "-Dlocalstatedir=/var"
-         (string-append "-Dsystem_bubblewrap="
-                        (assoc-ref %build-inputs "bubblewrap")
-                        "/bin/bwrap")
-         (string-append "-Dsystem_dbus_proxy="
-                        (assoc-ref %build-inputs "xdg-dbus-proxy")
-                        "/bin/xdg-dbus-proxy"))
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-after 'unpack 'disable-failing-tests
-            (lambda _
-              (substitute* "tests/test-matrix/meson.build"
-                ;; The following tests fail with error message related to fusermount3
-                ;; failing an unmount operation ("No such file or directory").
-                (("^.*test-http-utils.*$") "")
-                (("^.*test-summaries <at> system.wrap.*$") "")
-                (("^.*test-prune.*$") ""))))
-          (add-after 'unpack 'fix-tests
-            (lambda* (#:key inputs #:allow-other-keys)
-              (copy-recursively
-               (search-input-directory inputs "lib/locale")
-               "/tmp/locale")
-              (for-each make-file-writable (find-files "/tmp"))
-              (substitute* "tests/make-test-runtime.sh"
-                (("cp `which.*") "echo guix\n")
-                (("cp -r /usr/lib/locale/C\\.\\*")
-                 (string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
+  (let ((release "1.16.0")
+        (revision "1"))
+    (package
+      (name "flatpak")
+      (version (string-append release "-" revision))
+      (source
+       (origin
+         (method url-fetch)
+         (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
+                             release "/flatpak-" release ".tar.xz"))
+         (sha256
+          (base32 "0ajbz8ms4h5nyjr59hv9z8vaimj4f3p51v8idmy14qnbmmjwa2nb"))
+         (patches
+          (search-patches "flatpak-fix-fonts-icons.patch"
+                          "flatpak-fix-path.patch"
+                          "flatpak-fix-icon-validation.patch"
+                          "flatpak-unset-gdk-pixbuf-for-sandbox.patch"))))
+      (build-system meson-build-system)
+      (arguments
+       (list
+        #:configure-flags
+        #~(list
+           "-Dsystem_helper=disabled"
+           "-Dlocalstatedir=/var"
+           (string-append "-Dsystem_bubblewrap="
+                          (assoc-ref %build-inputs "bubblewrap")
+                          "/bin/bwrap")
+           (string-append "-Dsystem_dbus_proxy="
+                          (assoc-ref %build-inputs "xdg-dbus-proxy")
+                          "/bin/xdg-dbus-proxy"))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'disable-failing-tests
+              (lambda _
+                (substitute* "tests/test-matrix/meson.build"
+                  ;; The following tests fail with error message related to fusermount3
+                  ;; failing an unmount operation ("No such file or directory").
+                  (("^.*test-http-utils.*$") "")
+                  (("^.*test-summaries <at> system.wrap.*$") "")
+                  (("^.*test-prune.*$") ""))))
+            (add-after 'unpack 'fix-tests
+              (lambda* (#:key inputs #:allow-other-keys)
+                (copy-recursively
+                 (search-input-directory inputs "lib/locale")
+                 "/tmp/locale")
+                (for-each make-file-writable (find-files "/tmp"))
+                (substitute* "tests/make-test-runtime.sh"
+                  (("cp `which.*") "echo guix\n")
+                  (("cp -r /usr/lib/locale/C\\.\\*")
+                   (string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
 cp -r /tmp/locale/*/en_US.*")))
-              (substitute* "tests/libtest.sh"
-                (("/bin/kill") (which "kill"))
-                (("/usr/bin/python3") (which "python3")))
-              #t))
-          (add-after 'unpack 'p11-kit-fix
-            (lambda* (#:key inputs #:allow-other-keys)
-              (let ((p11-path (search-input-file inputs "/bin/p11-kit")))
-                (substitute* "session-helper/flatpak-session-helper.c"
-                  (("\"p11-kit\",")
-                   (string-append "\"" p11-path "\","))
-                  (("if \\(g_find_program_in_path \\(\"p11-kit\"\\)\\)")
-                   (string-append "if (g_find_program_in_path (\""
-                                  p11-path "\"))"))))))
-          (add-after 'unpack 'fix-icon-validation
-            (lambda* (#:key outputs #:allow-other-keys)
-              (let* ((out (assoc-ref outputs "out"))
-                     (store (dirname out)))
-                (substitute* "icon-validator/validate-icon.c"
-                  (("@storeDir@") store)))))
-          (add-before 'check 'pre-check
-            (lambda _
-              ;; Set $HOME to writable location for testcommon tests.
-              (setenv "HOME" "/tmp")))
-          (add-after 'install 'wrap-flatpak
-            (lambda* (#:key inputs #:allow-other-keys)
-              (let ((flatpak (string-append #$output "/bin/flatpak"))
-                    (glib-networking (assoc-ref inputs "glib-networking")))
-                (wrap-program flatpak
-                  ;; Allow GIO to find TLS backend.
-                  `("GIO_EXTRA_MODULES" prefix
-                    (,(string-append glib-networking "/lib/gio/modules"))))))))))
-    (native-inputs
-     (list bison
-           dbus ; for dbus-daemon
-           gettext-minimal
-           `(,glib "bin") ; for glib-mkenums + gdbus-codegen
-           gtk-doc
-           (libc-utf8-locales-for-target)
-           gobject-introspection
-           libcap
-           pkg-config
-           python
-           python-pyparsing
-           socat
-           which))
-    (inputs
-     (list appstream
-           appstream-glib
-           bash-minimal
-           bubblewrap
-           curl
-           fuse
-           gdk-pixbuf
-           libcap
-           libostree
-           libsoup-minimal-2
-           libxml2
-           p11-kit
-           polkit
-           util-linux
-           xdg-dbus-proxy
-           zstd))
-    (propagated-inputs (list glib-networking
-                             gnupg
-                             gsettings-desktop-schemas
-                             ;; The following are listed in Requires.private of
-                             ;; `flatpak.pc'.
-                             curl
-                             dconf
-                             gpgme
-                             json-glib
-                             libarchive
-                             libseccomp
-                             libxau))
-    (home-page "https://flatpak.org")
-    (synopsis "System for building, distributing, and running sandboxed desktop
+                (substitute* "tests/libtest.sh"
+                  (("/bin/kill") (which "kill"))
+                  (("/usr/bin/python3") (which "python3")))
+                #t))
+            (add-after 'unpack 'p11-kit-fix
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let ((p11-path (search-input-file inputs "/bin/p11-kit")))
+                  (substitute* "session-helper/flatpak-session-helper.c"
+                    (("\"p11-kit\",")
+                     (string-append "\"" p11-path "\","))
+                    (("if \\(g_find_program_in_path \\(\"p11-kit\"\\)\\)")
+                     (string-append "if (g_find_program_in_path (\""
+                                    p11-path "\"))"))))))
+            (add-after 'unpack 'fix-icon-validation
+              (lambda* (#:key outputs #:allow-other-keys)
+                (let* ((out (assoc-ref outputs "out"))
+                       (store (dirname out)))
+                  (substitute* "icon-validator/validate-icon.c"
+                    (("@storeDir@") store)))))
+            (add-before 'check 'pre-check
+              (lambda _
+                ;; Set $HOME to writable location for testcommon tests.
+                (setenv "HOME" "/tmp")))
+            (add-after 'install 'wrap-flatpak
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let ((flatpak (string-append #$output "/bin/flatpak"))
+                      (glib-networking (assoc-ref inputs "glib-networking")))
+                  (wrap-program flatpak
+                    ;; Prevent error:
+                    ;; "No GSettings schemas are installed on the system"
+                    `("GSETTINGS_SCHEMA_DIR" =
+                      (, (string-append
+                          #$(this-package-input "gsettings-desktop-schemas")
+                          "/share/glib-2.0/schemas")))
+                    ;; Allow GIO to find TLS backend.
+                    `("GIO_EXTRA_MODULES" prefix
+                      (,(string-append glib-networking "/lib/gio/modules"))))))))))
+      (native-inputs
+       (list bison
+             dbus ; for dbus-daemon
+             gettext-minimal
+             `(,glib "bin") ; for glib-mkenums + gdbus-codegen
+             gtk-doc
+             (libc-utf8-locales-for-target)
+             gobject-introspection
+             libcap
+             pkg-config
+             python
+             python-pyparsing
+             socat
+             which))
+      (inputs
+       (list appstream
+             appstream-glib
+             bash-minimal
+             bubblewrap
+             curl
+             fuse
+             gsettings-desktop-schemas
+             gdk-pixbuf
+             libcap
+             libostree
+             libsoup-minimal-2
+             libxml2
+             p11-kit
+             polkit
+             util-linux
+             xdg-dbus-proxy
+             zstd))
+      (propagated-inputs (list glib-networking
+                               gnupg
+                               gsettings-desktop-schemas
+                               ;; The following are listed in Requires.private of
+                               ;; `flatpak.pc'.
+                               curl
+                               dconf
+                               gpgme
+                               json-glib
+                               libarchive
+                               libseccomp
+                               libxau))
+      (home-page "https://flatpak.org")
+      (synopsis "System for building, distributing, and running sandboxed desktop
 applications")
-    (description "Flatpak is a system for building, distributing, and running
+      (description "Flatpak is a system for building, distributing, and running
 sandboxed desktop applications on GNU/Linux.")
-    (license license:lgpl2.1+)))
+      (license license:lgpl2.1+))))
 
 (define-public fpm
   (package

base-commit: 772b70455d0d5972fdad80d8529647dce20f409a
-- 
2.49.0



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>
Cc: 77735-done <at> debbugs.gnu.org
Subject: Re: [bug#77735] [PATCH] gnu: flatpak: Fix "No GSettings schemas are
 installed on the system".
Date: Thu, 17 Apr 2025 22:31:51 +0200
Hey Bost,

Rostislav Svoboda <rostislav.svoboda <at> gmail.com> writes:

> I've seen some examples like:

I don’t doubt there are counterexamples, but! this one:

> (define-public muparser
>   ;; When switching download sites, muparser re-issued a 2.2.5 release with a
>   ;; different hash. In order to make `guix package --upgrade` work correctly,
>   ;; we set a Guix packaging revision.
>   ;; When the next version of muparser is released, we can remove
>   ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.

… apparently had a good reason to do so.  :-)

Not sure about the others.

> (But if you insist then I changed that - see attachment)

Applied, thanks!

Ludo’.


This bug report was last modified 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.