2018-12-13 17:58:09 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fontforge, python3 }:
|
2008-03-02 18:39:33 +00:00
|
|
|
|
2017-02-03 20:19:37 +00:00
|
|
|
let
|
2018-12-13 17:58:09 +00:00
|
|
|
inherit (python3.pkgs) fonttools;
|
2014-11-06 09:03:42 +00:00
|
|
|
|
2017-02-03 20:19:37 +00:00
|
|
|
common =
|
2019-05-13 04:54:44 +01:00
|
|
|
{ version, repo, sha256, nativeBuildInputs, postPatch ? null }:
|
2017-02-03 20:19:37 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-12-13 17:58:09 +00:00
|
|
|
pname = "liberation-fonts";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "liberationfonts";
|
|
|
|
rev = version;
|
|
|
|
inherit repo sha256;
|
2017-02-03 20:19:37 +00:00
|
|
|
};
|
2014-11-06 09:03:42 +00:00
|
|
|
|
2018-01-10 00:27:23 +00:00
|
|
|
inherit nativeBuildInputs postPatch;
|
2017-02-03 20:19:37 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2019-05-13 04:54:44 +01:00
|
|
|
find . -name '*.ttf' -exec install -m444 -Dt $out/share/fonts/truetype {} \;
|
2017-02-03 20:19:37 +00:00
|
|
|
|
2019-05-13 04:54:44 +01:00
|
|
|
install -m444 -Dt $out/share/doc/${pname}-${version} AUTHORS || true
|
|
|
|
install -m444 -Dt $out/share/doc/${pname}-${version} ChangeLog || true
|
|
|
|
install -m444 -Dt $out/share/doc/${pname}-${version} COPYING || true
|
|
|
|
install -m444 -Dt $out/share/doc/${pname}-${version} License.txt || true
|
|
|
|
install -m444 -Dt $out/share/doc/${pname}-${version} README || true
|
2017-02-03 20:19:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Liberation Fonts, replacements for Times New Roman, Arial, and Courier New";
|
|
|
|
longDescription = ''
|
|
|
|
The Liberation Fonts are intended to be replacements for the three most
|
|
|
|
commonly used fonts on Microsoft systems: Times New Roman, Arial, and
|
|
|
|
Courier New. Since 2012 they are based on croscore fonts.
|
|
|
|
|
|
|
|
There are three sets: Sans (a substitute for Arial, Albany, Helvetica,
|
|
|
|
Nimbus Sans L, and Bitstream Vera Sans), Serif (a substitute for Times
|
|
|
|
New Roman, Thorndale, Nimbus Roman, and Bitstream Vera Serif) and Mono
|
|
|
|
(a substitute for Courier New, Cumberland, Courier, Nimbus Mono L, and
|
|
|
|
Bitstream Vera Sans Mono).
|
|
|
|
'';
|
|
|
|
|
|
|
|
license = licenses.ofl;
|
2018-12-13 17:58:09 +00:00
|
|
|
homepage = https://github.com/liberationfonts;
|
2017-02-03 20:19:37 +00:00
|
|
|
maintainers = [
|
|
|
|
maintainers.raskin
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
2019-08-13 22:52:01 +01:00
|
|
|
liberation_ttf_v1 = common {
|
2018-12-13 17:58:09 +00:00
|
|
|
repo = "liberation-1.7-fonts";
|
|
|
|
version = "1.07.5";
|
2018-01-10 00:27:23 +00:00
|
|
|
nativeBuildInputs = [ fontforge ];
|
2018-12-13 17:58:09 +00:00
|
|
|
sha256 = "1ffl10mf78hx598sy9qr5m6q2b8n3mpnsj73bwixnd4985gsz56v";
|
2017-02-03 20:19:37 +00:00
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
liberation_ttf_v2 = common {
|
2018-12-13 17:58:09 +00:00
|
|
|
repo = "liberation-fonts";
|
|
|
|
version = "2.00.4";
|
2018-01-10 00:27:23 +00:00
|
|
|
nativeBuildInputs = [ fontforge fonttools ];
|
2017-08-19 07:27:59 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace scripts/setisFixedPitch-fonttools.py --replace \
|
|
|
|
'font = ttLib.TTFont(fontfile)' \
|
|
|
|
'font = ttLib.TTFont(fontfile, recalcTimestamp=False)'
|
|
|
|
'';
|
2018-12-13 17:58:09 +00:00
|
|
|
sha256 = "14bn1zlhyr4qaz5z2sx4h115pnbd41ix1vky8fxm2lx76xrjjiaa";
|
2008-03-02 18:39:33 +00:00
|
|
|
};
|
|
|
|
}
|