2021-01-15 07:29:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, kbd, bdftopcf
|
2022-10-13 22:16:16 +00:00
|
|
|
, libfaketime, xorg
|
2020-02-17 01:11:34 +00:00
|
|
|
}:
|
2015-05-18 15:50:50 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "uni-vga";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "http://www.inp.nsk.su/~bolkhov/files/fonts/univga/uni-vga.tgz";
|
2015-05-18 15:50:50 +00:00
|
|
|
sha256 = "05sns8h5yspa7xkl81ri7y1yxf5icgsnl497f3xnaryhx11s2rv6";
|
|
|
|
};
|
|
|
|
|
2020-02-17 01:11:34 +00:00
|
|
|
nativeBuildInputs =
|
2020-02-18 14:08:44 +00:00
|
|
|
[ bdftopcf libfaketime
|
2022-10-13 22:16:16 +00:00
|
|
|
xorg.fonttosfnt xorg.mkfontscale
|
2022-04-30 00:43:24 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [ perl kbd ];
|
2020-02-17 01:11:34 +00:00
|
|
|
|
|
|
|
postPatch = "patchShebangs .";
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
# convert font to compressed pcf
|
|
|
|
bdftopcf u_vga16.bdf | gzip -c -9 -n > u_vga16.pcf.gz
|
|
|
|
|
2020-02-18 14:08:44 +00:00
|
|
|
# convert bdf font to otb
|
|
|
|
faketime -f "1970-01-01 00:00:01" \
|
|
|
|
fonttosfnt -v -o u_vga16.otb u_vga16.bdf
|
2022-04-30 00:43:24 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2020-02-17 01:11:34 +00:00
|
|
|
# convert font to compressed psf
|
|
|
|
./bdf2psf.pl -s UniCyrX.sfm u_vga16.bdf \
|
|
|
|
| psfaddtable - UniCyrX.sfm - \
|
|
|
|
| gzip -c -9 -n > u_vga16.psf.gz
|
|
|
|
'';
|
2015-05-18 15:50:50 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-08-21 12:18:18 +00:00
|
|
|
# install pcf and otb (for X11 and GTK applications)
|
|
|
|
install -m 644 -D *.otb *.pcf.gz -t "$out/share/fonts"
|
2020-02-17 01:11:34 +00:00
|
|
|
mkfontdir "$out/share/fonts"
|
|
|
|
|
|
|
|
# install bdf font
|
|
|
|
install -m 644 -D *.bdf -t "$bdf/share/fonts"
|
|
|
|
mkfontdir "$bdf/share/fonts"
|
|
|
|
|
2022-04-30 00:43:24 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2020-02-18 14:08:44 +00:00
|
|
|
# install psf (for linux virtual terminal)
|
|
|
|
install -m 644 -D *.psf.gz -t "$out/share/consolefonts"
|
2015-05-18 15:50:50 +00:00
|
|
|
'';
|
|
|
|
|
2020-08-21 12:18:18 +00:00
|
|
|
outputs = [ "out" "bdf" ];
|
2017-08-10 19:43:49 +00:00
|
|
|
|
2022-04-30 00:43:24 +00:00
|
|
|
meta = with lib; {
|
2015-05-18 15:50:50 +00:00
|
|
|
description = "Unicode VGA font";
|
2020-02-18 14:08:44 +00:00
|
|
|
maintainers = [ maintainers.ftrvxmtrx ];
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.inp.nsk.su/~bolkhov/files/fonts/univga/";
|
2020-02-18 14:08:44 +00:00
|
|
|
license = licenses.mit;
|
2015-05-18 15:50:50 +00:00
|
|
|
};
|
|
|
|
}
|