diff mbox series

[bug#65879,gnome-team,v3,1/1] gnu: gnome-control-center: Update to 44.3.

Message ID 1361e95b870e39e696cdd8bb336b9a8250b1496a.1694955414.git.vivien@planete-kraus.eu
State New
Headers show
Series Gnome-control-center passes all tests, but still crashes | expand

Commit Message

Vivien Kraus Sept. 11, 2023, 9:26 p.m. UTC
* gnu/packages/gnome.scm (gnome-control-center): Update to 44.3.
[#:phases]<patch-paths>: Upstream already uses
/run/setuid-programs/passwd. Querying the GNOME version is done through dbus
now. Set up the test environment as gnome-shell, and run tests under
dbus-run-session.
[#:phases] <skip-gtk-update-icon-cache>: The icon cache update should be disabled
differently.
[#:phases] <check>: Override the check phase to run under dbus.
[native-inputs]: Add setxkbmap.
* gnu/packages/patches/gnome-control-center-firmware-security.patch: Disable
the firmware security panel.
* gnu/packages/gnome.scm (gnome-control-center): Apply the patch to disable
the firmware security panel.
* gnu/local.mk (dist_patch_DATA): Distribute the patch to disable
the firmware security panel.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/gnome.scm                        | 43 +++++++++++++------
 ...ome-control-center-firmware-security.patch | 33 ++++++++++++++
 3 files changed, 64 insertions(+), 13 deletions(-)
 create mode 100644 gnu/packages/patches/gnome-control-center-firmware-security.patch

Comments

Liliana Marie Prikler Sept. 17, 2023, 1:37 p.m. UTC | #1
Am Montag, dem 11.09.2023 um 23:26 +0200 schrieb Vivien Kraus:
> * gnu/packages/gnome.scm (gnome-control-center): Update to 44.3.
> [#:phases]<patch-paths>: Upstream already uses
> /run/setuid-programs/passwd. Querying the GNOME version is done
> through dbus
> now. Set up the test environment as gnome-shell, and run tests under
> dbus-run-session.
This can be "[#:phases]<patch-paths>: Adjust accordingly." imho.  For a
lengthier discussion, you can use the pre-ChangeLog blurb, should you
need it.
> [#:phases] <skip-gtk-update-icon-cache>: The icon cache update should
> be disabled differently.
You can drop the [#:phases] prefix.  Also, adjust accordingly – this
pattern is already well known throughout the rest of gnome and should
probably be put into meson-build-system itself at some point.
> [#:phases] <check>: Override the check phase to run under dbus.
Here, just drop the [#:phases] prefix.
> [native-inputs]: Add setxkbmap.
> * gnu/packages/patches/gnome-control-center-firmware-security.patch:
> Disable
> the firmware security panel.
> * gnu/packages/gnome.scm (gnome-control-center): Apply the patch to
> disable
> the firmware security panel.
> * gnu/local.mk (dist_patch_DATA): Distribute the patch to disable
> the firmware security panel.
I wonder what's this about the firmware security panel :)
The trio is usually 
patch: New file.
packages/module.scm (package): Use it here.
gnu/local.mk (dist_patch_DATA): Register it here.

Note that you have two blocks for gnome-control-center now.  I think
you should the patch and gnu/local.mk first so that you can have the
rest of the ChangeLog for the "important" changes :)
> ---
>  gnu/local.mk                                  |  1 +
>  gnu/packages/gnome.scm                        | 43 +++++++++++++----
> --
>  ...ome-control-center-firmware-security.patch | 33 ++++++++++++++
>  3 files changed, 64 insertions(+), 13 deletions(-)
> [...]
By the way, there's no need to send a cover letter for a single patch.
Just add your comments below the "---" line.  The biggest issue that
keeps me from pushing this is the reported crash; we should be able to
at least somehow get a working gnome-control-center even if it means
spawning an extra dbus session from a pure shell or something.  If you
can resolve this by testing in qemu, then fine, but until you do, let's
keep this on the wait list :)

Cheers
Liliana Marie Prikler Sept. 17, 2023, 4:23 p.m. UTC | #2
Am Sonntag, dem 17.09.2023 um 16:12 +0200 schrieb Vivien Kraus:
> Hi!
> 
> I split the patch in 2, first to add the patch, and then to do the
> update. Is it better that way?
> 
> > I wonder what's this about the firmware security panel :)
> 
> I’m sorry for messing up the commit style. You made the charitable
> assumption that there was something more than my negligence here, but
> unfortunately I’m just to blame.
It's fine – two patches or one both work.  Sorry for being a little
cheeky in my review.

> > The biggest issue that keeps me from pushing this is the reported
> > crash; we should be able to at least somehow get a working
> > gnome-control-center even if it means spawning an extra dbus
> > session from a pure shell or something.
> > If you can resolve this by testing in qemu, then fine, but until
> > you do, let's keep this on the wait list :)
> 
> I keep the gnome-shell idea in mind too. Anyway, I’ll wait for CI to
> rebuild qemu once it is merged.
Note, qemu builds locally even with the first patch removed, so I'll
push that next weekend.

Happy hacking in the meantime!
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index db21feb507..96560d72e7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1309,6 +1309,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/gmp-faulty-test.patch			\
   %D%/packages/patches/gnash-fix-giflib-version.patch	        \
   %D%/packages/patches/gnome-2048-fix-positional-argument.patch	\
+  %D%/packages/patches/gnome-control-center-firmware-security.patch	\
   %D%/packages/patches/gnome-control-center-libexecdir.patch	\
   %D%/packages/patches/gnome-online-miners-tracker-3.patch	\
   %D%/packages/patches/gnome-settings-daemon-gc.patch		\
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 2077478ff2..ff36967194 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -9016,7 +9016,7 @@  (define-public gnome-bluetooth
 (define-public gnome-control-center
   (package
     (name "gnome-control-center")
-    (version "42.4")
+    (version "44.3")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnome/sources/" name "/"
@@ -9024,7 +9024,10 @@  (define-public gnome-control-center
                                   name "-" version ".tar.xz"))
               (sha256
                (base32
-                "1ln5rch6zbfh3vl2nnnmw39bylgg38rin6xp7ra0ra4ay3wv3gvs"))))
+                "0yhcm0c0ghkfqswqlkwcln3jpaz6jzvqaph2c3lgmv635w2nash6"))
+              (patches
+               (search-patches
+                "gnome-control-center-firmware-security.patch"))))
     (build-system meson-build-system)
     (arguments
      (list
@@ -9048,19 +9051,32 @@  (define-public gnome-control-center
                              "panels/network/connection-editor/net-connection-editor.c")
                 (("\"nm-connection-editor")
                  (string-append "\"" (search-input-file
-                                      inputs "bin/nm-connection-editor"))))
-              (substitute* "panels/user-accounts/run-passwd.c"
-                (("/usr/bin/passwd")
-                 "/run/setuid-programs/passwd"))
-              (substitute* "panels/info-overview/cc-info-overview-panel.c"
-                (("DATADIR \"/gnome/gnome-version.xml\"")
-                 (format #f "~s" (search-input-file
-                                  inputs "share/gnome/gnome-version.xml"))))))
+                                      inputs "bin/nm-connection-editor"))))))
           (add-after 'unpack 'skip-gtk-update-icon-cache
             ;; Don't create 'icon-theme.cache'.
             (lambda _
-              (substitute* "build-aux/meson/meson_post_install.py"
-                (("gtk-update-icon-cache") (which "true"))))))))
+              (substitute* "meson.build"
+                (("gtk_update_icon_cache: true")
+                 "gtk_update_icon_cache: false"))))
+          (replace 'check
+            (lambda* (#:key parallel-tests? tests? #:allow-other-keys)
+              (when tests?
+                ;; Tests require a running X server.
+                (system "Xvfb :1 &")
+                (setenv "DISPLAY" ":1")
+                ;; For the missing /var/lib/dbus/machine-id
+                (setenv "DBUS_FATAL_WARNINGS" "0")
+                (setenv "NO_AT_BRIDGE" "1")
+                (setenv "HOME" "/tmp")
+                (setenv "XDG_RUNTIME_DIR" (string-append (getcwd) "/runtime-dir"))
+                (mkdir (getenv "XDG_RUNTIME_DIR"))
+                (chmod (getenv "XDG_RUNTIME_DIR") #o700)
+                (setenv "MESON_TESTTHREADS"
+                        (if parallel-tests?
+                            (number->string (parallel-job-count))
+                            "1"))
+                (invoke "dbus-run-session" "--"
+                        "meson" "test" "-t" "0")))))))
     (native-inputs
      (list docbook-xsl
            gettext-minimal
@@ -9069,7 +9085,8 @@  (define-public gnome-control-center
            pkg-config
            python
            python-dbusmock
-           xorg-server-for-tests))
+           xorg-server-for-tests
+           setxkbmap))
     (inputs
      (list accountsservice
            colord-gtk
diff --git a/gnu/packages/patches/gnome-control-center-firmware-security.patch b/gnu/packages/patches/gnome-control-center-firmware-security.patch
new file mode 100644
index 0000000000..fd9d7b8ff4
--- /dev/null
+++ b/gnu/packages/patches/gnome-control-center-firmware-security.patch
@@ -0,0 +1,33 @@ 
+From: Jeremy Bicha <jeremy.bicha@canonical.com>
+Date: Mon, 22 Aug 2022 08:31:15 -0400
+Subject: firmware-security: Disable
+
+Not yet useful enough to justify its inclusion by default here
+
+You can get the same info by running
+fwupdmgr security
+
+If you drop this patch, add a Depends: fwupd [linux-any]
+
+https://launchpad.net/bugs/1987162
+
+https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1938
+
+[Stolen from the debian package]
+---
+ shell/cc-panel-loader.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
+index 17f9601..1b819a5 100644
+--- a/shell/cc-panel-loader.c
++++ b/shell/cc-panel-loader.c
+@@ -113,7 +113,7 @@ static CcPanelLoaderVtable default_panels[] =
+   PANEL_TYPE("info-overview",    cc_info_overview_panel_get_type,        NULL),
+   PANEL_TYPE("keyboard",         cc_keyboard_panel_get_type,             NULL),
+   PANEL_TYPE("location",         cc_location_panel_get_type,             NULL),
+-  PANEL_TYPE("firmware-security",cc_firmware_security_panel_get_type,    cc_firmware_security_panel_static_init_func),
++  // PANEL_TYPE("firmware-security",cc_firmware_security_panel_get_type,    cc_firmware_security_panel_static_init_func),
+   PANEL_TYPE("microphone",       cc_microphone_panel_get_type,           NULL),
+   PANEL_TYPE("mouse",            cc_mouse_panel_get_type,                NULL),
+   PANEL_TYPE("multitasking",     cc_multitasking_panel_get_type,         NULL),