about summary refs log tree commit diff
diff options
context:
space:
mode:
authorwxt2024-11-15 14:50:52 +0800
committergithub-actions[bot]2024-11-15 10:38:41 +0000
commitb700d64e0201d77625705537a6434b04ba7c685b (patch)
tree258d71789717cf6ced181162839b945caa918ded
parent7bdd6ff0f072db368e7e305336e5fbba56244792 (diff)
python3Packages.cirq-google: fix build backport-355905-to-release-24.11
(cherry picked from commit 663b2c175988c985ef6dc2753b66c70b2dbc101a)
-rw-r--r--pkgs/development/python-modules/cirq-google/default.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/cirq-google/default.nix b/pkgs/development/python-modules/cirq-google/default.nix
index 6c84cd1440e6..efb00a62ad3a 100644
--- a/pkgs/development/python-modules/cirq-google/default.nix
+++ b/pkgs/development/python-modules/cirq-google/default.nix
@@ -6,6 +6,8 @@
   protobuf,
   pytestCheckHook,
   setuptools,
+  protobuf4,
+  fetchpatch,
 }:
 
 buildPythonPackage rec {
@@ -17,6 +19,20 @@ buildPythonPackage rec {
 
   build-system = [ setuptools ];
 
+  patches = [
+    # https://github.com/quantumlib/Cirq/pull/6683 Support for protobuf5
+    (fetchpatch {
+      url = "https://github.com/quantumlib/Cirq/commit/bae02e4d83aafa29f50aa52073d86eb913ccb2d3.patch";
+      hash = "sha256-MqHhKa38BTM6viQtWik0TQjN0OPdrwzCZkkqZsiyF5w=";
+      includes = [ "cirq_google/serialization/arg_func_langs_test.py" ];
+      stripLen = 1;
+    })
+  ];
+
+  pythonRelaxDeps = [
+    "protobuf"
+  ];
+
   dependencies = [
     cirq-core
     google-api-core