2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2022-06-26 10:26:21 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2020-09-25 04:45:31 +00:00
|
|
|
, pythonOlder
|
2022-06-26 10:26:21 +00:00
|
|
|
, isPyPy
|
|
|
|
, fetchFromGitHub
|
|
|
|
, setuptools-scm
|
|
|
|
, fs
|
2020-09-25 04:45:31 +00:00
|
|
|
, lxml
|
2022-06-26 10:26:21 +00:00
|
|
|
, brotli
|
|
|
|
, brotlicffi
|
|
|
|
, zopfli
|
|
|
|
, unicodedata2
|
|
|
|
, lz4
|
2020-09-25 04:45:31 +00:00
|
|
|
, scipy
|
|
|
|
, munkres
|
2022-06-26 10:26:21 +00:00
|
|
|
, matplotlib
|
2020-09-25 04:45:31 +00:00
|
|
|
, sympy
|
2022-06-26 10:26:21 +00:00
|
|
|
, xattr
|
|
|
|
, skia-pathops
|
|
|
|
, uharfbuzz
|
2021-12-26 17:43:05 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fonttools";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "4.42.1";
|
|
|
|
format = "setuptools";
|
2021-12-26 17:43:05 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-fcFFJi9Hr0m74LwFIhhhm/bMfxepAvg4/ymU53MmsPg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
passthru.optional-dependencies = let
|
|
|
|
extras = {
|
|
|
|
ufo = [ fs ];
|
|
|
|
lxml = [ lxml ];
|
|
|
|
woff = [ (if isPyPy then brotlicffi else brotli) zopfli ];
|
|
|
|
unicode = lib.optional (pythonOlder "3.11") unicodedata2;
|
|
|
|
graphite = [ lz4 ];
|
|
|
|
interpolatable = [ (if isPyPy then munkres else scipy) ];
|
|
|
|
plot = [ matplotlib ];
|
|
|
|
symfont = [ sympy ];
|
|
|
|
type1 = lib.optional stdenv.isDarwin xattr;
|
|
|
|
pathops = [ skia-pathops ];
|
|
|
|
repacker = [ uharfbuzz ];
|
|
|
|
};
|
|
|
|
in extras // {
|
|
|
|
all = lib.concatLists (lib.attrValues extras);
|
|
|
|
};
|
2021-12-26 17:43:05 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-26 17:43:05 +00:00
|
|
|
pytestCheckHook
|
2022-07-14 12:49:19 +00:00
|
|
|
] ++ lib.concatLists (lib.attrVals ([
|
2022-06-26 10:26:21 +00:00
|
|
|
"woff"
|
|
|
|
"interpolatable"
|
2023-11-16 04:20:00 +00:00
|
|
|
"ufo"
|
2022-07-14 12:49:19 +00:00
|
|
|
] ++ lib.optionals (!skia-pathops.meta.broken) [
|
|
|
|
"pathops" # broken
|
|
|
|
] ++ [
|
2022-06-26 10:26:21 +00:00
|
|
|
"repacker"
|
2022-07-14 12:49:19 +00:00
|
|
|
]) passthru.optional-dependencies);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
pythonImportsCheck = [ "fontTools" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preCheck = ''
|
2021-12-26 17:43:05 +00:00
|
|
|
# tests want to execute the "fonttools" executable from $PATH
|
|
|
|
export PATH="$out/bin:$PATH"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
# Timestamp tests have timing issues probably related
|
|
|
|
# to our file timestamp normalization
|
|
|
|
disabledTests = [
|
|
|
|
"test_recalc_timestamp_ttf"
|
|
|
|
"test_recalc_timestamp_otf"
|
|
|
|
"test_ttcompile_timestamp_calcs"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# avoid test which depend on fs and matplotlib
|
|
|
|
# fs and matplotlib were removed to prevent strong cyclic dependencies
|
|
|
|
"Tests/misc/plistlib_test.py"
|
|
|
|
"Tests/pens"
|
|
|
|
"Tests/ufoLib"
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/fonttools/fonttools";
|
|
|
|
description = "A library to manipulate font files from Python";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.sternenseemann ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|