1{ lib
2, buildPythonPackage
3, pythonAtLeast
4, fetchFromGitHub
5, fetchpatch
6, libuv
7}:
8
9buildPythonPackage rec {
10 pname = "pyuv";
11 version = "1.4.0";
12 disabled = pythonAtLeast "3.11";
13
14 src = fetchFromGitHub {
15 owner = "saghul";
16 repo = "pyuv";
17 rev = "pyuv-${version}";
18 sha256 = "1wiwwdylz66lfsjh6p4iv7pfhzvnhwjk332625njizfhz3gq9fwr";
19 };
20
21 patches = [
22 (fetchpatch {
23 name = "fix-build-with-python3.10.patch";
24 url = "https://github.com/saghul/pyuv/commit/8bddcc27052017b5b9cb89c24dbfdf06737b0dd3.patch";
25 sha256 = "sha256-J/3ky64Ff+gYpN3ksFLNuZ5xgPbBkyOl4LTY6fiHAgk=";
26 })
27 ];
28
29 setupPyBuildFlags = [ "--use-system-libuv" ];
30
31 buildInputs = [ libuv ];
32
33 doCheck = false; # doesn't work in sandbox
34
35 pythonImportsCheck = [ "pyuv" ];
36
37 meta = with lib; {
38 description = "Python interface for libuv";
39 homepage = "https://github.com/saghul/pyuv";
40 license = licenses.mit;
41 maintainers = with maintainers; [ dotlambda ];
42 };
43}