depot/third_party/nixpkgs/pkgs/development/python-modules/grpcio/default.nix
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

63 lines
1.3 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, grpc
, six
, protobuf
, enum34 ? null
, futures ? null
, isPy27
, pkg-config
, cython
, c-ares
, openssl
, zlib
}:
buildPythonPackage rec {
pname = "grpcio";
format = "setuptools";
version = "1.60.0";
src = fetchPypi {
inherit pname version;
hash = "sha256-IZkWWhr/tmaqJK3wyXQ2aG0KYbxfwRPAN3Aft8f865Y=";
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cython pkg-config ];
buildInputs = [ c-ares openssl zlib ];
propagatedBuildInputs = [ six protobuf ]
++ lib.optionals (isPy27) [ enum34 futures ];
preBuild = ''
export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS="$NIX_BUILD_CORES"
if [ -z "$enableParallelBuilding" ]; then
GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=1
fi
'' + lib.optionalString stdenv.isDarwin ''
unset AR
'';
GRPC_BUILD_WITH_BORING_SSL_ASM = "";
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1;
GRPC_PYTHON_BUILD_SYSTEM_ZLIB = 1;
GRPC_PYTHON_BUILD_SYSTEM_CARES = 1;
# does not contain any tests
doCheck = false;
enableParallelBuilding = true;
pythonImportsCheck = [ "grpc" ];
meta = with lib; {
description = "HTTP/2-based RPC framework";
license = licenses.asl20;
homepage = "https://grpc.io/grpc/python/";
maintainers = with maintainers; [ ];
};
}