Subject: [bug#42958] [PATCH core-updates 10/29] gnu: cairo: Update package definition.

From: Raghav Gururajan <[email-masked]>
Date: Thu, 24 Sep 2020 11:35:09 -0400

@Danny

Please find the attached split patches.

Regards,
RG.
>From 4e13823ff058adfed4422b3208ee1547bb7e3cc2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <[email-masked]>
Date: Thu, 24 Sep 2020 11:18:50 -0400
Subject: [PATCH 26/30] gnu: cairo: Make some cosmetic changes.

* gnu/packages/gtk.scm (cairo): Make some cosmetic changes.
---
 gnu/packages/gtk.scm | 78 ++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index ff8547d00b..ea4ca684bf 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -121,57 +121,57 @@ tools have full access to view and control running applications.")
 
 (define-public cairo
   (package
-   (name "cairo")
-   (version "1.16.0")
-   (source (origin
-            (method url-fetch)
-            (uri (string-append "https://cairographics.org/releases/cairo-"
-                                version ".tar.xz"))
-            (sha256
-             (base32
-              "0c930mk5xr2bshbdljv005j3j8zr47gqmkry3q6qgvqky6rjjysy"))))
-   (build-system gnu-build-system)
-   (propagated-inputs
-    `(("fontconfig" ,fontconfig)
-      ("freetype" ,freetype)
-      ("glib" ,glib)
-      ("libpng" ,libpng)
-      ("libx11" ,libx11)
-      ("libxext" ,libxext)
-      ("libxrender" ,libxrender)
-      ("pixman" ,pixman)))
-   (inputs
-    `(("ghostscript" ,ghostscript)
-      ("libspectre" ,libspectre)
-      ("poppler" ,poppler)
-      ("xorgproto" ,xorgproto)
-      ("zlib" ,zlib)))
-   (native-inputs
-     `(("pkg-config" ,pkg-config)
-      ("python" ,python-wrapper)))
+    (name "cairo")
+    (version "1.16.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://cairographics.org/releases/cairo-"
+                       version ".tar.xz"))
+       (sha256
+        (base32 "0c930mk5xr2bshbdljv005j3j8zr47gqmkry3q6qgvqky6rjjysy"))))
+    (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f  ; see http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00085.html
-       #:configure-flags '("--enable-tee"      ;needed for GNU Icecat
-                           "--enable-xml"      ;for cairo-xml support
-                           "--disable-static")))
-   (synopsis "2D graphics library")
-   (description
-    "Cairo is a 2D graphics library with support for multiple output devices.
+     `(#:tests? #f ; see http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00085.html
+       #:configure-flags
+       (list "--enable-tee"
+             "--enable-xml"
+             "--disable-static")))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)))
+    (inputs
+     `(("ghostscript" ,ghostscript)
+       ("libspectre" ,libspectre)
+       ("poppler" ,poppler)
+       ("xorgproto" ,xorgproto)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("fontconfig" ,fontconfig)
+       ("freetype" ,freetype)
+       ("glib" ,glib)
+       ("libpng" ,libpng)
+       ("libx11" ,libx11)
+       ("libxext" ,libxext)
+       ("libxrender" ,libxrender)
+       ("pixman" ,pixman)))
+    (synopsis "2D graphics library")
+    (description
+     "Cairo is a 2D graphics library with support for multiple output devices.
 Currently supported output targets include the X Window System (via both
 Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file
 output.  Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.
-
 Cairo is designed to produce consistent output on all output media while
 taking advantage of display hardware acceleration when available
 eg. through the X Render Extension).
-
 The cairo API provides operations similar to the drawing operators of
 PostScript and PDF.  Operations in cairo including stroking and filling cubic
 Bézier splines, transforming and compositing translucent images, and
 antialiased text rendering.  All drawing operations can be transformed by any
 affine transformation (scale, rotation, shear, etc.).")
-   (license license:lgpl2.1) ; or Mozilla Public License 1.1
-   (home-page "https://cairographics.org/")))
+    (home-page "https://cairographics.org/")
+    (license license:lgpl2.1)))
 
 (define-public cairo-xcb
   (package
-- 
2.28.0

>From 6639868a35a88667ea103c965d12138bebacb12c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <[email-masked]>
Date: Thu, 24 Sep 2020 11:20:07 -0400
Subject: [PATCH 27/30] gnu: cairo: Change build-system.

* gnu/packages/gtk.scm (cairo) [build-system]: Change from gnu to glib-or-gtk.
---
 gnu/packages/gtk.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index ea4ca684bf..fea6695821 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -131,7 +131,7 @@ tools have full access to view and control running applications.")
                        version ".tar.xz"))
        (sha256
         (base32 "0c930mk5xr2bshbdljv005j3j8zr47gqmkry3q6qgvqky6rjjysy"))))
-    (build-system gnu-build-system)
+    (build-system glib-or-gtk-build-system)
     (arguments
      `(#:tests? #f ; see http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00085.html
        #:configure-flags
-- 
2.28.0

>From 82afad9ea3ca75e07c5c43c77daa7af5ff99e49c Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <[email-masked]>
Date: Thu, 24 Sep 2020 11:24:36 -0400
Subject: [PATCH 28/30] gnu: cairo: Move documentation to separate output.

* gnu/packages/gtk.scm (cairo) [outputs]: New output "doc".
[arguments]<#:configure-flags>[--with-html-dir]: New flag.
---
 gnu/packages/gtk.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index fea6695821..eb76b11e91 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -132,12 +132,17 @@ tools have full access to view and control running applications.")
        (sha256
         (base32 "0c930mk5xr2bshbdljv005j3j8zr47gqmkry3q6qgvqky6rjjysy"))))
     (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
     (arguments
      `(#:tests? #f ; see http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00085.html
        #:configure-flags
-       (list "--enable-tee"
-             "--enable-xml"
-             "--disable-static")))
+       (list
+        "--enable-tee"
+        "--enable-xml"
+        "--disable-static"
+        (string-append "--with-html-dir="
+                       (assoc-ref %outputs "doc")
+                       "/share/gtk-doc/html"))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("python" ,python-wrapper)))
-- 
2.28.0

>From a3ad002396f7b112bb9117d5c4879bf720c40fd4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <[email-masked]>
Date: Thu, 24 Sep 2020 11:27:34 -0400
Subject: [PATCH 29/30] gnu: cairo: Enable some features.

* gnu/packages/gtk.scm (cairo) [native-inputs]: Add gobject-introspection.
[inputs]: Add libdrm. Remove xorgproto and zlib.
[propagated-inputs]: Add libxcb.
---
 gnu/packages/gtk.scm | 38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index eb76b11e91..f7184acb23 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -137,30 +137,44 @@ tools have full access to view and control running applications.")
      `(#:tests? #f ; see http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00085.html
        #:configure-flags
        (list
-        "--enable-tee"
-        "--enable-xml"
         "--disable-static"
+        ;; XXX: To be enabled.
+        ;; "--enable-gallium=yes"
+        ;; "--enable-gl=yes"
+        ;; " --enable-glesv2=yes"
+        ;; "--enable-glesv3=yes"
+        ;; "--enable-cogl=yes"
+        ;; "--enable-directfb=yes"
+        ;; "--enable-vg=yes"
+        "--enable-tee=yes"
+        "--enable-xml=yes"
         (string-append "--with-html-dir="
                        (assoc-ref %outputs "doc")
                        "/share/gtk-doc/html"))))
     (native-inputs
-     `(("pkg-config" ,pkg-config)
+     `(("gobject-introspection" ,gobject-introspection)
+       ("pkg-config" ,pkg-config)
        ("python" ,python-wrapper)))
     (inputs
-     `(("ghostscript" ,ghostscript)
+     `(("drm" ,libdrm)
+       ("ghostscript" ,ghostscript)
        ("libspectre" ,libspectre)
-       ("poppler" ,poppler)
-       ("xorgproto" ,xorgproto)
-       ("zlib" ,zlib)))
+       ("poppler" ,poppler)))
     (propagated-inputs
-     `(("fontconfig" ,fontconfig)
+     `( ;; ("cogl" ,cogl)
+       ;; ("directfb" ,directfb)
+       ("fontconfig" ,fontconfig)
        ("freetype" ,freetype)
        ("glib" ,glib)
+       ;; ("gtk+" ,gtk+)
        ("libpng" ,libpng)
-       ("libx11" ,libx11)
-       ("libxext" ,libxext)
-       ("libxrender" ,libxrender)
-       ("pixman" ,pixman)))
+       ;; ("librsvg" ,librsvg)
+       ;; ("opengl" ,mesa)
+       ("pixman" ,pixman)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xext" ,libxext)
+       ("xrender" ,libxrender)))
     (synopsis "2D graphics library")
     (description
      "Cairo is a 2D graphics library with support for multiple output devices.
-- 
2.28.0

>From 97ed550e5a5c56184722fc14b8795c9030998cfd Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <[email-masked]>
Date: Thu, 24 Sep 2020 11:31:47 -0400
Subject: [PATCH 30/30] gnu: cairo: Update synopsis, description and license.

* gnu/packages/gtk.scm (cairo) [synopsis]: Modify.
[description]: Modify.
[license]: Modify.
---
 gnu/packages/gtk.scm | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index f7184acb23..2afd3489d7 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -175,22 +175,17 @@ tools have full access to view and control running applications.")
        ("xcb" ,libxcb)
        ("xext" ,libxext)
        ("xrender" ,libxrender)))
-    (synopsis "2D graphics library")
-    (description
-     "Cairo is a 2D graphics library with support for multiple output devices.
-Currently supported output targets include the X Window System (via both
-Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file
-output.  Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.
-Cairo is designed to produce consistent output on all output media while
-taking advantage of display hardware acceleration when available
-eg. through the X Render Extension).
-The cairo API provides operations similar to the drawing operators of
-PostScript and PDF.  Operations in cairo including stroking and filling cubic
-Bézier splines, transforming and compositing translucent images, and
-antialiased text rendering.  All drawing operations can be transformed by any
-affine transformation (scale, rotation, shear, etc.).")
+    (synopsis "Multi-platform 2D graphics library")
+    (description "Cairo is a 2D graphics library with support for multiple output
+devices.  Currently supported output targets include the X Window System (via
+both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file
+output.  Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.")
     (home-page "https://cairographics.org/")
-    (license license:lgpl2.1)))
+    (license
+     ;; This project is dual-licensed.
+     (list
+      license:lgpl2.1+
+      license:mpl1.1))))
 
 (define-public cairo-xcb
   (package
-- 
2.28.0