* [Buildroot] [PATCH] package/opencv: depend on webp mux/demux
@ 2026-07-26 21:59 Alessandro Rubini
2026-08-21 10:23 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Alessandro Rubini @ 2026-07-26 21:59 UTC (permalink / raw)
To: buildroot
Without this dependency, autoconfiguration fails:
CMake Error: The following variables are used in this project,
but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly
in the CMake files:
WEBP_DEMUX_LIBRARY
linked by target "opencv_imgcodecs"
in directory [...]/build/opencv4-4.13.0/modules/imgcodecs
WEBP_MUX_LIBRARY
linked by target "opencv_imgcodecs"
in directory [...]/build/opencv4-4.13.0/modules/imgcodecs
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
---
package/opencv4/Config.in | 2 ++
package/opencv4/opencv4.mk | 1 +
2 files changed, 3 insertions(+)
diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
index 47c1cf3f4a..856f3e8abd 100644
--- a/package/opencv4/Config.in
+++ b/package/opencv4/Config.in
@@ -7,6 +7,8 @@ menuconfig BR2_PACKAGE_OPENCV4
depends on !BR2_STATIC_LIBS # include dlfcn.h
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
select BR2_PACKAGE_ZLIB
+ select BR2_PACKAGE_WEBP_DEMUX
+ select BR2_PACKAGE_WEBP_MUX
help
OpenCV (Open Source Computer Vision) is a library of
programming functions for real time computer vision.
diff --git a/package/opencv4/opencv4.mk b/package/opencv4/opencv4.mk
index 0e2567eb6f..b08e8a33d4 100644
--- a/package/opencv4/opencv4.mk
+++ b/package/opencv4/opencv4.mk
@@ -261,6 +261,7 @@ OPENCV4_CONF_OPTS += \
-DWITH_XINE=OFF
OPENCV4_DEPENDENCIES += host-pkgconf zlib
+OPENCV4_DEPENDENCIES += webp
ifeq ($(BR2_PACKAGE_OPENCV4_CONTRIB),y)
# OPENCV4 depends on OPENCV4_CONTRIB, and not the other way around.
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/opencv: depend on webp mux/demux
2026-07-26 21:59 [Buildroot] [PATCH] package/opencv: depend on webp mux/demux Alessandro Rubini
@ 2026-08-21 10:23 ` Thomas Petazzoni via buildroot
2026-08-21 10:28 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-21 10:23 UTC (permalink / raw)
To: Alessandro Rubini; +Cc: buildroot
Hello Alessandro,
Thanks for your patch!
On Sun, Jul 26, 2026 at 11:59:31PM +0200, Alessandro Rubini wrote:
> Without this dependency, autoconfiguration fails:
>
> CMake Error: The following variables are used in this project,
> but they are set to NOTFOUND.
> Please set them or make sure they are set and tested correctly
> in the CMake files:
> WEBP_DEMUX_LIBRARY
> linked by target "opencv_imgcodecs"
> in directory [...]/build/opencv4-4.13.0/modules/imgcodecs
> WEBP_MUX_LIBRARY
> linked by target "opencv_imgcodecs"
> in directory [...]/build/opencv4-4.13.0/modules/imgcodecs
>
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
> ---
> package/opencv4/Config.in | 2 ++
> package/opencv4/opencv4.mk | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
> index 47c1cf3f4a..856f3e8abd 100644
> --- a/package/opencv4/Config.in
> +++ b/package/opencv4/Config.in
> @@ -7,6 +7,8 @@ menuconfig BR2_PACKAGE_OPENCV4
> depends on !BR2_STATIC_LIBS # include dlfcn.h
> depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
> select BR2_PACKAGE_ZLIB
> + select BR2_PACKAGE_WEBP_DEMUX
> + select BR2_PACKAGE_WEBP_MUX
I don't think this is correct, because here a build of opencv4 with
nothing special works fine, so it means that webp doesn't seem to be a
mandatory dependency of opencv4, but your patch turns webp into a
mandatory dependency of opencv4.
Basically here:
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y
BR2_PACKAGE_OPENCV4=y
builds fine.
But I do see autobuilder failures for this issue, for example:
https://autobuild.buildroot.net/results/acb/acbddbea6d18272b5830be1b5fa5f40cf37e0389/build-end.log
In the autobuilders, I see that the few occurrences of this failures
occur when BR2_PACKAGE_OPENCV4_WITH_WEBP is enabled, which pulls in
webp as a dependency already.
So two things need to be figured out:
1. Under what conditions exactly is webp required, so that the
dependency can be added only when needed
2. Since when the problem exists. Indeed, when we are fixing bugs, we
always have to figure out if the fix needs to be backported to our
stable branch (currently 2025.02.x), so every fix must come with a
reference to the commit that introduced the problem in the first
place. Or at least figure out whether 2025.02.x was affected or
not.
Also, your patch could anyway not be correct, because we already have:
ifeq ($(BR2_PACKAGE_OPENCV4_WITH_WEBP),y)
OPENCV4_CONF_OPTS += -DWITH_WEBP=ON
OPENCV4_DEPENDENCIES += webp
else
OPENCV4_CONF_OPTS += -DWITH_WEBP=OFF
endif
which adds webp conditionally, and it wouldn't make sense to add it
unconditionally, and then have some logic to add it conditionally.
Could you have a look into this?
Thanks a lot!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/opencv: depend on webp mux/demux
2026-08-21 10:23 ` Thomas Petazzoni via buildroot
@ 2026-08-21 10:28 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-21 10:28 UTC (permalink / raw)
To: Alessandro Rubini; +Cc: buildroot
On Fri, Aug 21, 2026 at 12:23:03PM +0200, Thomas Petazzoni wrote:
> In the autobuilders, I see that the few occurrences of this failures
> occur when BR2_PACKAGE_OPENCV4_WITH_WEBP is enabled, which pulls in
> webp as a dependency already.
Ah, I can indeed reproduce the problem with:
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y
BR2_PACKAGE_OPENCV4=y
BR2_PACKAGE_OPENCV4_WITH_WEBP=y
but in this case, webp is already added as a dependency of opencv4. So
your patch is not actually correct.
What I guess happens is that we build webp without demux/mux support,
so we're missing features. So I believe the correct fix is probably:
diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
index 47c1cf3f4a..e4a15f742b 100644
--- a/package/opencv4/Config.in
+++ b/package/opencv4/Config.in
@@ -369,6 +369,8 @@ config BR2_PACKAGE_OPENCV4_WITH_V4L
config BR2_PACKAGE_OPENCV4_WITH_WEBP
bool "webp support"
select BR2_PACKAGE_WEBP
+ select BR2_PACKAGE_WEBP_DEMUX
+ select BR2_PACKAGE_WEBP_MUX
help
Enable WebP support.
Remains to figure out since when this problem occurs. The 4.12.0 ->
4.13.0 bump of opencv4 in commit
33178c538541be224e49b5f548bd5404de3912fa ? But this one has been
around for quite a while.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-21 10:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-26 21:59 [Buildroot] [PATCH] package/opencv: depend on webp mux/demux Alessandro Rubini
2026-08-21 10:23 ` Thomas Petazzoni via buildroot
2026-08-21 10:28 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox