terminus_font: generate otb and split output

This commit is contained in:
rnhmjoj 2020-02-16 10:46:35 +01:00
parent 27006fcb4d
commit 4eb84c9ed4
No known key found for this signature in database
GPG key ID: BFBAF4C975F76450
2 changed files with 31 additions and 7 deletions

View file

@ -1,4 +1,7 @@
{ stdenv, fetchurl, python3, bdftopcf, mkfontdir, mkfontscale }:
{ stdenv, fetchurl, python3
, libfaketime, fonttosfnt
, bdftopcf, mkfontscale
}:
stdenv.mkDerivation rec {
pname = "terminus-font";
@ -9,16 +12,36 @@ stdenv.mkDerivation rec {
sha256 = "1bwlkj39rqbyq57v5yssayav6hzv1n11b9ml2s0dpiyfsn6rqy9l";
};
nativeBuildInputs = [ python3 bdftopcf mkfontdir mkfontscale ];
patchPhase = ''
substituteInPlace Makefile --replace 'fc-cache' '#fc-cache'
'';
nativeBuildInputs =
[ python3 bdftopcf libfaketime
fonttosfnt mkfontscale
];
enableParallelBuilding = true;
postPatch = ''
substituteInPlace Makefile --replace 'fc-cache' '#fc-cache'
'';
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 "$otb/share/fonts/misc";
mkfontdir "$otb/share/fonts/misc"
'';
installTargets = [ "install" "fontdir" ];
outputs = [ "out" "otb" ];
meta = with stdenv.lib; {
description = "A clean fixed width font";
longDescription = ''

View file

@ -17971,7 +17971,8 @@ in
tenderness = callPackage ../data/fonts/tenderness { };
terminus_font = callPackage ../data/fonts/terminus-font { };
terminus_font = callPackage ../data/fonts/terminus-font
{ inherit (buildPackages.xorg) fonttosfnt mkfontscale; };
terminus_font_ttf = callPackage ../data/fonts/terminus-font-ttf { };