Commit bfde8576 authored by Berk D. Demir's avatar Berk D. Demir Committed by sternenseemann
Browse files

go-font: Fetch only the installables instead of entire blobs repo

Switch to using `fetchzip` to download a subdirectory tarball including
TrueType fonts and their license instead of cloning Go's 'images'
repository.

- Simplifies the derivation
- Downloads 900K instead of 28M
- Requires 1/8 CPU cycles
- ...shortening the build time.
parent 8aa59fb1
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
{ lib, fetchgit }:
{ lib, fetchzip }:

let
  version = "2.010";
in (fetchgit {
  name = "go-font-${version}";
  url = "https://go.googlesource.com/image";
  rev = "41969df76e82aeec85fa3821b1e24955ea993001";
in (fetchzip {
  name = "go-font-${version}";
  url = "https://go.googlesource.com/image/+archive/${rev}/font/gofont/ttfs.tar.gz";
  stripRoot = false;

  postFetch = ''
    mv $out source
    cd source

    mkdir -p $out/share/fonts/truetype
    mkdir -p $out/share/doc/go-font
    cp font/gofont/ttfs/* $out/share/fonts/truetype
    mv $out/share/fonts/truetype/README $out/share/doc/go-font/LICENSE
    mv $out/*.ttf $out/share/fonts/truetype
    mv $out/README $out/share/doc/go-font/LICENSE
  '';

  sha256 = "175jwq16qjnd2k923n9gcbjizchy7yv4n41dm691sjwrhbl0b13x";