python312Packages.protobuf: fix build

This commit is contained in:
Martin Weinelt 2024-03-26 15:56:25 +01:00
parent 11e596c56d
commit 4dd692fb1a
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ buildPythonPackage {
#
postPatch = ''
sed -i "/extra_compile_args.append('-std=c++14')/d" setup.py
# The former function has been renamed into the latter in Python 3.12.
# Does not apply to all protobuf versions, hence --replace-warn.
substituteInPlace google/protobuf/internal/json_format_test.py \
--replace-warn assertRaisesRegexp assertRaisesRegex
'';
nativeBuildInputs = lib.optional isPyPy tzdata;