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 1/2] gnu: Add skia-for-libreoffice.
Date: Wed, 18 Jan 2023 22:27:34 +0100 [thread overview]
Message-ID: <20230118212735.27131-1-ngraves@ngraves.fr> (raw)
In-Reply-To: <87pmbblmz5.fsf@ngraves.fr>
* gnu/packages/libreoffice.scm (skia-for-libreoffice): New variable.
---
gnu/packages/libreoffice.scm | 66 ++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index b959470d8f..372b18a24f 100644
--- a/gnu/packages/libreoffice.scm
+++ b/gnu/packages/libreoffice.scm
@@ -75,6 +75,7 @@ (define-module (gnu packages libreoffice)
#:use-module (gnu packages image)
#:use-module (gnu packages java)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages llvm)
#:use-module (gnu packages logging)
#:use-module (gnu packages m4)
#:use-module (gnu packages maths)
@@ -1155,3 +1156,68 @@ (define (install-appdata app)
'((release-monitoring-url
. "https://www.libreoffice.org/download/download-libreoffice/")))
(license license:mpl2.0)))
+
+(define skia-tarball
+ (origin
+ (method url-fetch)
+ (uri "https://dev-www.libreoffice.org/src/skia-m103-b301ff025004c9cd82816c86c547588e6c24b466.tar.xz")
+ (sha256
+ (base32 "1navlqbm6ja78whj5p1jwnlg3fmnpqjwh00dmbm4n424gqjad560"))))
+
+(define-public skia-for-libreoffice
+ (package
+ (inherit libreoffice)
+ (name "skia-for-libreoffice")
+ (arguments
+ (substitute-keyword-arguments (package-arguments libreoffice)
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ (delete 'include-built-skia)
+ (delete 'bin-and-desktop-install)
+ (add-after 'insert-external-tarballs 'insert-skia-tarball
+ (lambda _
+ (copy-file
+ #$skia-tarball
+ (string-append
+ "external/tarballs/"
+ "skia-m103-b301ff025004c9cd82816c86c547588e6c24b466.tar.xz"))))
+ (replace 'build
+ (lambda _ (invoke "make" "Library_skia")))
+ (replace 'install
+ (lambda _
+ (with-directory-excursion "instdir/program"
+ (for-each
+ (lambda (lib)
+ (install-file lib (string-append #$output "/lib")))
+ (find-files "." "\\.so$")))
+ (define* (install-header header)
+ (let* ((inc (string-append #$output "/include/"))
+ (ridx (string-rindex header #\/))
+ (dir (string-append inc (string-take header ridx))))
+ (install-file header dir)))
+ (with-directory-excursion "workdir/UnpackedTarball"
+ (for-each install-header (find-files "skia" "\\.h")))))))
+ ((#:configure-flags flags)
+ ;; Else needs llvm gold linker.
+ `(delete "--enable-lto" ,flags))
+ ((#:validate-runpath? _ #f) #f)))
+ (native-inputs (modify-inputs
+ (append (package-native-inputs libreoffice)
+ ;; here because of configure step
+ (package-inputs libreoffice))
+ (prepend clang-11)
+ ;; Avoid circular dependency.
+ (delete "skia-for-libreoffice")))
+ (inputs (list expat fontconfig freetype harfbuzz mesa libwebp zlib))
+ (home-page "https://skia.org/")
+ (synopsis "2D graphics library")
+ (description
+ "Skia is a 2D graphics library for drawing text, geometries, and images.
+It supports:
+@itemize
+@item 3x3 matrices with perspective
+@item antialiasing, transparency, filters
+@item shaders, xfermodes, maskfilters, patheffects
+@item subpixel text
+@end itemize")
+ (license license:bsd-3)))
--
2.38.1
next prev parent 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 ` Nicolas Graves via Guix-patches via [this message]
2023-01-18 21:27 ` [bug#60939] [PATCH v2 " Nicolas Graves via Guix-patches via
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-1-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).