lol

i-dot-ming: 7.01 -> 8.00

linsui 278fd09d 2772b970

+26 -4
+26 -4
pkgs/data/fonts/i-dot-ming/default.nix
··· 1 - { lib, fetchzip }: 1 + { lib, fetchurl, writeScript }: 2 2 3 3 let 4 - version = "7.01"; 4 + version = "8.00"; 5 5 in 6 - fetchzip { 6 + fetchurl { 7 7 name = "i.ming-${version}"; 8 8 url = "https://raw.githubusercontent.com/ichitenfont/I.Ming/${version}/${version}/I.Ming-${version}.ttf"; 9 - sha256 = "1b2dj7spkznpkad8a0blqigj9f6ism057r0wn9wdqg5g88yp32vd"; 9 + hash = "sha256-JGu9H0+IdJL6QQtLwvqlFLEaJdq1JVRiqLm5zptwjyE="; 10 10 11 + recursiveHash = true; 12 + downloadToTemp = true; 11 13 postFetch = '' 12 14 install -DT -m444 $downloadedFile $out/share/fonts/truetype/I.Ming/I.Ming.ttf 13 15 ''; 16 + 17 + passthru = { 18 + updateScript = writeScript "updater" '' 19 + #!/usr/bin/env nix-shell 20 + #!nix-shell -i bash -p curl gnused 21 + set -e 22 + version=$(curl -i -s https://github.com/ichitenfont/I.Ming/releases/latest | sed -n -E 's|^location.*releases/tag/([0-9.]+).*$|\1|p') 23 + if [[ $version != ${version} ]]; then 24 + tmp=$(mktemp -d) 25 + curl -Lo $tmp/I.Ming.ttf https://raw.githubusercontent.com/ichitenfont/I.Ming/$version/$version/I.Ming-$version.ttf 26 + install -DT -m444 $tmp/I.Ming.ttf $tmp/share/fonts/truetype/I.Ming/I.Ming.ttf 27 + rm $tmp/I.Ming.ttf 28 + hash=$(nix hash path --type sha256 --base32 --sri $tmp) 29 + sed -i -E \ 30 + -e "s/version = \"[0-9.]+\"/version = \"$version\"/" \ 31 + -e "s|hash = \".*\"|hash = \"$hash\"|" \ 32 + pkgs/data/fonts/i-dot-ming/default.nix 33 + fi 34 + ''; 35 + }; 14 36 15 37 meta = with lib; { 16 38 description = "An open source Pan-CJK serif typeface";