From patchwork Mon Apr 25 03:56:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 38863 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 212AA27BBEA; Mon, 25 Apr 2022 05:22:57 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8A8F827BBE9 for ; Mon, 25 Apr 2022 05:22:56 +0100 (BST) Received: from localhost ([::1]:46332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niqFT-0002ZF-Ma for patchwork@mira.cbaines.net; Mon, 25 Apr 2022 00:22:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nipvb-00080W-Hn for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:27 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nipvZ-0001nQ-AX for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:23 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nipvZ-0008FM-7r for guix-patches@gnu.org; Mon, 25 Apr 2022 00:02:21 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55104] [PATCH 080/232] gnu: Add skia. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Apr 2022 04:02:21 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55104 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55104@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 55104-submit@debbugs.gnu.org id=B55104.165085933031489 (code B ref 55104); Mon, 25 Apr 2022 04:02:21 +0000 Received: (at 55104) by debbugs.gnu.org; 25 Apr 2022 04:02:10 +0000 Received: from localhost ([127.0.0.1]:60890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nipvN-0008Ba-LB for submit@debbugs.gnu.org; Mon, 25 Apr 2022 00:02:10 -0400 Received: from mail-qk1-f179.google.com ([209.85.222.179]:33452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nipu2-0007sz-1O for 55104@debbugs.gnu.org; Mon, 25 Apr 2022 00:00:47 -0400 Received: by mail-qk1-f179.google.com with SMTP id s4so10018421qkh.0 for <55104@debbugs.gnu.org>; Sun, 24 Apr 2022 21:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FhynO9n26h9Vsiuc0EznnyFaMdJQt2ozkpHuTldXwCE=; b=HqtceMZJi3Q6A0yODop0bT5TF8zZYbmNPbQEC+7jH40cLsOJ2yTfZFGJPCMLVgBLvz rzaQdyOEAbC9ayML7bqMV2MO3BTeHx+VgONRaNPUYM0sCP+kVPXSbftwThztWItySPuD LFI/yCp4/S0BSANlOXTTcdRuHr4uK3cn3xzK4kuoqJ4KMv27ftenW8Kyorau5CwxOw1K 53ZsI2a1ojM/00QVspPtKjKwNba/uN8W16rZgxXrhoQt3ZiYz8tmpgEI95Gwls/gMQZT nGcjx+Qn2khRlnqGlq8BCQPJaIzmdC3rFK0cEVI2SdtLPoFrAoIcAmNcOLAe0GNwSy2S w+MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FhynO9n26h9Vsiuc0EznnyFaMdJQt2ozkpHuTldXwCE=; b=sLw/QUCwsHmpTn+J4KJkkzdS4lclFAeZRQd/zv6jtYb1x/IXpjlz3wWDGGdxHp/Exn JFHnR2IsJLP5A3HhBfXBL/e8P4cAqCruQ1MgXH37FIwdPtI872mLp5u7CkcGdaLxaU5x ems9vCcLZPsIJZWFd0euiasm8kQNKwA9icyIZ02Mnix/7Oz1VExZsQn0fOrFCnrik1LR DTeNS0RyA7CIorEukUU/0zzVjUhATVQxQLhltO71VFmw3Y8dhwBov3ZivUWb8kRbSzRR x0oH6yvyJVWgoqOamHY4qUINnKpAPyFa1q5xKiBX4NZCdbhvFcsCQ3TKPyRhYpMtlhY8 +Swg== X-Gm-Message-State: AOAM531A/0/sf9WQ5MExGETJne0lM2CfXkbETBzcgvnG74CZPG9EtdWv Ci0gVXURO5aZkIvkUfjCb0Juesak3x1ImA== X-Google-Smtp-Source: ABdhPJwfoMarTMuy3rWLOAs8LfZAFLpZ0iQtleqX/DYOZe4srIFeMa4I91sHYyZG0JCzEBOLV/ObLA== X-Received: by 2002:a37:94c1:0:b0:69e:afbb:675f with SMTP id w184-20020a3794c1000000b0069eafbb675fmr8950611qkd.334.1650859240417; Sun, 24 Apr 2022 21:00:40 -0700 (PDT) Received: from localhost.localdomain (dsl-150-232.b2b2c.ca. [66.158.150.232]) by smtp.gmail.com with ESMTPSA id w82-20020a376255000000b0069ee3f0ae63sm4478142qkb.45.2022.04.24.21.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 21:00:40 -0700 (PDT) From: Maxim Cournoyer Date: Sun, 24 Apr 2022 23:56:46 -0400 Message-Id: <20220425035918.25683-80-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220425035918.25683-1-maxim.cournoyer@gmail.com> References: <20220425035918.25683-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 50f562abc1..16e182b827 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -55,6 +55,7 @@ (define-module (gnu packages graphics) #: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 @@ (define-module (gnu packages graphics) #: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) @@ -1864,6 +1866,113 @@ (define-public coin3D-4 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")