2020-02-10 22:28:49 +01:00
|
|
|
|
{ stdenv
|
|
|
|
|
, stdenvNoCC
|
|
|
|
|
, lib
|
|
|
|
|
, fetchFromGitHub
|
2020-02-29 22:31:47 +01:00
|
|
|
|
, fetchurl
|
2020-02-10 22:28:49 +01:00
|
|
|
|
, cairo
|
2020-08-25 22:07:00 +02:00
|
|
|
|
, python3
|
2021-01-17 03:14:13 +01:00
|
|
|
|
, pkg-config
|
2020-02-10 22:28:49 +01:00
|
|
|
|
, pngquant
|
|
|
|
|
, which
|
|
|
|
|
, imagemagick
|
2020-08-25 22:07:00 +02:00
|
|
|
|
, zopfli
|
2020-02-10 22:28:49 +01:00
|
|
|
|
}:
|
2016-03-29 20:00:18 +02:00
|
|
|
|
|
2018-05-28 17:32:16 +02:00
|
|
|
|
let
|
2020-02-10 22:28:49 +01:00
|
|
|
|
mkNoto = { pname, weights }:
|
|
|
|
|
stdenvNoCC.mkDerivation {
|
|
|
|
|
inherit pname;
|
|
|
|
|
version = "2020-01-23";
|
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "googlefonts";
|
|
|
|
|
repo = "noto-fonts";
|
|
|
|
|
rev = "f4726a2ec36169abd02a6d8abe67c8ff0236f6d8";
|
|
|
|
|
sha256 = "0zc1r7zph62qmvzxqfflsprazjf6x1qnwc2ma27kyzh6v36gaykw";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
|
# We copy in reverse preference order -- unhinted first, then
|
|
|
|
|
# hinted -- to get the "best" version of each font while
|
|
|
|
|
# maintaining maximum coverage.
|
|
|
|
|
#
|
|
|
|
|
# TODO: install OpenType, variable versions?
|
|
|
|
|
local out_ttf=$out/share/fonts/truetype/noto
|
|
|
|
|
install -m444 -Dt $out_ttf phaseIII_only/unhinted/ttf/*/*-${weights}.ttf
|
|
|
|
|
install -m444 -Dt $out_ttf phaseIII_only/hinted/ttf/*/*-${weights}.ttf
|
|
|
|
|
install -m444 -Dt $out_ttf unhinted/*/*-${weights}.ttf
|
|
|
|
|
install -m444 -Dt $out_ttf hinted/*/*-${weights}.ttf
|
2018-05-28 17:32:16 +02:00
|
|
|
|
'';
|
2020-02-10 22:28:49 +01:00
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
2018-05-28 17:32:16 +02:00
|
|
|
|
description = "Beautiful and free fonts for many languages";
|
2020-04-01 03:11:51 +02:00
|
|
|
|
homepage = "https://www.google.com/get/noto/";
|
2018-05-28 17:32:16 +02:00
|
|
|
|
longDescription =
|
|
|
|
|
''
|
|
|
|
|
When text is rendered by a computer, sometimes characters are
|
|
|
|
|
displayed as “tofu”. They are little boxes to indicate your device
|
|
|
|
|
doesn’t have a font to display the text.
|
2015-09-20 00:22:20 +02:00
|
|
|
|
|
2018-05-28 17:32:16 +02:00
|
|
|
|
Google has been developing a font family called Noto, which aims to
|
|
|
|
|
support all languages with a harmonious look and feel. Noto is
|
|
|
|
|
Google’s answer to tofu. The name noto is to convey the idea that
|
|
|
|
|
Google’s goal is to see “no more tofu”. Noto has multiple styles and
|
|
|
|
|
weights, and freely available to all.
|
2015-09-20 00:22:20 +02:00
|
|
|
|
|
2018-05-28 17:32:16 +02:00
|
|
|
|
This package also includes the Arimo, Cousine, and Tinos fonts.
|
|
|
|
|
'';
|
2020-02-10 22:28:49 +01:00
|
|
|
|
license = licenses.ofl;
|
2018-05-28 17:32:16 +02:00
|
|
|
|
platforms = platforms.all;
|
2020-02-10 22:28:49 +01:00
|
|
|
|
maintainers = with maintainers; [ mathnerd314 emily ];
|
2018-05-28 17:32:16 +02:00
|
|
|
|
};
|
2015-09-20 00:22:20 +02:00
|
|
|
|
};
|
2021-11-13 16:45:50 +01:00
|
|
|
|
|
|
|
|
|
mkNotoCJK = { typeface, version, rev, sha256 }:
|
|
|
|
|
stdenvNoCC.mkDerivation {
|
|
|
|
|
pname = "noto-fonts-cjk-${lib.toLower typeface}";
|
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "googlefonts";
|
|
|
|
|
repo = "noto-cjk";
|
|
|
|
|
inherit rev sha256;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
installPhase = ''
|
2022-01-21 18:59:51 +01:00
|
|
|
|
install -m444 -Dt $out/share/fonts/opentype/noto-cjk ${typeface}/OTC/*.ttc
|
2021-11-13 16:45:50 +01:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
|
description = "Beautiful and free fonts for CJK languages";
|
|
|
|
|
homepage = "https://www.google.com/get/noto/help/cjk/";
|
|
|
|
|
longDescription = ''
|
|
|
|
|
Noto ${typeface} CJK is a ${lib.toLower typeface} typeface designed as
|
|
|
|
|
an intermediate style between the modern and traditional. It is
|
|
|
|
|
intended to be a multi-purpose digital font for user interface
|
|
|
|
|
designs, digital content, reading on laptops, mobile devices, and
|
|
|
|
|
electronic books. Noto ${typeface} CJK comprehensively covers
|
|
|
|
|
Simplified Chinese, Traditional Chinese, Japanese, and Korean in a
|
|
|
|
|
unified font family. It supports regional variants of ideographic
|
|
|
|
|
characters for each of the four languages. In addition, it supports
|
|
|
|
|
Japanese kana, vertical forms, and variant characters (itaiji); it
|
|
|
|
|
supports Korean hangeul — both contemporary and archaic.
|
|
|
|
|
'';
|
|
|
|
|
license = licenses.ofl;
|
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
maintainers = with maintainers; [ mathnerd314 emily ];
|
|
|
|
|
};
|
|
|
|
|
};
|
2018-05-28 17:32:16 +02:00
|
|
|
|
in
|
|
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
|
{
|
2018-05-28 17:32:16 +02:00
|
|
|
|
noto-fonts = mkNoto {
|
2020-02-10 22:28:49 +01:00
|
|
|
|
pname = "noto-fonts";
|
2018-05-28 17:32:16 +02:00
|
|
|
|
weights = "{Regular,Bold,Light,Italic,BoldItalic,LightItalic}";
|
|
|
|
|
};
|
2020-02-10 22:28:49 +01:00
|
|
|
|
|
2018-05-28 17:32:16 +02:00
|
|
|
|
noto-fonts-extra = mkNoto {
|
2020-02-10 22:28:49 +01:00
|
|
|
|
pname = "noto-fonts-extra";
|
2018-05-28 17:32:16 +02:00
|
|
|
|
weights = "{Black,Condensed,Extra,Medium,Semi,Thin}*";
|
2015-09-20 00:22:20 +02:00
|
|
|
|
};
|
2020-02-10 22:28:49 +01:00
|
|
|
|
|
2021-11-13 16:45:50 +01:00
|
|
|
|
noto-fonts-cjk-sans = mkNotoCJK {
|
|
|
|
|
typeface = "Sans";
|
|
|
|
|
version = "2.004";
|
|
|
|
|
rev = "9f7f3c38eab63e1d1fddd8d50937fe4f1eacdb1d";
|
|
|
|
|
sha256 = "sha256-BX4tcDcz+RGka8mtced1k3BopUJQ14t1BtAVqTjyPik=";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
noto-fonts-cjk-serif = mkNotoCJK {
|
|
|
|
|
typeface = "Serif";
|
|
|
|
|
version = "2.000";
|
|
|
|
|
rev = "9f7f3c38eab63e1d1fddd8d50937fe4f1eacdb1d";
|
|
|
|
|
sha256 = "sha256-BX4tcDcz+RGka8mtced1k3BopUJQ14t1BtAVqTjyPik=";
|
2015-09-20 00:22:20 +02:00
|
|
|
|
};
|
2020-02-10 22:28:49 +01:00
|
|
|
|
|
2019-10-29 10:41:47 +01:00
|
|
|
|
noto-fonts-emoji = let
|
2021-11-02 23:51:40 +01:00
|
|
|
|
version = "2.034";
|
2020-08-25 22:07:00 +02:00
|
|
|
|
emojiPythonEnv =
|
|
|
|
|
python3.withPackages (p: with p; [ fonttools nototools ]);
|
2019-10-29 10:41:47 +01:00
|
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 23:52:01 +02:00
|
|
|
|
pname = "noto-fonts-emoji";
|
2021-11-02 23:51:40 +01:00
|
|
|
|
inherit version;
|
2015-09-20 00:22:20 +02:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-08-25 22:07:00 +02:00
|
|
|
|
owner = "googlefonts";
|
2015-09-20 00:22:20 +02:00
|
|
|
|
repo = "noto-emoji";
|
2020-09-17 16:01:27 +02:00
|
|
|
|
rev = "v${version}";
|
2021-11-04 14:40:28 +01:00
|
|
|
|
sha256 = "1d6zzk0ii43iqfnjbldwp8sasyx99lbjp1nfgqjla7ixld6yp98l";
|
2015-09-20 00:22:20 +02:00
|
|
|
|
};
|
|
|
|
|
|
2020-08-25 22:07:00 +02:00
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
cairo
|
|
|
|
|
imagemagick
|
|
|
|
|
zopfli
|
|
|
|
|
pngquant
|
|
|
|
|
which
|
2021-01-17 03:14:13 +01:00
|
|
|
|
pkg-config
|
2020-08-25 22:07:00 +02:00
|
|
|
|
emojiPythonEnv
|
|
|
|
|
];
|
2015-09-21 11:27:41 +02:00
|
|
|
|
|
2016-03-29 20:00:18 +02:00
|
|
|
|
postPatch = ''
|
2020-08-25 22:07:00 +02:00
|
|
|
|
patchShebangs *.py
|
|
|
|
|
patchShebangs third_party/color_emoji/*.py
|
|
|
|
|
# remove check for virtualenv, since we handle
|
|
|
|
|
# python requirements using python.withPackages
|
|
|
|
|
sed -i '/ifndef VIRTUAL_ENV/,+2d' Makefile
|
2020-09-29 23:46:22 +02:00
|
|
|
|
|
2021-07-26 20:37:28 +02:00
|
|
|
|
# Remove check for missing zopfli, it doesn't
|
|
|
|
|
# work and we guarantee its presence already.
|
|
|
|
|
sed -i '/ifdef MISSING_ZOPFLI/,+2d' Makefile
|
|
|
|
|
sed -i '/ifeq (,$(shell which $(ZOPFLIPNG)))/,+4d' Makefile
|
|
|
|
|
|
|
|
|
|
sed -i '/ZOPFLIPNG = zopflipng/d' Makefile
|
|
|
|
|
echo "ZOPFLIPNG = ${zopfli}/bin/zopflipng" >> Makefile
|
|
|
|
|
|
2020-09-29 23:46:22 +02:00
|
|
|
|
# Make the build verbose so it won't get culled by Hydra thinking that
|
|
|
|
|
# it somehow got stuck doing nothing.
|
|
|
|
|
sed -i 's;\t@;\t;' Makefile
|
2015-09-21 11:27:41 +02:00
|
|
|
|
'';
|
2015-09-20 00:22:20 +02:00
|
|
|
|
|
2016-03-29 20:00:18 +02:00
|
|
|
|
enableParallelBuilding = true;
|
2015-09-20 00:22:20 +02:00
|
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
|
mkdir -p $out/share/fonts/noto
|
2016-03-29 20:00:18 +02:00
|
|
|
|
cp NotoColorEmoji.ttf fonts/NotoEmoji-Regular.ttf $out/share/fonts/noto
|
2015-09-20 00:22:20 +02:00
|
|
|
|
'';
|
|
|
|
|
|
2020-02-10 22:28:49 +01:00
|
|
|
|
meta = with lib; {
|
2015-09-20 00:22:20 +02:00
|
|
|
|
description = "Color and Black-and-White emoji fonts";
|
2020-08-25 22:07:00 +02:00
|
|
|
|
homepage = "https://github.com/googlefonts/noto-emoji";
|
2018-11-24 18:23:53 +01:00
|
|
|
|
license = with licenses; [ ofl asl20 ];
|
2015-09-20 00:22:20 +02:00
|
|
|
|
platforms = platforms.all;
|
2021-11-02 23:51:40 +01:00
|
|
|
|
maintainers = with maintainers; [ mathnerd314 sternenseemann ];
|
2015-09-20 00:22:20 +02:00
|
|
|
|
};
|
|
|
|
|
};
|
2020-02-29 22:31:47 +01:00
|
|
|
|
|
2021-11-03 23:09:47 +01:00
|
|
|
|
noto-fonts-emoji-blob-bin =
|
|
|
|
|
let
|
|
|
|
|
pname = "noto-fonts-emoji-blob-bin";
|
|
|
|
|
version = "14.0.1";
|
|
|
|
|
in
|
|
|
|
|
fetchurl {
|
|
|
|
|
name = "${pname}-${version}";
|
2020-02-29 22:31:47 +01:00
|
|
|
|
url = "https://github.com/C1710/blobmoji/releases/download/v${version}/Blobmoji.ttf";
|
2021-11-03 23:09:47 +01:00
|
|
|
|
sha256 = "sha256-wSH9kRJ8y2i5ZDqzeT96dJcEJnHDSpU8bOhmxaT+UCg=";
|
2020-02-29 22:31:47 +01:00
|
|
|
|
|
2021-11-03 23:09:47 +01:00
|
|
|
|
downloadToTemp = true;
|
|
|
|
|
recursiveHash = true;
|
|
|
|
|
postFetch = ''
|
|
|
|
|
install -Dm 444 $downloadedFile $out/share/fonts/blobmoji/Blobmoji.ttf
|
|
|
|
|
'';
|
2020-02-29 22:31:47 +01:00
|
|
|
|
|
2021-11-03 23:09:47 +01:00
|
|
|
|
meta = with lib; {
|
|
|
|
|
description = "Noto Emoji with extended Blob support";
|
|
|
|
|
homepage = "https://github.com/C1710/blobmoji";
|
|
|
|
|
license = with licenses; [ ofl asl20 ];
|
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
maintainers = with maintainers; [ rileyinman jk ];
|
|
|
|
|
};
|
2020-02-29 22:31:47 +01:00
|
|
|
|
};
|
2015-09-21 11:27:41 +02:00
|
|
|
|
}
|