forked from mirrors/nixpkgs
noto-fonts, noto-fonts-cjk: make the font derivation fixed-output
- [x] make the font derivation fixed-output (https://github.com/NixOS/nixpkgs/issues/27754)
This commit is contained in:
parent
a4e44ffecb
commit
973ebce996
|
@ -1,30 +1,23 @@
|
||||||
{ stdenv, fetchurl, fetchFromGitHub, optipng, cairo, unzip, pythonPackages, pkgconfig, pngquant, which, imagemagick }:
|
{ stdenv, fetchzip, fetchFromGitHub, optipng, cairo, unzip, pythonPackages, pkgconfig, pngquant, which, imagemagick }:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
# 18MB
|
# 18MB
|
||||||
noto-fonts = let version = "git-2016-03-29"; in stdenv.mkDerivation {
|
noto-fonts = let version = "git-2016-03-29"; in fetchzip {
|
||||||
name = "noto-fonts-${version}";
|
name = "noto-fonts-${version}";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
url = https://github.com/googlei18n/noto-fonts/archive/e8b0af48b15d64bd490edab4418b5e396cf29644.zip;
|
||||||
owner = "googlei18n";
|
postFetch = ''
|
||||||
repo = "noto-fonts";
|
unzip $downloadedFile
|
||||||
rev = "e8b0af48b15d64bd490edab4418b5e396cf29644";
|
|
||||||
sha256 = "02yv12fbb4n1gp9g9m0qxnj6adpg9hfsr9377h2d4xsf6sxcgy6f";
|
|
||||||
};
|
|
||||||
|
|
||||||
phases = [ "unpackPhase" "installPhase" ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/share/fonts/noto
|
mkdir -p $out/share/fonts/noto
|
||||||
cp hinted/*.ttf $out/share/fonts/noto
|
cp noto-fonts-*/hinted/*.ttf $out/share/fonts/noto
|
||||||
# Also copy unhinted & alpha fonts for better glyph coverage,
|
# Also copy unhinted & alpha fonts for better glyph coverage,
|
||||||
# if they don't have a hinted version
|
# if they don't have a hinted version
|
||||||
# (see https://groups.google.com/d/msg/noto-font/ZJSkZta4n5Y/tZBnLcPdbS0J)
|
# (see https://groups.google.com/d/msg/noto-font/ZJSkZta4n5Y/tZBnLcPdbS0J)
|
||||||
cp -n unhinted/*.ttf $out/share/fonts/noto
|
cp -n noto-fonts-*/unhinted/*.ttf $out/share/fonts/noto
|
||||||
cp -n alpha/*.ttf $out/share/fonts/noto
|
cp -n noto-fonts-*/alpha/*.ttf $out/share/fonts/noto
|
||||||
'';
|
'';
|
||||||
|
sha256 = "0wphc8671dpbx3rxzmjisnjipg2c2vkhw2i6mmyamd6vvcwajd64";
|
||||||
preferLocalBuild = true;
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
inherit version;
|
inherit version;
|
||||||
|
@ -49,27 +42,16 @@ rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# 89MB
|
# 89MB
|
||||||
noto-fonts-cjk = let version = "1.004"; in stdenv.mkDerivation {
|
noto-fonts-cjk = let version = "1.004"; in fetchzip {
|
||||||
name = "noto-fonts-cjk-${version}";
|
name = "noto-fonts-cjk-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
# Same as https://noto-website.storage.googleapis.com/pkgs/NotoSansCJK.ttc.zip but versioned & with no extra SIL license file
|
||||||
# Same as https://noto-website.storage.googleapis.com/pkgs/NotoSansCJK.ttc.zip but versioned & with no extra SIL license file
|
url = "https://raw.githubusercontent.com/googlei18n/noto-cjk/40d9f5b179a59a06b98373c76bdc3e2119e4e6b2/NotoSansCJK.ttc.zip";
|
||||||
url = "https://raw.githubusercontent.com/googlei18n/noto-cjk/40d9f5b179a59a06b98373c76bdc3e2119e4e6b2/NotoSansCJK.ttc.zip";
|
postFetch = ''
|
||||||
sha256 = "1vg3si6slvk8cklq6s5c76s84kqjc4wvwzr4ysljzjpgzra2rfn6";
|
mkdir -p $out/share/fonts
|
||||||
};
|
unzip -j $downloadedFile \*.ttc -d $out/share/fonts/noto
|
||||||
|
|
||||||
nativeBuildInputs = [ unzip ];
|
|
||||||
|
|
||||||
phases = [ "unpackPhase" "installPhase" ];
|
|
||||||
|
|
||||||
sourceRoot = ".";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/share/fonts/noto
|
|
||||||
cp *.ttc $out/share/fonts/noto
|
|
||||||
'';
|
'';
|
||||||
|
sha256 = "0ghw2azqq3nkcxsbvf53qjmrhcfsnry79rq7jsr0wwi2pn7d3dsq";
|
||||||
preferLocalBuild = true;
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
Loading…
Reference in a new issue