parent
6104102c24
commit
caa4e6dcb2
@ -0,0 +1,23 @@ |
||||
{ fetchgit }: |
||||
{ |
||||
angle2 = fetchgit { |
||||
url = "https://chromium.googlesource.com/angle/angle.git"; |
||||
rev = "956ab4d9fab36be9929e63829475d4d69b2c681c"; |
||||
sha256 = "0fcw04wwkn3ixr9l9k0d32n78r9g72p31ii9i5spsq2d0wlylr38"; |
||||
}; |
||||
dng_sdk = fetchgit { |
||||
url = "https://android.googlesource.com/platform/external/dng_sdk.git"; |
||||
rev = "96443b262250c390b0caefbf3eed8463ba35ecae"; |
||||
sha256 = "1rsr7njhj7c5p87hfznj069fdc3qqhvvnq9sa2rb8c4q849rlzx6"; |
||||
}; |
||||
piex = fetchgit { |
||||
url = "https://android.googlesource.com/platform/external/piex.git"; |
||||
rev = "bb217acdca1cc0c16b704669dd6f91a1b509c406"; |
||||
sha256 = "05ipmag6k55jmidbyvg5mkqm69zfw03gfkqhi9jnjlmlbg31y412"; |
||||
}; |
||||
sfntly = fetchgit { |
||||
url = "https://chromium.googlesource.com/external/github.com/googlei18n/sfntly.git"; |
||||
rev = "b18b09b6114b9b7fe6fc2f96d8b15e8a72f66916"; |
||||
sha256 = "0zf1h0dibmm38ldypccg4faacvskmd42vsk6zbxlfcfwjlqm6pp4"; |
||||
}; |
||||
} |
@ -0,0 +1,37 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
FILTER=$1 |
||||
OUT=skia-deps.nix |
||||
REVISION=89e4ca4352d05adc892f5983b108433f29b2c0c2 |
||||
DEPS=$(curl -s https://raw.githubusercontent.com/aseprite/skia/$REVISION/DEPS) |
||||
THIRD_PARTY_DEPS=$(echo "$DEPS" | grep third_party | grep "#" -v | sed 's/"//g') |
||||
|
||||
function write_fetch_defs () |
||||
{ |
||||
while read -r DEP; do |
||||
NAME=$(echo "$DEP" | cut -d: -f1 | cut -d/ -f3 | sed 's/ //g') |
||||
URL=$(echo "$DEP" | cut -d: -f2- | cut -d@ -f1 | sed 's/ //g') |
||||
REV=$(echo "$DEP" | cut -d: -f2- | cut -d@ -f2 | sed 's/[ ,]//g') |
||||
|
||||
echo "Fetching $NAME@$REV" |
||||
PREFETCH=$(nix-prefetch-git --rev "$REV" "$URL") |
||||
|
||||
( |
||||
cat <<EOF |
||||
$NAME = fetchgit { |
||||
url = "$URL"; |
||||
rev = "$REV"; |
||||
sha256 = $(echo $PREFETCH | jq '.sha256'); |
||||
}; |
||||
EOF |
||||
) >> "$OUT" |
||||
|
||||
echo "----------" |
||||
echo |
||||
done <<< "$1" |
||||
} |
||||
|
||||
echo "{ fetchgit }:" > "$OUT" |
||||
echo "{" >> "$OUT" |
||||
write_fetch_defs "$(echo "$THIRD_PARTY_DEPS" | grep -E "$FILTER")" |
||||
echo "}" >> "$OUT" |
@ -0,0 +1,68 @@ |
||||
{ stdenv, lib, fetchFromGitHub, fetchgit, python2, gn, ninja |
||||
, fontconfig, expat, icu58, libjpeg, libpng, libwebp, zlib |
||||
, 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; }; |
||||
in |
||||
stdenv.mkDerivation rec { |
||||
name = "skia-aseprite-m71"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "aseprite"; |
||||
repo = "skia"; |
||||
# latest commit from aseprite-m71 branch |
||||
rev = "89e4ca4352d05adc892f5983b108433f29b2c0c2"; |
||||
sha256 = "0n3vrkswvi6rib9zv2pzi18h3j5wm7flmgkgaikcm6q7iw4l2c7x"; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ python2 gn ninja ]; |
||||
|
||||
buildInputs = [ |
||||
fontconfig expat icu58 libjpeg libpng libwebp zlib |
||||
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 |
||||
''; |
||||
} |
Loading…
Reference in new issue