1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7 cython,
8 pkgconfig,
9 setuptools,
10 setuptools-scm,
11 pytestCheckHook,
12 ApplicationServices,
13}:
14
15buildPythonPackage rec {
16 pname = "uharfbuzz";
17 version = "0.41.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.5";
21
22 src = fetchFromGitHub {
23 owner = "harfbuzz";
24 repo = "uharfbuzz";
25 rev = "refs/tags/v${version}";
26 fetchSubmodules = true;
27 hash = "sha256-N/Vprr1lJmDLUzf+aX374YbJhDuHOpPzNeYXpLOANeI=";
28 };
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace-fail "setuptools >= 36.4, < 72.2" setuptools
33 '';
34
35 build-system = [
36 cython
37 pkgconfig
38 setuptools
39 setuptools-scm
40 ];
41
42 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ ApplicationServices ];
43
44 nativeCheckInputs = [ pytestCheckHook ];
45
46 pythonImportsCheck = [ "uharfbuzz" ];
47
48 meta = with lib; {
49 description = "Streamlined Cython bindings for the harfbuzz shaping engine";
50 homepage = "https://github.com/harfbuzz/uharfbuzz";
51 license = licenses.asl20;
52 maintainers = [ ];
53 };
54}