Skip to contentSkip to conversation

libjson: new package

PATCH New spdawson at gmail.com 2 participants 3 messages Mar 27, 2013 – Apr 30, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libjson: new package

From: Simon Dawson <[email protected]>

---
 package/Config.in                                  |    1 +
 package/libjson/Config.in                          |   11 ++++
 .../libjson/libjson-0001-fix-broken-makefile.patch |   16 ++++++
 package/libjson/libjson.mk                         |   53 ++++++++++++++++++++
 4 files changed, 81 insertions(+)
 create mode 100644 package/libjson/Config.in
 create mode 100644 package/libjson/libjson-0001-fix-broken-makefile.patch
 create mode 100644 package/libjson/libjson.mk
package/Config.in +1 -0
index 463d1b9..5f9c6c1 100644
@@ -609,6 +609,7 @@ source "package/expat/Config.in"
 source "package/ezxml/Config.in"
 source "package/json-c/Config.in"
 source "package/json-glib/Config.in"
+source "package/libjson/Config.in"
 source "package/libroxml/Config.in"
 source "package/libxml-parser-perl/Config.in"
 source "package/libxml2/Config.in"
package/libjson/Config.in new file +11 -0
new file mode 100644
index 0000000..949c748
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_LIBJSON
+	bool "libjson"
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  A JSON reader and writer which is super-efficient and usually
+	  runs circles around other JSON libraries.
+
+	  http://sourceforge.net/projects/libjson/
+
+comment "libjson requires a toolchain with C++ support"
+	depends on !BR2_INSTALL_LIBSTDCPP
package/libjson/libjson-0001-fix-broken-makefile.patch new file +16 -0
new file mode 100644
index 0000000..8ceb0ca
@@ -0,0 +1,16 @@
+Fix the broken libjson makefile.
+
+Signed-off-by: Simon Dawson <[email protected]>
+
+diff -Nurp a/makefile b/makefile
+--- a/makefile	2012-05-30 10:15:42.000000000 +0100
++++ b/makefile	2013-03-27 18:45:34.814670534 +0000
+@@ -170,7 +170,7 @@ include_path     = $(prefix)/$(includedi
+ # Usage check
+ ifdef CXXFLAGS
+ ifdef BUILD_TYPE
+-	$(error CXXFLAGS and BUILD_TYPE are mutually exclusive)
++$(error CXXFLAGS and BUILD_TYPE are mutually exclusive)
+ endif
+ endif
+ 
package/libjson/libjson.mk new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 libjson: new package

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"spdawson" == spdawson <[email protected]> writes:

spdawson> From: Simon Dawson <[email protected]> spdawson> Signed-off-by: Simon Dawson <[email protected]> spdawson> ---

 spdawson>  package/Config.in                                  |    1 +
 spdawson>  package/libjson/Config.in                          |   11 ++++
 spdawson>  .../libjson/libjson-0001-fix-broken-makefile.patch |   16 ++++++
 spdawson>  package/libjson/libjson.mk                         |   53 ++++++++++++++++++++
 spdawson>  4 files changed, 81 insertions(+)
 spdawson>  create mode 100644 package/libjson/Config.in
 spdawson>  create mode 100644 package/libjson/libjson-0001-fix-broken-makefile.patch
 spdawson>  create mode 100644 package/libjson/libjson.mk

Committed with some modifications (see below) - Thanks.

spdawson> +LIBJSON_LICENSE_FILES = License.txt spdawson> +
spdawson> +LIBJSON_MAKE_OPT = BUILD_TYPE= SHARED=1

spdawson> +
spdawson> +define LIBJSON_EXTRACT_CMDS
spdawson> + unzip -d $(@D) $(DL_DIR)/$(LIBJSON_SOURCE)
spdawson> + mv $(@D)/libjson/* $(@D)
spdawson> + $(RM) -r $(@D)/libjson
spdawson> +endef
spdawson> +
spdawson> +define LIBJSON_BUILD_CMDS
spdawson> + mkdir -p $(@D)/Objects_shared $(@D)/_internal/Source/Dependencies

It should be built statically if BR2_PREFER_STATIC_LIB is enabled, so SHARED=0 and Objects_static.

It complains loudly that the assert checks are still enabled, so I've changed it to pass -NDEBUG in CXXFLAGS, like the makefile normally does.

spdawson> +define LIBJSON_INSTALL_TARGET_CMDS
spdawson> + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
spdawson> + $(LIBJSON_MAKE_OPT) prefix=$(TARGET_DIR)/usr install -C $(@D)
spdawson> +endef

It runs ldconfig after installation, which doesn't make sense for cross compilation, and the host version is normally not in the path, so I've stripped that.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 libjson: new package

Quoted 14 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"spdawson" == spdawson <[email protected]> writes:

spdawson> From: Simon Dawson <[email protected]> spdawson> Signed-off-by: Simon Dawson <[email protected]> spdawson> ---

 spdawson>  package/Config.in                                  |    1 +
 spdawson>  package/libjson/Config.in                          |   11 ++++
 spdawson>  .../libjson/libjson-0001-fix-broken-makefile.patch |   16 ++++++
 spdawson>  package/libjson/libjson.mk                         |   53 ++++++++++++++++++++
 spdawson>  4 files changed, 81 insertions(+)
 spdawson>  create mode 100644 package/libjson/Config.in
 spdawson>  create mode 100644 package/libjson/libjson-0001-fix-broken-makefile.patch
 spdawson>  create mode 100644 package/libjson/libjson.mk
Quoted 1 line

Committed with some modifications (see below) - Thanks.

Thanks for your help with this Peter.

Simon.