Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 909087 - media-libs/opencv w/ >=dev-libs/protobuf-22.x: undefined reference to `absl::lts_20230802::log_internal::LogMessageFatal::~LogMessageFatal()'
Summary: media-libs/opencv w/ >=dev-libs/protobuf-22.x: undefined reference to `absl::...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Paul Zander
URL: https://github.com/opencv/opencv/pull...
Whiteboard: fixed in 4.9.0
Keywords: UPSTREAM
: 923747 (view as bug list)
Depends on: 921968
Blocks: 912819
  Show dependency tree
 
Reported: 2023-06-24 17:01 UTC by Mark Conway
Modified: 2024-02-04 12:45 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Conway 2023-06-24 17:01:19 UTC
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
        # ===================================================
Comment 1 Andreas Sturmlechner gentoo-dev 2023-06-27 11:49:21 UTC

*** This bug has been marked as a duplicate of bug 909081 ***
Comment 2 Andreas Sturmlechner gentoo-dev 2024-02-04 10:32:11 UTC
*** Bug 923747 has been marked as a duplicate of this bug. ***
Comment 3 Andreas Sturmlechner gentoo-dev 2024-02-04 11:37:45 UTC
Testing upstream patch backport right now.
Comment 4 Larry the Git Cow gentoo-dev 2024-02-04 12:45:10 UTC
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(-)