GNU bug report logs - #60939
[PATCH] Add skia-for-libreoffice.

Previous Next

Package: guix-patches;

Reported by: Nicolas Graves <ngraves <at> ngraves.fr>

Date: Wed, 18 Jan 2023 18:26:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 60939 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [bug#60939] [PATCH v2 2/2] gnu: libreoffice: Enable build with skia.
Date: Wed, 18 Jan 2023 22:27:35 +0100
* gnu/packages/libreoffice.scm (libreoffice): Enable build with skia.
---
 gnu/packages/libreoffice.scm | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index 372b18a24f..72cd17fa09 100644
--- a/gnu/packages/libreoffice.scm
+++ b/gnu/packages/libreoffice.scm
@@ -970,6 +970,34 @@ (define-public libreoffice
                 (("/usr/bin/xdg-open")
                  (search-input-file inputs "/bin/xdg-open")))
               (setenv "CPPFLAGS" "-std=c++17")))
+          (add-before 'configure 'include-built-skia
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let* ((incdir (search-input-directory inputs "include/skia/"))
+                     (outdir (string-drop-right
+                              incdir
+                              (string-length "include/skia/")))
+                     (libdir (string-append outdir "lib")))
+                (substitute* "RepositoryExternal.mk"
+                  ;; Delete options that trigger skia build.
+                  (("-DSK_USER_CONFIG_HEADER=\"<\\$\\(BUILDDIR\\)\\/config_host\\/config_skia\\.h>\"")
+                   "")
+                  (("-DSKIA_DLL")
+                   "")
+                  ;; Include skia .h files.
+                  (("\\$\\(call gb_UnpackedTarball_get_dir,skia\\)")
+                   incdir)
+                  ;; Use skia as an external library.
+                  (("\\$\\(call gb_LinkTarget_use_libraries,\\$\\(1\\),skia\\)")
+                   (string-append "$(call gb_LinkTarget_add_libs,$(1),"
+                                  "-L" libdir " -lskialo)")))
+                ;; Delete skia library unpack and build steps.
+                (substitute* "external/skia/Module_skia.mk"
+                  (("UnpackedTarball_skia") "")
+                  (("Library_skia") ""))
+                ;; Symlink the library (used in make install).
+                (mkdir-p "instdir/program")
+                (symlink (search-input-file inputs "lib/libskialo.so")
+                         "instdir/program/libskialo.so"))))
           (add-after 'install 'reset-zip-timestamps
             (lambda _
               (for-each (lambda (file)
@@ -1042,7 +1070,6 @@ (define (install-appdata app)
          "--without-java"
          ;; FIXME: Enable once the corresponding inputs are packaged.
          "--disable-coinmp"
-         "--disable-skia"
          ;; This could (Debian does this) be a separate output containing only
          ;; program/libfirebird_sdbclo.so, if there's a way to point to it.
          "--enable-firebird-sdbc"
@@ -1138,6 +1165,7 @@ (define (install-appdata app)
            qrcodegen-cpp
            redland
            sane-backends
+           skia-for-libreoffice
            unixodbc
            unzip
            vigra
-- 
2.38.1





This bug report was last modified 2 years and 148 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.