python311Packages.protobuf: fix tests

This commit is contained in:
Weijia Wang 2023-01-15 14:39:32 +01:00
parent 09091c7521
commit 5b90cec99c

View File

@ -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)"