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
20 outputs = [ "out" "dev" ];
21
22 nativeBuildInputs = [ cython pkg-config ];
23
24 buildInputs = [ c-ares openssl zlib ];
25 propagatedBuildInputs = [ six protobuf ]
26 ++ lib.optionals (isPy27) [ enum34 futures ];
27
28 preBuild = lib.optionalString stdenv.isDarwin "unset AR";
29
30 GRPC_BUILD_WITH_BORING_SSL_ASM = "";
31 GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1;
32 GRPC_PYTHON_BUILD_SYSTEM_ZLIB = 1;
33 GRPC_PYTHON_BUILD_SYSTEM_CARES = 1;
34
35 # does not contain any tests
36 doCheck = false;
37
38 pythonImportsCheck = [ "grpc" ];
39
40 meta = with lib; {
41 description = "HTTP/2-based RPC framework";
42 license = licenses.asl20;
43 homepage = "https://grpc.io/grpc/python/";
44 maintainers = with maintainers; [ SuperSandro2000 ];
45 };
46}