nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, python3
2, bdftopcf, xorg
3, libfaketime,
4}:
5
6stdenv.mkDerivation rec {
7 pname = "tewi-font";
8 version = "2.0.2";
9
10 src = fetchFromGitHub {
11 owner = "lucy";
12 repo = pname;
13 rev = version;
14 sha256 = "1axv9bv10xlcmgfyjh3z5kn5fkg3m6n1kskcs5hvlmyb6m1zk91j";
15 };
16
17 nativeBuildInputs =
18 [ python3 bdftopcf xorg.mkfontscale
19 libfaketime xorg.fonttosfnt
20 ];
21
22 postPatch = ''
23 # make gzip deterministic
24 sed 's/gzip -9/gzip -9 -n/g' -i Makefile
25
26 # fix python not found
27 patchShebangs scripts/merge
28 '';
29
30 postBuild = ''
31 # convert bdf fonts to otb
32 for i in *.bdf; do
33 name=$(basename "$i" .bdf)
34 faketime -f "1970-01-01 00:00:01" \
35 fonttosfnt -v -o "$name.otb" "$i"
36 done
37 '';
38
39 installPhase = ''
40 fontDir="$out/share/fonts/misc"
41 install -m 644 -D *.otb out/* -t "$fontDir"
42 mkfontdir "$fontDir"
43 '';
44
45 meta = with lib; {
46 description = "A nice bitmap font, readable even at small sizes";
47 longDescription = ''
48 Tewi is a bitmap font, readable even at very small font sizes. This is
49 particularily useful while programming, to fit a lot of code on your
50 screen.
51 '';
52 homepage = "https://github.com/lucy/tewi-font";
53 license = {
54 fullName = "GNU General Public License with a font exception";
55 url = "https://www.gnu.org/licenses/gpl-faq.html#FontException";
56 };
57 maintainers = [ maintainers.fro_ozen ];
58 };
59}