2019-06-04 13:16:34 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchgit, python2, gn, ninja
|
2020-02-18 06:57:40 +00:00
|
|
|
, fontconfig, expat, icu58, libglvnd, libjpeg, libpng, libwebp, zlib
|
2019-06-04 13:16:34 +01:00
|
|
|
, mesa, libX11
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# skia-deps.nix is generated by: ./skia-make-deps.sh 'angle2|dng_sdk|piex|sfntly'
|
|
|
|
depSrcs = import ./skia-deps.nix { inherit fetchgit; };
|
2020-03-25 22:32:03 +00:00
|
|
|
gnOld = gn.overrideAttrs (oldAttrs: rec {
|
|
|
|
version = "20190403";
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://gn.googlesource.com/gn";
|
|
|
|
rev = "64b846c96daeb3eaf08e26d8a84d8451c6cb712b";
|
|
|
|
sha256 = "1v2kzsshhxn0ck6gd5w16gi2m3higwd9vkyylmsczxfxnw8skgpy";
|
|
|
|
};
|
|
|
|
});
|
2019-06-04 13:16:34 +01:00
|
|
|
in
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-06-04 13:16:34 +01:00
|
|
|
name = "skia-aseprite-m71";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aseprite";
|
|
|
|
repo = "skia";
|
|
|
|
# latest commit from aseprite-m71 branch
|
2020-03-25 22:32:03 +00:00
|
|
|
rev = "89e4ca4352d05adc892f5983b108433f29b2c0c2"; # TODO: Remove the gnOld override
|
2019-06-04 13:16:34 +01:00
|
|
|
sha256 = "0n3vrkswvi6rib9zv2pzi18h3j5wm7flmgkgaikcm6q7iw4l2c7x";
|
|
|
|
};
|
|
|
|
|
2020-03-25 22:32:03 +00:00
|
|
|
nativeBuildInputs = [ python2 gnOld ninja ];
|
2019-06-04 13:16:34 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
2020-02-18 06:57:40 +00:00
|
|
|
fontconfig expat icu58 libglvnd libjpeg libpng libwebp zlib
|
2019-06-04 13:16:34 +01:00
|
|
|
mesa libX11
|
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
gn gen out/Release --args="is_debug=false is_official_build=true"
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
ninja -C out/Release skia
|
|
|
|
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 \
|
|
|
|
out/Release/*.a \
|
|
|
|
src/gpu/**/*.h \
|
|
|
|
third_party/externals/angle2/include \
|
|
|
|
third_party/skcms/**/*.h
|
|
|
|
'';
|
|
|
|
}
|