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