Skip to contentSkip to conversation

libsoup:add a new routine & build as native package

PATCH New Jiang Lu 4 participants 10 messages Mar 20, 2019

lore
Share & tools
lore

Jiang Lu

author
#0 lore raw

PATCH v2 1/1 libsoup:add a new routine & build as native package

[v2]
1.Split patch for libsoup into 2 patch for different purpose.
2.Update relocatable_native_pcfiles() to avoid a error introduced by glib-networking-native.

[v1]
This rr including 2 patch:
1.add a new routine for libsoup with name soup_uri_to_string_with_password() and make libsoup compiled as a native package.
2.make glib-networking compiled as a native package.

Make this change for ostree utilies, which needs libsoup when building ostree image on host.

Thanks
Jiang Lu

author
#1 lore raw

PATCH 1/4 libsoup:add soup_uri_to_string_with_password

The existed soup_uri_to_string does not have password, add a function to support it.

---
 ...add-soup_uri_to_string_with_password.patch | 67 +++++++++++++++++++
 .../libsoup/libsoup-2.4_2.64.2.bb             |  3 +-
 2 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libsoup/libsoup-2.4/0001-add-soup_uri_to_string_with_password.patch
meta/recipes-support/libsoup/libsoup-2.4/0001-add-soup_uri_to_string_with_password.patch new file +67 -0
new file mode 100644
index 0000000000..c679d6b9e5
@@ -0,0 +1,67 @@
+From 82c2f059bc7c491c8c4c728408eb913bfc4a6f0a Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Wed, 6 Jun 2018 22:37:30 +0800
+Subject: [PATCH] add soup_uri_to_string_with_password
+
+The existed soup_uri_to_string does not have password, add a
+function to support it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ libsoup/soup-uri.c | 21 +++++++++++++++++++++
+ libsoup/soup-uri.h |  5 +++++
+ 2 files changed, 26 insertions(+)
+
+diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
+index 3eafd87..8421f1c 100644
+--- a/libsoup/soup-uri.c
++++ b/libsoup/soup-uri.c
+@@ -619,6 +619,27 @@ soup_uri_to_string (SoupURI *uri, gboolean just_path_and_query)
+ }
+ 
+ /**
++ * soup_uri_to_string_with_password:
++ * @uri: a #SoupURI
++ * @just_path_and_query: if %TRUE, output just the path and query portions
++ *
++ * Returns a string representing @uri.
++ *
++ * If @just_path_and_query is %TRUE, this concatenates the path and query
++ * together. That is, it constructs the string that would be needed in
++ * the Request-Line of an HTTP request for @uri.
++ *
++ * Note that the output will contain a password, if @uri does.
++ *
++ * Return value: a string representing @uri, which the caller must free.
++ **/
++char *
++soup_uri_to_string_with_password (SoupURI *uri, gboolean just_path_and_query)
++{
++	return soup_uri_to_string_internal (uri, just_path_and_query, TRUE, FALSE);
++}
++
++/**
+  * soup_uri_copy:
+  * @uri: a #SoupURI
+  *
+diff --git a/libsoup/soup-uri.h b/libsoup/soup-uri.h
+index b9360c6..af702d3 100644
+--- a/libsoup/soup-uri.h
++++ b/libsoup/soup-uri.h
+@@ -57,6 +57,11 @@ char   	   *soup_uri_to_string             (SoupURI    *uri,
+ 					    gboolean    just_path_and_query);
+ 
+ SOUP_AVAILABLE_IN_2_4
++char   	   *soup_uri_to_string_with_password             (SoupURI    *uri,
++					    gboolean    just_path_and_query);
++
++
++SOUP_AVAILABLE_IN_2_4
+ SoupURI	   *soup_uri_copy                  (SoupURI    *uri);
+ 
+ SOUP_AVAILABLE_IN_2_4
+-- 
+2.7.4
+
meta/recipes-support/libsoup/libsoup-2.4_2.64.2.bb +2 -1
index ae7c1a6863..a123818cf3 100644
@@ -11,6 +11,7 @@ SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
 
 SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \
            file://0001-Do-not-enforce-no-introspection-when-cross-building.patch \
+           file://0001-add-soup_uri_to_string_with_password.patch \
            "
 SRC_URI[md5sum] = "cac755dc6c6acd6e0c70007f547548f5"
 SRC_URI[sha256sum] = "75ddc194a5b1d6f25033bb9d355f04bfe5c03e0e1c71ed0774104457b3a786c6"
@@ -48,4 +49,4 @@ EXTRA_OEMESON_append_class-target = " ${@bb.utils.contains('GTKDOC_ENABLED', 'Tr
 DEBIAN_NOAUTONAME_${PN} = "1"
 
 # glib-networking is needed for SSL, proxies, etc.
-RRECOMMENDS_${PN} = "glib-networking"
+DEPENDS += "glib-networking"
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH 1/4] libsoup:add soup_uri_to_string_with_password

meta/recipes-support/libsoup/libsoup-2.4/0001-add-soup_uri_to_string_with_password.patch line 9

Quoted 4 lines · Jiang Lu
meta/recipes-support/libsoup/libsoup-2.4/0001-add-soup_uri_to_string_with_password.patch new file +4 -0
+The existed soup_uri_to_string does not have password, add a
+function to support it.
+
+Upstream-Status: Pending

Why are you adding this function? Have you submitted it upstream?

meta/recipes-support/libsoup/libsoup-2.4_2.64.2.bb EXTRA_OEMESON_append_class-target = " ${@bb.utils.contains('GTKDOC_ENABLED', 'Tr · line 52

Quoted 3 lines
 # glib-networking is needed for SSL, proxies, etc.
meta/recipes-support/libsoup/libsoup-2.4_2.64.2.bb +1 -1
-RRECOMMENDS_${PN} = "glib-networking"
+DEPENDS += "glib-networking"

Apart from not being explained in the commit message, this also seems plain wrong.

Ross

author
#3 lore raw

PATCH 2/4 libsoup:enable libsoup build as native package

In reply to Jiang Lu

Enable libsoup build as a native package, for it may invoked by other native package, such as ostree.

---
 meta/recipes-support/libsoup/libsoup-2.4_2.64.2.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-support/libsoup/libsoup-2.4_2.64.2.bb +2 -0
index a123818cf3..c2284c0458 100644
@@ -50,3 +50,5 @@ DEBIAN_NOAUTONAME_${PN} = "1"
 
 # glib-networking is needed for SSL, proxies, etc.
 DEPENDS += "glib-networking"
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.17.1
#4 lore raw

Re: [PATCH 2/4] libsoup:enable libsoup build as native package

Quoted 1 line · Jiang Lu

+BBCLASSEXTEND = "native"

Can you test a nativesdk build too, might as well add both.

Ross

author
#5 lore raw

PATCH 3/4 glib-networking:enable glib-networking build as native package

In reply to Jiang Lu

Enable glib-networking build as a native package, for it is depended by libsoup.

---
 .../glib-networking/glib-networking_2.58.0.bb            | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +9 -0
index f3190e1cae..96ba181b71 100644
@@ -29,3 +29,12 @@ FILES_${PN} += "\
                 "
 FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
 FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
+
+# Make sure we compile with ca-certificates support enabled.
+PACKAGECONFIG_append = " ca-certificates"
+
+DEPENDS += "ca-certificates"
+RDEPENDS_${PN} += "ca-certificates"
+
+# We need native version for ostree-/flatpak-native.
+BBCLASSEXTEND = "native"
Signature · 1 line
2.17.1
#6 lore raw

Re: [PATCH 3/4] glib-networking:enable glib-networking build as native package

meta/recipes-core/glib-networking/glib-networking_2.58.0.bb FILES_${PN} += "\ · line 34

Quoted 2 lines · Jiang Lu
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +2 -0
+# Make sure we compile with ca-certificates support enabled.
+PACKAGECONFIG_append = " ca-certificates"

Aside from doing PACKAGECONFIG_append in a recipe being the wrong thing to do:

PACKAGECONFIG ??= "gnutls"
PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls" PACKAGECONFIG[libproxy] = "-Dlibproxy_support=true,-Dlibproxy_support=false,libproxy"

There is no ca-certificates PACKAGECONFIG.

meta/recipes-core/glib-networking/glib-networking_2.58.0.bb FILES_${PN} += "\ · line 37

Quoted 2 lines
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +2 -0
+DEPENDS += "ca-certificates"
+RDEPENDS_${PN} += "ca-certificates"

Build time and runtime? Not explained in the commit message. Should be part of this mythical ca-certificates PACKAGECONFIG.

meta/recipes-core/glib-networking/glib-networking_2.58.0.bb FILES_${PN} += "\ · line 40

Quoted 2 lines
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +2 -0
+# We need native version for ostree-/flatpak-native.
+BBCLASSEXTEND = "native"

oe-core doesnt need a comment listing the recipes that you're trying to build.

Ross

#7 lore raw

Re: [PATCH 3/4] glib-networking:enable glib-networking build as native package

In reply to Jiang Lu
Quoted 13 lines · Jiang Lu

Enable glib-networking build as a native package, for it is depended by libsoup.

---
 .../glib-networking/glib-networking_2.58.0.bb            | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +0 -0
index f3190e1cae..96ba181b71 100644

meta/recipes-core/glib-networking/glib-networking_2.58.0.bb FILES_${PN} += "\ · line 34

Quoted 6 lines
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +3 -0
@@ -29,3 +29,12 @@ FILES_${PN} += "\
                 "
 FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
 FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
+
+# Make sure we compile with ca-certificates support enabled.
+PACKAGECONFIG_append = " ca-certificates"

Why not enable it in default PACKAGECONFIG? Using _append will make it more difficult for people to remove this in their layer.

meta/recipes-core/glib-networking/glib-networking_2.58.0.bb FILES_${PN} += "\ · line 36

Quoted 2 lines
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +2 -0
+
+DEPENDS += "ca-certificates"

Is it really build time dependency?

Quoted 12 lines
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +4 -0
+RDEPENDS_${PN} += "ca-certificates"
+
+# We need native version for ostree-/flatpak-native.
+BBCLASSEXTEND = "native"
Signature · 7 lines
2.17.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#8 lore raw

Re: [PATCH 3/4] glib-networking:enable glib-networking build as native package

In reply to Jiang Lu
Quoted 16 lines · Jiang Lu

Enable glib-networking build as a native package, for it is depended by libsoup.

---
 .../glib-networking/glib-networking_2.58.0.bb            | 9
+++++++++
 1 file changed, 9 insertions(+)
(quoted diff) +0 -0

networking_2.58.0.bb b/meta/recipes-core/glib-networking/glib- networking_2.58.0.bb
index f3190e1cae..96ba181b71 100644

meta/recipes-core/glib-networking/glib-networking_2.58.0.bb FILES_${PN} += "\ · line 34

Quoted 6 lines
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +3 -0
@@ -29,3 +29,12 @@ FILES_${PN} += "\
                 "
 FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
 FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
+
+# Make sure we compile with ca-certificates support enabled.
+PACKAGECONFIG_append = " ca-certificates"

This wasn't acceptable in the last patch and still isn't acceptable now. We don't use _append in recipes like this with PACKAGECONFIG.

meta/recipes-core/glib-networking/glib-networking_2.58.0.bb FILES_${PN} += "\ · line 37

Quoted 2 lines
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +2 -0
+DEPENDS += "ca-certificates"
+RDEPENDS_${PN} += "ca-certificates"

This belongs in the PACKAGECONFIG entry.

meta/recipes-core/glib-networking/glib-networking_2.58.0.bb FILES_${PN} += "\ · line 40

Quoted 2 lines
meta/recipes-core/glib-networking/glib-networking_2.58.0.bb +2 -0
+# We need native version for ostree-/flatpak-native.
+BBCLASSEXTEND = "native"

This belongs in a separate patch.

Cheers,

Richard

author
#9 lore raw

PATCH 4/4 relocatable: add file existence checking in relocatable_native_pcfiles

In reply to Jiang Lu

Some package may create a ${libdir}/pkgconfig directory in its sysroot without .pc file. It leads following error:
sed: can't read ${sysroot}/${libdir}/pkgconfig/*.pc: No such file or directory

To avoid this, add a file existence checking in relocatable_native_pcfiles() before sed.

---
 meta/classes/relocatable.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/classes/relocatable.bbclass +4 -2
index 582812c1cf..eb9989d18c 100644
@@ -7,11 +7,13 @@ python relocatable_binaries_preprocess() {
 }
 
 relocatable_native_pcfiles () {
-	if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then
+	filecnt=`ls -l ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc 2>/dev/null | wc -l`
+	if [ $filecnt -gt 0 ]; then
 		rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")}
 		sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc
 	fi
-	if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then
+	filecnt=`ls -l ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc 2>/dev/null | wc -l`
+	if [ $filecnt -gt 0 ]; then
 		rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")}
 		sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc
 	fi
Signature · 1 line
2.17.1