From 5b90cec99c7a212aca340a40401f9df3e4302b7c Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 15 Jan 2023 14:39:32 +0100 Subject: [PATCH] python311Packages.protobuf: fix tests --- pkgs/development/python-modules/protobuf/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix index cd1fb4806f1..8df8bb7c4a7 100644 --- a/pkgs/development/python-modules/protobuf/default.nix +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -3,6 +3,8 @@ , buildPythonPackage , protobuf , isPyPy +, fetchpatch +, pythonAtLeast }: let @@ -23,6 +25,15 @@ buildPythonPackage { sourceRoot = "source/python"; + patches = lib.optionals (pythonAtLeast "3.11") [ + (fetchpatch { + url = "https://github.com/protocolbuffers/protobuf/commit/da973aff2adab60a9e516d3202c111dbdde1a50f.patch"; + stripLen = 2; + extraPrefix = ""; + hash = "sha256-a/12C6yIe1tEKjsMxcfDAQ4JHolA8CzkN7sNG8ZspPs="; + }) + ]; + prePatch = '' if [[ "$(<../version.json)" != *'"python": "'"$version"'"'* ]]; then echo "Python library version mismatch. Derivation version: $version, actual: $(<../version.json)"