Subject: [PATCH core-update-frozen 10/13] gnu: libcloudproviders-minimal: Introduce minimal variant.

From: Maxim Cournoyer <[email-masked]>
Date: Wed, 27 Oct 2021 00:51:41 -0400

* gnu/packages/gnome.scm (libcloudproviders-minimal): New minimal variant that
doesn't require Inkscape to be built (through gtk-doc).
[source]: Adjust URI.
[outputs]: Remove field.
[configure-flags]: Disable introspection, docs and vala bindings.
[phases]{move-doc}: Move phase to ...
(libcloudproviders)[phases]: ... here.
Rewrite in terms of libcloudproviders-minimal.  The "doc" output is moved
here.
[configure-flags]: Clear inherited flags and enable doc.
* gnu/packages/gtk.scm (gtk+)[inputs]{libcloudproviders}: Use the minimal
variant to prevent a cycle with Inkscape.
---
 gnu/packages/gnome.scm | 60 +++++++++++++++++++++++++-----------------
 gnu/packages/gtk.scm   |  2 +-
 2 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 4b1adc2997..1c4f6a4c94 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -39,7 +39,7 @@
 ;;; Copyright © 2019 Giacomo Leidi <[email-masked]>
 ;;; Copyright © 2019 Jelle Licht <[email-masked]>
 ;;; Copyright © 2019 Jonathan Frederickson <[email-masked]>
-;;; Copyright © 2019, 2020 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2019, 2020 Martin Becze <[email-masked]>
 ;;; Copyright © 2019 David Wilson <[email-masked]>
 ;;; Copyright © 2019, 2020 Raghav Gururajan <[email-masked]>
@@ -338,41 +338,28 @@ (define-public brasero
 features to enable users to create their discs easily and quickly.")
     (license license:gpl2+)))
 
-(define-public libcloudproviders
+;;; Minimal variant, used to break a cycle with Inkscape.
+(define-public libcloudproviders-minimal
   (package
-    (name "libcloudproviders")
+    (name "libcloudproviders-minimal")
     (version "0.3.1")
     (source
      (origin
        (method url-fetch)
        (uri
-        (string-append "mirror://gnome/sources/" name "/"
-                       (version-major+minor version) "/"
-                       name "-" version ".tar.xz"))
+        (string-append "mirror://gnome/sources/libcloudproviders/"
+                       (version-major+minor version)
+                       "/libcloudproviders-" version ".tar.xz"))
        (sha256
         (base32 "0aars24myf6n8b8hm1n12hsgcm54097kpbpm4ba31zp1l4y22qs7"))))
     (build-system meson-build-system)
-    (outputs '("out" "doc"))
     (arguments
-     `(#:glib-or-gtk? #t     ; To wrap binaries and/or compile schemas
-       #:configure-flags
-       (list
-        "-Denable-gtk-doc=true")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'install 'move-doc
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (doc (assoc-ref outputs "doc")))
-               (mkdir-p (string-append doc "/share"))
-               (rename-file
-                (string-append out "/share/gtk-doc")
-                (string-append doc "/share/gtk-doc"))
-               #t))))))
+     `(#:glib-or-gtk? #t             ; To wrap binaries and/or compile schemas
+       #:configure-flags (list "-Dintrospection=false"
+                               "-Denable-gtk-doc=false"
+                               "-Dvapigen=false")))
     (native-inputs
      `(("glib:bin" ,glib "bin")
-       ("gobject-introspection" ,gobject-introspection)
-       ("gtk-doc" ,gtk-doc/stable)
        ("pkg-config" ,pkg-config)
        ("vala" ,vala)))
     (inputs
@@ -386,6 +373,31 @@ (define-public libcloudproviders
     (home-page "https://csorianognome.wordpress.com/2015/07/07/cloud-providers/")
     (license license:lgpl3+)))
 
+(define-public libcloudproviders
+  (package/inherit libcloudproviders-minimal
+    (name "libcloudproviders")
+    (version "0.3.1")
+    (outputs (cons "doc" (package-outputs libcloudproviders-minimal)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments libcloudproviders-minimal)
+       ((#:configure-flags _)
+        '("-Denable-gtk-doc=true"))     ;false by default
+       ((#:phases phases '%standard-phases)
+        `(modify-phases %standard-phases
+           (add-after 'install 'move-doc
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (doc (assoc-ref outputs "doc")))
+                 (mkdir-p (string-append doc "/share"))
+                 (rename-file
+                  (string-append out "/share/gtk-doc")
+                  (string-append doc "/share/gtk-doc")))))))))
+    (native-inputs
+     (append
+         `(("gobject-introspection" ,gobject-introspection)
+           ("gtk-doc" ,gtk-doc/stable))
+         (package-native-inputs libcloudproviders-minimal)))))
+
 (define-public libgrss
   (package
     (name "libgrss")
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index a515bca5ac..e92c6b1398 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1005,7 +1005,7 @@ (define-public gtk+
                           gdk-pixbuf+svg
                           gdk-pixbuf))
        ("glib" ,glib)
-       ("libcloudproviders" ,libcloudproviders)
+       ("libcloudproviders" ,libcloudproviders-minimal)
        ("libepoxy" ,libepoxy)
        ("libx11" ,libx11)
        ("libxcomposite" ,libxcomposite)
-- 
2.33.1