depot/third_party/nixpkgs/pkgs/development/python-modules/protobuf/default.nix
Default email eeb71630af Project import generated by Copybara.
GitOrigin-RevId: 636051e353461f073ac55d5d42c1ed062a345046
2022-11-02 23:02:43 +01:00

46 lines
980 B
Nix

{ buildPackages
, lib
, buildPythonPackage
, protobuf
, pyext
, isPyPy
}:
buildPythonPackage {
inherit (protobuf) pname src version;
disabled = isPyPy;
prePatch = ''
while [ ! -d python ]; do
cd *
done
cd python
'';
nativeBuildInputs = [ pyext ];
buildInputs = [ protobuf ];
propagatedNativeBuildInputs = [
# For protoc of the same version.
buildPackages."protobuf${lib.versions.major protobuf.version}_${lib.versions.minor protobuf.version}"
];
setupPyGlobalFlags = "--cpp_implementation";
pythonImportsCheck = [
"google.protobuf"
"google.protobuf.internal._api_implementation" # Verify that --cpp_implementation worked
];
passthru = {
inherit protobuf;
};
meta = with lib; {
description = "Protocol Buffers are Google's data interchange format";
homepage = "https://developers.google.com/protocol-buffers/";
license = licenses.bsd3;
maintainers = with maintainers; [ knedlsepp ];
};
}