I an effort to update another package, I have updated dev-libs/protobuf to 23.3. Even though dev-libs/protobuf doesn't have an ebuild > 21, it is a documented issue. https://bugs.gentoo.org/906811 has an ebuild for dev-libs/protobuf-22.3 and I am in the process of modifying it a bit to work with 23.3. https://github.com/protocolbuffers/protobuf/issues/12746#issuecomment-1553244976 CMake's `FindProtobuf` is broken for 22.x and up, and `find_package(protobuf CONFIG)` needs to be used. https://github.com/protocolbuffers/protobuf/issues/12746#issuecomment-1555328698 `FIND_PACKAGE(Protobuf)` falls back to the `FindPackage` implementation shipped with cmake, which is broken. What you want is `FIND_PACKAGE(Protobuf CONFIG)` Here is a diff of opencv-4.7.0.ebuild that is working for me /var/db/repos $ diff -c {gentoo,local}/media-libs/opencv/opencv-4.7.0.ebuild *** gentoo/media-libs/opencv/opencv-4.7.0.ebuild 2023-05-17 08:33:34.310081642 -0500 --- local/media-libs/opencv/opencv-4.7.0.ebuild 2023-06-24 11:54:42.982811210 -0500 *************** *** 313,318 **** --- 313,321 ---- sed -e '/add_subdirectory(.*3rdparty.*)/ d' \ -i CMakeLists.txt cmake/*cmake || die + sed -e '/find_package/ s/(Protobuf QUIET)/(Protobuf CONFIG QUIET)/' \ + -i cmake/OpenCVFindProtobuf.cmake || die + if use dnnsamples; then mv "${WORKDIR}/res10_300x300_ssd_iter_140000.caffemodel" "${WORKDIR}/${P}/samples/dnn/" || die fi *************** *** 470,475 **** --- 473,479 ---- # =================================================== -DBUILD_PROTOBUF=OFF -DPROTOBUF_UPDATE_FILES=ON + -Dprotobuf_MODULE_COMPATIBLE=ON # =================================================== # things we want to be hard enabled not worth useflag # ===================================================
*** This bug has been marked as a duplicate of bug 909081 ***
*** Bug 923747 has been marked as a duplicate of this bug. ***
Testing upstream patch backport right now.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c080f8d73d1351815fa52e13155c6a12093693f commit 5c080f8d73d1351815fa52e13155c6a12093693f Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2024-02-04 10:39:56 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2024-02-04 12:44:32 +0000 media-libs/opencv: Fix build with >=dev-libs/protobuf-22 Urgent fix since someone decided to bump dev-libs/protobuf-22.5 ... Closes: https://bugs.gentoo.org/909087 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> .../opencv/files/opencv-4.8.1-protobuf-22.patch | 190 +++++++++++++++++++++ media-libs/opencv/opencv-4.8.1-r1.ebuild | 4 +- 2 files changed, 193 insertions(+), 1 deletion(-)