nixpkgs-suyu/pkgs/data/fonts/terminus-font/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

62 lines
1.9 KiB
Nix

{ lib, stdenv, fetchurl, python3
, libfaketime, fonttosfnt
, bdftopcf, mkfontscale
}:
stdenv.mkDerivation rec {
pname = "terminus-font";
version = "4.48"; # set here for use in URL below
src = fetchurl {
url = "mirror://sourceforge/project/${pname}/${pname}-${version}/${pname}-${version}.tar.gz";
sha256 = "1bwlkj39rqbyq57v5yssayav6hzv1n11b9ml2s0dpiyfsn6rqy9l";
};
nativeBuildInputs =
[ python3 bdftopcf libfaketime
fonttosfnt mkfontscale
];
enableParallelBuilding = true;
postPatch = ''
substituteInPlace Makefile --replace 'fc-cache' '#fc-cache'
substituteInPlace Makefile --replace 'gzip' 'gzip -n'
'';
postBuild = ''
# convert unicode bdf fonts to otb
for i in *.bdf; do
name=$(basename $i .bdf)
faketime -f "1970-01-01 00:00:01" \
fonttosfnt -v -o "$name.otb" "$i"
done
'';
postInstall = ''
# install otb fonts (for GTK applications)
install -m 644 -D *.otb -t "$out/share/fonts/misc";
mkfontdir "$out/share/fonts/misc"
'';
installTargets = [ "install" "fontdir" ];
meta = with lib; {
description = "A clean fixed width font";
longDescription = ''
Terminus Font is designed for long (8 and more hours per day) work
with computers. Version 4.30 contains 850 characters, covers about
120 language sets and supports ISO8859-1/2/5/7/9/13/15/16,
Paratype-PT154/PT254, KOI8-R/U/E/F, Esperanto, many IBM, Windows and
Macintosh code pages, as well as the IBM VGA, vt100 and xterm
pseudographic characters.
The sizes present are 6x12, 8x14, 8x16, 10x20, 11x22, 12x24, 14x28 and
16x32. The styles are normal and bold (except for 6x12), plus
EGA/VGA-bold for 8x14 and 8x16.
'';
homepage = "http://terminus-font.sourceforge.net/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ astsmtl ];
};
}