2020-09-25 04:45:31 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
|
2020-12-25 13:55:36 +00:00
|
|
|
, fonttools
|
|
|
|
, lxml, fs # for fonttools extras
|
2021-06-04 09:07:49 +00:00
|
|
|
, setuptools-scm
|
2021-07-24 12:14:16 +00:00
|
|
|
, pytestCheckHook, pytest-cov, pytest-xdist
|
2022-04-27 09:35:20 +00:00
|
|
|
, runAllTests ? false, psautohint # for passthru.tests
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "psautohint";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "2.4.0";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-12-25 13:55:36 +00:00
|
|
|
owner = "adobe-type-tools";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "125nx7accvbk626qlfar90va1995kp9qfrz6a978q4kv2kk37xai";
|
2020-09-25 04:45:31 +00:00
|
|
|
fetchSubmodules = true; # data dir for tests
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
echo '#define PSAUTOHINT_VERSION "${version}"' > libpsautohint/src/version.h
|
|
|
|
sed -i '/use_scm_version/,+3d' setup.py
|
|
|
|
sed -i '/setup(/a \ version="${version}",' setup.py
|
|
|
|
'';
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ fonttools lxml fs ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-02-19 19:06:45 +00:00
|
|
|
pytestCheckHook
|
2021-07-24 12:14:16 +00:00
|
|
|
pytest-cov
|
|
|
|
pytest-xdist
|
2020-12-25 13:55:36 +00:00
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
disabledTests = lib.optionals (!runAllTests) [
|
2020-12-25 13:55:36 +00:00
|
|
|
# Slow tests, reduces test time from ~5 mins to ~30s
|
|
|
|
"test_mmufo"
|
|
|
|
"test_flex_ufo"
|
|
|
|
"test_ufo"
|
|
|
|
"test_flex_otf"
|
|
|
|
"test_multi_outpath"
|
|
|
|
"test_mmhint"
|
|
|
|
"test_otf"
|
2023-03-30 22:05:00 +00:00
|
|
|
# flaky tests (see https://github.com/adobe-type-tools/psautohint/issues/385)
|
|
|
|
"test_hashmap_old_version"
|
|
|
|
"test_hashmap_no_version"
|
2020-12-25 13:55:36 +00:00
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru.tests = {
|
|
|
|
fullTestsuite = psautohint.override { runAllTests = true; };
|
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Script to normalize the XML and other data inside of a UFO";
|
|
|
|
homepage = "https://github.com/adobe-type-tools/psautohint";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
|
|
};
|
|
|
|
}
|