From 663b2c175988c985ef6dc2753b66c70b2dbc101a Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Fri, 15 Nov 2024 14:50:52 +0800 Subject: [PATCH] python3Packages.cirq-google: fix build --- .../python-modules/cirq-google/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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