Merge pull request #80228 from rnhmjoj/tamsyn

tamsyn: generate otb and split output
This commit is contained in:
Michele Guerini Rocco 2020-02-17 19:49:09 +01:00 committed by GitHub
commit 02371d9410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 15 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, mkfontdir, mkfontscale }: { stdenv, fetchurl, fontforge, mkfontscale }:
let let
version = "1.11"; version = "1.11";
@ -11,27 +11,32 @@ in stdenv.mkDerivation {
sha256 = "0kpjzdj8sv5871b8827mjgj9dswk75h94jj5iia2bds18ih1pglp"; sha256 = "0kpjzdj8sv5871b8827mjgj9dswk75h94jj5iia2bds18ih1pglp";
}; };
nativeBuildInputs = [ mkfontdir mkfontscale ]; nativeBuildInputs = [ fontforge mkfontscale ];
unpackPhase = '' unpackPhase = ''
tar -xzf $src --strip-components=1 tar -xzf $src --strip-components=1
''; '';
installPhase = '' postBuild = ''
# install the pcf fonts (for xorg applications) # convert pcf fonts to otb
fontDir="$out/share/fonts/tamsyn" for i in *.pcf; do
mkdir -p "$fontDir" name=$(basename "$i" .pcf)
mv *.pcf "$fontDir" fontforge -lang=ff -c "Open(\"$i\"); Generate(\"$name.otb\")"
mv *.psf.gz "$fontDir" done
cd "$fontDir" # compress pcf fonts
mkfontdir gzip -n -9 *.pcf
mkfontscale
''; '';
outputHashAlgo = "sha256"; installPhase = ''
outputHashMode = "recursive"; install -m 644 -D *.pcf.gz -t "$out/share/fonts/misc"
outputHash = "13l7ighfmn3kmqmchlksfg8ss22ndjk71rs0f9fn5p5zk7s4dn5x"; install -m 644 -D *.psf.gz -t "$out/share/consolefonts"
install -m 644 -D *.otb -t "$otb/share/fonts/misc"
mkfontdir "$out/share/fonts/misc"
mkfontdir "$otb/share/fonts/misc"
'';
outputs = [ "out" "otb" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A monospace bitmap font aimed at programmers"; description = "A monospace bitmap font aimed at programmers";

View File

@ -17965,7 +17965,7 @@ in
inherit (callPackages ../data/fonts/tai-languages { }) tai-ahom; inherit (callPackages ../data/fonts/tai-languages { }) tai-ahom;
tamsyn = callPackage ../data/fonts/tamsyn { }; tamsyn = callPackage ../data/fonts/tamsyn { inherit (buildPackages.xorg) mkfontscale; };
tango-icon-theme = callPackage ../data/icons/tango-icon-theme { tango-icon-theme = callPackage ../data/icons/tango-icon-theme {
gtk = res.gtk2; gtk = res.gtk2;