Skip to contentSkip to conversation

cjson: bump to version v1.0.2

PATCH Superseded Fabrice Fontaine 2 participants 2 messages Nov 29, 2016 – Nov 30, 2016

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 cjson: bump to version v1.0.2

This is a major update in cjson:
- project site moved from sourceforge to github
- project recommends to use the new cmake buildsystem instead of the legacy make
- BR2_STATIC_LIBS is now OK (README does not mention issue anymore)
- As include path and library name have changed, tinycbor has to be updated

---
Changes v2 -> v3 (after review of Thomas Petazzoni):
- Update commit message
- Merge tinycbor patch inside cjson patch

Changes v1 -> v2 (after review of Danomi Manchego):
- Retrieve cjson version v1.0.1 instead of v1.0.0

 package/cjson/Config.in                            |  4 +-
 package/cjson/cjson.hash                           |  2 +
 package/cjson/cjson.mk                             | 22 +------
 .../tinycbor/0001-Update-cjson-include-path.patch  | 69 ++++++++++++++++++++++
 4 files changed, 75 insertions(+), 22 deletions(-)
 create mode 100644 package/cjson/cjson.hash
 create mode 100644 package/tinycbor/0001-Update-cjson-include-path.patch
package/cjson/Config.in +1 -3
index bbe4c4a..04eff4c 100644
@@ -1,9 +1,7 @@
 config BR2_PACKAGE_CJSON
 	bool "cJSON"
-	# For static build with cJSON.c directly see README
-	depends on !BR2_STATIC_LIBS
 	help
 	  An ultra-lightweight, portable, single-file, simple-as-can-be ANSI-C
 	  compliant JSON parser, under MIT license.
 
-	  http://cjson.sourceforge.net/
+	  https://github.com/DaveGamble/cJSON
package/cjson/cjson.hash new file +2 -0
new file mode 100644
index 0000000..27f1d46
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256	5c3a4a77796b230efbd74369b0974d14ac0408f2677bd116d4a4b5894b9be372	cjson-v1.0.2.tar.gz
package/cjson/cjson.mk +3 -19
index 8f21ef8..c544a77 100644
@@ -4,26 +4,10 @@
 #
 ################################################################################
 
-CJSON_VERSION = 58
-CJSON_SITE_METHOD = svn
-CJSON_SITE = http://svn.code.sf.net/p/cjson/code
+CJSON_VERSION = v1.0.2
+CJSON_SITE = $(call github,DaveGamble,cjson,$(CJSON_VERSION))
 CJSON_INSTALL_STAGING = YES
 CJSON_LICENSE = MIT
 CJSON_LICENSE_FILES = LICENSE
 
-define CJSON_BUILD_CMDS
-	cd $(@D) && $(TARGET_CC) $(TARGET_CFLAGS) -shared -fPIC -lm \
-		cJSON.c -o libcJSON.so
-endef
-
-define CJSON_INSTALL_STAGING_CMDS
-	$(INSTALL) -D $(@D)/cJSON.h $(STAGING_DIR)/usr/include/cJSON.h
-	$(INSTALL) -D $(@D)/libcJSON.so $(STAGING_DIR)/usr/lib/libcJSON.so
-endef
-
-define CJSON_INSTALL_TARGET_CMDS
-	$(INSTALL) -D $(@D)/cJSON.h $(TARGET_DIR)/usr/include/cJSON.h
-	$(INSTALL) -D $(@D)/libcJSON.so $(TARGET_DIR)/usr/lib/libcJSON.so
-endef
-
-$(eval $(generic-package))
+$(eval $(cmake-package))
package/tinycbor/0001-Update-cjson-include-path.patch new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
2.5.0
#1 lore raw

PATCH v3 1/1 cjson: bump to version v1.0.2

Hello,

Quoted 9 lines · Fabrice Fontaine

This is a major update in cjson:
- project site moved from sourceforge to github
- project recommends to use the new cmake buildsystem instead of the legacy make
- BR2_STATIC_LIBS is now OK (README does not mention issue anymore)
- As include path and library name have changed, tinycbor has to be updated

Unfortunately, with this patch applied to the next branch, the following defconfig:

BR2_arm=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2016.08-613-ge98b4dd.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_5=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_14=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_CJSON=y
BR2_PACKAGE_TINYCBOR=y
# BR2_TARGET_ROOTFS_TAR is not set

does not build:

/home/thomas/projets/buildroot/output/host/usr/bin/arm-linux-gcc -o bin/cbordump -static tools/cbordump/cbordump.o lib/libtinycbor.a -lm /home/thomas/projets/buildroot/output/host/usr/bin/arm-linux-gcc -o bin/json2cbor -static -lcjson tools/json2cbor/json2cbor.o lib/libtinycbor.a -lm tools/json2cbor/json2cbor.o: In function `get_meta_data':
json2cbor.c:(.text.get_meta_data+0x3c): undefined reference to `cJSON_GetObjectItem'
tools/json2cbor/json2cbor.o: In function `main':
json2cbor.c:(.text.startup.main+0x244): undefined reference to `cJSON_ParseWithOpts'
json2cbor.c:(.text.startup.main+0x294): undefined reference to `cJSON_Delete'
collect2: error: ld returned 1 exit status
Makefile:118: recipe for target 'bin/json2cbor' failed
make[2]: *** [bin/json2cbor] Error 1
package/pkg-generic.mk:216: recipe for target '/home/thomas/projets/buildroot/output/build/tinycbor-v0.4/.stamp_built' failed make[1]: *** [/home/thomas/projets/buildroot/output/build/tinycbor-v0.4/.stamp_built] Error 2
Makefile:79: recipe for target '_all' failed

Could you have a look and send an updated version?

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com