diff mbox series

[v2] gstreamer1.0-plugins-good: Provide Qt6 option for qmlgl

Message ID 20240401071355.1702280-1-cordlandwehr@kde.org
State New
Headers show
Series [v2] gstreamer1.0-plugins-good: Provide Qt6 option for qmlgl | expand

Commit Message

Andreas Cord-Landwehr April 1, 2024, 7:13 a.m. UTC
Introduce PACKAGECONFIG option for Qt6 and provide meson cross-build
file that helps meson to locate qt native binaries.

Qt provides pkg-config files since Qt6.3+, but those files are not
sufficient to detect native tools that are located in the
recipe-sysroot-native location, because pkg-config does not know about
the location of them. Thus, introduce a helper config that points mesons
to those binaries.

Signed-off-by: Andreas Cord-Landwehr <cordlandwehr@kde.org>
---
 .../gstreamer1.0-plugins-good_1.22.11.bb       | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

Comments

Alexander Kanavin April 2, 2024, 6:26 p.m. UTC | #1
meson does have a way to specify whether native pkg-config should be
used (defaulting to cross), so I think this should rather be fixed in
gstreamer source, particularly its meson files?

Alex

On Mon, 1 Apr 2024 at 09:14, Andreas Cord-Landwehr <cordlandwehr@kde.org> wrote:
>
> Introduce PACKAGECONFIG option for Qt6 and provide meson cross-build
> file that helps meson to locate qt native binaries.
>
> Qt provides pkg-config files since Qt6.3+, but those files are not
> sufficient to detect native tools that are located in the
> recipe-sysroot-native location, because pkg-config does not know about
> the location of them. Thus, introduce a helper config that points mesons
> to those binaries.
>
> Signed-off-by: Andreas Cord-Landwehr <cordlandwehr@kde.org>
> ---
>  .../gstreamer1.0-plugins-good_1.22.11.bb       | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
> index edd8609b7c..3b95bd6e46 100644
> --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
> @@ -12,6 +12,17 @@ SRC_URI[sha256sum] = "6ddd032381827d31820540735f0004b429436b0bdac19aaeab44fa22fa
>
>  S = "${WORKDIR}/gst-plugins-good-${PV}"
>
> +do_write_config:append() {
> +    cat >${WORKDIR}/meson-qt6.cross <<EOF
> +[binaries]
> +qmake = '${STAGING_BINDIR_NATIVE}/qmake'
> +moc = '${STAGING_DIR_NATIVE}/usr/libexec/moc'
> +rcc = '${STAGING_DIR_NATIVE}/usr/libexec/rcc'
> +uic = '${STAGING_DIR_NATIVE}/usr/libexec/uic'
> +lrelease = '${STAGING_BINDIR_NATIVE}/lrelease'
> +EOF
> +}
> +
>  LICENSE = "LGPL-2.1-or-later"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
>                      file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
> @@ -35,7 +46,7 @@ X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage"
>  X11ENABLEOPTS = "-Dximagesrc=enabled -Dximagesrc-xshm=enabled -Dximagesrc-xfixes=enabled -Dximagesrc-xdamage=enabled"
>  X11DISABLEOPTS = "-Dximagesrc=disabled -Dximagesrc-xshm=disabled -Dximagesrc-xfixes=disabled -Dximagesrc-xdamage=disabled"
>
> -QT5WAYLANDDEPENDS = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "qtwayland", "", d)}"
> +QTWAYLANDDEPENDS = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "qtwayland", "", d)}"
>
>  PACKAGECONFIG[asm]        = "-Dasm=enabled,-Dasm=disabled,nasm-native"
>  PACKAGECONFIG[bz2]        = "-Dbz2=enabled,-Dbz2=disabled,bzip2"
> @@ -52,7 +63,8 @@ PACKAGECONFIG[libpng]     = "-Dpng=enabled,-Dpng=disabled,libpng"
>  PACKAGECONFIG[libv4l2]    = "-Dv4l2-libv4l2=enabled,-Dv4l2-libv4l2=disabled,v4l-utils"
>  PACKAGECONFIG[mpg123]     = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
>  PACKAGECONFIG[pulseaudio] = "-Dpulse=enabled,-Dpulse=disabled,pulseaudio"
> -PACKAGECONFIG[qt5]        = "-Dqt5=enabled,-Dqt5=disabled,qtbase qtdeclarative qtbase-native ${QT5WAYLANDDEPENDS}"
> +PACKAGECONFIG[qt5]        = "-Dqt5=enabled,-Dqt5=disabled,qtbase qtdeclarative qtbase-native ${QTWAYLANDDEPENDS}"
> +PACKAGECONFIG[qt6]        = "-Dqt6=enabled,-Dqt6=disabled,qtbase qtdeclarative qtbase-native qttools-native ${QTWAYLANDDEPENDS}"
>  PACKAGECONFIG[soup2]      = "-Dsoup=enabled,,libsoup-2.4,,,soup3"
>  PACKAGECONFIG[soup3]      = "-Dsoup=enabled,,libsoup,,,soup2"
>  PACKAGECONFIG[speex]      = "-Dspeex=enabled,-Dspeex=disabled,speex"
> @@ -78,4 +90,6 @@ EXTRA_OEMESON += " \
>      -Dwaveform=disabled \
>  "
>
> +MESON_CROSS_FILE:class-target:append = "${@bb.utils.contains('PACKAGECONFIG', 'qt6', ' --cross ${WORKDIR}/meson-qt6.cross', '', d)}"
> +
>  FILES:${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs"
> --
> 2.40.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#197673): https://lists.openembedded.org/g/openembedded-core/message/197673
> Mute This Topic: https://lists.openembedded.org/mt/105259530/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Andreas Cord-Landwehr April 2, 2024, 7:20 p.m. UTC | #2
Hi Alex, thanks for your answer! I raised this topic also upstream in

https://github.com/mesonbuild/meson/issues/13018

Regarding the way meson finds native binaries, do you have an example how this 
is done in Yocto specifically how meson is pointed to the recipe-sysroot-
native? All I could find was pkg-config but that has a special native pc file as 
far as I see.

Cheers,
Andreas

On Tuesday, April 2, 2024 8:26:48 PM CEST Alexander Kanavin wrote:
> meson does have a way to specify whether native pkg-config should be
> used (defaulting to cross), so I think this should rather be fixed in
> gstreamer source, particularly its meson files?
> 
> Alex
> 
> On Mon, 1 Apr 2024 at 09:14, Andreas Cord-Landwehr <cordlandwehr@kde.org> 
wrote:
> > Introduce PACKAGECONFIG option for Qt6 and provide meson cross-build
> > file that helps meson to locate qt native binaries.
> > 
> > Qt provides pkg-config files since Qt6.3+, but those files are not
> > sufficient to detect native tools that are located in the
> > recipe-sysroot-native location, because pkg-config does not know about
> > the location of them. Thus, introduce a helper config that points mesons
> > to those binaries.
> > 
> > Signed-off-by: Andreas Cord-Landwehr <cordlandwehr@kde.org>
> > ---
> > 
> >  .../gstreamer1.0-plugins-good_1.22.11.bb       | 18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> > 
> > diff --git
> > a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
> > b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
> > index edd8609b7c..3b95bd6e46 100644
> > ---
> > a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
> > +++
> > b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
> > @@ -12,6 +12,17 @@ SRC_URI[sha256sum] =
> > "6ddd032381827d31820540735f0004b429436b0bdac19aaeab44fa22fa> 
> >  S = "${WORKDIR}/gst-plugins-good-${PV}"
> > 
> > +do_write_config:append() {
> > +    cat >${WORKDIR}/meson-qt6.cross <<EOF
> > +[binaries]
> > +qmake = '${STAGING_BINDIR_NATIVE}/qmake'
> > +moc = '${STAGING_DIR_NATIVE}/usr/libexec/moc'
> > +rcc = '${STAGING_DIR_NATIVE}/usr/libexec/rcc'
> > +uic = '${STAGING_DIR_NATIVE}/usr/libexec/uic'
> > +lrelease = '${STAGING_BINDIR_NATIVE}/lrelease'
> > +EOF
> > +}
> > +
> > 
> >  LICENSE = "LGPL-2.1-or-later"
> >  LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
> >  
> >                      file://gst/replaygain/rganalysis.c;beginline=1;endlin
> >                      e=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"> 
> > @@ -35,7 +46,7 @@ X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes
> > libxdamage"> 
> >  X11ENABLEOPTS = "-Dximagesrc=enabled -Dximagesrc-xshm=enabled
> >  -Dximagesrc-xfixes=enabled -Dximagesrc-xdamage=enabled" X11DISABLEOPTS =
> >  "-Dximagesrc=disabled -Dximagesrc-xshm=disabled
> >  -Dximagesrc-xfixes=disabled -Dximagesrc-xdamage=disabled"> 
> > -QT5WAYLANDDEPENDS = "${@bb.utils.contains("DISTRO_FEATURES", "wayland",
> > "qtwayland", "", d)}" +QTWAYLANDDEPENDS =
> > "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "qtwayland", "", d)}"> 
> >  PACKAGECONFIG[asm]        = "-Dasm=enabled,-Dasm=disabled,nasm-native"
> >  PACKAGECONFIG[bz2]        = "-Dbz2=enabled,-Dbz2=disabled,bzip2"
> > 
> > @@ -52,7 +63,8 @@ PACKAGECONFIG[libpng]     =
> > "-Dpng=enabled,-Dpng=disabled,libpng"> 
> >  PACKAGECONFIG[libv4l2]    =
> >  "-Dv4l2-libv4l2=enabled,-Dv4l2-libv4l2=disabled,v4l-utils"
> >  PACKAGECONFIG[mpg123]     = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
> >  PACKAGECONFIG[pulseaudio] =
> >  "-Dpulse=enabled,-Dpulse=disabled,pulseaudio"> 
> > -PACKAGECONFIG[qt5]        = "-Dqt5=enabled,-Dqt5=disabled,qtbase
> > qtdeclarative qtbase-native ${QT5WAYLANDDEPENDS}" +PACKAGECONFIG[qt5]    
> >    = "-Dqt5=enabled,-Dqt5=disabled,qtbase qtdeclarative qtbase-native
> > ${QTWAYLANDDEPENDS}" +PACKAGECONFIG[qt6]        =
> > "-Dqt6=enabled,-Dqt6=disabled,qtbase qtdeclarative qtbase-native
> > qttools-native ${QTWAYLANDDEPENDS}"> 
> >  PACKAGECONFIG[soup2]      = "-Dsoup=enabled,,libsoup-2.4,,,soup3"
> >  PACKAGECONFIG[soup3]      = "-Dsoup=enabled,,libsoup,,,soup2"
> >  PACKAGECONFIG[speex]      = "-Dspeex=enabled,-Dspeex=disabled,speex"
> > 
> > @@ -78,4 +90,6 @@ EXTRA_OEMESON += " \
> > 
> >      -Dwaveform=disabled \
> >  
> >  "
> > 
> > +MESON_CROSS_FILE:class-target:append =
> > "${@bb.utils.contains('PACKAGECONFIG', 'qt6', ' --cross
> > ${WORKDIR}/meson-qt6.cross', '', d)}" +
> > 
> >  FILES:${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs"
> > 
> > --
> > 2.40.1
> > 
> > 
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#197673):
> > https://lists.openembedded.org/g/openembedded-core/message/197673 Mute
> > This Topic: https://lists.openembedded.org/mt/105259530/1686489 Group
> > Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
> > [alex.kanavin@gmail.com] -=-=-=-=-=-=-=-=-=-=-=-
Alexander Kanavin April 2, 2024, 7:32 p.m. UTC | #3
On Tue, 2 Apr 2024 at 21:20, Andreas Cord-Landwehr <cordlandwehr@kde.org> wrote:
> https://github.com/mesonbuild/meson/issues/13018
>
> Regarding the way meson finds native binaries, do you have an example how this
> is done in Yocto specifically how meson is pointed to the recipe-sysroot-
> native? All I could find was pkg-config but that has a special native pc file as
> far as I see.

Slightly wrong upstream, I think. Meson already has 'native' keyword
in various functions, for example dependency():
https://mesonbuild.com/Reference-manual_functions.html#dependency
Setting that to true will result in meson calling native pkg-config
for obtaining information, and that would point to the native sysroot.

So gstreamer needs to be fixed to use native: true for finding
binaries it needs to execute. Did you look into how it looks for them
in its meson.build files?

Alex
diff mbox series

Patch

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
index edd8609b7c..3b95bd6e46 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.11.bb
@@ -12,6 +12,17 @@  SRC_URI[sha256sum] = "6ddd032381827d31820540735f0004b429436b0bdac19aaeab44fa22fa
 
 S = "${WORKDIR}/gst-plugins-good-${PV}"
 
+do_write_config:append() {
+    cat >${WORKDIR}/meson-qt6.cross <<EOF
+[binaries]
+qmake = '${STAGING_BINDIR_NATIVE}/qmake'
+moc = '${STAGING_DIR_NATIVE}/usr/libexec/moc'
+rcc = '${STAGING_DIR_NATIVE}/usr/libexec/rcc'
+uic = '${STAGING_DIR_NATIVE}/usr/libexec/uic'
+lrelease = '${STAGING_BINDIR_NATIVE}/lrelease'
+EOF
+}
+
 LICENSE = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
                     file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
@@ -35,7 +46,7 @@  X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage"
 X11ENABLEOPTS = "-Dximagesrc=enabled -Dximagesrc-xshm=enabled -Dximagesrc-xfixes=enabled -Dximagesrc-xdamage=enabled"
 X11DISABLEOPTS = "-Dximagesrc=disabled -Dximagesrc-xshm=disabled -Dximagesrc-xfixes=disabled -Dximagesrc-xdamage=disabled"
 
-QT5WAYLANDDEPENDS = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "qtwayland", "", d)}"
+QTWAYLANDDEPENDS = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "qtwayland", "", d)}"
 
 PACKAGECONFIG[asm]        = "-Dasm=enabled,-Dasm=disabled,nasm-native"
 PACKAGECONFIG[bz2]        = "-Dbz2=enabled,-Dbz2=disabled,bzip2"
@@ -52,7 +63,8 @@  PACKAGECONFIG[libpng]     = "-Dpng=enabled,-Dpng=disabled,libpng"
 PACKAGECONFIG[libv4l2]    = "-Dv4l2-libv4l2=enabled,-Dv4l2-libv4l2=disabled,v4l-utils"
 PACKAGECONFIG[mpg123]     = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
 PACKAGECONFIG[pulseaudio] = "-Dpulse=enabled,-Dpulse=disabled,pulseaudio"
-PACKAGECONFIG[qt5]        = "-Dqt5=enabled,-Dqt5=disabled,qtbase qtdeclarative qtbase-native ${QT5WAYLANDDEPENDS}"
+PACKAGECONFIG[qt5]        = "-Dqt5=enabled,-Dqt5=disabled,qtbase qtdeclarative qtbase-native ${QTWAYLANDDEPENDS}"
+PACKAGECONFIG[qt6]        = "-Dqt6=enabled,-Dqt6=disabled,qtbase qtdeclarative qtbase-native qttools-native ${QTWAYLANDDEPENDS}"
 PACKAGECONFIG[soup2]      = "-Dsoup=enabled,,libsoup-2.4,,,soup3"
 PACKAGECONFIG[soup3]      = "-Dsoup=enabled,,libsoup,,,soup2"
 PACKAGECONFIG[speex]      = "-Dspeex=enabled,-Dspeex=disabled,speex"
@@ -78,4 +90,6 @@  EXTRA_OEMESON += " \
     -Dwaveform=disabled \
 "
 
+MESON_CROSS_FILE:class-target:append = "${@bb.utils.contains('PACKAGECONFIG', 'qt6', ' --cross ${WORKDIR}/meson-qt6.cross', '', d)}"
+
 FILES:${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs"