noto-fonts-cjk: use typeface and version to generate git rev

This commit is contained in:
wrvsrx 2023-05-06 18:35:08 +08:00
parent cf12cc9d6a
commit b7028fd6dc

View file

@ -89,7 +89,7 @@ rec {
}; };
}; };
mkNotoCJK = { typeface, version, rev, sha256 }: mkNotoCJK = { typeface, version, sha256 }:
stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
pname = "noto-fonts-cjk-${lib.toLower typeface}"; pname = "noto-fonts-cjk-${lib.toLower typeface}";
inherit version; inherit version;
@ -97,7 +97,8 @@ rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "googlefonts"; owner = "googlefonts";
repo = "noto-cjk"; repo = "noto-cjk";
inherit rev sha256; rev = "${typeface}${version}";
inherit sha256;
sparseCheckout = [ "${typeface}/Variable/OTC" ]; sparseCheckout = [ "${typeface}/Variable/OTC" ];
}; };
@ -154,14 +155,12 @@ rec {
noto-fonts-cjk-sans = mkNotoCJK { noto-fonts-cjk-sans = mkNotoCJK {
typeface = "Sans"; typeface = "Sans";
version = "2.004"; version = "2.004";
rev = "Sans2.004";
sha256 = "sha256-IgalJkiOAVjNxKaPAQWfb5hKeqclliR4qVXCq63FGWY="; sha256 = "sha256-IgalJkiOAVjNxKaPAQWfb5hKeqclliR4qVXCq63FGWY=";
}; };
noto-fonts-cjk-serif = mkNotoCJK { noto-fonts-cjk-serif = mkNotoCJK {
typeface = "Serif"; typeface = "Serif";
version = "2.001"; version = "2.001";
rev = "Serif2.001";
sha256 = "sha256-y1103SS0qkZMhEL5+7kQZ+OBs5tRaqkqOcs4796Fzhg="; sha256 = "sha256-y1103SS0qkZMhEL5+7kQZ+OBs5tRaqkqOcs4796Fzhg=";
}; };