···11-{ lib, stdenvNoCC, fetchFromGitHub }:
11+{ lib
22+, stdenvNoCC
33+, fetchFromGitHub
44+, fonts ? []
55+}:
2637stdenvNoCC.mkDerivation {
48 pname = "google-fonts";
55- version = "unstable-2022-02-26";
99+ version = "unstable-2022-11-14";
6101111+ # Adobe Blank is split out in a seperate output,
1212+ # because it causes crashes with `libfontconfig`.
1313+ # It has an absurd number of symbols
714 outputs = [ "out" "adobeBlank" ];
815916 src = fetchFromGitHub {
1017 owner = "google";
1118 repo = "fonts";
1212- rev = "2fba0d68602b7eb3374d030c1c34939de56023f9";
1313- sha256 = "sha256-IFkKwRRyZeOXD8/9n8UDrruUKK6oQK4BD9wYN2dmSAc=";
1919+ rev = "83e116a566eda04a2469a11ee562cef1d7b33e4f";
2020+ sha256 = "sha256-sSabk+VWkoXj1Nzv9ufgIU/nkfKf4XkZU1SO+j+eSPA=";
1421 };
15221616- patchPhase = ''
2323+ postPatch = ''
1724 # These directories need to be removed because they contain
1825 # older or duplicate versions of fonts also present in other
1926 # directories. This causes non-determinism in the install since
2027 # the installation order of font files with the same name is not
2128 # fixed.
2229 rm -rv ofl/cabincondensed \
2323- ofl/signikanegative \
2424- ofl/signikanegativesc
3030+ ofl/signikanegative \
3131+ ofl/signikanegativesc \
3232+ axisregistry/tests/data
25332634 if find . -name "*.ttf" | sed 's|.*/||' | sort | uniq -c | sort -n | grep -v '^.*1 '; then
2735 echo "error: duplicate font names"
···31393240 dontBuild = true;
33414242+ # The font files are in the fonts directory and use two naming schemes:
4343+ # FamilyName-StyleName.ttf and FamilyName[param1,param2,...].ttf
4444+ # This installs all fonts if fonts is empty and otherwise only
4545+ # the specified fonts by FamilyName. To do this, it invokes
4646+ # `find` 2 times for every font, anyone is free to do this
4747+ # in a more efficient way.
4848+ fonts = map (font: builtins.replaceStrings [" "] [""] font) fonts;
3449 installPhase = ''
3550 adobeBlankDest=$adobeBlank/share/fonts/truetype
3651 install -m 444 -Dt $adobeBlankDest ofl/adobeblank/AdobeBlank-Regular.ttf
3752 rm -r ofl/adobeblank
3853 dest=$out/share/fonts/truetype
5454+ '' + (if fonts == [] then ''
3955 find . -name '*.ttf' -exec install -m 444 -Dt $dest '{}' +
4040- '';
5656+ '' else ''
5757+ for font in $fonts; do
5858+ find . -name "$font-*.ttf" -exec install -m 444 -Dt $dest '{}' +
5959+ find . -name "$font[*.ttf" -exec install -m 444 -Dt $dest '{}' +
6060+ done
6161+ '');
41624263 meta = with lib; {
4364 homepage = "https://fonts.google.com";