Skip to contentSkip to conversation

glib-2.0: rationalise build dependencies

PATCH In review Ross Burton 2 participants 4 messages Jan 10, 2018 – Jan 12, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 glib-2.0: rationalise build dependencies

nativesdk-glib-2.0 doesn't build-depend on nativesdk-gettext, but all variations need to depend on gettext-native as they need msgfmt (so gettext-minimal-native isn't an option).

Also add virtual/libintl as glib explicitly needs this. Generally this is provided by glibc but some platforms (such as MinGW) don't.

---
 meta/recipes-core/glib-2.0/glib.inc | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
meta/recipes-core/glib-2.0/glib.inc +8 -5
index cfeb48a5368..b374f6bb2e4 100644
@@ -3,7 +3,7 @@ DESCRIPTION = "GLib is a general-purpose utility library, which provides many us
 HOMEPAGE = "https://developer.gnome.org/glib/"
 
 # pcre is under BSD;
-# docs/reference/COPYING is with a 'public domai'-like license!
+# docs/reference/COPYING is with a 'public domain'-like license!
 LICENSE = "LGPLv2.1+ & BSD & PD"
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                     file://glib/glib.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \
@@ -19,10 +19,13 @@ CVE_PRODUCT = "glib"
 
 BBCLASSEXTEND = "native nativesdk"
 
-DEPENDS = "virtual/libiconv libffi zlib glib-2.0-native"
-DEPENDS_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', ' dbus', '', d)}"
-DEPENDS_class-native = "pkgconfig-native gettext-native libffi-native zlib-native"
-DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib glib-2.0-native"
+DEPENDS = "glib-2.0-native \
+           gettext-native \
+           virtual/libintl \
+           virtual/libiconv \
+           libffi \
+           zlib \
+           ${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus', '', d)}"
 
 PACKAGES += "${PN}-codegen ${PN}-utils"
 
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 gettext: rationalise optional dependencies

gettext has optional dependencies on libxml2, glib, libcroco and libunistring. If they're not available then gettext will use internal copies, but it can also use system libraries.

For gettext-native and nativesdk-gettext continue to use the internal copies to reduce the dependencies, but for target use the system shared libraries.

Also gettext 0.19.7 onwards swapped expat for libxm2, so remove the build dependency on expat.

---
 meta/recipes-core/gettext/gettext_0.19.8.1.bb | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
meta/recipes-core/gettext/gettext_0.19.8.1.bb +11 -7
index c2059e608b1..97083c0da2d 100644
@@ -8,7 +8,7 @@ SECTION = "libs"
 LICENSE = "GPLv3+ & LGPL-2.1+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
-DEPENDS = "gettext-native virtual/libiconv expat"
+DEPENDS = "gettext-native virtual/libiconv"
 DEPENDS_class-native = "gettext-minimal-native"
 PROVIDES = "virtual/libintl virtual/gettext"
 PROVIDES_class-native = "virtual/gettext-native"
@@ -22,8 +22,6 @@ SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
 SRC_URI[md5sum] = "97e034cf8ce5ba73a28ff6c3c0638092"
 SRC_URI[sha256sum] = "ff942af0e438ced4a8b0ea4b0b6e0d6d657157c5e2364de57baa279c1c125c43"
 
-PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
-
 inherit autotools texinfo
 
 EXTRA_OECONF += "--without-lispdir \
@@ -33,18 +31,24 @@ EXTRA_OECONF += "--without-lispdir \
                  --disable-native-java \
                  --disable-openmp \
                  --disable-acl \
-                 --with-included-glib \
                  --without-emacs \
                  --without-cvs \
                  --without-git \
-                 --with-included-libxml \
-                 --with-included-libcroco \
-                 --with-included-libunistring \
                 "
 EXTRA_OECONF_append_class-target = " \
                  --with-bisonlocaledir=${datadir}/locale \
 "
 
+PACKAGECONFIG ??= "croco glib libxml libunistring"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[croco] = "--without-included-libcroco,--with-included-libcroco,libcroco"
+PACKAGECONFIG[glib] = "--without-included-glib,--with-included-glib,glib-2.0"
+PACKAGECONFIG[libxml] = "--without-included-libxml,--with-included-libxml,libxml2"
+PACKAGECONFIG[libunistring] = "--without-included-libunistring,--with-included-libunistring,libunistring"
+PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
+
 acpaths = '-I ${S}/gettext-runtime/m4 \
            -I ${S}/gettext-tools/m4'
 
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 2/2] gettext: rationalise optional dependencies

Quoted 7 lines · Ross Burton

gettext has optional dependencies on libxml2, glib, libcroco and libunistring. If they're not available then gettext will use internal copies, but it can also use system libraries.

For gettext-native and nativesdk-gettext continue to use the internal copies to reduce the dependencies, but for target use the system shared libraries.

Do we get any reduction in size ? if yes how much, not sure whats the defaults generally used by other distributions but it would nice to be using the default config
options for best results.

Quoted 67 lines

Also gettext 0.19.7 onwards swapped expat for libxm2, so remove the build dependency on expat.

---
 meta/recipes-core/gettext/gettext_0.19.8.1.bb | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
meta/recipes-core/gettext/gettext_0.19.8.1.bb +11 -8
index c2059e608b1..97083c0da2d 100644
@@ -8,7 +8,7 @@ SECTION = "libs"
 LICENSE = "GPLv3+ & LGPL-2.1+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
-DEPENDS = "gettext-native virtual/libiconv expat"
+DEPENDS = "gettext-native virtual/libiconv"
 DEPENDS_class-native = "gettext-minimal-native"
 PROVIDES = "virtual/libintl virtual/gettext"
 PROVIDES_class-native = "virtual/gettext-native"
@@ -22,8 +22,6 @@ SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
 SRC_URI[md5sum] = "97e034cf8ce5ba73a28ff6c3c0638092"
 SRC_URI[sha256sum] = "ff942af0e438ced4a8b0ea4b0b6e0d6d657157c5e2364de57baa279c1c125c43"
 
-PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
-
 inherit autotools texinfo
 
 EXTRA_OECONF += "--without-lispdir \
@@ -33,18 +31,24 @@ EXTRA_OECONF += "--without-lispdir \
                  --disable-native-java \
                  --disable-openmp \
                  --disable-acl \
-                 --with-included-glib \
                  --without-emacs \
                  --without-cvs \
                  --without-git \
-                 --with-included-libxml \
-                 --with-included-libcroco \
-                 --with-included-libunistring \
                 "
 EXTRA_OECONF_append_class-target = " \
                  --with-bisonlocaledir=${datadir}/locale \
 "
 
+PACKAGECONFIG ??= "croco glib libxml libunistring"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[croco] = "--without-included-libcroco,--with-included-libcroco,libcroco"
+PACKAGECONFIG[glib] = "--without-included-glib,--with-included-glib,glib-2.0"
+PACKAGECONFIG[libxml] = "--without-included-libxml,--with-included-libxml,libxml2"
+PACKAGECONFIG[libunistring] = "--without-included-libunistring,--with-included-libunistring,libunistring"
+PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
+
 acpaths = '-I ${S}/gettext-runtime/m4 \
            -I ${S}/gettext-tools/m4'
 
--

2.11.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw

Re: [PATCH 2/2] gettext: rationalise optional dependencies

Quoted 10 lines · Khem Raj
Quoted 1 line · Ross Burton

gettext has optional dependencies on libxml2, glib, libcroco and

libunistring.

Quoted 1 line

If they're not available then gettext will use internal copies, but it

can also

Quoted 3 lines

use system libraries.

For gettext-native and nativesdk-gettext continue to use the internal

copies to

Quoted 8 lines
Quoted 2 lines

reduce the dependencies, but for target use the system shared libraries.

Do we get any reduction in size ? if yes how much, not sure whats the defaults
generally used by other distributions but it would nice to be using the default config
options for best results.

When using the system shared libraries the gettext package is about a megabyte smaller from memory, but obviously it has more deps (which is why I left it as a packageconfig).

For native, circular dependencies mean we can't use system libraries anyway.

Ross