Subject: Re: [bug#75375] [PATCH v1 1/2] teams: gnome: Add gnome-manifest.

From: Maxim Cournoyer <[email-masked]>
Date: Sun, 19 Jan 2025 11:20:07 +0900

Hi Liliana,

Liliana Marie Prikler <[email-masked]> writes:

> * etc/teams/gnome/gnome-manifest.scm: New file.

[...]

> +(define (propagated-inputs package)
> +  (map
> +   (match-lambda
> +     ((_ (? package? pkg)) pkg)
> +     ((_ (? package? pkg) output) (list pkg output)))
> +   (package-propagated-inputs package)))
> +
> +(packages->manifest
> + (append-map propagated-inputs
> +             (list gnome-meta-core-services
> +                   gnome-meta-core-shell
> +                   gnome-meta-core-utilities
> +                   gnome-essential-extras)))

Good idea!  I have an unfinished branch locally where I was devising the
same; it looked like this:

--8<---------------cut here---------------start------------->8---
+(use-modules (guix git-download)
+             (guix packages)
+             (guix profiles)
+             (guix utils)
+             (gnu packages))
+
+;;; Commentary:
+;;;
+;;; This manifest can be used to update the GNOME packages collection, via
+;;; e.g.:
+;;;
+;;; ./pre-inst-env guix refresh -u -m etc/teams/gnome/gnome-manifest.scm \
+;;;   --target-version=48
+;;;
+;;; Code:
+
+(define (gnome-package? p)
+  "Predicate to check if P is a GNOME package."
+  (let ((uri (and=> (package-source p)
+                    (lambda (x)
+                      (and (origin? x)
+                           (origin-uri x)))))
+        (loc (package-location p)))
+    (or (and uri
+             (cond
+              ((string? uri)
+               (string-prefix? "mirror://gnome/" uri))
+              ((git-reference? uri)
+               (string-contains "gitlab.gnome.org"
+                                (git-reference-url uri)))
+              (else #f)))
+        (and loc
+             (string-contains "gnu/packages/gnome"
+                              (location-file loc))))))
+
+(define* (gnome-packages-manifest)
+  "Return a manifest of all GNOME packages."
+  (manifest
+   (map package->manifest-entry
+        (fold-packages
+         (lambda (package lst)
+           (if (gnome-package? package)
+               (cons package lst)
+               lst))
+         '()))))
--8<---------------cut here---------------end--------------->8---

The comment with --target-version=48 (partial version) depends on a
complete but unreleased feature (I'll publish it soon), that enables to
do so.

Would that be a more comprehensive of GNOME packages?  I'm also not sure
of the merit of separating extensions from other GNOME packages?

-- 
Thanks,
Maxim