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";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "15.1.05";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
otf = fetchurl {
|
|
|
|
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.otf";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-e2K1CsuxhmidwwxEbOQ2e4fXlInpkHuDJV+fvg3PueE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
pcf = fetchurl {
|
|
|
|
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.pcf.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-zpc9Z4XXvma/tXRYOvAAQIpjyYS+1XPiaLZF4xYPTbw=";
|
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
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# install pcf and otf fonts
|
2020-04-24 23:36:52 +00:00
|
|
|
install -m 644 -D ${pcf} $out/share/fonts/unifont.pcf.gz
|
2023-10-09 19:29:22 +00:00
|
|
|
install -m 644 -D ${otf} $out/share/fonts/opentype/unifont.otf
|
2020-04-24 23:36:52 +00:00
|
|
|
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";
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = [ maintainers.rycee ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|