1{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder 2, fonttools 3, lxml, fs # for fonttools extras 4, setuptools-scm 5, pytestCheckHook, pytest-cov, pytest-xdist 6, runAllTests ? false, psautohint # for passthru.tests 7}: 8 9buildPythonPackage rec { 10 pname = "psautohint"; 11 version = "2.4.0"; 12 13 disabled = pythonOlder "3.7"; 14 15 src = fetchFromGitHub { 16 owner = "adobe-type-tools"; 17 repo = pname; 18 rev = "v${version}"; 19 sha256 = "125nx7accvbk626qlfar90va1995kp9qfrz6a978q4kv2kk37xai"; 20 fetchSubmodules = true; # data dir for tests 21 }; 22 23 postPatch = '' 24 echo '#define PSAUTOHINT_VERSION "${version}"' > libpsautohint/src/version.h 25 sed -i '/use_scm_version/,+3d' setup.py 26 sed -i '/setup(/a \ version="${version}",' setup.py 27 ''; 28 29 nativeBuildInputs = [ setuptools-scm ]; 30 31 propagatedBuildInputs = [ fonttools lxml fs ]; 32 33 checkInputs = [ 34 pytestCheckHook 35 pytest-cov 36 pytest-xdist 37 ]; 38 disabledTests = lib.optionals (!runAllTests) [ 39 # Slow tests, reduces test time from ~5 mins to ~30s 40 "test_mmufo" 41 "test_flex_ufo" 42 "test_ufo" 43 "test_flex_otf" 44 "test_multi_outpath" 45 "test_mmhint" 46 "test_otf" 47 ]; 48 49 passthru.tests = { 50 fullTestsuite = psautohint.override { runAllTests = true; }; 51 }; 52 53 meta = with lib; { 54 description = "Script to normalize the XML and other data inside of a UFO"; 55 homepage = "https://github.com/adobe-type-tools/psautohint"; 56 license = licenses.bsd3; 57 maintainers = [ maintainers.sternenseemann ]; 58 }; 59}