git.iko.soy/typeable/nixpkgs
on master help sign in
gohufont: add console version
commitcb976a40ab6de82b17d047944078c63abff7507c authorrnhmjoj <micheleguerinirocco@me.com> dateMon 31 Aug 2015, 16:06 (11 years ago) parent77f18a1
1 file changed+38−5
pkgs/data/fonts/gohufont/default.nix+38−5
pkgs/data/fonts/gohufont/default.nix+38−5
@@ -1,26 +1,59 @@
1−{ stdenv, fetchurl, mkfontdir, mkfontscale }:
1+{ stdenv, fetchurl, mkfontdir, mkfontscale, bdf2psf }:
22
33stdenv.mkDerivation rec {
44 name = "gohufont-2.0";
55
6− src = fetchurl {
6+ pcf = fetchurl {
77 url = "http://font.gohu.org/gohufont-2.0.tar.gz";
88 sha256 = "0vi87fvj3m52piz2k6vqday03cah6zvz3dzrvjch3qjna1i1nb7s";
99 };
1010
11− buildInputs = [ mkfontdir mkfontscale ];
11+ bdf = fetchurl {
12+ url = "http://font.gohu.org/gohufont-bdf-2.0.tar.gz";
13+ sha256 = "0rqqavhqbs7pajcblg92mjlz2dxk8b60vgdh271axz7kjs2wf9mr";
14+ };
15+
16+ buildInputs = [ mkfontdir mkfontscale bdf2psf ];
17+
18+ unpackPhase = ''
19+ mkdir pcf bdf
20+ tar -xzf $pcf --strip-components=1 -C pcf
21+ tar -xzf $bdf --strip-components=1 -C bdf
22+ '';
1223
1324 installPhase = ''
25+ # convert bdf to psf fonts
26+ sourceRoot="$(pwd)"
27+ mkdir psf
28+
29+ cd "${bdf2psf}/usr/share/bdf2psf"
30+ for i in $sourceRoot/bdf/*.bdf; do
31+ bdf2psf --fb $i standard.equivalents \
32+ ascii.set+useful.set+linux.set 512 \
33+ "$sourceRoot/psf/$(basename $i .bdf).psf"
34+ done
35+ cd "$sourceRoot"
36+
37+ # install the psf fonts (for the virtual console)
38+ fontDir="$out/share/consolefonts"
39+ mkdir -p "$fontDir"
40+ mv psf/*.psf "$fontDir"
41+
42+
43+ # install the pcf fonts (for xorg applications)
1444 fontDir="$out/share/fonts/misc"
1545 mkdir -p "$fontDir"
16− mv *.pcf.gz "$fontDir"
46+ mv pcf/*.pcf.gz "$fontDir"
47+
1748 cd "$fontDir"
1849 mkfontdir
1950 mkfontscale
2051 '';
2152
2253 meta = with stdenv.lib; {
23− description = "A monospace bitmap font well suited for programming and terminal use";
54+ description = ''
55+ A monospace bitmap font well suited for programming and terminal use
56+ '';
2457 homepage = http://font.gohu.org/;
2558 license = licenses.wtfpl;
2659 maintainers = with maintainers; [ epitrochoid ];