Message ID | 20251016142349.1055072-1-corentin.guillevic@smile.fr |
---|---|
State | New |
Headers | show |
Series | [meta-oe] opencv: limit features in native | expand |
> -----Original Message----- > From: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> On Behalf Of Corentin Guillevic via lists.openembedded.org > Sent: den 16 oktober 2025 16:24 > To: openembedded-devel@lists.openembedded.org > Cc: Peter Kjellerstedt <peter.kjellerstedt@axis.com>; Corentin Guillevic <corentin.guillevic@smile.fr> > Subject: [oe] [meta-oe][PATCH] opencv: limit features in native > > Since commit 91e428d4cd5a ("opencv: Support building for native"), > opencv can be built on a native target. However, not all of their > PACKAGECONFIG dependencies (ade, libgphoto2, ffmpeg, gstreamer1.0 and > gstreamer1.0-plugins-base) can be built in this context due to the > missing native BBCLASSEXTEND. Sorry about that. We turn off many of opencv's features in our configuration, which is why I missed this. > > These recipes would need to be extended for native build, but specific > work is required to ensure they work properly. To make opencv-native work > for now, remove the above features by splitting PACKAGECONFIG in 3: > common, native and target. > > Effectively, PACKAGECONFIG for native is target minus gapi, gstreamer, > gphoto2 and libav. > > Fixes this warning from AB[0]: > WARNING: Nothing PROVIDES 'gstreamer1.0-plugins-base-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: > WARNING: Nothing PROVIDES 'ffmpeg-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: > WARNING: Nothing PROVIDES 'libgphoto2-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes- support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: > WARNING: Nothing PROVIDES 'gstreamer1.0-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: > WARNING: Nothing PROVIDES 'ade-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: > WARNING: Nothing RPROVIDES 'opencv-dev-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb RDEPENDS on or otherwise requires it) > WARNING: Nothing RPROVIDES 'opencv-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb RDEPENDS on or otherwise requires it) > [0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/82/builds/469/steps/13/logs/warnings > > Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr> > --- > meta-oe/recipes-support/opencv/opencv_4.12.0.bb | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/meta-oe/recipes-support/opencv/opencv_4.12.0.bb b/meta-oe/recipes-support/opencv/opencv_4.12.0.bb > index 27499caa92..54b19edcff 100644 > --- a/meta-oe/recipes-support/opencv/opencv_4.12.0.bb > +++ b/meta-oe/recipes-support/opencv/opencv_4.12.0.bb > @@ -86,9 +86,12 @@ LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" > > EXTRA_OECMAKE:append:x86 = " -DX86=ON" > > -PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \ > - ${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)} \ > +PACKAGECONFIG_COMMON = "python3 eigen jpeg png tiff v4l libv4l samples tbb \ > + ${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)}" > + > +PACKAGECONFIG:class-target ??= "${PACKAGECONFIG_COMMON} gapi gstreamer gphoto2 \ > ${@bb.utils.contains_any("LICENSE_FLAGS_ACCEPTED", "commercial_ffmpeg commercial", "libav", "", d)}" > +PACKAGECONFIG:class-native ??= "${PACKAGECONFIG_COMMON}" Which is more commonly written as: PACKAGECONFIG ??= "python3 eigen jpeg png tiff v4l libv4l samples tbb \ ${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)}" PACKAGECONFIG:append:class-target = " gapi gstreamer gphoto2 \ ${@bb.utils.contains_any("LICENSE_FLAGS_ACCEPTED", "commercial_ffmpeg commercial", "libav", "", d)}" > > # TBB does not build for powerpc so disable that package config > PACKAGECONFIG:remove:powerpc = "tbb" > -- > 2.49.0 //Peter
diff --git a/meta-oe/recipes-support/opencv/opencv_4.12.0.bb b/meta-oe/recipes-support/opencv/opencv_4.12.0.bb index 27499caa92..54b19edcff 100644 --- a/meta-oe/recipes-support/opencv/opencv_4.12.0.bb +++ b/meta-oe/recipes-support/opencv/opencv_4.12.0.bb @@ -86,9 +86,12 @@ LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" EXTRA_OECMAKE:append:x86 = " -DX86=ON" -PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \ - ${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)} \ +PACKAGECONFIG_COMMON = "python3 eigen jpeg png tiff v4l libv4l samples tbb \ + ${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)}" + +PACKAGECONFIG:class-target ??= "${PACKAGECONFIG_COMMON} gapi gstreamer gphoto2 \ ${@bb.utils.contains_any("LICENSE_FLAGS_ACCEPTED", "commercial_ffmpeg commercial", "libav", "", d)}" +PACKAGECONFIG:class-native ??= "${PACKAGECONFIG_COMMON}" # TBB does not build for powerpc so disable that package config PACKAGECONFIG:remove:powerpc = "tbb"
Since commit 91e428d4cd5a ("opencv: Support building for native"), opencv can be built on a native target. However, not all of their PACKAGECONFIG dependencies (ade, libgphoto2, ffmpeg, gstreamer1.0 and gstreamer1.0-plugins-base) can be built in this context due to the missing native BBCLASSEXTEND. These recipes would need to be extended for native build, but specific work is required to ensure they work properly. To make opencv-native work for now, remove the above features by splitting PACKAGECONFIG in 3: common, native and target. Effectively, PACKAGECONFIG for native is target minus gapi, gstreamer, gphoto2 and libav. Fixes this warning from AB[0]: WARNING: Nothing PROVIDES 'gstreamer1.0-plugins-base-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: WARNING: Nothing PROVIDES 'ffmpeg-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: WARNING: Nothing PROVIDES 'libgphoto2-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: WARNING: Nothing PROVIDES 'gstreamer1.0-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: WARNING: Nothing PROVIDES 'ade-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb DEPENDS on or otherwise requires it). Close matches: WARNING: Nothing RPROVIDES 'opencv-dev-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb RDEPENDS on or otherwise requires it) WARNING: Nothing RPROVIDES 'opencv-native' (but virtual:native:[...]/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.12.0.bb RDEPENDS on or otherwise requires it) [0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/82/builds/469/steps/13/logs/warnings Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr> --- meta-oe/recipes-support/opencv/opencv_4.12.0.bb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)