[5/6] libxkbcommon: split libraries into separate packages

Message ID 20211203164340.2963235-5-ross.burton@arm.com
State Accepted, archived
Commit 1a30af54d335db302393e14a0fa6cac4adbd1bee
Headers show
Series [1/6] libx11: update patch status | expand

Commit Message

Ross Burton Dec. 3, 2021, 4:43 p.m. UTC
The sublibraries, such as libxkbcommon-x11, have specific linkage, so to
avoid link creep they can be put into separate packages.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Richard Purdie Dec. 4, 2021, 9:45 a.m. UTC | #1
On Fri, 2021-12-03 at 16:43 +0000, Ross Burton wrote:
> The sublibraries, such as libxkbcommon-x11, have specific linkage, so to
> avoid link creep they can be put into separate packages.
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb b/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
> index b4541cc698..425c1f386d 100644
> --- a/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
> +++ b/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
> @@ -25,8 +25,14 @@ PACKAGECONFIG[wayland] = "-Denable-wayland=true,-Denable-wayland=false,wayland-n
>  PACKAGECONFIG[x11] = "-Denable-x11=true,-Denable-x11=false,libxcb xkeyboard-config,"
>  
>  PACKAGE_BEFORE_PN += "xkbcli"
> +FILES:${PN} = ""
>  FILES:xkbcli = "${bindir}/xkbcli ${libexecdir}/xkbcommon/xkbcli-*"
>  
> +python populate_packages:prepend () {
> +    # Put the libraries into separate packages to avoid dependency creep
> +    do_split_packages(d, d.expand('${libdir}'), r'^(lib.*)\.so\.*', '%s', '%s library', extra_depends='', allow_links=True)
> +}
> +
>  # Fix a following runtime error:
>  # xkbcommon: ERROR: couldn't find a Compose file for locale "C"
>  RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libx11-locale', 'libx11-compose-data', d)}"

Something isn't quite right in a weston build:

https://autobuilder.yoctoproject.org/typhoon/#/builders/119/builds/1044/steps/12/logs/stdio

Cheers,

Richard

Patch

diff --git a/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb b/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
index b4541cc698..425c1f386d 100644
--- a/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
+++ b/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
@@ -25,8 +25,14 @@  PACKAGECONFIG[wayland] = "-Denable-wayland=true,-Denable-wayland=false,wayland-n
 PACKAGECONFIG[x11] = "-Denable-x11=true,-Denable-x11=false,libxcb xkeyboard-config,"
 
 PACKAGE_BEFORE_PN += "xkbcli"
+FILES:${PN} = ""
 FILES:xkbcli = "${bindir}/xkbcli ${libexecdir}/xkbcommon/xkbcli-*"
 
+python populate_packages:prepend () {
+    # Put the libraries into separate packages to avoid dependency creep
+    do_split_packages(d, d.expand('${libdir}'), r'^(lib.*)\.so\.*', '%s', '%s library', extra_depends='', allow_links=True)
+}
+
 # Fix a following runtime error:
 # xkbcommon: ERROR: couldn't find a Compose file for locale "C"
 RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libx11-locale', 'libx11-compose-data', d)}"