From 8c383061a3f5bf63262da88803f70ed62743eed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kemetm=C3=BCller?= Date: Mon, 22 Nov 2021 17:18:12 +0100 Subject: [PATCH 1/4] python.pkgs.protobuf: Remove empty dev output --- pkgs/development/python-modules/protobuf/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix index db3b73d7462..4f5878928bf 100644 --- a/pkgs/development/python-modules/protobuf/default.nix +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -18,8 +18,6 @@ buildPythonPackage { inherit disabled; doCheck = doCheck && !isPy27; # setuptools>=41.4 no longer collects correctly on python2 - outputs = [ "out" "dev" ]; - propagatedBuildInputs = [ six ] ++ lib.optionals isPy27 [ google-apputils ]; propagatedNativeBuildInputs = [ buildPackages.protobuf ]; # For protoc. nativeBuildInputs = [ pyext ] ++ lib.optionals isPy27 [ google-apputils ]; From 69ee45f10448280cfd81e32167a0fdb0d5640389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kemetm=C3=BCller?= Date: Mon, 22 Nov 2021 17:19:45 +0100 Subject: [PATCH 2/4] python.pkgs.protobuf: Fix C++ backend --- .../python-modules/protobuf/default.nix | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix index 4f5878928bf..7dc1e8abd03 100644 --- a/pkgs/development/python-modules/protobuf/default.nix +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -39,27 +39,12 @@ buildPythonPackage { cd python ''; - preConfigure = lib.optionalString (lib.versionAtLeast protobuf.version "2.6.0") '' - export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp - export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2 - ''; + setupPyGlobalFlags = lib.optional (lib.versionAtLeast protobuf.version "2.6.0") + "--cpp_implementation"; - preBuild = '' - # Workaround for https://github.com/google/protobuf/issues/2895 - ${python.pythonForBuild.interpreter} setup.py build - '' + lib.optionalString (lib.versionAtLeast protobuf.version "2.6.0") '' - ${python.pythonForBuild.interpreter} setup.py build_ext --cpp_implementation - ''; - - installFlags = lib.optional (lib.versionAtLeast protobuf.version "2.6.0") - "--install-option='--cpp_implementation'"; - - # the _message.so isn't installed, so we'll do that manually. - # if someone can figure out a less hacky way to get the _message.so to - # install, please do replace this. - postInstall = lib.optionalString (lib.versionAtLeast protobuf.version "2.6.0") '' - cp -v $(find build -name "_message*") $out/${python.sitePackages}/google/protobuf/pyext - ''; + pythonImportsCheck = lib.optionals (lib.versionAtLeast protobuf.version "2.6.0") [ + "google.protobuf.internal._api_implementation" # Verify that --cpp_implementation worked + ]; meta = with lib; { description = "Protocol Buffers are Google's data interchange format"; From e106e3e01abf0f72057868db7bc1295c5176002b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 7 Dec 2021 18:46:18 -0500 Subject: [PATCH 3/4] python.pkgs.protobuf: add google.protobuf to pythonImportsCheck Co-authored-by: Sandro --- pkgs/development/python-modules/protobuf/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix index 7dc1e8abd03..87a57a3bba2 100644 --- a/pkgs/development/python-modules/protobuf/default.nix +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -42,7 +42,9 @@ buildPythonPackage { setupPyGlobalFlags = lib.optional (lib.versionAtLeast protobuf.version "2.6.0") "--cpp_implementation"; - pythonImportsCheck = lib.optionals (lib.versionAtLeast protobuf.version "2.6.0") [ + pythonImportsCheck = [ + "google.protobuf" + ] ++ lib.optionals (lib.versionAtLeast protobuf.version "2.6.0") [ "google.protobuf.internal._api_implementation" # Verify that --cpp_implementation worked ]; From fcbe3f1e37dd0bcadbd70c08a4cf372db013b42b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kemetm=C3=BCller?= Date: Mon, 13 Dec 2021 21:43:42 +0100 Subject: [PATCH 4/4] python.pkgs.protobuf: Add myself as maintainer --- pkgs/development/python-modules/protobuf/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix index 87a57a3bba2..30e9fbf9ea7 100644 --- a/pkgs/development/python-modules/protobuf/default.nix +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -52,6 +52,7 @@ buildPythonPackage { description = "Protocol Buffers are Google's data interchange format"; homepage = "https://developers.google.com/protocol-buffers/"; license = licenses.bsd3; + maintainers = with maintainers; [ knedlsepp ]; }; passthru.protobuf = protobuf;