Re: [OE-core] [oe-core 2/2] glib-networking:enable glib-networking complie as native package

2019-03-20 Thread Jiang


在 2019/3/19 下午11:36, Peter Kjellerstedt 写道:

-Original Message-
From: openembedded-core-boun...@lists.openembedded.org  On Behalf Of Jiang Lu
Sent: den 19 mars 2019 08:55
To: lu.ji...@windriver.com; openembedded-core@lists.openembedded.org
Subject: [OE-core] [oe-core 2/2] glib-networking:enable glib-networking
complie as native package

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

Signed-off-by: Jiang Lu 
---
  .../glib-networking/glib-networking_2.58.0.bb | 31 +++
  1 file changed, 31 insertions(+)

diff --git a/meta/recipes-core/glib-networking/glib-
networking_2.58.0.bb b/meta/recipes-core/glib-networking/glib-
networking_2.58.0.bb
index f3190e1cae..35b4a3fa76 100644
--- a/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
+++ b/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
@@ -29,3 +29,34 @@ 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"
+# OE-core's relocatable.bbclass assumes that every package which
+# ends up creating a ${libdir}/pkgconfig directory in its sysroot
+# will always also install .pc-files there and tries to uncondi-
+# tionally update paths in those files using globbing that fails
+# if no such files are present. This presumption is not true for
+# glib-networking which happens to create a directory by dereferencing
+# a GIO pkgconfig variable which in turn is defined relative to
+# the pkgconfig directory (${pcfiledir}/../...), causing pkgconfig
+# to get created.

How about fixing relocatable_native_pcfiles() in relocatable.bbclass
instead so that it ignores empty pkgconfig directories?



Thanks,

I prefer add a .pc file existence checking in 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

Thanks

Jiang Lu




+#
+# Could be worked around in the upatream recipe but since that
+# does not provide/create native versions of the package and since
+# this problem is related to native packages, we work around it here.
+#
+do_install_append_class-native () {
+for _pc in ${D}${libdir}/pkgconfig/*.pc; do
+case $_pc in
+*'*.pc') rm -fr ${D}${libdir}/pkgconfig;;
+*.pc)break;;
+esac
+done

Why complicate things? Just remove the directory if it exists
and is empty:

rmdir ${D}${libdir}/pkgconfig 2>/dev/null || :


+}
--
2.17.1

//Peter



--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [oe-core 2/2] glib-networking:enable glib-networking complie as native package

2019-03-19 Thread Burton, Ross
On Tue, 19 Mar 2019 at 15:37, Peter Kjellerstedt
 wrote:
> > +do_install_append_class-native () {
> > +for _pc in ${D}${libdir}/pkgconfig/*.pc; do
> > +case $_pc in
> > +*'*.pc') rm -fr ${D}${libdir}/pkgconfig;;
> > +*.pc)break;;
> > +esac
> > +done
>
> Why complicate things? Just remove the directory if it exists
> and is empty:
>
> rmdir ${D}${libdir}/pkgconfig 2>/dev/null || :

Bikeshed!  Or

rmdir --ignore-fail-on-non-empty ${D}${libdir}/pkgconfig

Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [oe-core 2/2] glib-networking:enable glib-networking complie as native package

2019-03-19 Thread Peter Kjellerstedt
> -Original Message-
> From: openembedded-core-boun...@lists.openembedded.org  core-boun...@lists.openembedded.org> On Behalf Of Jiang Lu
> Sent: den 19 mars 2019 08:55
> To: lu.ji...@windriver.com; openembedded-core@lists.openembedded.org
> Subject: [OE-core] [oe-core 2/2] glib-networking:enable glib-networking
> complie as native package
> 
> Enable glib-networking compile as a native package, for it is depended
> by
> libsoup.
> 
> Signed-off-by: Jiang Lu 
> ---
>  .../glib-networking/glib-networking_2.58.0.bb | 31 +++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/meta/recipes-core/glib-networking/glib-
> networking_2.58.0.bb b/meta/recipes-core/glib-networking/glib-
> networking_2.58.0.bb
> index f3190e1cae..35b4a3fa76 100644
> --- a/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
> +++ b/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
> @@ -29,3 +29,34 @@ 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"
> +# OE-core's relocatable.bbclass assumes that every package which
> +# ends up creating a ${libdir}/pkgconfig directory in its sysroot
> +# will always also install .pc-files there and tries to uncondi-
> +# tionally update paths in those files using globbing that fails
> +# if no such files are present. This presumption is not true for
> +# glib-networking which happens to create a directory by dereferencing
> +# a GIO pkgconfig variable which in turn is defined relative to
> +# the pkgconfig directory (${pcfiledir}/../...), causing pkgconfig
> +# to get created.

How about fixing relocatable_native_pcfiles() in relocatable.bbclass 
instead so that it ignores empty pkgconfig directories?

> +#
> +# Could be worked around in the upatream recipe but since that
> +# does not provide/create native versions of the package and since
> +# this problem is related to native packages, we work around it here.
> +#
> +do_install_append_class-native () {
> +for _pc in ${D}${libdir}/pkgconfig/*.pc; do
> +case $_pc in
> +*'*.pc') rm -fr ${D}${libdir}/pkgconfig;;
> +*.pc)break;;
> +esac
> +done

Why complicate things? Just remove the directory if it exists 
and is empty:

rmdir ${D}${libdir}/pkgconfig 2>/dev/null || :

> +}
> --
> 2.17.1

//Peter

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [oe-core 2/2] glib-networking:enable glib-networking complie as native package

2019-03-19 Thread Richard Purdie
On Tue, 2019-03-19 at 15:54 +0800, Jiang Lu wrote:
> Enable glib-networking compile as a native package, for it is
> depended by
> libsoup.
> 
> Signed-off-by: Jiang Lu 
> ---
>  .../glib-networking/glib-networking_2.58.0.bb | 31
> +++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/meta/recipes-core/glib-networking/glib-
> networking_2.58.0.bb b/meta/recipes-core/glib-networking/glib-
> networking_2.58.0.bb
> index f3190e1cae..35b4a3fa76 100644
> --- a/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
> +++ b/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
> @@ -29,3 +29,34 @@ 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"
> +# OE-core's relocatable.bbclass assumes that every package which
> +# ends up creating a ${libdir}/pkgconfig directory in its sysroot
> +# will always also install .pc-files there and tries to uncondi-
> +# tionally update paths in those files using globbing that fails
> +# if no such files are present. This presumption is not true for
> +# glib-networking which happens to create a directory by
> dereferencing
> +# a GIO pkgconfig variable which in turn is defined relative to
> +# the pkgconfig directory (${pcfiledir}/../...), causing pkgconfig
> +# to get created.
> +#
> +# Could be worked around in the upatream recipe but since that
> +# does not provide/create native versions of the package and since
> +# this problem is related to native packages, we work around it
> here.
> +#
> +do_install_append_class-native () {
> +for _pc in ${D}${libdir}/pkgconfig/*.pc; do
> +case $_pc in
> +*'*.pc') rm -fr ${D}${libdir}/pkgconfig;;
> +*.pc)break;;
> +esac
> +done
> +}

This reads as if there is a bbappend in some layer which is now being
dumped verbatim into the upstream recipe with no thought as to what
makes sense.

We don't do PACKAGECONFIG_append in recipes and we don't hack .pc files
like this. The dependencies suggest we should also fix the
PACKAGECONFIG DEPENDS/RDEPENDS too.

This needs more work.

Also, for the first patch, its unclear why we need/want the patch
present there and the commit shortlog doesn't really describe the
multiple things the patch is doing.

Cheers,

Richard


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [oe-core 2/2] glib-networking:enable glib-networking complie as native package

2019-03-19 Thread Jiang Lu
Enable glib-networking compile as a native package, for it is depended by
libsoup.

Signed-off-by: Jiang Lu 
---
 .../glib-networking/glib-networking_2.58.0.bb | 31 +++
 1 file changed, 31 insertions(+)

diff --git a/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb 
b/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
index f3190e1cae..35b4a3fa76 100644
--- a/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
+++ b/meta/recipes-core/glib-networking/glib-networking_2.58.0.bb
@@ -29,3 +29,34 @@ 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"
+# OE-core's relocatable.bbclass assumes that every package which
+# ends up creating a ${libdir}/pkgconfig directory in its sysroot
+# will always also install .pc-files there and tries to uncondi-
+# tionally update paths in those files using globbing that fails
+# if no such files are present. This presumption is not true for
+# glib-networking which happens to create a directory by dereferencing
+# a GIO pkgconfig variable which in turn is defined relative to
+# the pkgconfig directory (${pcfiledir}/../...), causing pkgconfig
+# to get created.
+#
+# Could be worked around in the upatream recipe but since that
+# does not provide/create native versions of the package and since
+# this problem is related to native packages, we work around it here.
+#
+do_install_append_class-native () {
+for _pc in ${D}${libdir}/pkgconfig/*.pc; do
+case $_pc in
+*'*.pc') rm -fr ${D}${libdir}/pkgconfig;;
+*.pc)break;;
+esac
+done
+}
-- 
2.17.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core