2022-11-08 13:18:32 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchgit, python3, gn, ninja
|
2024-01-24 01:57:31 +00:00
|
|
|
, fontconfig, expat, icu, libglvnd, libjpeg, libpng, libwebp, zlib
|
2022-11-08 13:18:32 +00:00
|
|
|
, mesa, libX11, harfbuzzFull
|
2019-06-04 12:16:34 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# skia-deps.nix is generated by: ./skia-make-deps.sh 'angle2|dng_sdk|piex|sfntly'
|
|
|
|
depSrcs = import ./skia-deps.nix { inherit fetchgit; };
|
|
|
|
in
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-07-23 15:52:53 +00:00
|
|
|
pname = "skia";
|
2022-11-08 13:18:32 +00:00
|
|
|
version = "aseprite-m102";
|
2019-06-04 12:16:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aseprite";
|
|
|
|
repo = "skia";
|
2022-11-08 13:18:32 +00:00
|
|
|
# latest commit from aseprite-m102 branch
|
|
|
|
rev = "861e4743af6d9bf6077ae6dda7274e5a136ee4e2";
|
|
|
|
hash = "sha256-IlZbalmHl549uDUfPG8hlzub8TLWhG0EsV6HVAPdsl0=";
|
2019-06-04 12:16:34 +00:00
|
|
|
};
|
|
|
|
|
2022-11-08 13:18:32 +00:00
|
|
|
nativeBuildInputs = [ python3 gn ninja ];
|
2019-06-04 12:16:34 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2024-01-24 01:57:31 +00:00
|
|
|
fontconfig expat icu libglvnd libjpeg libpng libwebp zlib
|
2022-11-08 13:18:32 +00:00
|
|
|
mesa libX11 harfbuzzFull
|
2019-06-04 12:16:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = with depSrcs; ''
|
|
|
|
mkdir -p third_party/externals
|
|
|
|
ln -s ${angle2} third_party/externals/angle2
|
|
|
|
ln -s ${dng_sdk} third_party/externals/dng_sdk
|
|
|
|
ln -s ${piex} third_party/externals/piex
|
|
|
|
ln -s ${sfntly} third_party/externals/sfntly
|
|
|
|
'';
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
2022-11-08 13:18:32 +00:00
|
|
|
gn gen out/Release --args="is_debug=false is_official_build=true extra_cflags=[\"-I${harfbuzzFull.dev}/include/harfbuzz\"]"
|
2019-06-04 12:16:34 +00:00
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2022-11-08 13:18:32 +00:00
|
|
|
ninja -C out/Release skia modules
|
2019-06-04 12:16:34 +00:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
|
|
|
|
# Glob will match all subdirs.
|
|
|
|
shopt -s globstar
|
|
|
|
|
|
|
|
# All these paths are used in some way when building aseprite.
|
|
|
|
cp -r --parents -t $out/ \
|
|
|
|
include/codec \
|
|
|
|
include/config \
|
|
|
|
include/core \
|
|
|
|
include/effects \
|
|
|
|
include/gpu \
|
|
|
|
include/private \
|
|
|
|
include/utils \
|
2022-11-08 13:18:32 +00:00
|
|
|
include/third_party/skcms/*.h \
|
2019-06-04 12:16:34 +00:00
|
|
|
out/Release/*.a \
|
|
|
|
src/gpu/**/*.h \
|
2022-11-08 13:18:32 +00:00
|
|
|
src/core/*.h \
|
|
|
|
modules/skshaper/include/*.h \
|
2019-06-04 12:16:34 +00:00
|
|
|
third_party/externals/angle2/include \
|
|
|
|
third_party/skcms/**/*.h
|
|
|
|
'';
|
2021-07-23 15:52:53 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Skia is a complete 2D graphic library for drawing Text, Geometries, and Images";
|
|
|
|
homepage = "https://skia.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2019-06-04 12:16:34 +00:00
|
|
|
}
|