mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
84 lines
1.4 KiB
Nix
84 lines
1.4 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.64.1";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-jVHdHFnV+g80JmuAo4BewpofJkJcKlRzYTP22H/Eloo=";
|
|
};
|
|
|
|
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.hostPlatform.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 = [ ];
|
|
};
|
|
}
|