Skip to contentSkip to conversation

pkgconfig: Add pkg-config-native to SDK

PATCH In review Tom Hochstein 2 participants 7 messages Dec 23, 2024 – Jan 7, 2025 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/5 pkgconfig: Add pkg-config-native to SDK

Building weston with an SDK fails to find pkg-config-native:

```
Did not find pkg-config by name 'pkg-config-native'
Found pkg-config: NO
Found CMake: /opt/poky/5.1/sysroots/x86_64-pokysdk-linux/usr/bin/cmake (3.31.0)
Build-time dependency wayland-scanner found: NO (tried cmake)

protocol/meson.build:1:14: ERROR: Dependency lookup for wayland-scanner with method 'pkgconfig' failed: Pkg-config for machine build machine not found. Giving up.
```

Fix the problem by extending the pkg-config-native wrapper install to class-nativesdk.

---
 meta/recipes-devtools/pkgconfig/pkgconfig_git.bb | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
meta/recipes-devtools/pkgconfig/pkgconfig_git.bb +11 -2
index 6f13d0177e..2b298eb5e8 100644
@@ -46,9 +46,9 @@ FILES:${PN} += "${datadir}/aclocal/pkg.m4"
 # specifying an appropriate provide.
 RPROVIDES:${PN} += "pkgconfig(pkg-config)"
 
-# Install a pkg-config-native wrapper that will use the native sysroot instead
-# of the MACHINE sysroot, for using pkg-config when building native tools.
 do_install:append:class-native () {
+    # Install a pkg-config-native wrapper that will use the native sysroot instead
+    # of the MACHINE sysroot, for using pkg-config when building native tools.
     sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
         -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
         < ${UNPACKDIR}/pkg-config-native.in > ${B}/pkg-config-native
@@ -59,6 +59,15 @@ do_install:append:class-native () {
     install -m755 ${B}/pkg-config-esdk ${D}${bindir}/pkg-config-esdk
 }
 
+do_install:append:class-nativesdk () {
+    # Install a pkg-config-native wrapper that will use the native sysroot instead
+    # of the MACHINE sysroot, for using pkg-config when building native tools.
+    sed -e "s|@PATH_NATIVE@|\$OECORE_NATIVE_SYSROOT|" \
+        -e "s|@LIBDIR_NATIVE@|\$OECORE_NATIVE_SYSROOT/usr/lib/pkgconfig|" \
+        < ${UNPACKDIR}/pkg-config-native.in > ${B}/pkg-config-native
+    install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native
+}
+
 pkgconfig_sstate_fixup_esdk () {
 	if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" -a "${WITHIN_EXT_SDK}" = "1" ] ; then
 		pkgconfdir="${SSTATE_INSTDIR}/recipe-sysroot-native/${bindir_native}"
Signature · 1 line
2.34.1
#1 lore raw

PATCH v4 2/5 wayland-protocols: Remove inoperative packaging override

The upgrade to 1.38 re-enables the dev package [1]. With the dev package enabled, the file wayland-protocol.pc is filtered by default into the dev package, and the override adding it to the main package does nothing and is not needed.

[1] https://github.com/openembedded/openembedded-core/commit/5de187aee675a78fe59620a3fb64a5da5ae662aa

---
 meta/recipes-graphics/wayland/wayland-protocols_1.38.bb | 2 --
 1 file changed, 2 deletions(-)
meta/recipes-graphics/wayland/wayland-protocols_1.38.bb +0 -2
index 3e628ab113..be6b732b1a 100644
@@ -21,7 +21,5 @@ inherit meson pkgconfig allarch
 
 EXTRA_OEMESON += "-Dtests=false"
 
-FILES:${PN} += "${datadir}/pkgconfig/wayland-protocols.pc"
-
 BBCLASSEXTEND = "native nativesdk"
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH v4 3/5 weston: Fix wayland-protocols dependency

In reply to Tom Hochstein

An SDK build of weston fails:

```
Run-time dependency wayland-protocols found: NO (tried pkgconfig and cmake)
```

The file wayland-protocols.pc is missing in the SDK. This is traced to the upgrade of wayland-protocols to 1.38 [1], which re-enables the dev package, which moves wayland-protocols.pc to wayland-protocols-dev.

[1] https://github.com/openembedded/openembedded-core/commit/5de187aee675a78fe59620a3fb64a5da5ae662aa

---
 meta/recipes-graphics/wayland/weston_14.0.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/wayland/weston_14.0.1.bb +1 -1
index 50749d7d15..4cb0ca4d5f 100644
@@ -137,7 +137,7 @@ RDEPENDS:${PN}-xwayland += "xwayland"
 
 RDEPENDS:${PN} += "xkeyboard-config"
 RRECOMMENDS:${PN} = "weston-init liberation-fonts"
-RRECOMMENDS:${PN}-dev += "wayland-protocols"
+RDEPENDS:${PN}-dev += "wayland-protocols-dev"
 
 USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM:${PN} = "--system weston-launch"
Signature · 1 line
2.34.1
#3 lore raw

PATCH v4 4/5 weston: Disable unused tests build

In reply to Tom Hochstein

Building weston with core-image-weston SDK fails for xwayland tests:

```
Run-time dependency xcb-cursor found: NO (tried pkgconfig and cmake)

tests/meson.build:357:2: ERROR: Problem encountered: xcb and xcb-cursor required for running xwayland tests
```

The problem is the tests folder is built but not installed. This behavior seems to have been introduced with the 12.0.1 upgrade.

https://github.com/openembedded/openembedded-core/commit/be7da75827b4ffee3a243f977faad429dd9fa21c

Disable the build of the unused tests. Also drop the xwayland dependency on xcb-util-cursor since it is a specific requirement for the xwayland test build.

---
 meta/recipes-graphics/wayland/weston_14.0.1.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-graphics/wayland/weston_14.0.1.bb +2 -2
index 4cb0ca4d5f..2a0a403d99 100644
@@ -31,7 +31,7 @@ LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '',
 
 WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
 
-EXTRA_OEMESON += "-Dpipewire=false"
+EXTRA_OEMESON += "-Dpipewire=false -Dtests=false"
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms wayland egl clients', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
@@ -72,7 +72,7 @@ PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp"
 # Weston with systemd support
 PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd dbus"
 # Weston with Xwayland support (requires X11 and Wayland)
-PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,libxcb libxcursor xcb-util-cursor xwayland"
+PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,libxcb libxcursor xwayland"
 # Clients support
 PACKAGECONFIG[clients] = "-Dsimple-clients=${SIMPLECLIENTS} -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false"
 # Virtual remote output with GStreamer on DRM backend
Signature · 1 line
2.34.1
#4 lore raw

PATCH v4 5/5 mesa: Fix missing GLES3 headers in SDK sysroot

In reply to Tom Hochstein

Building weston with core-image-weston SDK fails:

```
../libweston/renderer-gl/gl-shader-config-color-transformation.c:29:10: fatal error: GLES3/gl3.h: No such file or directory
   29 | #include <GLES3/gl3.h>
      |          ^~~~~~~~~~~~~
```

Both GLES2 and GLES3 implementations are contained in libGLESv2.so.2, which is packaged in libgles2-mesa. However, the headers are split between libgles2-mesa-dev and libgles3-mesa-dev, which is why the GLES3 headers end up missing in the SDK sysroot.

Add a dependency so the GLES3 headers are properly associated with the GLES3 implementation.

---
 meta/recipes-graphics/mesa/mesa.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-graphics/mesa/mesa.inc +5 -0
index 9fdf496e8b..b3c595b767 100644
@@ -233,6 +233,11 @@ DEV_PKG_DEPENDENCY = ""
 # development package of libgles3.
 RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
 
+# GLES2 and GLES3 implementations are packaged in a single library in libgles2-mesa.
+# Add a dependency so the GLES3 dev package is associated with its implementation.
+RDEPENDS:libgles2-mesa += "libgles3-mesa"
+ALLOW_EMPTY:libgles3-mesa = "1"
+
 RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'libclc spirv-tools', '', d)}"
 
 PACKAGES =+ "libegl-mesa libegl-mesa-dev \
Signature · 1 line
2.34.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Re: [OE-core] [PATCH v4 5/5] mesa: Fix missing GLES3 headers in SDK sysroot

I saw that patches 1-4 are accepted but not this one. Do I need to re- submit?

Tom

Quoted 47 lines · Tom Hochstein via lists.openembedded.org

Building weston with core-image-weston SDK fails:

```
../libweston/renderer-gl/gl-shader-config-color-transformation.c:29:10: fatal error: GLES3/gl3.h: No such file or directory
    29 | #include <GLES3/gl3.h>
       |          ^~~~~~~~~~~~~
```

Both GLES2 and GLES3 implementations are contained in libGLESv2.so.2, which is packaged in libgles2-mesa. However, the headers are split between libgles2-mesa-dev and libgles3-mesa-dev, which is why the GLES3 headers end up missing in the SDK sysroot.

Add a dependency so the GLES3 headers are properly associated with the GLES3 implementation.

---
  meta/recipes-graphics/mesa/mesa.inc | 5 +++++
  1 file changed, 5 insertions(+)
meta/recipes-graphics/mesa/mesa.inc +5 -1
index 9fdf496e8b..b3c595b767 100644
@@ -233,6 +233,11 @@ DEV_PKG_DEPENDENCY = ""
  # development package of libgles3.
  RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
 
+# GLES2 and GLES3 implementations are packaged in a single library in libgles2-mesa.
+# Add a dependency so the GLES3 dev package is associated with its implementation.
+RDEPENDS:libgles2-mesa += "libgles3-mesa"
+ALLOW_EMPTY:libgles3-mesa = "1"
+
  RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'libclc spirv-tools', '', d)}"
 
  PACKAGES =+ "libegl-mesa libegl-mesa-dev \
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#209052): https://lists.openembedded.org/g/openembedded-core/message/209052
Mute This Topic: https://lists.openembedded.org/mt/110262802/3617670
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw

Re: [OE-core] [PATCH v4 5/5] mesa: Fix missing GLES3 headers in SDK sysroot

Quoted 3 lines · Tom Hochstein via lists.openembedded.org

I saw that patches 1-4 are accepted but not this one. Do I need to re-
submit?

I'm still not convinced the patch is correct but I haven't worked out how to explain why (or had time to convince myself it is right). It is in master-next alongside a ton of other patches I wasn't able to spend enough time reviewing over the holidays.

Cheers,

Richard