media-libs/opencv: fix build with protobuf-34.2

Protobuf deprecated a member function; suggested replacement
Patch puts this replacement inline.

Bug: https://bugs.gentoo.org/976143
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/994
Merges: https://codeberg.org/gentoo/gentoo/pulls/994
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
NHOrus
2026-05-28 12:37:03 +01:00
committed by Sam James
parent 341d80fad5
commit 1dbb30107a
2 changed files with 1692 additions and 0 deletions
@@ -0,0 +1,15 @@
https://bugs.gentoo.org/976143
Protibuf deprecated proto2::FieldDescriptor::is_optional, with recommended replacement
Upstream patch that adds said replacement:
https://github.com/opencv/opencv/commit/61a3d7d25d2987b9c72e072ff9d38dbcbb31ab54
--- a/modules/dnn/src/caffe/caffe_importer.cpp
+++ b/modules/dnn/src/caffe/caffe_importer.cpp
@@ -217,7 +217,7 @@
const google::protobuf::UnknownFieldSet& unknownFields = msgRefl->GetUnknownFields(msg);
bool hasData = fd->is_required() ||
- (fd->is_optional() && msgRefl->HasField(msg, fd)) ||
+ ((!fd->is_required() && !fd->is_repeated()) && msgRefl->HasField(msg, fd)) ||
(fd->is_repeated() && msgRefl->FieldSize(msg, fd) > 0) ||
!unknownFields.empty();
if (!hasData)
File diff suppressed because it is too large Load Diff