2022-10-21 18:38:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, xorg
|
|
|
|
, libfaketime
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "unifont";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "15.0.04";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
ttf = fetchurl {
|
2022-04-27 09:35:20 +00:00
|
|
|
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.ttf";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-kkSbEvWBrvcnBgHDdKJjpSYF6BJDEwmYSxVQbPkQ6so=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
pcf = fetchurl {
|
|
|
|
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.pcf.gz";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-rdzJuOkXYojgm5VfpshtJuCJYM0/iS+HnWMXEDsLQPg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
nativeBuildInputs = [ libfaketime xorg.fonttosfnt xorg.mkfontscale ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
dontUnpack = true;
|
2020-04-24 23:36:52 +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 =
|
|
|
|
''
|
|
|
|
# install otb fonts
|
2020-09-25 04:45:31 +00:00
|
|
|
install -m 644 -D unifont.otb "$out/share/fonts/unifont.otb"
|
|
|
|
mkfontdir "$out/share/fonts"
|
2020-04-24 23:36:52 +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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Unicode font for Base Multilingual Plane";
|
2021-08-06 21:57:35 +00:00
|
|
|
homepage = "https://unifoundry.com/unifont/";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Basically GPL2+ with font exception.
|
2021-08-06 21:57:35 +00:00
|
|
|
license = "https://unifoundry.com/LICENSE.txt";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.rycee maintainers.vrthra ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|