Subject: bug#68228: closed (Re: [bug#68228] [PATCH v4] gnu: Add gnome-software.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 20 Mar 2025 05:50:02 +0000

Your bug report

#68228: [PATCH] gnu: Add gnome-software.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
68228: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68228
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#68228] [PATCH v4] gnu: Add gnome-software.
From: Maxim Cournoyer <[email-masked]>
To: Noé Lopez <[email-masked]>
Cc: terramorpha <[email-masked]>, Mathieu Othacehe <[email-masked]>, Vivien Kraus <[email-masked]>, Liliana Marie Prikler <[email-masked]>, [email-masked]
Date: Thu, 20 Mar 2025 14:49:02 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Noé Lopez <[email-masked]> writes:

> From: terramorpha <[email-masked]>
>
> * gnu/packages/gnome.scm (gnome-software): New variable.

A 2nd look on it from my side.  Apologies for failing to mention these
in my first look.

[...]

> +(define-public gnome-software
> +  (package
> +    (name "gnome-software")
> +    (version "46.5")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri
> +        (string-append "mirror://gnome/sources/"
> +                       name "/"
> +                       (version-major version) "/"
> +                       name "-" version ".tar.xz"))
> +       (sha256 (base32 "0b5y9z64582aarw3v92wjm63yib2q85ylny1k7k4d2y48jivirb9"))))
> +    (build-system meson-build-system)
> +    (arguments
> +     (list
> +      #:test-options #~(list "--no-suite=plugins") ;needs a dbus-system
> +      #:glib-or-gtk? #t
> +      #:configure-flags
> +      #~(list "-Dsoup2=true"

Why forcing libsoup2?  libsoup2 is deprecated in GNOME; we should be
using the newer version.  If there are problems, it should be ideally
resolved, failing that at least a comment should appear above to explain
why we force libsoup2.

>From meson.build, it seems we should be able to use libsoup v3:

--8<---------------cut here---------------start------------->8---
if get_option('soup2')
  libsoup = dependency('libsoup-2.4', version : '>= 2.52.0')
  libsoupapiversion = '2.4'
  conf.set('SOUP_HTTP_URI_FLAGS', '(G_URI_FLAGS_HAS_PASSWORD | G_URI_FLAGS_ENCODED_PATH | G_URI_FLAGS_ENCODED_QUERY | G_URI_FLAGS_ENCODED_FRAGMENT | G_URI_FLAGS_SCHEME_NORMALIZE)')
else
  libsoup = dependency('libsoup-3.0', version : '>= 3.0')
  libsoupapiversion = '3.0'
endif
--8<---------------cut here---------------end--------------->8---

> +              "-Dman=false"             ;tries to access the internet

That surprises me!  Looking at src/meson.build, I see:

--8<---------------cut here---------------start------------->8---
if get_option('man')
  xsltproc = find_program('xsltproc')
  custom_target('manfile-gnome-software',
    input: 'gnome-software.xml',
    output: 'gnome-software.1',
    install: true,
    install_dir: join_paths(get_option('mandir'), 'man1'),
    command: [
      xsltproc,
      '--nonet',
      '--stringparam', 'man.output.quietly', '1',
      '--stringparam', 'funcsynopsis.style', 'ansi',
      '--stringparam', 'man.th.extra1.suppress', '1',
      '--stringparam', 'man.authors.section.enabled', '0',
      '--stringparam', 'man.copyright.section.enabled', '0',
      '-o', '@OUTPUT@',
      'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
      '@INPUT@'
    ]
  )
endif
--8<---------------cut here---------------end--------------->8---

We were just missing the docbook-xsl and libxslt packages as native
inputs.

> +              "-Dhardcoded_proprietary_webapps=false")
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (add-after 'unpack 'patch-iso-codes
> +            (lambda _
> +              (with-directory-excursion "src"
> +                (substitute* "./gs-language.c"
> +                  (("DATADIR")
> +                   (format #f "\"~a/share\"" #$iso-codes))))))
> +          (add-before 'install 'disable-gtk-update-icon-cache
> +            (lambda _
> +              (setenv "DESTDIR" "/")
> +              ;; Needed for complete RUNPATHs, but not actually needed at runtime.
> +              (copy-file
> +               "../build/lib/libgnomesoftware.so.20"
> +               (string-append #$output "/lib/libgnomesoftware.so.20")))))))

The above lib copying is weird, but it indeed relates to some
post-install script that has to do with generating the icon cache (at
least that's one of the things it does).  Perhaps we could disable this
post-install script instead and avoid that useful library?

> +    (native-inputs
> +     (list `(,glib "bin")
> +           gettext-minimal
> +           gtk-doc
> +           pkg-config))
> +    (inputs
> +     (list appstream
> +           flatpak
> +           fwupd
> +           gdk-pixbuf
> +           gtk
> +           json-glib
> +           libadwaita
> +           libglib-testing

Hm, the above is for some epiphany self-test plugin, which appears
only useful while running the test suite; 'guix size gnome-software'
doesn't list it either, so it can indeed be moved to the native inputs.

> +           libgudev
> +           libostree
> +           libsoup-minimal-2
> +           libxmlb
> +           malcontent
> +           packagekit
> +           polkit
> +           sysprof
> +           valgrind))

sysprof and valgrind should also be moved to native inputs (aka build
time dependencies).

> +    (synopsis "Graphical software manager for gnome")

s/gnome/GNOME/

> +    (description "Software allows you to find and install new apps and system
>

> +extensions and remove existing installed apps.")

I'd use s/apps/applications/, and call it 'GNOME Software' instead of
just 'Software'.

Actually, having tested that hands on, I was satisfied with a version
that implements most of the above changes:

--8<---------------cut here---------------start------------->8---
1 file changed, 18 insertions(+), 14 deletions(-)
gnu/packages/gnome.scm | 32 ++++++++++++++++++--------------

modified   gnu/packages/gnome.scm
@@ -14616,12 +14616,13 @@ (define-public gnome-software
     (build-system meson-build-system)
     (arguments
      (list
-      #:test-options #~(list "--no-suite=plugins") ;needs a dbus-system
+      #:test-options
+      ;; The plugins test suite requires a D-Bus system session, which
+      ;; attempts to set its session under /var/run and fails.
+      #~(list "--no-suite=plugins")
       #:glib-or-gtk? #t
       #:configure-flags
-      #~(list "-Dsoup2=true"
-              "-Dman=false"             ;tries to access the internet
-              "-Dhardcoded_proprietary_webapps=false")
+      #~(list "-Dhardcoded_proprietary_webapps=false")
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'patch-iso-codes
@@ -14638,10 +14639,15 @@ (define-public gnome-software
                "../build/lib/libgnomesoftware.so.20"
                (string-append #$output "/lib/libgnomesoftware.so.20")))))))
     (native-inputs
-     (list `(,glib "bin")
+     (list docbook-xsl
            gettext-minimal
+           `(,glib "bin")
            gtk-doc
-           pkg-config))
+           libglib-testing
+           libxslt                      ;for xsltproc
+           pkg-config
+           sysprof
+           valgrind))
     (inputs
      (list appstream
            flatpak
@@ -14650,18 +14656,16 @@ (define-public gnome-software
            gtk
            json-glib
            libadwaita
-           libglib-testing
            libgudev
            libostree
-           libsoup-minimal-2
+           libsoup-minimal
            libxmlb
            malcontent
            packagekit
-           polkit
-           sysprof
-           valgrind))
-    (synopsis "Graphical software manager for gnome")
-    (description "Software allows you to find and install new apps and system
-extensions and remove existing installed apps.")
+           polkit))
+    (synopsis "Graphical software manager for GNOME")
+    (description "GNOME Software allows you to find and install new
+applications and system extensions and remove existing installed
+applications.")
     (license license:gpl2+)
     (home-page "https://apps.gnome.org/en/Software/")))

--8<---------------cut here---------------end--------------->8---

So I've already pushed it as commit 77ff73a920, add myself as co-author
via a git trailer in the commit message.

To be able to use libsoup 3, I had to update ostree first to have it use
libsoup 3 as well.

Thank you!

-- 
Maxim

Subject: [PATCH] gnu: Add gnome-software.
From: Justin Veilleux <[email-masked]>
To: [email-masked]
Date: Wed, 03 Jan 2024 01:30:38 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi. This is a patch for gnome-software.

Cheers.

>From c8c61e3b4c3b30c2b28c7fed971e19d7bea4cf46 Mon Sep 17 00:00:00 2001
Message-ID: <c8c[email-masked]>
From: terramorpha <[email-masked]>
Date: Wed, 3 Jan 2024 01:23:36 -0500
Subject: [PATCH] gnu: Add gnome-software.

* gnu/packages/gnome.scm (gnome-software): New variable.

Change-Id: I5838a581d8612eed0697c801fff0e241256ce558
---
 gnu/packages/gnome.scm | 71 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index b2d4b73088..fe507d5b2d 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -77,6 +77,7 @@
 ;;; Copyright © 2023 Juliana Sims <[email-masked]>
 ;;; Copyright © 2023 Dominik Delgado Steuter <[email-masked]>
 ;;; Copyright © 2023 Zhu Zihao <[email-masked]>
+;;; Copyright © 2024 Justin Veilleux <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -13459,3 +13460,73 @@ (define-public xffm+
     (home-page "http://xffm.org/")
     (license license:gpl3+)
     (properties '((upstream-name . "xffm")))))
+
+(define-public gnome-software
+  (package
+    (name "gnome-software")
+    (version "42.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://gnome/sources/"
+                       name "/"
+                       (version-major version) "/"
+                       name "-" version ".tar.xz"))
+       (sha256 (base32 "091jc82450lsrm0l8wi2byh1317abwp5c32wrrk0hpbz59iljhz8"))))
+
+    (native-inputs
+     (list
+      pkg-config
+      (list glib "bin")
+      gnu-gettext
+      gtk-doc
+      (list gtk "bin")
+      desktop-file-utils))
+
+    (inputs
+     (list
+      appstream
+      gdk-pixbuf
+      libxmlb
+      gtk
+      json-glib
+      libsoup
+      libadwaita
+      valgrind
+      gsettings-desktop-schemas
+      polkit
+      packagekit
+      flatpak
+      libostree
+      libsoup-minimal-2
+      malcontent
+      libgudev))
+    (build-system meson-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after
+              'unpack
+              'patch-iso-codes
+            (lambda* (#:key native-inputs inputs #:allow-other-keys)
+              (with-directory-excursion
+                  "src"
+                (substitute* "./gs-language.c"
+                  (("DATADIR")
+                   (format #f "\"~a/share\"" #$iso-codes)))
+                (invoke "cat" "gs-language.c")))))
+
+      #:configure-flags
+      ''("-Dfwupd=false"
+         "-Dsoup2=true"
+         ;; tries to download something over the internet, makes the build fail
+         "-Dman=false")
+      #:tests? #f
+      #:validate-runpath? #f))
+    (synopsis "Graphical software manager for gnome")
+    (description "Software allows you to find and install new apps and system
+extensions and remove existing installed apps.")
+    (license license:gpl2)
+    (home-page "https://apps.gnome.org/en/Software/")))

base-commit: f4628000024219bf373922ff4a6fa752eb821797
-- 
2.41.0