diff mbox series

[meta-oe,kirkstone] glfw: add packageconfig and wayland dependencies

Message ID 20230426203453.3497409-2-rs@ti.com
State New
Headers show
Series [meta-oe,kirkstone] glfw: add packageconfig and wayland dependencies | expand

Commit Message

Randolph Sapp April 26, 2023, 8:34 p.m. UTC
From: Randolph Sapp <rs@ti.com>

GLFW has the ability to use a wayland backend. This patch adds a config
for it and attempts to automatically resolve the most common collision
since the wayland and x11 backends are mutually exclusive.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 meta-oe/recipes-core/glfw/glfw_3.3.bb | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

Comments

Khem Raj April 27, 2023, 8:22 a.m. UTC | #1
fails layer check perhaps it has some cross layer deps

https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2693

On Wed, Apr 26, 2023 at 1:35 PM Randolph Sapp via
lists.openembedded.org <rs=ti.com@lists.openembedded.org> wrote:
>
> From: Randolph Sapp <rs@ti.com>
>
> GLFW has the ability to use a wayland backend. This patch adds a config
> for it and attempts to automatically resolve the most common collision
> since the wayland and x11 backends are mutually exclusive.
>
> Signed-off-by: Randolph Sapp <rs@ti.com>
> ---
>  meta-oe/recipes-core/glfw/glfw_3.3.bb | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/meta-oe/recipes-core/glfw/glfw_3.3.bb b/meta-oe/recipes-core/glfw/glfw_3.3.bb
> index b31bba6b6b..29d7b5de42 100644
> --- a/meta-oe/recipes-core/glfw/glfw_3.3.bb
> +++ b/meta-oe/recipes-core/glfw/glfw_3.3.bb
> @@ -20,7 +20,18 @@ EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_DOCS=OFF"
>
>  CFLAGS += "-fPIC"
>
> -DEPENDS = "libpng libglu zlib libxrandr libxinerama libxi libxcursor"
> -REQUIRED_DISTRO_FEATURES = "x11 opengl"
> +DEPENDS = "libpng libglu zlib"
> +REQUIRED_DISTRO_FEATURES = "opengl"
> +ANY_OF_DISTRO_FEATURES = "wayland x11"
> +
> +# upstream considers x11 and wayland backends mutually exclusive and will
> +# prioritize wayland if it is enabled
> +
> +PACKAGECONFIG ??= " \
> +    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', 'x11', d)} \
> +"
> +
> +PACKAGECONFIG[wayland] = "-DGLFW_USE_WAYLAND=ON,,wayland wayland-native wayland-protocols extra-cmake-modules libxkbcommon"
> +PACKAGECONFIG[x11] = ",,libxrandr libxinerama libxi libxcursor"
>
>  COMPATIBLE_HOST:libc-musl = "null"
> --
> 2.40.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#102202): https://lists.openembedded.org/g/openembedded-devel/message/102202
> Mute This Topic: https://lists.openembedded.org/mt/98523628/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Denys Dmytriyenko April 27, 2023, 4:02 p.m. UTC | #2
On Thu, Apr 27, 2023 at 01:22:16AM -0700, Khem Raj wrote:
> fails layer check perhaps it has some cross layer deps
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2693
> 
> On Wed, Apr 26, 2023 at 1:35 PM Randolph Sapp via
> lists.openembedded.org <rs=ti.com@lists.openembedded.org> wrote:
> >
> > From: Randolph Sapp <rs@ti.com>
> >
> > GLFW has the ability to use a wayland backend. This patch adds a config
> > for it and attempts to automatically resolve the most common collision
> > since the wayland and x11 backends are mutually exclusive.
> >
> > Signed-off-by: Randolph Sapp <rs@ti.com>
> > ---
> >  meta-oe/recipes-core/glfw/glfw_3.3.bb | 15 +++++++++++++--
> >  1 file changed, 13 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta-oe/recipes-core/glfw/glfw_3.3.bb b/meta-oe/recipes-core/glfw/glfw_3.3.bb
> > index b31bba6b6b..29d7b5de42 100644
> > --- a/meta-oe/recipes-core/glfw/glfw_3.3.bb
> > +++ b/meta-oe/recipes-core/glfw/glfw_3.3.bb
> > @@ -20,7 +20,18 @@ EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_DOCS=OFF"
> >
> >  CFLAGS += "-fPIC"
> >
> > -DEPENDS = "libpng libglu zlib libxrandr libxinerama libxi libxcursor"
> > -REQUIRED_DISTRO_FEATURES = "x11 opengl"
> > +DEPENDS = "libpng libglu zlib"
> > +REQUIRED_DISTRO_FEATURES = "opengl"
> > +ANY_OF_DISTRO_FEATURES = "wayland x11"
> > +
> > +# upstream considers x11 and wayland backends mutually exclusive and will
> > +# prioritize wayland if it is enabled
> > +
> > +PACKAGECONFIG ??= " \
> > +    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', 'x11', d)} \
> > +"
> > +
> > +PACKAGECONFIG[wayland] = "-DGLFW_USE_WAYLAND=ON,,wayland wayland-native wayland-protocols extra-cmake-modules libxkbcommon"

^^^ extra-cmake-modules is a KDE piece and available from these layers:
https://layers.openembedded.org/layerindex/branch/master/recipes/?q=extra-cmake-modules


> > +PACKAGECONFIG[x11] = ",,libxrandr libxinerama libxi libxcursor"
> >
> >  COMPATIBLE_HOST:libc-musl = "null"
> > --
> > 2.40.0
Randolph Sapp April 27, 2023, 4:14 p.m. UTC | #3
On 4/27/23 11:02, Denys Dmytriyenko wrote:
> On Thu, Apr 27, 2023 at 01:22:16AM -0700, Khem Raj wrote:
>> fails layer check perhaps it has some cross layer deps
>>
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2693
>>
>> On Wed, Apr 26, 2023 at 1:35 PM Randolph Sapp via
>> lists.openembedded.org <rs=ti.com@lists.openembedded.org> wrote:
>>>
>>> From: Randolph Sapp <rs@ti.com>
>>>
>>> GLFW has the ability to use a wayland backend. This patch adds a config
>>> for it and attempts to automatically resolve the most common collision
>>> since the wayland and x11 backends are mutually exclusive.
>>>
>>> Signed-off-by: Randolph Sapp <rs@ti.com>
>>> ---
>>>   meta-oe/recipes-core/glfw/glfw_3.3.bb | 15 +++++++++++++--
>>>   1 file changed, 13 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meta-oe/recipes-core/glfw/glfw_3.3.bb b/meta-oe/recipes-core/glfw/glfw_3.3.bb
>>> index b31bba6b6b..29d7b5de42 100644
>>> --- a/meta-oe/recipes-core/glfw/glfw_3.3.bb
>>> +++ b/meta-oe/recipes-core/glfw/glfw_3.3.bb
>>> @@ -20,7 +20,18 @@ EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_DOCS=OFF"
>>>
>>>   CFLAGS += "-fPIC"
>>>
>>> -DEPENDS = "libpng libglu zlib libxrandr libxinerama libxi libxcursor"
>>> -REQUIRED_DISTRO_FEATURES = "x11 opengl"
>>> +DEPENDS = "libpng libglu zlib"
>>> +REQUIRED_DISTRO_FEATURES = "opengl"
>>> +ANY_OF_DISTRO_FEATURES = "wayland x11"
>>> +
>>> +# upstream considers x11 and wayland backends mutually exclusive and will
>>> +# prioritize wayland if it is enabled
>>> +
>>> +PACKAGECONFIG ??= " \
>>> +    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', 'x11', d)} \
>>> +"
>>> +
>>> +PACKAGECONFIG[wayland] = "-DGLFW_USE_WAYLAND=ON,,wayland wayland-native wayland-protocols extra-cmake-modules libxkbcommon"
> 
> ^^^ extra-cmake-modules is a KDE piece and available from these layers:
> https://layers.openembedded.org/layerindex/branch/master/recipes/?q=extra-cmake-modules
> 
> 
>>> +PACKAGECONFIG[x11] = ",,libxrandr libxinerama libxi libxcursor"
>>>
>>>   COMPATIBLE_HOST:libc-musl = "null"
>>> --
>>> 2.40.0

Rats. Well now I guess I know why this was never enabled. What's the 
play? Drop this or add a new layer dependency? I think I already know 
the answer but I figure I should ask anyway.
Khem Raj April 27, 2023, 4:21 p.m. UTC | #4
On Thu, Apr 27, 2023 at 9:14 AM Randolph Sapp <rs@ti.com> wrote:

> On 4/27/23 11:02, Denys Dmytriyenko wrote:
> > On Thu, Apr 27, 2023 at 01:22:16AM -0700, Khem Raj wrote:
> >> fails layer check perhaps it has some cross layer deps
> >>
> >> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2693
> >>
> >> On Wed, Apr 26, 2023 at 1:35 PM Randolph Sapp via
> >> lists.openembedded.org <rs=ti.com@lists.openembedded.org> wrote:
> >>>
> >>> From: Randolph Sapp <rs@ti.com>
> >>>
> >>> GLFW has the ability to use a wayland backend. This patch adds a config
> >>> for it and attempts to automatically resolve the most common collision
> >>> since the wayland and x11 backends are mutually exclusive.
> >>>
> >>> Signed-off-by: Randolph Sapp <rs@ti.com>
> >>> ---
> >>>   meta-oe/recipes-core/glfw/glfw_3.3.bb | 15 +++++++++++++--
> >>>   1 file changed, 13 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/meta-oe/recipes-core/glfw/glfw_3.3.bb
> b/meta-oe/recipes-core/glfw/glfw_3.3.bb
> >>> index b31bba6b6b..29d7b5de42 100644
> >>> --- a/meta-oe/recipes-core/glfw/glfw_3.3.bb
> >>> +++ b/meta-oe/recipes-core/glfw/glfw_3.3.bb
> >>> @@ -20,7 +20,18 @@ EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON
> -DGLFW_BUILD_DOCS=OFF"
> >>>
> >>>   CFLAGS += "-fPIC"
> >>>
> >>> -DEPENDS = "libpng libglu zlib libxrandr libxinerama libxi libxcursor"
> >>> -REQUIRED_DISTRO_FEATURES = "x11 opengl"
> >>> +DEPENDS = "libpng libglu zlib"
> >>> +REQUIRED_DISTRO_FEATURES = "opengl"
> >>> +ANY_OF_DISTRO_FEATURES = "wayland x11"
> >>> +
> >>> +# upstream considers x11 and wayland backends mutually exclusive and
> will
> >>> +# prioritize wayland if it is enabled
> >>> +
> >>> +PACKAGECONFIG ??= " \
> >>> +    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland',
> 'x11', d)} \
> >>> +"
> >>> +
> >>> +PACKAGECONFIG[wayland] = "-DGLFW_USE_WAYLAND=ON,,wayland
> wayland-native wayland-protocols extra-cmake-modules libxkbcommon"
> >
> > ^^^ extra-cmake-modules is a KDE piece and available from these layers:
> >
> https://layers.openembedded.org/layerindex/branch/master/recipes/?q=extra-cmake-modules
> >
> >
> >>> +PACKAGECONFIG[x11] = ",,libxrandr libxinerama libxi libxcursor"
> >>>
> >>>   COMPATIBLE_HOST:libc-musl = "null"
> >>> --
> >>> 2.40.0
>
> Rats. Well now I guess I know why this was never enabled. What's the
> play? Drop this or add a new layer dependency? I think I already know


You can add this as dependency via packageconfig and keep it disabled by
default


> the answer but I figure I should ask anyway.
>
Randolph Sapp April 27, 2023, 4:35 p.m. UTC | #5
On 4/27/23 11:21, Khem Raj wrote:
> 
> 
> On Thu, Apr 27, 2023 at 9:14 AM Randolph Sapp <rs@ti.com 
> <mailto:rs@ti.com>> wrote:
> 
>     On 4/27/23 11:02, Denys Dmytriyenko wrote:
>      > On Thu, Apr 27, 2023 at 01:22:16AM -0700, Khem Raj wrote:
>      >> fails layer check perhaps it has some cross layer deps
>      >>
>      >>
>     https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2693 <https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2693>
>      >>
>      >> On Wed, Apr 26, 2023 at 1:35 PM Randolph Sapp via
>      >> lists.openembedded.org <http://lists.openembedded.org>
>     <rs=ti.com@lists.openembedded.org
>     <mailto:ti.com@lists.openembedded.org>> wrote:
>      >>>
>      >>> From: Randolph Sapp <rs@ti.com <mailto:rs@ti.com>>
>      >>>
>      >>> GLFW has the ability to use a wayland backend. This patch adds
>     a config
>      >>> for it and attempts to automatically resolve the most common
>     collision
>      >>> since the wayland and x11 backends are mutually exclusive.
>      >>>
>      >>> Signed-off-by: Randolph Sapp <rs@ti.com <mailto:rs@ti.com>>
>      >>> ---
>      >>>   meta-oe/recipes-core/glfw/glfw_3.3.bb <http://glfw_3.3.bb> |
>     15 +++++++++++++--
>      >>>   1 file changed, 13 insertions(+), 2 deletions(-)
>      >>>
>      >>> diff --git a/meta-oe/recipes-core/glfw/glfw_3.3.bb
>     <http://glfw_3.3.bb> b/meta-oe/recipes-core/glfw/glfw_3.3.bb
>     <http://glfw_3.3.bb>
>      >>> index b31bba6b6b..29d7b5de42 100644
>      >>> --- a/meta-oe/recipes-core/glfw/glfw_3.3.bb <http://glfw_3.3.bb>
>      >>> +++ b/meta-oe/recipes-core/glfw/glfw_3.3.bb <http://glfw_3.3.bb>
>      >>> @@ -20,7 +20,18 @@ EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON
>     -DGLFW_BUILD_DOCS=OFF"
>      >>>
>      >>>   CFLAGS += "-fPIC"
>      >>>
>      >>> -DEPENDS = "libpng libglu zlib libxrandr libxinerama libxi
>     libxcursor"
>      >>> -REQUIRED_DISTRO_FEATURES = "x11 opengl"
>      >>> +DEPENDS = "libpng libglu zlib"
>      >>> +REQUIRED_DISTRO_FEATURES = "opengl"
>      >>> +ANY_OF_DISTRO_FEATURES = "wayland x11"
>      >>> +
>      >>> +# upstream considers x11 and wayland backends mutually
>     exclusive and will
>      >>> +# prioritize wayland if it is enabled
>      >>> +
>      >>> +PACKAGECONFIG ??= " \
>      >>> +    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland',
>     'wayland', 'x11', d)} \
>      >>> +"
>      >>> +
>      >>> +PACKAGECONFIG[wayland] = "-DGLFW_USE_WAYLAND=ON,,wayland
>     wayland-native wayland-protocols extra-cmake-modules libxkbcommon"
>      >
>      > ^^^ extra-cmake-modules is a KDE piece and available from these
>     layers:
>      >
>     https://layers.openembedded.org/layerindex/branch/master/recipes/?q=extra-cmake-modules <https://layers.openembedded.org/layerindex/branch/master/recipes/?q=extra-cmake-modules>
>      >
>      >
>      >>> +PACKAGECONFIG[x11] = ",,libxrandr libxinerama libxi libxcursor"
>      >>>
>      >>>   COMPATIBLE_HOST:libc-musl = "null"
>      >>> --
>      >>> 2.40.0
> 
>     Rats. Well now I guess I know why this was never enabled. What's the
>     play? Drop this or add a new layer dependency? I think I already know 
> 
> 
> You can add this as dependency via packageconfig and keep it disabled by 
> default

Better than nothing. V2 in a minute.
diff mbox series

Patch

diff --git a/meta-oe/recipes-core/glfw/glfw_3.3.bb b/meta-oe/recipes-core/glfw/glfw_3.3.bb
index b31bba6b6b..29d7b5de42 100644
--- a/meta-oe/recipes-core/glfw/glfw_3.3.bb
+++ b/meta-oe/recipes-core/glfw/glfw_3.3.bb
@@ -20,7 +20,18 @@  EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_DOCS=OFF"
 
 CFLAGS += "-fPIC"
 
-DEPENDS = "libpng libglu zlib libxrandr libxinerama libxi libxcursor"
-REQUIRED_DISTRO_FEATURES = "x11 opengl"
+DEPENDS = "libpng libglu zlib"
+REQUIRED_DISTRO_FEATURES = "opengl"
+ANY_OF_DISTRO_FEATURES = "wayland x11"
+
+# upstream considers x11 and wayland backends mutually exclusive and will
+# prioritize wayland if it is enabled
+
+PACKAGECONFIG ??= " \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', 'x11', d)} \
+"
+
+PACKAGECONFIG[wayland] = "-DGLFW_USE_WAYLAND=ON,,wayland wayland-native wayland-protocols extra-cmake-modules libxkbcommon"
+PACKAGECONFIG[x11] = ",,libxrandr libxinerama libxi libxcursor"
 
 COMPATIBLE_HOST:libc-musl = "null"