2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub
|
2020-02-07 21:49:24 +00:00
|
|
|
, mkfontscale, bdf2psf, bdftopcf
|
2020-02-07 17:21:29 +00:00
|
|
|
, fonttosfnt, libfaketime
|
2019-03-02 15:09:28 +00:00
|
|
|
}:
|
2015-08-14 02:41:03 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gohufont";
|
2019-03-02 15:09:28 +00:00
|
|
|
version = "2.1";
|
2015-08-14 02:41:03 +00:00
|
|
|
|
2019-12-07 16:22:14 +00:00
|
|
|
src = fetchFromGitHub {
|
2019-03-02 15:09:28 +00:00
|
|
|
owner = "hchargois";
|
|
|
|
repo = "gohufont";
|
|
|
|
rev = "cc36b8c9fed7141763e55dcee0a97abffcf08224";
|
|
|
|
sha256 = "1hmp11mrr01b29phw0xyj4h9b92qz19cf56ssf6c47c5j2c4xmbv";
|
2015-08-31 14:06:22 +00:00
|
|
|
};
|
|
|
|
|
2019-12-07 16:22:14 +00:00
|
|
|
nativeBuildInputs =
|
2020-02-07 21:49:24 +00:00
|
|
|
[ mkfontscale bdf2psf bdftopcf
|
2020-02-07 17:21:29 +00:00
|
|
|
fonttosfnt libfaketime
|
|
|
|
];
|
2015-08-31 14:06:22 +00:00
|
|
|
|
2019-03-02 15:09:28 +00:00
|
|
|
buildPhase = ''
|
2019-12-07 16:22:14 +00:00
|
|
|
# convert bdf fonts to psf
|
2019-03-02 15:09:28 +00:00
|
|
|
build=$(pwd)
|
2015-08-31 14:06:22 +00:00
|
|
|
mkdir psf
|
2019-09-14 08:26:55 +00:00
|
|
|
cd ${bdf2psf}/share/bdf2psf
|
2019-12-07 16:22:14 +00:00
|
|
|
for i in $src/*.bdf; do
|
|
|
|
name=$(basename $i .bdf)
|
2019-03-02 15:09:28 +00:00
|
|
|
bdf2psf \
|
|
|
|
--fb "$i" standard.equivalents \
|
|
|
|
ascii.set+useful.set+linux.set 512 \
|
2019-12-07 16:22:14 +00:00
|
|
|
"$build/psf/$name.psf"
|
2019-03-02 15:09:28 +00:00
|
|
|
done
|
|
|
|
cd $build
|
2015-08-31 14:06:22 +00:00
|
|
|
|
2020-02-07 21:49:24 +00:00
|
|
|
# convert bdf fonts to pcf
|
2019-12-07 16:22:14 +00:00
|
|
|
for i in *.bdf $src/hidpi/*.bdf; do
|
|
|
|
name=$(basename $i .bdf)
|
|
|
|
bdftopcf -o "$name.pcf" "$i"
|
2020-02-07 21:49:24 +00:00
|
|
|
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"
|
2015-08-31 14:06:22 +00:00
|
|
|
done
|
2019-03-02 15:09:28 +00:00
|
|
|
'';
|
2015-08-31 14:06:22 +00:00
|
|
|
|
2019-03-02 15:09:28 +00:00
|
|
|
installPhase = ''
|
2015-08-31 14:06:22 +00:00
|
|
|
# install the psf fonts (for the virtual console)
|
|
|
|
fontDir="$out/share/consolefonts"
|
2020-02-07 21:49:24 +00:00
|
|
|
install -D -m 644 -t "$fontDir" psf/*.psf
|
2015-08-31 14:06:22 +00:00
|
|
|
|
2020-08-21 12:18:18 +00:00
|
|
|
# install the pcf and otb fonts (for X11,GTK applications)
|
2015-08-14 02:41:03 +00:00
|
|
|
fontDir="$out/share/fonts/misc"
|
2020-08-21 12:18:18 +00:00
|
|
|
install -D -m 644 -t "$fontDir" *.pcf *.otb
|
2020-02-07 21:49:24 +00:00
|
|
|
mkfontdir "$fontDir"
|
2015-08-14 02:41:03 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-08-31 14:06:22 +00:00
|
|
|
description = ''
|
|
|
|
A monospace bitmap font well suited for programming and terminal use
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://font.gohu.org/";
|
2019-03-02 15:09:28 +00:00
|
|
|
license = licenses.wtfpl;
|
|
|
|
maintainers = with maintainers; [ epitrochoid rnhmjoj ];
|
2015-08-14 02:41:03 +00:00
|
|
|
};
|
|
|
|
}
|