2019-03-02 15:09:28 +00:00
|
|
|
{ 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 03:41:03 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gohufont";
|
2019-03-02 15:09:28 +00:00
|
|
|
version = "2.1";
|
2015-08-14 03:41:03 +01: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 15:06:22 +01: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 15:06:22 +01: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 15:06:22 +01:00
|
|
|
mkdir psf
|
2019-09-14 09:26:55 +01: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 15:06:22 +01: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 15:06:22 +01:00
|
|
|
done
|
2019-03-02 15:09:28 +00:00
|
|
|
'';
|
2015-08-31 15:06:22 +01:00
|
|
|
|
2019-03-02 15:09:28 +00:00
|
|
|
installPhase = ''
|
2015-08-31 15:06:22 +01: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 15:06:22 +01:00
|
|
|
|
2020-02-07 21:49:24 +00:00
|
|
|
# install the pcf fonts (for xorg applications)
|
2015-08-14 03:41:03 +01:00
|
|
|
fontDir="$out/share/fonts/misc"
|
2020-02-07 21:49:24 +00:00
|
|
|
install -D -m 644 -t "$fontDir" *.pcf
|
|
|
|
mkfontdir "$fontDir"
|
2015-08-31 15:06:22 +01:00
|
|
|
|
2020-02-07 21:49:24 +00:00
|
|
|
# install the otb fonts (for gtk applications)
|
|
|
|
fontDir="$otb/share/fonts/misc"
|
|
|
|
install -D -m 644 -t "$fontDir" *.otb
|
|
|
|
mkfontdir "$fontDir"
|
2015-08-14 03:41:03 +01:00
|
|
|
'';
|
|
|
|
|
2020-02-07 21:49:24 +00:00
|
|
|
outputs = [ "out" "otb" ];
|
2017-08-10 20:43:49 +01:00
|
|
|
|
2015-08-14 03:41:03 +01:00
|
|
|
meta = with stdenv.lib; {
|
2015-08-31 15:06:22 +01:00
|
|
|
description = ''
|
|
|
|
A monospace bitmap font well suited for programming and terminal use
|
|
|
|
'';
|
2019-11-16 00:41:23 +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 03:41:03 +01:00
|
|
|
};
|
|
|
|
}
|