7 stdenvNoCC.mkDerivation {
8 pname = "google-fonts";
9 version = "unstable-2024-06-21";
11 # Adobe Blank is split out in a separate output,
12 # because it causes crashes with `libfontconfig`.
13 # It has an absurd number of symbols
14 outputs = [ "out" "adobeBlank" ];
16 src = fetchFromGitHub {
19 rev = "d5ea3092960d3d5db0b7a9890c828bafbf159c51";
20 hash = "sha256-jQVwAgrZzdCVD4aaX4vYJLqj67t9vn60bYPuBWWMbBg=";
24 # These directories need to be removed because they contain
25 # older or duplicate versions of fonts also present in other
26 # directories. This causes non-determinism in the install since
27 # the installation order of font files with the same name is not
29 rm -rv ofl/cabincondensed \
31 ofl/signikanegativesc \
33 axisregistry/tests/data
35 if find . -name "*.ttf" | sed 's|.*/||' | sort | uniq -c | sort -n | grep -v '^.*1 '; then
36 echo "error: duplicate font names"
43 # The font files are in the fonts directory and use three naming schemes:
44 # FamilyName-StyleName.ttf, FamilyName[param1,param2,...].ttf, and
45 # FamilyName.ttf. This installs all fonts if fonts is empty and otherwise
46 # only the specified fonts by FamilyName.
47 fonts = map (font: builtins.replaceStrings [" "] [""] font) fonts;
49 adobeBlankDest=$adobeBlank/share/fonts/truetype
50 install -m 444 -Dt $adobeBlankDest ofl/adobeblank/AdobeBlank-Regular.ttf
52 dest=$out/share/fonts/truetype
53 '' + (if fonts == [] then ''
54 find . -name '*.ttf' -exec install -m 444 -Dt $dest '{}' +
56 for font in $fonts; do
57 find . \( -name "$font-*.ttf" -o -name "$font[*.ttf" -o -name "$font.ttf" \) -exec install -m 444 -Dt $dest '{}' +
62 homepage = "https://fonts.google.com";
63 description = "Font files available from Google Fonts";
64 license = with licenses; [ asl20 ofl ufl ];
65 platforms = platforms.all;
67 maintainers = with maintainers; [ manveru ];
68 sourceProvenance = [ sourceTypes.binaryBytecode ];