skia-aseprite: init at m102-861e4743af

vigress8 e329e660 099266ab

+190 -121
+4 -4
pkgs/applications/editors/aseprite/skia-deps.nix pkgs/by-name/sk/skia-aseprite/deps.nix
··· 3 3 angle2 = fetchgit { 4 4 url = "https://chromium.googlesource.com/angle/angle.git"; 5 5 rev = "8718783526307a3fbb35d4c1ad4e8101262a0d73"; 6 - sha256 = "0c90q8f4syvwcayw58743sa332dcpkmblwh3ffkjqn5ygym04xji"; 6 + hash = "sha256-UXYCqn++WCyncwNyuuq8rIkxlB7koMK9Ynx7TRzCIDE="; 7 7 }; 8 8 dng_sdk = fetchgit { 9 9 url = "https://android.googlesource.com/platform/external/dng_sdk.git"; 10 10 rev = "c8d0c9b1d16bfda56f15165d39e0ffa360a11123"; 11 - sha256 = "1nlq082aij7q197i5646bi4vd2il7fww6sdwhqisv2cs842nyfwm"; 11 + hash = "sha256-lTtvBUGaia0jhrxpw7k7NIq2SVyGmBJPCvjIqAQCmNo="; 12 12 }; 13 13 piex = fetchgit { 14 14 url = "https://android.googlesource.com/platform/external/piex.git"; 15 15 rev = "bb217acdca1cc0c16b704669dd6f91a1b509c406"; 16 - sha256 = "05ipmag6k55jmidbyvg5mkqm69zfw03gfkqhi9jnjlmlbg31y412"; 16 + hash = "sha256-IhAfxlu0UmllihBP9wbg7idT8azlbb9arLKUaZ6qNxY="; 17 17 }; 18 18 sfntly = fetchgit { 19 19 url = "https://chromium.googlesource.com/external/github.com/googlei18n/sfntly.git"; 20 20 rev = "b55ff303ea2f9e26702b514cf6a3196a2e3e2974"; 21 - sha256 = "1qi5rfzmwfrji46x95g6dsb03i1v26700kifl2hpgm3pqhr7afpz"; 21 + hash = "sha256-/zp1MsR31HehoC5OAI4RO8QBlm7mldQNiTI7Xr/LJeI="; 22 22 }; 23 23 }
-37
pkgs/applications/editors/aseprite/skia-make-deps.sh
··· 1 - #!/usr/bin/env bash 2 - 3 - FILTER=$1 4 - OUT=skia-deps.nix 5 - REVISION=861e4743af6d9bf6077ae6dda7274e5a136ee4e2 6 - DEPS=$(curl -s https://raw.githubusercontent.com/aseprite/skia/$REVISION/DEPS) 7 - THIRD_PARTY_DEPS=$(echo "$DEPS" | grep third_party | grep "#" -v | sed 's/"//g') 8 - 9 - function write_fetch_defs () 10 - { 11 - while read -r DEP; do 12 - NAME=$(echo "$DEP" | cut -d: -f1 | cut -d/ -f3 | sed 's/ //g') 13 - URL=$(echo "$DEP" | cut -d: -f2- | cut -d@ -f1 | sed 's/ //g') 14 - REV=$(echo "$DEP" | cut -d: -f2- | cut -d@ -f2 | sed 's/[ ,]//g') 15 - 16 - echo "Fetching $NAME@$REV" 17 - PREFETCH=$(nix-prefetch-git --rev "$REV" "$URL") 18 - 19 - ( 20 - cat <<EOF 21 - $NAME = fetchgit { 22 - url = "$URL"; 23 - rev = "$REV"; 24 - sha256 = $(echo $PREFETCH | jq '.sha256'); 25 - }; 26 - EOF 27 - ) >> "$OUT" 28 - 29 - echo "----------" 30 - echo 31 - done <<< "$1" 32 - } 33 - 34 - echo "{ fetchgit }:" > "$OUT" 35 - echo "{" >> "$OUT" 36 - write_fetch_defs "$(echo "$THIRD_PARTY_DEPS" | grep -E "$FILTER")" 37 - echo "}" >> "$OUT"
-80
pkgs/applications/editors/aseprite/skia.nix
··· 1 - { stdenv, lib, fetchFromGitHub, fetchgit, python3, gn, ninja 2 - , fontconfig, expat, icu, libglvnd, libjpeg, libpng, libwebp, zlib 3 - , mesa, libX11, harfbuzzFull 4 - }: 5 - 6 - let 7 - # skia-deps.nix is generated by: ./skia-make-deps.sh 'angle2|dng_sdk|piex|sfntly' 8 - depSrcs = import ./skia-deps.nix { inherit fetchgit; }; 9 - in 10 - stdenv.mkDerivation { 11 - pname = "skia"; 12 - version = "aseprite-m102"; 13 - 14 - src = fetchFromGitHub { 15 - owner = "aseprite"; 16 - repo = "skia"; 17 - # latest commit from aseprite-m102 branch 18 - rev = "861e4743af6d9bf6077ae6dda7274e5a136ee4e2"; 19 - hash = "sha256-IlZbalmHl549uDUfPG8hlzub8TLWhG0EsV6HVAPdsl0="; 20 - }; 21 - 22 - nativeBuildInputs = [ python3 gn ninja ]; 23 - 24 - buildInputs = [ 25 - fontconfig expat icu libglvnd libjpeg libpng libwebp zlib 26 - mesa libX11 harfbuzzFull 27 - ]; 28 - 29 - preConfigure = with depSrcs; '' 30 - mkdir -p third_party/externals 31 - ln -s ${angle2} third_party/externals/angle2 32 - ln -s ${dng_sdk} third_party/externals/dng_sdk 33 - ln -s ${piex} third_party/externals/piex 34 - ln -s ${sfntly} third_party/externals/sfntly 35 - ''; 36 - 37 - configurePhase = '' 38 - runHook preConfigure 39 - gn gen out/Release --args="is_debug=false is_official_build=true extra_cflags=[\"-I${harfbuzzFull.dev}/include/harfbuzz\"]" 40 - runHook postConfigure 41 - ''; 42 - 43 - buildPhase = '' 44 - runHook preBuild 45 - ninja -C out/Release skia modules 46 - runHook postBuild 47 - ''; 48 - 49 - installPhase = '' 50 - mkdir -p $out 51 - 52 - # Glob will match all subdirs. 53 - shopt -s globstar 54 - 55 - # All these paths are used in some way when building aseprite. 56 - cp -r --parents -t $out/ \ 57 - include/codec \ 58 - include/config \ 59 - include/core \ 60 - include/effects \ 61 - include/gpu \ 62 - include/private \ 63 - include/utils \ 64 - include/third_party/skcms/*.h \ 65 - out/Release/*.a \ 66 - src/gpu/**/*.h \ 67 - src/core/*.h \ 68 - modules/skshaper/include/*.h \ 69 - third_party/externals/angle2/include \ 70 - third_party/skcms/**/*.h 71 - ''; 72 - 73 - meta = with lib; { 74 - description = "Skia is a complete 2D graphic library for drawing Text, Geometries, and Images"; 75 - homepage = "https://skia.org/"; 76 - license = licenses.bsd3; 77 - maintainers = with maintainers; [ ]; 78 - platforms = platforms.all; 79 - }; 80 - }
+115
pkgs/by-name/sk/skia-aseprite/package.nix
··· 1 + { 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, 21 + }: 22 + 23 + let 24 + # deps.nix is generated by ./update.sh 25 + depSrcs = import ./deps.nix { inherit fetchgit; }; 26 + in 27 + clangStdenv.mkDerivation (finalAttrs: { 28 + pname = "skia-aseprite"; 29 + version = "m102-861e4743af"; 30 + 31 + src = fetchFromGitHub { 32 + owner = "aseprite"; 33 + repo = "skia"; 34 + rev = finalAttrs.version; 35 + hash = "sha256-IlZbalmHl549uDUfPG8hlzub8TLWhG0EsV6HVAPdsl0="; 36 + }; 37 + 38 + nativeBuildInputs = [ 39 + gn 40 + ninja 41 + python3 42 + ]; 43 + 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 + ''; 51 + 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 + ''; 57 + 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 + ]; 71 + 72 + buildPhase = '' 73 + runHook preBuild 74 + ninja -C lib skia modules 75 + runHook postBuild 76 + ''; 77 + 78 + installPhase = '' 79 + runHook preInstall 80 + mkdir -p $out 81 + 82 + # Glob will match all subdirs. 83 + shopt -s globstar 84 + 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 101 + 102 + runHook postInstall 103 + ''; 104 + 105 + passthru.updateScript = [ ./update.sh ] ++ builtins.attrNames depSrcs; 106 + 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 + }; 115 + })
+71
pkgs/by-name/sk/skia-aseprite/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell --pure -i bash 3 + #!nix-shell -p cacert curl git jq nix-prefetch-git 4 + # shellcheck shell=bash 5 + # vim: set tabstop=2 shiftwidth=2 expandtab: 6 + set -euo pipefail 7 + shopt -s inherit_errexit 8 + 9 + [ $# -gt 0 ] || { 10 + printf >&2 'usage: %s <deps>' "$0" 11 + exit 1 12 + } 13 + 14 + pkgpath=$(git rev-parse --show-toplevel)/pkgs/by-name/sk/skia-aseprite 15 + depfilter=$(tr ' ' '|' <<< "$*") 16 + depfile=$pkgpath/deps.nix 17 + pkgfile=$pkgpath/package.nix 18 + 19 + update_deps() { 20 + local deps third_party_deps name url rev hash prefetch 21 + 22 + version=$(sed -n 's|.*version = "\(.*\)".*|\1|p' < "$pkgfile") 23 + deps=$(curl -fsS https://raw.githubusercontent.com/aseprite/skia/$version/DEPS) 24 + third_party_deps=$(sed -n 's|[ ",]||g; s|:| |; s|@| |; s|^third_party/externals/||p' <<< "$deps") 25 + filtered=$(grep -E -- "$depfilter" <<< "$third_party_deps") 26 + if [[ -z $filtered ]]; then 27 + printf >&2 '%s: error: filter "%s" matched nothing' "$0" "$depfilter" 28 + return 1 29 + fi 30 + 31 + printf '{ fetchgit }:\n{\n' 32 + while read -r name url rev; do 33 + printf >&2 'Fetching %s@%s\n' "$name" "$rev" 34 + prefetch=$(nix-prefetch-git --quiet --rev "$rev" "$url") 35 + hash=$(jq -r '.hash' <<< "$prefetch") 36 + 37 + cat << EOF 38 + $name = fetchgit { 39 + url = "$url"; 40 + rev = "$rev"; 41 + hash = "$hash"; 42 + }; 43 + EOF 44 + # `read` could exit with a non-zero code without a newline at the end 45 + done < <(printf '%s\n' "$filtered") 46 + printf '}\n' 47 + } 48 + 49 + update_version() { 50 + local newver newrev 51 + newver=$( 52 + curl --fail \ 53 + --header 'Accept: application/vnd.github+json' \ 54 + --location --show-error --silent \ 55 + ${GITHUB_TOKEN:+ --user \":$GITHUB_TOKEN\"} \ 56 + https://api.github.com/repos/aseprite/skia/releases/latest \ 57 + | jq -r .tag_name 58 + ) 59 + newhash=$(nix-prefetch-git --quiet --rev "$newver" https://github.com/aseprite/skia.git | jq -r '.hash') 60 + sed \ 61 + -e 's|version = ".*"|version = "'$newver'"|' \ 62 + -e 's|hash = ".*"|hash = "'$newhash'"|' \ 63 + -- "$pkgfile" 64 + } 65 + 66 + temp=$(mktemp) 67 + trap 'ret=$?; rm -rf -- "$temp"; exit $ret' EXIT 68 + update_version > "$temp" 69 + cp "$temp" "$pkgfile" 70 + update_deps > "$temp" 71 + cp "$temp" "$depfile"