nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, libfaketime, xorg }:
2
3stdenv.mkDerivation rec {
4 pname = "efont-unicode";
5 version = "0.4.2";
6
7 src = fetchurl {
8 url = "http://openlab.ring.gr.jp/efont/dist/unicode-bdf/${pname}-bdf-${version}.tar.bz2";
9 sha256 = "sha256-fT7SsYlV3dCQrf0IZfiNI1grj3ngDgr8IkWdg+f9m3M=";
10 };
11
12 nativeBuildInputs = with xorg;
13 [ libfaketime bdftopcf fonttosfnt mkfontscale ];
14
15 buildPhase = ''
16 runHook preBuild
17
18 # convert bdf fonts to pcf
19 for f in *.bdf; do
20 bdftopcf -t -o "''${f%.bdf}.pcf" "$f"
21 done
22 gzip -n -9 *.pcf
23
24 # convert bdf fonts to otb
25 for f in *.bdf; do
26 faketime -f "1970-01-01 00:00:01" \
27 fonttosfnt -v -m 2 -o "''${f%.bdf}.otb" "$f"
28 done
29
30 runHook postBuild
31 '';
32
33 installPhase = ''
34 runHook preInstall
35
36 dir=share/fonts/misc
37 install -D -m 644 -t "$out/$dir" *.otb *.pcf.gz
38 install -D -m 644 -t "$bdf/$dir" *.bdf
39 mkfontdir "$out/$dir"
40 mkfontdir "$bdf/$dir"
41
42 runHook postInstall
43 '';
44
45 outputs = [ "out" "bdf" ];
46
47 meta = with lib; {
48 description = "The /efont/ Unicode bitmap font";
49 homepage = "http://openlab.ring.gr.jp/efont/unicode/";
50 license = licenses.bsd3;
51 platforms = platforms.all;
52 maintainers = [ maintainers.ncfavier ];
53 };
54}