diff mbox

[1/1] tinycbor: new package

Message ID 1469435859-25918-1-git-send-email-fabrice.fontaine@orange.com
State Accepted
Headers show

Commit Message

Fabrice Fontaine July 25, 2016, 8:37 a.m. UTC
Concise Binary Object Representation (CBOR) Library

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
---
 package/Config.in              |  1 +
 package/tinycbor/Config.in     | 20 ++++++++++++++++++++
 package/tinycbor/tinycbor.hash |  2 ++
 package/tinycbor/tinycbor.mk   | 38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 61 insertions(+)
 create mode 100644 package/tinycbor/Config.in
 create mode 100644 package/tinycbor/tinycbor.hash
 create mode 100644 package/tinycbor/tinycbor.mk

Comments

Thomas Petazzoni July 25, 2016, 9:35 p.m. UTC | #1
Hello,

On Mon, 25 Jul 2016 10:37:39 +0200, Fabrice Fontaine wrote:
> Concise Binary Object Representation (CBOR) Library
> 
> Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>

Applied, after doing a few minor changes:

    [Thomas:
     - use lower-case letters in the Config.in option prompt
     - remove BR2_PACKAGE_TINYCBOR_JSON2CBOR sub-option, simply rely on
       the cjson package being enabled
     - pass prefix=/usr only at install time.]

Thanks!

Thomas
Thomas Petazzoni July 30, 2016, 2:43 p.m. UTC | #2
Hello,

On Mon, 25 Jul 2016 10:37:39 +0200, Fabrice Fontaine wrote:
> Concise Binary Object Representation (CBOR) Library
> 
> Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
> ---
>  package/Config.in              |  1 +
>  package/tinycbor/Config.in     | 20 ++++++++++++++++++++
>  package/tinycbor/tinycbor.hash |  2 ++
>  package/tinycbor/tinycbor.mk   | 38 ++++++++++++++++++++++++++++++++++++++
>  4 files changed, 61 insertions(+)
>  create mode 100644 package/tinycbor/Config.in
>  create mode 100644 package/tinycbor/tinycbor.hash
>  create mode 100644 package/tinycbor/tinycbor.mk

This package is causing two types of build failures:

 * On Blackfin only:

   http://autobuild.buildroot.net/?reason=tinycbor-v0.3.1&arch=bfin

   The Blackfin external toolchain uses gcc 4.3, which is pretty old.
   The error occurs on unnamed unions, maybe there's a problem with
   that. But
   https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Unnamed-Fields.html
   seems to indicate it was already supported in gcc 4.3. More
   investigation is needed.

 * On other architectures, a problem occurs when
   output/target/usr/lib/libtinycbor.a is created as a directory, for
   some reason:

   http://autobuild.buildroot.net/results/760/7605c301f460398c2435f6b73d6d07c7d1022e8c/build-end.log

Could you look into those issues?

Thanks,

Thomas
Thomas Petazzoni July 30, 2016, 7:52 p.m. UTC | #3
Hello,

On Sat, 30 Jul 2016 16:43:01 +0200, Thomas Petazzoni wrote:

>  * On other architectures, a problem occurs when
>    output/target/usr/lib/libtinycbor.a is created as a directory, for
>    some reason:
> 
>    http://autobuild.buildroot.net/results/760/7605c301f460398c2435f6b73d6d07c7d1022e8c/build-end.log

I have committed a patch to fix this problem:
https://git.buildroot.org/buildroot/commit/?id=04c9be519de922cda3e20a00be2fad39b265d398.

The Blackfin problem remains to be solved, however.

Thanks,

Thomas
Fabrice Fontaine July 30, 2016, 8:03 p.m. UTC | #4
Dear Thomas,

Issue with unnamed union will be fixed by giving a name to it, patch has
been accepted upstream: https://github.com/01org/tinycbor/pull/35.
Thanks a lot for fixing the other issue.

Best Regards,

Fabrice

2016-07-30 21:52 GMT+02:00 Thomas Petazzoni <
thomas.petazzoni@free-electrons.com>:

> Hello,
>
> On Sat, 30 Jul 2016 16:43:01 +0200, Thomas Petazzoni wrote:
>
> >  * On other architectures, a problem occurs when
> >    output/target/usr/lib/libtinycbor.a is created as a directory, for
> >    some reason:
> >
> >
> http://autobuild.buildroot.net/results/760/7605c301f460398c2435f6b73d6d07c7d1022e8c/build-end.log
>
> I have committed a patch to fix this problem:
>
> https://git.buildroot.org/buildroot/commit/?id=04c9be519de922cda3e20a00be2fad39b265d398
> .
>
> The Blackfin problem remains to be solved, however.
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
Thomas Petazzoni July 30, 2016, 9:24 p.m. UTC | #5
Hello,

On Sat, 30 Jul 2016 22:03:14 +0200, Fabrice Fontaine wrote:

> Issue with unnamed union will be fixed by giving a name to it, patch has
> been accepted upstream: https://github.com/01org/tinycbor/pull/35.
> Thanks a lot for fixing the other issue.

Will you send a Buildroot patch to integrate the tinycbor fix until
upstream makes a new release?

Thanks!

Thomas
Fabrice Fontaine July 31, 2016, 6:56 a.m. UTC | #6
Dear Thomas,

Thiago will rework the patch:
https://github.com/01org/tinycbor/commit/4628a110b736c3c31bd8c577ea1d29400e0c0a53
so we'll have to wait for the 0.4 release.

Best Regards,

Fabrice

2016-07-30 23:24 GMT+02:00 Thomas Petazzoni <
thomas.petazzoni@free-electrons.com>:

> Hello,
>
> On Sat, 30 Jul 2016 22:03:14 +0200, Fabrice Fontaine wrote:
>
> > Issue with unnamed union will be fixed by giving a name to it, patch has
> > been accepted upstream: https://github.com/01org/tinycbor/pull/35.
> > Thanks a lot for fixing the other issue.
>
> Will you send a Buildroot patch to integrate the tinycbor fix until
> upstream makes a new release?
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 814141f..8ceeb9e 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1328,6 +1328,7 @@  endif
 	source "package/qlibc/Config.in"
 	source "package/sphinxbase/Config.in"
 	source "package/startup-notification/Config.in"
+	source "package/tinycbor/Config.in"
 	source "package/tz/Config.in"
 	source "package/tzdata/Config.in"
 endmenu
diff --git a/package/tinycbor/Config.in b/package/tinycbor/Config.in
new file mode 100644
index 0000000..edbe64a
--- /dev/null
+++ b/package/tinycbor/Config.in
@@ -0,0 +1,20 @@ 
+config BR2_PACKAGE_TINYCBOR
+	bool "tinyCBOR"
+	help
+	  Concise Binary Object Representation (CBOR) Library
+
+	  https://github.com/01org/tinycbor
+
+if BR2_PACKAGE_TINYCBOR
+
+config BR2_PACKAGE_TINYCBOR_JSON2CBOR
+	bool "json2cbor"
+	depends on !BR2_STATIC_LIBS # cJSON
+	select BR2_PACKAGE_CJSON
+	help
+	  The TinyCBOR library does not provide a way to convert from
+	  JSON representation back to encoded form. However, json2cbor
+	  can be used for that purpose. That tool supports the metadata
+	  format that these functions may produce.
+
+endif # BR2_PACKAGE_TINYCBOR
diff --git a/package/tinycbor/tinycbor.hash b/package/tinycbor/tinycbor.hash
new file mode 100644
index 0000000..e60a86c
--- /dev/null
+++ b/package/tinycbor/tinycbor.hash
@@ -0,0 +1,2 @@ 
+# Locally computed:
+sha256	e73a617b3a51fac103df1faab9ea037e509c1491cca29c1fd4b5083d74267597	tinycbor-v0.3.1.tar.gz
diff --git a/package/tinycbor/tinycbor.mk b/package/tinycbor/tinycbor.mk
new file mode 100644
index 0000000..5d05a22
--- /dev/null
+++ b/package/tinycbor/tinycbor.mk
@@ -0,0 +1,38 @@ 
+################################################################################
+#
+# tinycbor
+#
+################################################################################
+
+TINYCBOR_VERSION = v0.3.1
+TINYCBOR_SITE = $(call github,01org,tinycbor,$(TINYCBOR_VERSION))
+TINYCBOR_LICENSE = MIT
+TINYCBOR_LICENSE_FILES = LICENSE
+
+TINYCBOR_DEPENDENCIES = host-pkgconf
+TINYCBOR_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_CJSON),y)
+TINYCBOR_DEPENDENCIES += cjson
+endif
+
+TINYCBOR_MAKE_OPTS = \
+	$(TARGET_CONFIGURE_OPTS) \
+	V=1 \
+	prefix=/usr
+
+define TINYCBOR_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TINYCBOR_MAKE_OPTS) -C $(@D)
+endef
+
+define TINYCBOR_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TINYCBOR_MAKE_OPTS) -C $(@D) \
+		DESTDIR=$(STAGING_DIR) install
+endef
+
+define TINYCBOR_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TINYCBOR_MAKE_OPTS) -C $(@D) \
+		DESTDIR=$(TARGET_DIR) install
+endef
+
+$(eval $(generic-package))