Merge pull request #210914 from wegank/protobuf-darwin

python311Packages.protobuf: fix tests
This commit is contained in:
Nick Cao 2023-01-18 14:06:27 +08:00 committed by GitHub
commit 6af676a9a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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