nixpkgs/pkgs/development/python-modules/grpcio/default.nix
Daniël de Kok 715ec6e885 pythonPackages.grpcio: fix build on Darwin
Builds on Darwin have started to fail recently. This seems to be caused
by a check in Makefile that verifies whether the system is able to build
BoringSSL. This check attempts to compile test/build/boringssl.c, which
is absent in PyPI archives of grpcio.

This change builds the grpcio module directly from the grpc git
repository, so that all the files that are necessary for checks are
present.

Affects #56826 since darwin builds of this derivation on nixpkgs-19.03
fail.
2019-03-27 20:06:15 +01:00

34 lines
969 B
Nix

{ stdenv, buildPythonPackage, fetchFromGitHub, lib, darwin
, six, protobuf, enum34, futures, isPy27, isPy34, pkgconfig
, cython}:
with stdenv.lib;
buildPythonPackage rec {
pname = "grpcio";
version = "1.18.0";
src = fetchFromGitHub {
owner = "grpc";
repo = "grpc";
rev = "v${version}";
fetchSubmodules = true;
sha256 = "0cilbhk35gv46mk40jl5f3iqa94x14qyxbavpfq0kh0rld82nx4m";
};
nativeBuildInputs = [ cython pkgconfig ]
++ optional stdenv.isDarwin darwin.cctools;
propagatedBuildInputs = [ six protobuf ]
++ lib.optionals (isPy27 || isPy34) [ enum34 ]
++ lib.optionals (isPy27) [ futures ];
preBuild = optionalString stdenv.isDarwin "unset AR";
meta = with stdenv.lib; {
description = "HTTP/2-based RPC framework";
license = lib.licenses.asl20;
homepage = "https://grpc.io/grpc/python/";
maintainers = with maintainers; [ vanschelven ];
};
}