nixpkgs/pkgs/data/fonts/unifont/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, mkfontscale
2020-02-17 00:07:00 +00:00
, libfaketime, fonttosfnt
}:
stdenv.mkDerivation rec {
pname = "unifont";
2022-04-20 07:36:18 +00:00
version = "14.0.03";
ttf = fetchurl {
2022-04-20 07:36:18 +00:00
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.ttf";
sha256 = "1qyc7nqyhjnarwgpkah52qv7hr0yfzak7084ilrj7z0nii4f5y57";
};
pcf = fetchurl {
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.pcf.gz";
2022-04-20 07:36:18 +00:00
sha256 = "1sgvxpr4ydjnbk70j0lpgxz5x851lmrmxjb5x8lsz0i2hm32jdbc";
};
2020-02-17 00:07:00 +00:00
nativeBuildInputs = [ libfaketime fonttosfnt mkfontscale ];
2021-07-22 15:20:32 +00:00
dontUnpack = true;
2020-02-17 00:07:00 +00:00
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 =
''
2020-02-17 00:07:00 +00:00
# install otb fonts
install -m 644 -D unifont.otb "$out/share/fonts/unifont.otb"
mkfontdir "$out/share/fonts"
2020-02-17 00:07:00 +00:00
# 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 lib; {
description = "Unicode font for Base Multilingual Plane";
2021-08-05 20:57:36 +00:00
homepage = "https://unifoundry.com/unifont/";
# Basically GPL2+ with font exception.
2021-08-05 20:57:36 +00:00
license = "https://unifoundry.com/LICENSE.txt";
2016-07-04 17:32:08 +00:00
maintainers = [ maintainers.rycee maintainers.vrthra ];
platforms = platforms.all;
};
}