evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / sk / skia-aseprite / package.nix
blob3b34ad631862fb4763c6924a7f084ca45765c42c
2   aseprite,
3   clangStdenv,
4   expat,
5   fetchFromGitHub,
6   fetchgit,
7   fontconfig,
8   gn,
9   harfbuzzFull,
10   icu,
11   lib,
12   libglvnd,
13   libjpeg,
14   libpng,
15   libwebp,
16   libX11,
17   mesa,
18   ninja,
19   python3,
20   zlib,
23 let
24   # deps.nix is generated by ./update.sh
25   depSrcs = import ./deps.nix { inherit fetchgit; };
27 clangStdenv.mkDerivation (finalAttrs: {
28   pname = "skia-aseprite";
29   version = "m102-861e4743af";
31   src = fetchFromGitHub {
32     owner = "aseprite";
33     repo = "skia";
34     rev = finalAttrs.version;
35     hash = "sha256-IlZbalmHl549uDUfPG8hlzub8TLWhG0EsV6HVAPdsl0=";
36   };
38   nativeBuildInputs = [
39     gn
40     ninja
41     python3
42   ];
44   preConfigure = with depSrcs; ''
45     mkdir -p third_party/externals
46     ln -s ${angle2} third_party/externals/angle2
47     ln -s ${dng_sdk} third_party/externals/dng_sdk
48     ln -s ${piex} third_party/externals/piex
49     ln -s ${sfntly} third_party/externals/sfntly
50   '';
52   configurePhase = ''
53     runHook preConfigure
54     gn gen lib --args="is_debug=false is_official_build=true extra_cflags=[\"-I${harfbuzzFull.dev}/include/harfbuzz\"]"
55     runHook postConfigure
56   '';
58   buildInputs = [
59     expat
60     fontconfig
61     harfbuzzFull
62     icu
63     libglvnd
64     libjpeg
65     libpng
66     libwebp
67     libX11
68     mesa
69     zlib
70   ];
72   buildPhase = ''
73     runHook preBuild
74     ninja -C lib skia modules
75     runHook postBuild
76   '';
78   installPhase = ''
79     runHook preInstall
80     mkdir -p $out
82     # Glob will match all subdirs.
83     shopt -s globstar
85     # All these paths are used in some way when building Aseprite.
86     cp -r --parents -t $out/ \
87       include/codec \
88       include/config \
89       include/core \
90       include/effects \
91       include/gpu \
92       include/private \
93       include/utils \
94       include/third_party/skcms/*.h \
95       lib/*.a \
96       modules/skshaper/include/*.h \
97       src/core/*.h \
98       src/gpu/**/*.h \
99       third_party/externals/angle2/include \
100       third_party/skcms/**/*.h
102     runHook postInstall
103   '';
105   passthru.updateScript = [ ./update.sh ] ++ builtins.attrNames depSrcs;
107   meta = {
108     description = "Complete 2D graphic library for drawing Text, Geometries, and Images (Aseprite's fork)";
109     homepage = "https://skia.org/";
110     downloadPage = "https://github.com/aseprite/skia";
111     license = lib.licenses.bsd3;
112     inherit (aseprite.meta) maintainers;
113     platforms = lib.platforms.all;
114   };