summary refs log tree commit diff
path: root/pkgs/data/fonts/tewi/default.nix
blob: fbc29cdf5fb1d95e3af8c1fc02ac2d08657fb424 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{stdenv, fetchgit, bdftopcf, mkfontdir, mkfontscale}:

stdenv.mkDerivation rec {
  date = "2015-06-07";
  name = "tewi-font-${date}";

  src = fetchgit {
    url = "https://github.com/lucy/tewi-font";
    rev = "ff930e66ae471da4fdc226ffe65fd1ccd13d4a69";
    sha256 = "0c7k847cp68w20frzsdknpss2cwv3lp970asyybv65jxyl2jz3iq";
  };

  nativeBuildInputs = [ bdftopcf mkfontdir mkfontscale ];
  buildPhase = ''
    for i in *.bdf; do
        bdftopcf -o ''${i/bdf/pcf} $i
    done

    gzip -n *.pcf
  '';

  installPhase = ''
    fontDir="$out/share/fonts/misc"
    mkdir -p "$fontDir"
    mv *.pcf.gz "$fontDir"

    cd "$fontDir"
    mkfontdir
    mkfontscale
  '';

  outputHashAlgo = "sha256";
  outputHashMode = "recursive";
  outputHash = "14dv3m1svahjyb9c1x1570qrmlnynzg0g36b10bqqs8xvhix34yq";

  meta = with stdenv.lib; {
    description = "A nice bitmap font, readable even at small sizes";
    longDescription = ''
      Tewi is a bitmap font, readable even at very small font sizes. This is
      particularily useful while programming, to fit a lot of code on your
      screen.
    '';
    homepage = https://github.com/lucy/tewi-font;
    license = {
      fullName = "GNU General Public License with a font exception";
      url = "https://www.gnu.org/licenses/gpl-faq.html#FontException";
    };
    maintainers = [ maintainers.fro_ozen ];
  };
}