diff mbox series

[bug#67473,gnome-team,v5,11/19] gnu: Deprecate libsoup-minimal.

Message ID e446c1c546db43abc6caea4639c3ad8a85c6d9a0.1701794891.git.vivien@planete-kraus.eu
State New
Headers show
Series [bug#67473,gnome-team,v5,01/19] gnu: gdk-pixbuf: Update to 2.42.10. | expand

Commit Message

Vivien Kraus Dec. 4, 2023, 6:27 p.m. UTC
This patch makes the old libsoup-minimal a full package, by adding a "doc"
output, -Ddocs=enabled to the configure-flags, a 'move-doc phase and
gettext-minimal and gi-docgen to the native-inputs. The libsoup-minimal-2
package inherits from that and must undo all these changes on top of the
existing fixes (change origin, change tests fixes).

Finally, libsoup-minimal is re-introduced as a deprecated-package.

* gnu/packages/gnome.scm (libsoup): New variable from the old libsoup-minimal.
[outputs]: Add "out" and "doc".
[#:configure-flags]: Replace -Ddocs=disabled with -Ddocs=enabled.
[#:phases]: Add 'move-doc.
[native-inputs]: Add gettext-minimal and gi-docgen.
(libsoup-minimal-2): Inherit from libsoup instead of libsoup-minimal.
[name]: Set to "libsoup-minimal".
[outputs]: Delete "doc".
[#:configure-flags]: Delete -Ddocs=enabled since the package base has docs.
[#:phases]: Replace with libsoup-minimal-2 test fixes.
[native-inputs]: Delete gettext-minimal and gi-docgen.
(libsoup-minimal): New variable.

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

Comments

Maxim Cournoyer Dec. 8, 2023, 10:09 p.m. UTC | #1
Hi Vivien,

Vivien Kraus <vivien@planete-kraus.eu> writes:

> This patch makes the old libsoup-minimal a full package, by adding a "doc"
> output, -Ddocs=enabled to the configure-flags, a 'move-doc phase and
> gettext-minimal and gi-docgen to the native-inputs. The libsoup-minimal-2
> package inherits from that and must undo all these changes on top of the
> existing fixes (change origin, change tests fixes).
>
> Finally, libsoup-minimal is re-introduced as a deprecated-package.
>
> * gnu/packages/gnome.scm (libsoup): New variable from the old libsoup-minimal.
> [outputs]: Add "out" and "doc".
> [#:configure-flags]: Replace -Ddocs=disabled with -Ddocs=enabled.
> [#:phases]: Add 'move-doc.
> [native-inputs]: Add gettext-minimal and gi-docgen.
> (libsoup-minimal-2): Inherit from libsoup instead of libsoup-minimal.
> [name]: Set to "libsoup-minimal".
> [outputs]: Delete "doc".
> [#:configure-flags]: Delete -Ddocs=enabled since the package base has docs.
> [#:phases]: Replace with libsoup-minimal-2 test fixes.
> [native-inputs]: Delete gettext-minimal and gi-docgen.
> (libsoup-minimal): New variable.

IIUC, a minimal libsoup variant is not needed at this point since
inkscape depends on libsoup-minimal-2 rather than libsoup-minimal.

That may be true currently, but we should be ready for when a newer
Inkscape release is ready for a modern libsoup.  When this happens,
we'll still need a minimal version around, so I wouldn't remove it.
Does this make sense?
Vivien Kraus Dec. 8, 2023, 10:13 p.m. UTC | #2
Le vendredi 08 décembre 2023 à 17:09 -0500, Maxim Cournoyer a écrit :
> IIUC, a minimal libsoup variant is not needed at this point since
> inkscape depends on libsoup-minimal-2 rather than libsoup-minimal.
> 
> That may be true currently, but we should be ready for when a newer
> Inkscape release is ready for a modern libsoup.  When this happens,
> we'll still need a minimal version around, so I wouldn't remove it.
> Does this make sense?
I don’t understand. I thought you asked for libsoup and libsoup-minimal
to be merged, because the closure size difference was not that big.
Libsoup-minimal is not removed, it is just marked deprecated. Do you
want me to drop this v5 11/19?

Vivien
Maxim Cournoyer Dec. 9, 2023, 1:54 p.m. UTC | #3
Hi Vivien,

Vivien Kraus <vivien@planete-kraus.eu> writes:

> Le vendredi 08 décembre 2023 à 17:09 -0500, Maxim Cournoyer a écrit :
>> IIUC, a minimal libsoup variant is not needed at this point since
>> inkscape depends on libsoup-minimal-2 rather than libsoup-minimal.
>> 
>> That may be true currently, but we should be ready for when a newer
>> Inkscape release is ready for a modern libsoup.  When this happens,
>> we'll still need a minimal version around, so I wouldn't remove it.
>> Does this make sense?
> I don’t understand. I thought you asked for libsoup and libsoup-minimal
> to be merged, because the closure size difference was not that big.
> Libsoup-minimal is not removed, it is just marked deprecated. Do you
> want me to drop this v5 11/19?

Apologies if I've contradicted my earlier replies here.  I've given this
some more thought and unless the cycle between inkscape and
libsoup-minimal (2 or 3) no longer exists, I don't think we should let
go of the minimal variant of libsoup as it's a matter of time before
inkscape depends on libsoup 3 (at which point we'd be back at square one
in terms of cycles, right?).

If my above reasoning holds, then yes, what I'm suggesting is to drop
this 11/19 and the few following commits that follow-up on it.
diff mbox series

Patch

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 2b24453e8f..25d964e596 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5017,9 +5017,9 @@  (define-public libshumate
 as OpenStreetMap, OpenCycleMap, OpenAerialMap and Maps.")
     (license license:lgpl2.1+)))
 
-(define-public libsoup-minimal
+(define-public libsoup
   (package
-    (name "libsoup-minimal")
+    (name "libsoup")
     (version "3.4.4")
     (source (origin
               (method url-fetch)
@@ -5030,9 +5030,10 @@  (define-public libsoup-minimal
                (base32
                 "1an5n2sa70f40my4g20lk38s5ib99c32bzzg8gm91v9nbxr6f719"))))
     (build-system meson-build-system)
+    (outputs '("out" "doc"))
     (arguments
      (list
-      #:configure-flags #~(list "-Ddocs=disabled")
+      #:configure-flags #~(list "-Ddocs=enabled")
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'adjust-tests
@@ -5050,9 +5051,16 @@  (define-public libsoup-minimal
               (substitute* "tests/meson.build"
                 ((".*'name': 'hsts'.*") ""))
               (substitute* "tests/hsts-db-test.c"
-                ((".*/hsts-db/subdomains.*") "")))))))
+                ((".*/hsts-db/subdomains.*") ""))))
+          (add-after 'install 'move-doc
+            (lambda _
+              (mkdir-p (string-append #$output:doc "/share"))
+              (rename-file (string-append #$output "/share/doc")
+                           (string-append #$output:doc "/share/doc")))))))
     (native-inputs
-     (list `(,glib "bin") ;for glib-mkenums
+     (list gettext-minimal
+           `(,glib "bin") ;for glib-mkenums
+           gi-docgen
            gobject-introspection
            pkg-config
            python-wrapper
@@ -5083,7 +5091,8 @@  (define-public libsoup-minimal
 ;;; An older variant kept to build the 'rest' package.
 (define-public libsoup-minimal-2
   (package
-    (inherit libsoup-minimal)
+    (inherit libsoup)
+    (name "libsoup-minimal")
     (version "2.74.3")
     (source (origin
               (method url-fetch)
@@ -5093,15 +5102,17 @@  (define-public libsoup-minimal-2
               (sha256
                (base32
                 "04rgv6hkyhgi7lak9865yxgbgky6gc635p7w6nhcbj64rx0prdz4"))))
+    (outputs (delete "doc" (package-outputs libsoup)))
     (arguments
      (substitute-keyword-arguments (package-arguments libsoup-minimal)
        ((#:configure-flags configure-flags)
-        ;; The option named changed between libsoup 2 and libsoup 3.
         #~(cons "-Dgtk_doc=false"
-                (delete "-Ddocs=disabled" #$configure-flags)))
+                (delete "-Ddocs=enabled" #$configure-flags)))
        ((#:phases phases)
-        #~(modify-phases #$phases
-            (replace 'adjust-tests
+        #~(modify-phases %standard-phases
+            ;; Cannot reuse #$phases here, because it references the "doc"
+            ;; output of this package, so Guix expects a "doc" output.
+            (add-after 'unpack 'adjust-tests
               (lambda _
                 ;; Disable the SSL test, failing since 2.68 and resolved in
                 ;; libsoup 3.
@@ -5109,43 +5120,11 @@  (define-public libsoup-minimal-2
                   (("[ \t]*\\['ssl', true, \\[\\]\\],") ""))))))))
     (native-inputs
      (modify-inputs (package-native-inputs libsoup-minimal)
-       (replace "vala" vala-0.52)))))
+       (replace "vala" vala-0.52)
+       (delete "gettext-minimal" "gi-docgen")))))
 
-(define-public libsoup
-  (package/inherit libsoup-minimal
-    (name "libsoup")
-    (outputs (cons "doc" (package-outputs libsoup-minimal)))
-    (arguments
-     (substitute-keyword-arguments (package-arguments libsoup-minimal)
-       ((#:configure-flags configure-flags)
-        #~(cons "-Ddocs=enabled"
-                ;; The default value is 'auto', meaning it could be skipped.
-                (delete "-Ddocs=disabled" #$configure-flags)))
-       ((#:phases phases)
-        #~(modify-phases #$phases
-            (replace 'adjust-tests
-              (lambda _
-                ;; This test fails due to missing /etc/nsswitch.conf
-                ;; in the build environment.
-                (substitute* "tests/unix-socket-test.c"
-                  ((".*/sockets/unconnected.*") ""))
-
-                ;; These fail because "subdomain.localhost" does not resolve in
-                ;; the build environment.  Moreover, the hsts-test suite fails on
-                ;; i686-linux because of errors from `session_get_uri' like
-                ;; "Unexpected status 200 OK (expected 301 Moved Permanently)"
-                ;; (see: https://gitlab.gnome.org/GNOME/libsoup/-/issues/239).
-                (substitute* "tests/meson.build"
-                  ((".*'name': 'hsts'.*") ""))
-                (substitute* "tests/hsts-db-test.c"
-                  ((".*/hsts-db/subdomains.*") ""))))
-            (add-after 'install 'move-doc
-              (lambda _
-                (mkdir-p (string-append #$output:doc "/share"))
-                (rename-file (string-append #$output "/share/doc")
-                             (string-append #$output:doc "/share/doc"))))))))
-    (native-inputs (modify-inputs (package-native-inputs libsoup-minimal)
-                     (prepend gettext-minimal gi-docgen)))))
+(define-public libsoup-minimal
+  (deprecated-package "libsoup-minimal" libsoup))
 
 (define-public libsecret
   (package