2015-08-31 16:06:22 +02:00
|
|
|
{ stdenv, fetchurl, mkfontdir, mkfontscale, bdf2psf }:
|
2015-08-14 04:41:03 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "gohufont-2.0";
|
|
|
|
|
2015-08-31 16:06:22 +02:00
|
|
|
pcf = fetchurl {
|
2015-08-14 04:41:03 +02:00
|
|
|
url = "http://font.gohu.org/gohufont-2.0.tar.gz";
|
|
|
|
sha256 = "0vi87fvj3m52piz2k6vqday03cah6zvz3dzrvjch3qjna1i1nb7s";
|
|
|
|
};
|
|
|
|
|
2015-08-31 16:06:22 +02:00
|
|
|
bdf = fetchurl {
|
|
|
|
url = "http://font.gohu.org/gohufont-bdf-2.0.tar.gz";
|
|
|
|
sha256 = "0rqqavhqbs7pajcblg92mjlz2dxk8b60vgdh271axz7kjs2wf9mr";
|
|
|
|
};
|
|
|
|
|
2018-01-10 01:27:23 +01:00
|
|
|
nativeBuildInputs = [ mkfontdir mkfontscale bdf2psf ];
|
2015-08-31 16:06:22 +02:00
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
mkdir pcf bdf
|
|
|
|
tar -xzf $pcf --strip-components=1 -C pcf
|
|
|
|
tar -xzf $bdf --strip-components=1 -C bdf
|
|
|
|
'';
|
2015-08-14 04:41:03 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2015-08-31 16:06:22 +02:00
|
|
|
# convert bdf to psf fonts
|
|
|
|
sourceRoot="$(pwd)"
|
|
|
|
mkdir psf
|
|
|
|
|
|
|
|
cd "${bdf2psf}/usr/share/bdf2psf"
|
|
|
|
for i in $sourceRoot/bdf/*.bdf; do
|
|
|
|
bdf2psf --fb $i standard.equivalents \
|
|
|
|
ascii.set+useful.set+linux.set 512 \
|
|
|
|
"$sourceRoot/psf/$(basename $i .bdf).psf"
|
|
|
|
done
|
|
|
|
cd "$sourceRoot"
|
|
|
|
|
|
|
|
# install the psf fonts (for the virtual console)
|
|
|
|
fontDir="$out/share/consolefonts"
|
|
|
|
mkdir -p "$fontDir"
|
|
|
|
mv psf/*.psf "$fontDir"
|
|
|
|
|
|
|
|
|
|
|
|
# install the pcf fonts (for xorg applications)
|
2015-08-14 04:41:03 +02:00
|
|
|
fontDir="$out/share/fonts/misc"
|
|
|
|
mkdir -p "$fontDir"
|
2015-08-31 16:06:22 +02:00
|
|
|
mv pcf/*.pcf.gz "$fontDir"
|
|
|
|
|
2015-08-14 04:41:03 +02:00
|
|
|
cd "$fontDir"
|
|
|
|
mkfontdir
|
|
|
|
mkfontscale
|
|
|
|
'';
|
|
|
|
|
2017-08-10 21:43:49 +02:00
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
outputHashMode = "recursive";
|
|
|
|
outputHash = "0msl5y9q6hjbhc85v121x1b1rhsh2rbqqy4k234i5mpp8l3087r7";
|
|
|
|
|
2015-08-14 04:41:03 +02:00
|
|
|
meta = with stdenv.lib; {
|
2015-08-31 16:06:22 +02:00
|
|
|
description = ''
|
|
|
|
A monospace bitmap font well suited for programming and terminal use
|
|
|
|
'';
|
2015-08-14 04:41:03 +02:00
|
|
|
homepage = http://font.gohu.org/;
|
|
|
|
license = licenses.wtfpl;
|
|
|
|
maintainers = with maintainers; [ epitrochoid ];
|
2015-11-17 21:29:29 +01:00
|
|
|
platforms = platforms.linux;
|
2015-08-14 04:41:03 +02:00
|
|
|
};
|
|
|
|
}
|