Skip to contentSkip to conversation

pkgconfig: Add pkg-config-native to SDK

PATCH Superseded Tom Hochstein 1 participant 4 messages Dec 22, 2024

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 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 v2 2/4 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 v2 3/4 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 v2 4/4 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