Merge pull request #80261 from rnhmjoj/terminus

terminus_font: generate otb and split output
This commit is contained in:
Michele Guerini Rocco 2020-02-17 20:48:06 +01:00 committed by GitHub
commit 875f474b42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -17985,7 +17985,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 { };