depot/third_party/nixpkgs/pkgs/data/fonts/unifont/default.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

53 lines
1.4 KiB
Nix

{ lib, stdenv, fetchurl, xorg
, libfaketime
}:
stdenv.mkDerivation rec {
pname = "unifont";
version = "15.1.04";
otf = fetchurl {
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.otf";
hash = "sha256-J8g8ojXDq5nV013zXXi1rEAYQhpCh7G06mV7IpmZbTg=";
};
pcf = fetchurl {
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.pcf.gz";
hash = "sha256-XHKP8xx+GvhFYBW03Sambpd2gclKvQUz1JAjIlb59OI=";
};
nativeBuildInputs = [ libfaketime xorg.fonttosfnt xorg.mkfontscale ];
dontUnpack = true;
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 otf fonts
install -m 644 -D ${pcf} $out/share/fonts/unifont.pcf.gz
install -m 644 -D ${otf} $out/share/fonts/opentype/unifont.otf
cd "$out/share/fonts"
mkfontdir
mkfontscale
'';
meta = with lib; {
description = "Unicode font for Base Multilingual Plane";
homepage = "https://unifoundry.com/unifont/";
# Basically GPL2+ with font exception.
license = "https://unifoundry.com/LICENSE.txt";
maintainers = [ maintainers.rycee maintainers.vrthra ];
platforms = platforms.all;
};
}