diff options
author | rnhmjoj <rnhmjoj@inventati.org> | 2020-02-17 11:57:28 +0100 |
---|---|---|
committer | rnhmjoj <rnhmjoj@inventati.org> | 2020-02-17 11:57:28 +0100 |
commit | 270a1e4f8a45fdff2dc5f32d30882f6dab87ca9f (patch) | |
tree | 36968c4cc33c21c1caa8ef9447e8f839dccdc9b3 /pkgs/data/fonts | |
parent | 3b7f5c6762bb174bd9951a697b636e1db531e98a (diff) | |
download | nixlib-270a1e4f8a45fdff2dc5f32d30882f6dab87ca9f.tar nixlib-270a1e4f8a45fdff2dc5f32d30882f6dab87ca9f.tar.gz nixlib-270a1e4f8a45fdff2dc5f32d30882f6dab87ca9f.tar.bz2 nixlib-270a1e4f8a45fdff2dc5f32d30882f6dab87ca9f.tar.lz nixlib-270a1e4f8a45fdff2dc5f32d30882f6dab87ca9f.tar.xz nixlib-270a1e4f8a45fdff2dc5f32d30882f6dab87ca9f.tar.zst nixlib-270a1e4f8a45fdff2dc5f32d30882f6dab87ca9f.zip |
unscii: cleanup and split outputs
The font is very large and duplicated across many formats, some of which cannot be compressed, like `.hex` or `.svg`. For normal use (eg. X11, GTK applications) these formats are not necessary, so they are moved to another output reducing the default closure size.
Diffstat (limited to 'pkgs/data/fonts')
-rw-r--r-- | pkgs/data/fonts/unscii/default.nix | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/pkgs/data/fonts/unscii/default.nix b/pkgs/data/fonts/unscii/default.nix index cd4d0dc42cdd..93fe8cdfb74b 100644 --- a/pkgs/data/fonts/unscii/default.nix +++ b/pkgs/data/fonts/unscii/default.nix @@ -1,32 +1,55 @@ -{stdenv, fetchurl, perl, bdftopcf, perlPackages, fontforge, SDL, SDL_image}: +{ stdenv, fetchurl, perl, bdftopcf +, fontforge, SDL, SDL_image, mkfontscale +}: + stdenv.mkDerivation rec { pname = "unscii"; version = "1.1"; - # or fetchFromGitHub(owner,repo,rev) or fetchgit(rev) + src = fetchurl { url = "http://pelulamu.net/${pname}/${pname}-${version}-src.tar.gz"; sha256 = "0qcxcnqz2nlwfzlrn115kkp3n8dd7593h762vxs6vfqm13i39lq1"; }; - nativeBuildInputs = [perl bdftopcf perlPackages.TextCharWidth fontforge - SDL SDL_image]; + + nativeBuildInputs = + [ (perl.withPackages (p: [ p.TextCharWidth ])) + bdftopcf fontforge SDL SDL_image + mkfontscale + ]; + preConfigure = '' patchShebangs . ''; + + postBuild = '' + # compress pcf fonts + gzip -9 -n *.pcf + ''; + installPhase = '' - install -m444 -Dt $out/share/fonts *.hex *.pcf - install -m444 -Dt $out/share/fonts/truetype *.ttf - install -m444 -Dt $out/share/fonts/opentype *.otf - install -m444 -Dt $out/share/fonts/svg *.svg - install -m444 -Dt $out/share/fonts/web *.woff + # install fonts for use in X11 and GTK applications + install -m444 -Dt "$out/share/fonts/misc" *.pcf.gz + install -m444 -Dt "$out/share/fonts/opentype" *.otf + mkfontdir "$out/share/fonts/misc" + mkfontscale "$out/share/fonts/opentype" + + # install other formats in $extra + install -m444 -Dt "$extra/share/fonts/truetype" *.ttf + install -m444 -Dt "$extra/share/fonts/svg" *.svg + install -m444 -Dt "$extra/share/fonts/web" *.woff + install -m444 -Dt "$extra/share/fonts/misc" *.hex + mkfontscale "$extra"/share/fonts/* ''; + outputs = [ "out" "extra" ]; + meta = { inherit version; description = ''Bitmapped character-art-friendly Unicode fonts''; # Basically GPL2+ with font exception — because of the Unifont-augmented # version. The reduced version is public domain. license = http://unifoundry.com/LICENSE.txt; - maintainers = [stdenv.lib.maintainers.raskin]; + maintainers = [ stdenv.lib.maintainers.raskin ]; homepage = http://pelulamu.net/unscii/; }; } |