[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
80/242: gnu: Add skia.
From: |
guix-commits |
Subject: |
80/242: gnu: Add skia. |
Date: |
Thu, 12 May 2022 14:14:11 -0400 (EDT) |
apteryx pushed a commit to branch master
in repository guix.
commit f78ef318247741eadda87f3b8806bb0bb2fe11ae
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Fri Apr 8 16:41:13 2022 -0400
gnu: Add skia.
* gnu/packages/graphics.scm (skia): New variable.
---
gnu/packages/graphics.scm | 109 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 109 insertions(+)
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index b5a81ef196..e966a82dbb 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -55,6 +55,7 @@
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
+ #:use-module (gnu packages build-tools)
#:use-module (gnu packages cdrom)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
@@ -88,6 +89,7 @@
#:use-module (gnu packages maths)
#:use-module (gnu packages mp3)
#:use-module (gnu packages multiprecision)
+ #:use-module (gnu packages ninja)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages pdf)
#:use-module (gnu packages perl)
@@ -1858,6 +1860,113 @@ library for 3D visualization and visual simulation
software in the scientific
and engineering community.")
(license license:bsd-3)))
+(define-public skia
+ ;; Releases follow those of Chromium, about every 6 weeks. The release
+ ;; version can be found on this page:
+ ;; https://skia.org/docs/user/release/release_notes/. The commit used
+ ;; should be the last commit, as recommended at
+ ;; https://skia.org/docs/user/release/.
+ (let ((version "98")
+ (revision "0")
+ (commit "55c56abac381e1ae3f0116c410bed81b05e0a38a"))
+ (package
+ (name "skia")
+ (version (git-version version revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://skia.googlesource.com/skia.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1ldns2j1g2wj2phlxr9zqkdgs5g64pisxhwxcrq9ijn8a3jhafr2"))))
+ (build-system gnu-build-system) ;actually GN + Ninja
+ (arguments
+ (list
+ ;; Running the test suite would require 'dm'; unfortunately the tool
+ ;; can only be built for debug builds, which require fetching third
+ ;; party sources.
+ #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "BUILD.gn"
+ ;; Workaround a bug in the zlib third_party definition, that
+ ;; fails the build even when zlib is found from the system.
+ (("deps = \\[ \"//third_party/zlib\" ]")
+ "deps = []"))
+ (invoke "gn" "gen" "build"
+ (string-append
+ ;;
+ "--args="
+ "cc=\"gcc\" " ;defaults to 'cc'
+ "is_official_build=true " ;to use system libraries
+ "is_component_build=true " ;build as a shared library
+ ;; Specify where locate the harfbuzz and freetype
+ ;; includes.
+ (format #f "extra_cflags=[\"-I~a\",\"-I~a\"] "
+ (search-input-directory inputs
+ "include/harfbuzz")
+ (search-input-directory inputs
+ "include/freetype2"))
+ ;; Otherwise the validate-runpath phase fails.
+ "extra_ldflags=[\"-Wl,-rpath=" #$output "/lib\"] "
+ ;; Disabled, otherwise the build system attempts to
+ ;; download the SDK at build time.
+ "skia_use_dng_sdk=false "))))
+ (replace 'build
+ (lambda* (#:key parallel-build? #:allow-other-keys)
+ (let ((job-count (if parallel-build?
+ (number->string (parallel-job-count))
+ "1")))
+ (invoke "ninja" "-j" job-count "-C" "build"))))
+ (replace 'install
+ (lambda _
+ ;; Install headers.
+ (for-each (lambda (h)
+ (install-file h (string-append
+ #$output "/include/skia/"
+ (dirname h))))
+ (find-files "." "\\.h$"))
+ ;; Install libraries.
+ (for-each (lambda (lib)
+ (install-file lib (string-append #$output "/lib")))
+ (find-files "build" "^lib.*\\.(a|so)"))
+ ;; This pkgconfig file is useful at least to the
+ ;; python-skia-pathops package.
+ (define skia.pc (string-append #$output
+ "/lib/pkgconfig/skia.pc"))
+ (mkdir-p (dirname skia.pc))
+ (call-with-output-file skia.pc
+ (lambda (port)
+ (format port "\
+prefix=~a
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include/skia
+
+Name: skia
+Description: 2D graphic library for drawing text, geometries and images.
+URL: https://skia.org/
+Version: ~a
+Libs: -L${libdir} -lskia
+Cflags: -I${includedir}~%" #$output #$version))))))))
+ (native-inputs (list gn libjpeg-turbo ninja pkg-config python-wrapper))
+ (inputs (list expat fontconfig freetype harfbuzz mesa libwebp zlib))
+ (home-page "https://skia.org/")
+ (synopsis "2D graphics library")
+ (description "Skia is an open source 2D graphics library. It can be
+used for drawing text, geometries, and images and has support for:
+@itemize
+@item 3x3 matrices with perspective
+@item antialiasing, transparency, filters
+@item shaders, xfermodes, maskfilters, patheffects
+@item subpixel text
+@end itemize")
+ (license license:bsd-3))))
+
(define-public superfamiconv
(package
(name "superfamiconv")
- 10/242: gnu: python-ipython: Update to 8.2.0 [fixes CVE-2022-21699]., (continued)
- 10/242: gnu: python-ipython: Update to 8.2.0 [fixes CVE-2022-21699]., guix-commits, 2022/05/12
- 19/242: gnu: Add python-pcpp., guix-commits, 2022/05/12
- 36/242: gnu: Add python-types-toml., guix-commits, 2022/05/12
- 45/242: gnu: Add python-path-bootstrap., guix-commits, 2022/05/12
- 58/242: gnu: Add python-tempora., guix-commits, 2022/05/12
- 75/242: gnu: python-scipy: Update to 1.8.0 and enable parallel build., guix-commits, 2022/05/12
- 81/242: gnu: Add python-skia-pathops., guix-commits, 2022/05/12
- 92/242: gnu: Add python-untangle., guix-commits, 2022/05/12
- 107/242: gnu: python-ipyparallel: Update to 8.2.1., guix-commits, 2022/05/12
- 84/242: gnu: Add python-ufo2ft., guix-commits, 2022/05/12
- 80/242: gnu: Add skia.,
guix-commits <=
- 99/242: gnu: Add python-pytest-forked-next., guix-commits, 2022/05/12
- 119/242: gnu: Add python-docrepr., guix-commits, 2022/05/12
- 128/242: download: Add a mirror for CTAN., guix-commits, 2022/05/12
- 136/242: gnu: Add python-openapi-schema-validator., guix-commits, 2022/05/12
- 237/242: gnu: python-pytest-sanic: Update to 1.9.1., guix-commits, 2022/05/12
- 142/242: gnu: python-httpx: Update to 0.22.0., guix-commits, 2022/05/12
- 144/242: gnu: Add python-socksio., guix-commits, 2022/05/12
- 148/242: gnu: Add python-aioredis., guix-commits, 2022/05/12
- 157/242: gnu: python-numba: Update to 0.55.1., guix-commits, 2022/05/12
- 168/242: gnu: python-jupyter-kernel-mgmt: Update to 0.5.1 and disable tests., guix-commits, 2022/05/12