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)

authored by volth and committed by Franz Pletz 973ebce9 a4e44ffe

+16 -34
+16 -34
pkgs/data/fonts/noto-fonts/default.nix
··· 1 - { stdenv, fetchurl, fetchFromGitHub, optipng, cairo, unzip, pythonPackages, pkgconfig, pngquant, which, imagemagick }: 1 + { stdenv, fetchzip, fetchFromGitHub, optipng, cairo, unzip, pythonPackages, pkgconfig, pngquant, which, imagemagick }: 2 2 3 3 rec { 4 4 # 18MB 5 - noto-fonts = let version = "git-2016-03-29"; in stdenv.mkDerivation { 5 + noto-fonts = let version = "git-2016-03-29"; in fetchzip { 6 6 name = "noto-fonts-${version}"; 7 7 8 - src = fetchFromGitHub { 9 - owner = "googlei18n"; 10 - repo = "noto-fonts"; 11 - rev = "e8b0af48b15d64bd490edab4418b5e396cf29644"; 12 - sha256 = "02yv12fbb4n1gp9g9m0qxnj6adpg9hfsr9377h2d4xsf6sxcgy6f"; 13 - }; 8 + url = https://github.com/googlei18n/noto-fonts/archive/e8b0af48b15d64bd490edab4418b5e396cf29644.zip; 9 + postFetch = '' 10 + unzip $downloadedFile 14 11 15 - phases = [ "unpackPhase" "installPhase" ]; 16 - 17 - installPhase = '' 18 12 mkdir -p $out/share/fonts/noto 19 - cp hinted/*.ttf $out/share/fonts/noto 13 + cp noto-fonts-*/hinted/*.ttf $out/share/fonts/noto 20 14 # Also copy unhinted & alpha fonts for better glyph coverage, 21 15 # if they don't have a hinted version 22 16 # (see https://groups.google.com/d/msg/noto-font/ZJSkZta4n5Y/tZBnLcPdbS0J) 23 - cp -n unhinted/*.ttf $out/share/fonts/noto 24 - cp -n alpha/*.ttf $out/share/fonts/noto 17 + cp -n noto-fonts-*/unhinted/*.ttf $out/share/fonts/noto 18 + cp -n noto-fonts-*/alpha/*.ttf $out/share/fonts/noto 25 19 ''; 26 - 27 - preferLocalBuild = true; 20 + sha256 = "0wphc8671dpbx3rxzmjisnjipg2c2vkhw2i6mmyamd6vvcwajd64"; 28 21 29 22 meta = with stdenv.lib; { 30 23 inherit version; ··· 49 42 }; 50 43 }; 51 44 # 89MB 52 - noto-fonts-cjk = let version = "1.004"; in stdenv.mkDerivation { 45 + noto-fonts-cjk = let version = "1.004"; in fetchzip { 53 46 name = "noto-fonts-cjk-${version}"; 54 47 55 - src = fetchurl { 56 - # Same as https://noto-website.storage.googleapis.com/pkgs/NotoSansCJK.ttc.zip but versioned & with no extra SIL license file 57 - url = "https://raw.githubusercontent.com/googlei18n/noto-cjk/40d9f5b179a59a06b98373c76bdc3e2119e4e6b2/NotoSansCJK.ttc.zip"; 58 - sha256 = "1vg3si6slvk8cklq6s5c76s84kqjc4wvwzr4ysljzjpgzra2rfn6"; 59 - }; 60 - 61 - nativeBuildInputs = [ unzip ]; 62 - 63 - phases = [ "unpackPhase" "installPhase" ]; 64 - 65 - sourceRoot = "."; 66 - 67 - installPhase = '' 68 - mkdir -p $out/share/fonts/noto 69 - cp *.ttc $out/share/fonts/noto 48 + # Same as https://noto-website.storage.googleapis.com/pkgs/NotoSansCJK.ttc.zip but versioned & with no extra SIL license file 49 + url = "https://raw.githubusercontent.com/googlei18n/noto-cjk/40d9f5b179a59a06b98373c76bdc3e2119e4e6b2/NotoSansCJK.ttc.zip"; 50 + postFetch = '' 51 + mkdir -p $out/share/fonts 52 + unzip -j $downloadedFile \*.ttc -d $out/share/fonts/noto 70 53 ''; 71 - 72 - preferLocalBuild = true; 54 + sha256 = "0ghw2azqq3nkcxsbvf53qjmrhcfsnry79rq7jsr0wwi2pn7d3dsq"; 73 55 74 56 meta = with stdenv.lib; { 75 57 inherit version;