1{ lib, stdenv
2, buildPythonPackage
3, grpc
4, six
5, protobuf
6, enum34 ? null
7, futures ? null
8, isPy27
9, pkg-config
10, cython
11, c-ares
12, openssl
13, zlib
14}:
15
16buildPythonPackage rec {
17 inherit (grpc) src version;
18 pname = "grpcio";
19 format = "setuptools";
20
21 outputs = [ "out" "dev" ];
22
23 nativeBuildInputs = [ cython pkg-config ];
24
25 buildInputs = [ c-ares openssl zlib ];
26 propagatedBuildInputs = [ six protobuf ]
27 ++ lib.optionals (isPy27) [ enum34 futures ];
28
29 preBuild = lib.optionalString stdenv.isDarwin "unset AR";
30
31 GRPC_BUILD_WITH_BORING_SSL_ASM = "";
32 GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1;
33 GRPC_PYTHON_BUILD_SYSTEM_ZLIB = 1;
34 GRPC_PYTHON_BUILD_SYSTEM_CARES = 1;
35
36 # does not contain any tests
37 doCheck = false;
38
39 pythonImportsCheck = [ "grpc" ];
40
41 meta = with lib; {
42 description = "HTTP/2-based RPC framework";
43 license = licenses.asl20;
44 homepage = "https://grpc.io/grpc/python/";
45 maintainers = with maintainers; [ SuperSandro2000 ];
46 };
47}