3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/data/fonts/unifont/default.nix
rnhmjoj 6545e5a506
pkgs/data/fonts: merge back the split otb output
Since the Pango issue 457[1] has been fixed and Nixpkgs patched, it's no
longer necessary to keep X11 and .otb fonts in separate outputs (previously
they would cause application to display broken fonts).

[1]: https://gitlab.gnome.org/GNOME/pango/-/issues/457
2020-08-22 09:45:05 +02:00

54 lines
1.4 KiB
Nix

{ stdenv, fetchurl, mkfontscale
, libfaketime, fonttosfnt
}:
stdenv.mkDerivation rec {
pname = "unifont";
version = "13.0.01";
ttf = fetchurl {
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.ttf";
sha256 = "0y5bd7i5hp9ks6d3qq0bshywba7g90i3074wckpn9m8shh98ngcg";
};
pcf = fetchurl {
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.pcf.gz";
sha256 = "05zgz00n514cijqh9qcvr4iz0bla4hd028cvi1jlh0ic6fkafix8";
};
nativeBuildInputs = [ libfaketime fonttosfnt mkfontscale ];
phases = [ "buildPhase" "installPhase" ];
buildPhase =
''
# convert pcf font to otb
faketime -f "1970-01-01 00:00:01" \
fonttosfnt -g 2 -m 2 -v -o "unifont.otb" "${pcf}"
'';
installPhase =
''
# install otb fonts
install -m 644 -D unifont.otb "$out/share/fonts/unifont.otb"
mkfontdir "$out/share/fonts"
# install pcf and ttf fonts
install -m 644 -D ${pcf} $out/share/fonts/unifont.pcf.gz
install -m 644 -D ${ttf} $out/share/fonts/truetype/unifont.ttf
cd "$out/share/fonts"
mkfontdir
mkfontscale
'';
meta = with stdenv.lib; {
description = "Unicode font for Base Multilingual Plane";
homepage = "http://unifoundry.com/unifont.html";
# Basically GPL2+ with font exception.
license = "http://unifoundry.com/LICENSE.txt";
maintainers = [ maintainers.rycee maintainers.vrthra ];
platforms = platforms.all;
};
}