2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, mkfontscale
|
2020-02-17 00:07:00 +00:00
|
|
|
, libfaketime, fonttosfnt
|
|
|
|
}:
|
2010-07-28 15:35:01 +00:00
|
|
|
|
2015-01-11 14:07:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "unifont";
|
2021-01-01 07:44:35 +00:00
|
|
|
version = "13.0.05";
|
2010-07-28 15:35:01 +00:00
|
|
|
|
|
|
|
ttf = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.ttf";
|
2021-01-01 07:44:35 +00:00
|
|
|
sha256 = "0ff7zbyqi45q0171rl9ckj6lpfhcj8a9850d8j89m7wbwky32isf";
|
2008-03-02 18:39:33 +00:00
|
|
|
};
|
2010-07-28 15:35:01 +00:00
|
|
|
|
|
|
|
pcf = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://gnu/unifont/${pname}-${version}/${pname}-${version}.pcf.gz";
|
2021-01-01 07:44:35 +00:00
|
|
|
sha256 = "16n666p6rs6l4r8grh67gy4ls33qfnbb5xk7cksywzjwdh42js0r";
|
2008-03-02 18:39:33 +00:00
|
|
|
};
|
2010-07-28 15:35:01 +00:00
|
|
|
|
2020-02-17 00:07:00 +00:00
|
|
|
nativeBuildInputs = [ libfaketime fonttosfnt mkfontscale ];
|
2010-07-28 15:35:01 +00:00
|
|
|
|
2020-02-17 00:07:00 +00:00
|
|
|
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}"
|
|
|
|
'';
|
2010-07-28 15:35:01 +00:00
|
|
|
|
|
|
|
installPhase =
|
|
|
|
''
|
2020-02-17 00:07:00 +00:00
|
|
|
# install otb fonts
|
2020-08-21 12:18:18 +00:00
|
|
|
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"
|
2015-01-11 14:07:51 +00:00
|
|
|
mkfontdir
|
2010-07-28 15:35:01 +00:00
|
|
|
mkfontscale
|
|
|
|
'';
|
2015-01-11 14:07:51 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-10-06 09:49:53 +00:00
|
|
|
description = "Unicode font for Base Multilingual Plane";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://unifoundry.com/unifont.html";
|
2015-01-11 14:07:51 +00:00
|
|
|
|
|
|
|
# Basically GPL2+ with font exception.
|
2020-04-01 01:11:51 +00:00
|
|
|
license = "http://unifoundry.com/LICENSE.txt";
|
2016-07-04 17:32:08 +00:00
|
|
|
maintainers = [ maintainers.rycee maintainers.vrthra ];
|
2015-01-11 14:07:51 +00:00
|
|
|
platforms = platforms.all;
|
2008-03-02 18:39:33 +00:00
|
|
|
};
|
2010-07-28 15:35:01 +00:00
|
|
|
}
|