unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 60939@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#60939] [PATCH v2 2/2] gnu: libreoffice: Enable build with skia.
Date: Wed, 18 Jan 2023 22:27:35 +0100	[thread overview]
Message-ID: <20230118212735.27131-2-ngraves@ngraves.fr> (raw)
In-Reply-To: <20230118212735.27131-1-ngraves@ngraves.fr>

* 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





      reply	other threads:[~2023-01-18 21:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 18:24 [bug#60939] [PATCH] Add skia-for-libreoffice Nicolas Graves via Guix-patches via
2023-01-18 18:34 ` [bug#60939] [PATCH 1/2] gnu: " Nicolas Graves via Guix-patches via
2023-01-18 18:35   ` [bug#60939] [PATCH 2/2] gnu: libreoffice: Enable build with skia Nicolas Graves via Guix-patches via
2023-01-18 21:27 ` [bug#60939] [PATCH v2 1/2] gnu: Add skia-for-libreoffice Nicolas Graves via Guix-patches via
2023-01-18 21:27   ` Nicolas Graves via Guix-patches via [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230118212735.27131-2-ngraves@ngraves.fr \
    --to=guix-patches@gnu.org \
    --cc=60939@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).