Merge pull request #80326 from rnhmjoj/uni-vga

uni-vga: generate otb, psf and split output
This commit is contained in:
Michele Guerini Rocco 2020-02-19 11:07:22 +01:00 committed by GitHub
commit 0d47e820c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 14 deletions

View File

@ -1,4 +1,8 @@
{ stdenv, fetchurl, mkfontdir, mkfontscale }:
{ stdenv, fetchurl, perl, kbd, bdftopcf
, libfaketime, fonttosfnt, mkfontscale
}:
with stdenv.lib;
stdenv.mkDerivation {
name = "uni-vga";
@ -8,24 +12,50 @@ stdenv.mkDerivation {
sha256 = "05sns8h5yspa7xkl81ri7y1yxf5icgsnl497f3xnaryhx11s2rv6";
};
nativeBuildInputs = [ mkfontdir mkfontscale ];
nativeBuildInputs =
[ bdftopcf libfaketime
fonttosfnt mkfontscale
] ++ optionals stdenv.isLinux [ perl kbd ];
installPhase = ''
mkdir -p $out/share/fonts
cp *.bdf $out/share/fonts
cd $out/share/fonts
mkfontdir
mkfontscale
postPatch = "patchShebangs .";
buildPhase = ''
# convert font to compressed pcf
bdftopcf u_vga16.bdf | gzip -c -9 -n > u_vga16.pcf.gz
# convert bdf font to otb
faketime -f "1970-01-01 00:00:01" \
fonttosfnt -v -o u_vga16.otb u_vga16.bdf
'' + optionalString stdenv.isLinux ''
# convert font to compressed psf
./bdf2psf.pl -s UniCyrX.sfm u_vga16.bdf \
| psfaddtable - UniCyrX.sfm - \
| gzip -c -9 -n > u_vga16.psf.gz
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "0rfly7r6blr2ykxlv0f6my2w41vvxcw85chspljd2p1fxlr28jd7";
installPhase = ''
# install pcf (for X11 applications)
install -m 644 -D *.pcf.gz -t "$out/share/fonts"
mkfontdir "$out/share/fonts"
# install bdf font
install -m 644 -D *.bdf -t "$bdf/share/fonts"
mkfontdir "$bdf/share/fonts"
# install otb font (for GTK applications)
install -m 644 -D *.otb -t "$otb/share/fonts"
mkfontdir "$otb/share/fonts"
'' + optionalString stdenv.isLinux ''
# install psf (for linux virtual terminal)
install -m 644 -D *.psf.gz -t "$out/share/consolefonts"
'';
outputs = [ "out" "bdf" "otb" ];
meta = {
description = "Unicode VGA font";
maintainers = [stdenv.lib.maintainers.ftrvxmtrx];
maintainers = [ maintainers.ftrvxmtrx ];
homepage = http://www.inp.nsk.su/~bolkhov/files/fonts/univga/;
license = stdenv.lib.licenses.mit;
license = licenses.mit;
};
}

View File

@ -18039,7 +18039,8 @@ in
undefined-medium = callPackage ../data/fonts/undefined-medium { };
uni-vga = callPackage ../data/fonts/uni-vga { };
uni-vga = callPackage ../data/fonts/uni-vga
{ inherit (buildPackages.xorg) fonttosfnt mkfontscale; };
unicode-character-database = callPackage ../data/misc/unicode-character-database { };