Subject: [PATCH core-update-frozen 19/20] gnu: gtk: Replace gdk-pixbuf+svg by librsvg.

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

With the addition of a profile hook for computing the gdk-pixbuf loaders cache
file, there is no longer a need for gdk-pixbuf+svg, and librsvg can propagate
gdk-pixbuf without fear, so replace the former for the latter.

The replacement was automated with the following command:

   $ git grep -l ',gdk-pixbuf+svg)' \
     | xargs sed 's/(".*" ,gdk-pixbuf+svg)/("librsvg" ,librsvg)/' -i

* gnu/packages/gtk.scm (gdk-pixbuf+svg): Delete package.
(gtk+-2)[propagated-inputs]: Replace gdk-pixbuf+svg with librsvg.
(gtk+)[propagated-inputs]: Likewise.
* gnu/packages/gnome.scm (gdk-pixbuf+svg): Add deprecated package.
---
 gnu/packages/dunst.scm      |  2 +-
 gnu/packages/geo.scm        |  2 +-
 gnu/packages/gnome.scm      | 14 +++++++-------
 gnu/packages/graphviz.scm   |  2 +-
 gnu/packages/gstreamer.scm  |  4 ++--
 gnu/packages/gtk.scm        | 35 +++--------------------------------
 gnu/packages/image.scm      |  2 +-
 gnu/packages/mail.scm       |  2 +-
 gnu/packages/mate.scm       | 12 ++++++------
 gnu/packages/messaging.scm  |  2 +-
 gnu/packages/networking.scm |  2 +-
 gnu/packages/tryton.scm     |  2 +-
 gnu/packages/video.scm      |  2 +-
 gnu/packages/vnc.scm        |  2 +-
 14 files changed, 28 insertions(+), 57 deletions(-)

diff --git a/gnu/packages/dunst.scm b/gnu/packages/dunst.scm
index ce2c04bac6..9f3e4c036c 100644
--- a/gnu/packages/dunst.scm
+++ b/gnu/packages/dunst.scm
@@ -67,7 +67,7 @@ (define-public dunst
        ("which" ,which)))
     (inputs
      `(("dbus" ,dbus)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)   ; for svg support
+       ("librsvg" ,librsvg)   ; for svg support
        ("glib" ,glib)
        ("cairo" ,cairo)
        ("pango" ,pango)
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 938720f928..6cba568119 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -279,7 +279,7 @@ (define-public gnome-maps
        ("libsoup" ,libsoup)
        ("libgweather" ,libgweather)
        ("libxml2" ,libxml2)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("glib-networking" ,glib-networking)
        ("geoclue" ,geoclue)
        ("geocode-glib" ,geocode-glib)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index cbdf1d9762..a89cd8e7b4 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -602,7 +602,7 @@ (define-public libdmapsharing
        ("vala" ,vala)))
     (inputs
      `(("avahi" ,avahi)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("gee" ,libgee)
        ("gst-plugins-base" ,gst-plugins-base)
        ("gtk+" ,gtk+)))
@@ -921,7 +921,7 @@ (define-public gnome-photos
     (inputs
      `(("babl" ,babl)
        ("cairo" ,cairo)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("gegl" ,gegl)
        ("geocode-glib" ,geocode-glib)
        ("gexiv2" ,gexiv2)
@@ -2820,7 +2820,7 @@ (define-public gtg
        ("gtk+:bin" ,gtk+ "bin")
        ("pkg-config" ,pkg-config)))
     (inputs
-     `(("gdk-pixbuf" ,gdk-pixbuf+svg)
+     `(("librsvg" ,librsvg)
        ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
        ("gtk+" ,gtk+)
        ("pango" ,pango)
@@ -4257,7 +4257,7 @@ (define-public drawing
        ("gtk+:bin" ,gtk+ "bin")
        ("pkg-config" ,pkg-config)))
     (inputs
-     `(("gdk-pixbuf" ,gdk-pixbuf+svg)
+     `(("librsvg" ,librsvg)
        ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
        ("gtk+" ,gtk+)
        ("pango" ,pango)
@@ -6832,7 +6832,7 @@ (define-public epiphany
     (inputs
      `(("avahi" ,avahi)
        ("gcr" ,gcr)
-       ("gdk-pixbuf+svg" ,gdk-pixbuf+svg) ; for loading SVG files
+       ("librsvg" ,librsvg) ; for loading SVG files
        ("glib-networking" ,glib-networking)
        ("gnome-desktop" ,gnome-desktop)
        ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
@@ -8713,7 +8713,7 @@ (define-public gnome-shell
        ("evolution-data-server" ,evolution-data-server)
        ("gcr" ,gcr)
        ("gdm" ,gdm)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("gjs" ,gjs)
        ("gtk" ,gtk)
        ("gnome-autoar" ,gnome-autoar)
@@ -8777,7 +8777,7 @@ (define-public gtk-vnc
        ("vala" ,vala)))
     (inputs
      `(("cairo" ,cairo)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("glib" ,glib)
        ("gnutls" ,gnutls)
        ("libgcrypt" ,libgcrypt)
diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm
index 25ff51194f..16fbfb6842 100644
--- a/gnu/packages/graphviz.scm
+++ b/gnu/packages/graphviz.scm
@@ -357,7 +357,7 @@ (define-public xdot
                  (,(dirname (search-input-file inputs "bin/dot"))))))))))
     (inputs
      `(("atk" ,atk)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("graphviz" ,graphviz)
        ("gtk+" ,gtk+)
        ("python-pycairo" ,python-pycairo)
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index 1ac5cd4b8e..2a7679b490 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -311,7 +311,7 @@ (define-public libvisual-plugins
     (inputs
      `(("alsa-lib" ,alsa-lib)
        ("esound" ,esound)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("gtk+" ,gtk+-2)
        ("jack" ,jack-2)
        ("libx11" ,libx11)
@@ -668,7 +668,7 @@ (define-public gst-plugins-good
        ("bzip2" ,bzip2)
        ("cairo" ,cairo)
        ("flac" ,flac)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("glib" ,glib)
        ("glib-networking" ,glib-networking)
        ("glu" ,glu)
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 0463e26246..5bfc19e19d 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -714,35 +714,6 @@ (define-public gdk-pixbuf
     (home-page "https://wiki.gnome.org/Projects/GdkPixbuf")
     (license license:lgpl2.1+)))
 
-;; To build gdk-pixbuf with SVG support, we need librsvg, and librsvg depends
-;; on gdk-pixbuf, so this new variable.  Also, librsvg adds 90MiB to the
-;; closure size.
-(define-public gdk-pixbuf+svg
-  (package/inherit gdk-pixbuf
-    (name "gdk-pixbuf+svg")
-    (inputs
-     `(("librsvg" ,librsvg)
-       ,@(package-inputs gdk-pixbuf)))
-    (arguments
-     (substitute-keyword-arguments (package-arguments gdk-pixbuf)
-        ((#:phases phases)
-          `(modify-phases ,phases
-         (add-after 'install 'register-svg-loader
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out     (assoc-ref outputs "out"))
-                    (librsvg (assoc-ref inputs "librsvg"))
-                    (loaders
-                     (append
-                      (find-files out "^libpixbufloader-.*\\.so$")
-                      (find-files librsvg "^libpixbufloader-.*\\.so$")))
-                    (gdk-pixbuf-query-loaders
-                     (string-append out "/bin/gdk-pixbuf-query-loaders")))
-               (apply invoke
-                      gdk-pixbuf-query-loaders
-                      "--update-cache"
-                      loaders))))))))
-    (synopsis "Image loading library, with SVG support")))
-
 ;;; A minimal variant used to prevent a cycle with Inkscape.
 (define-public at-spi2-core-minimal
   (hidden-package
@@ -903,7 +874,7 @@ (define-public gtk+-2
        ;; Rust is not supported well on every architecture yet.
        ("gdk-pixbuf" ,(if (string-prefix? "x86_64" (or (%current-target-system)
                                                        (%current-system)))
-                          gdk-pixbuf+svg
+                          librsvg
                           gdk-pixbuf))
        ("glib" ,glib)
        ("pango" ,pango)))
@@ -1005,7 +976,7 @@ (define-public gtk+
        ;; SVG support is optional and requires librsvg, which pulls in rust.
        ;; Rust is not supported well on every architecture yet.
        ("gdk-pixbuf" ,(if (target-x86-64?)
-                          gdk-pixbuf+svg
+                          librsvg
                           gdk-pixbuf))
        ("glib" ,glib)
        ("libcloudproviders" ,libcloudproviders-minimal)
@@ -1267,7 +1238,7 @@ (define-public gtk
      ;; Following dependencies are referenced in .pc files.
      `(("cairo" ,cairo)
        ("fontconfig" ,fontconfig)
-       ("gdk-pixbuf+svg" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("glib" ,glib)
        ("graphene" ,graphene)
        ("libepoxy" ,libepoxy)
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 99852fc205..87093b14fa 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -2345,7 +2345,7 @@ (define-public mypaint
        ("gettext" ,gettext-minimal)))
     (inputs
      `(("gtk+" ,gtk+)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("hicolor-icon-theme" ,hicolor-icon-theme)
        ("libmypaint" ,libmypaint)
        ("mypaint-brushes" ,mypaint-brushes)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 23a8710b9b..5c72a2f1e1 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1687,7 +1687,7 @@ (define-public claws-mail
        ("enchant" ,enchant)
        ("expat" ,expat)
        ("fontconfig" ,fontconfig)
-       ("gdk-pixbuf+svg" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("ghostscript" ,ghostscript)
        ("glib" ,glib)
        ("gnupg" ,gnupg)
diff --git a/gnu/packages/mate.scm b/gnu/packages/mate.scm
index 08fd3562b3..41165e8de7 100644
--- a/gnu/packages/mate.scm
+++ b/gnu/packages/mate.scm
@@ -473,7 +473,7 @@ (define-public libmatekbd
        ("gobject-introspection" ,gobject-introspection)))
     (inputs
      `(("cairo" ,cairo)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("glib" ,glib)
        ("gtk+" ,gtk+)
        ("libx11" ,libx11)
@@ -983,7 +983,7 @@ (define-public mate-control-center
        ("polkit" ,polkit)
        ("startup-notification" ,startup-notification)))
     (propagated-inputs
-     `(("gdk-pixbuf" ,gdk-pixbuf+svg) ; mate-slab.pc
+     `(("librsvg" ,librsvg) ; mate-slab.pc
        ("librsvg" ,librsvg))) ; mate-slab.pc
     (home-page "https://mate-desktop.org/")
     (synopsis "MATE Desktop configuration tool")
@@ -1219,7 +1219,7 @@ (define-public mate-screensaver
        ("dbus-glib" ,dbus-glib)
        ("glib" ,glib)
        ("gtk+" ,gtk+)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("libcanberra" ,libcanberra)
        ("libglade" ,libglade)
        ("libmatekbd" ,libmatekbd)
@@ -1271,7 +1271,7 @@ (define-public mate-utils
        ("cairo" ,cairo)
        ("glib" ,glib)
        ("gtk+" ,gtk+)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("libcanberra" ,libcanberra)
        ("libgtop" ,libgtop)
        ("libx11" ,libx11)
@@ -1324,7 +1324,7 @@ (define-public eom
        ("exempi" ,exempi)
        ("glib" ,glib)
        ("gtk+" ,gtk+)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("libcanberra" ,libcanberra)
        ("libx11" ,libx11)
        ("libxext" ,libxext)
@@ -1384,7 +1384,7 @@ (define-public engrampa
        ("file" ,file)
        ("glib" ,glib)
        ("gtk+" ,gtk+)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("json-glib" ,json-glib)
        ("libcanberra" ,libcanberra)
        ("libx11" ,libx11)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index b5f39cc408..ef7b9085e5 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1306,7 +1306,7 @@ (define-public dino
      ;; NOTE: Commented-out lines are to be enabled in v0.3.0.
      `(("atk" ,atk)
        ("cairo" ,cairo)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("glib" ,glib)
        ("glib-networking" ,glib-networking)
        ("gpgme" ,gpgme)
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 4a415e9460..c87dd5440a 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -738,7 +738,7 @@ (define-public blueman
     (inputs
      `(("bluez" ,bluez)
        ("dbus" ,dbus)
-       ("gdkpixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("glib" ,glib)
        ("gtk+" ,gtk+)
        ("iproute2" ,iproute)
diff --git a/gnu/packages/tryton.scm b/gnu/packages/tryton.scm
index d5cfb63e1b..c1275edd22 100644
--- a/gnu/packages/tryton.scm
+++ b/gnu/packages/tryton.scm
@@ -113,7 +113,7 @@ (define-public tryton
      `(("glib-compile-schemas" ,glib "bin")
        ("gobject-introspection" ,gobject-introspection)))
     (propagated-inputs
-     `(("gdk-pixbuf" ,gdk-pixbuf+svg)
+     `(("librsvg" ,librsvg)
        ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
        ("gtk+" ,gtk+)
        ("python-dateutil" ,python-dateutil)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index ebee15e296..b9b1ca64be 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -4293,7 +4293,7 @@ (define-public pitivi
         ("gst-libav" ,gst-libav)
         ("gsound" ,gsound)
         ("gtk+" ,gtk+)
-        ("gdk-pixbuf+svg" ,gdk-pixbuf+svg)
+        ("librsvg" ,librsvg)
         ("libpeas" ,libpeas)
         ("libnotify" ,libnotify)
         ("pango" ,pango)
diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm
index 4c2b13c93c..00ae2be63d 100644
--- a/gnu/packages/vnc.scm
+++ b/gnu/packages/vnc.scm
@@ -120,7 +120,7 @@ (define-public remmina
        ("ffmpeg" ,ffmpeg)
        ("freerdp" ,freerdp)             ; for rdp plugin
        ("gcrypt" ,libgcrypt)
-       ("gdk-pixbuf" ,gdk-pixbuf+svg)
+       ("librsvg" ,librsvg)
        ("glib" ,glib)
        ("gnome-keyring" ,gnome-keyring)
        ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
-- 
2.33.1