uni-vga: reduce with lib usage

This commit is contained in:
Sandro Jäckel 2022-04-30 02:43:24 +02:00
parent 9b310a73db
commit 0201c6cf46
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -2,8 +2,6 @@
, libfaketime, fonttosfnt, mkfontscale , libfaketime, fonttosfnt, mkfontscale
}: }:
with lib;
stdenv.mkDerivation { stdenv.mkDerivation {
name = "uni-vga"; name = "uni-vga";
@ -15,7 +13,7 @@ stdenv.mkDerivation {
nativeBuildInputs = nativeBuildInputs =
[ bdftopcf libfaketime [ bdftopcf libfaketime
fonttosfnt mkfontscale fonttosfnt mkfontscale
] ++ optionals stdenv.isLinux [ perl kbd ]; ] ++ lib.optionals stdenv.isLinux [ perl kbd ];
postPatch = "patchShebangs ."; postPatch = "patchShebangs .";
@ -26,7 +24,7 @@ stdenv.mkDerivation {
# convert bdf font to otb # convert bdf font to otb
faketime -f "1970-01-01 00:00:01" \ faketime -f "1970-01-01 00:00:01" \
fonttosfnt -v -o u_vga16.otb u_vga16.bdf fonttosfnt -v -o u_vga16.otb u_vga16.bdf
'' + optionalString stdenv.isLinux '' '' + lib.optionalString stdenv.isLinux ''
# convert font to compressed psf # convert font to compressed psf
./bdf2psf.pl -s UniCyrX.sfm u_vga16.bdf \ ./bdf2psf.pl -s UniCyrX.sfm u_vga16.bdf \
| psfaddtable - UniCyrX.sfm - \ | psfaddtable - UniCyrX.sfm - \
@ -42,14 +40,14 @@ stdenv.mkDerivation {
install -m 644 -D *.bdf -t "$bdf/share/fonts" install -m 644 -D *.bdf -t "$bdf/share/fonts"
mkfontdir "$bdf/share/fonts" mkfontdir "$bdf/share/fonts"
'' + optionalString stdenv.isLinux '' '' + lib.optionalString stdenv.isLinux ''
# install psf (for linux virtual terminal) # install psf (for linux virtual terminal)
install -m 644 -D *.psf.gz -t "$out/share/consolefonts" install -m 644 -D *.psf.gz -t "$out/share/consolefonts"
''; '';
outputs = [ "out" "bdf" ]; outputs = [ "out" "bdf" ];
meta = { meta = with lib; {
description = "Unicode VGA font"; description = "Unicode VGA font";
maintainers = [ maintainers.ftrvxmtrx ]; maintainers = [ maintainers.ftrvxmtrx ];
homepage = "http://www.inp.nsk.su/~bolkhov/files/fonts/univga/"; homepage = "http://www.inp.nsk.su/~bolkhov/files/fonts/univga/";