1{ 2 stdenv, 3 lib, 4 buildPythonPackage, 5 fetchFromGitHub, 6 pytestCheckHook, 7 setuptools, 8 setuptools-scm, 9 distutils, 10 ttfautohint, 11 fonttools, 12}: 13 14buildPythonPackage rec { 15 pname = "ttfautohint-py"; 16 version = "0.6.0"; 17 pyproject = true; 18 19 src = fetchFromGitHub { 20 owner = "fonttools"; 21 repo = "ttfautohint-py"; 22 tag = "v${version}"; 23 hash = "sha256-wA8su7HEQnDbCShrX9fiP/VKNMtMqeayHbQXHqy8iOA="; 24 }; 25 26 postPatch = '' 27 substituteInPlace src/python/ttfautohint/__init__.py \ 28 --replace-fail '_exe_full_path = None' '_exe_full_path = "${lib.getExe ttfautohint}"' 29 ''; 30 31 env.TTFAUTOHINTPY_BUNDLE_DLL = false; 32 33 build-system = [ 34 setuptools 35 setuptools-scm 36 distutils 37 ]; 38 39 dependencies = [ 40 setuptools # for pkg_resources 41 ]; 42 43 buildInputs = [ ttfautohint ]; 44 45 nativeCheckInputs = [ 46 pytestCheckHook 47 fonttools 48 ]; 49 50 pythonImportsCheck = [ "ttfautohint" ]; 51 52 meta = { 53 description = "Python wrapper for ttfautohint, a free auto-hinter for TrueType fonts"; 54 homepage = "https://github.com/fonttools/ttfautohint-py"; 55 changelog = "https://github.com/fonttools/ttfautohint-py/releases/tag/${src.tag}"; 56 license = lib.licenses.mit; 57 maintainers = with lib.maintainers; [ jopejoe1 ]; 58 }; 59}