2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub
|
2022-10-21 18:38:19 +00:00
|
|
|
, xorg, bdf2psf, bdftopcf
|
|
|
|
, libfaketime
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gohufont";
|
|
|
|
version = "2.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hchargois";
|
|
|
|
repo = "gohufont";
|
|
|
|
rev = "cc36b8c9fed7141763e55dcee0a97abffcf08224";
|
|
|
|
sha256 = "1hmp11mrr01b29phw0xyj4h9b92qz19cf56ssf6c47c5j2c4xmbv";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs =
|
2022-10-21 18:38:19 +00:00
|
|
|
[ xorg.mkfontscale bdf2psf bdftopcf
|
|
|
|
xorg.fonttosfnt libfaketime
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
# convert bdf fonts to psf
|
|
|
|
build=$(pwd)
|
|
|
|
mkdir psf
|
|
|
|
cd ${bdf2psf}/share/bdf2psf
|
|
|
|
for i in $src/*.bdf; do
|
|
|
|
name=$(basename $i .bdf)
|
|
|
|
bdf2psf \
|
|
|
|
--fb "$i" standard.equivalents \
|
|
|
|
ascii.set+useful.set+linux.set 512 \
|
|
|
|
"$build/psf/$name.psf"
|
|
|
|
done
|
|
|
|
cd $build
|
|
|
|
|
|
|
|
# convert bdf fonts to pcf
|
|
|
|
for i in *.bdf $src/hidpi/*.bdf; do
|
|
|
|
name=$(basename $i .bdf)
|
|
|
|
bdftopcf -o "$name.pcf" "$i"
|
|
|
|
done
|
|
|
|
|
|
|
|
# convert unicode bdf fonts to otb
|
|
|
|
for i in *-uni*.bdf $src/hidpi/*-uni*.bdf; do
|
|
|
|
name=$(basename $i .bdf)
|
|
|
|
faketime -f "1970-01-01 00:00:01" \
|
|
|
|
fonttosfnt -v -o "$name.otb" "$i"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# install the psf fonts (for the virtual console)
|
|
|
|
fontDir="$out/share/consolefonts"
|
|
|
|
install -D -m 644 -t "$fontDir" psf/*.psf
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# install the pcf and otb fonts (for X11,GTK applications)
|
2020-04-24 23:36:52 +00:00
|
|
|
fontDir="$out/share/fonts/misc"
|
2020-09-25 04:45:31 +00:00
|
|
|
install -D -m 644 -t "$fontDir" *.pcf *.otb
|
2020-04-24 23:36:52 +00:00
|
|
|
mkfontdir "$fontDir"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = ''
|
|
|
|
A monospace bitmap font well suited for programming and terminal use
|
|
|
|
'';
|
|
|
|
homepage = "https://font.gohu.org/";
|
|
|
|
license = licenses.wtfpl;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|