* [Buildroot] [PATCH] libjson: new package
@ 2013-03-27 20:28 spdawson at gmail.com
2013-04-29 20:55 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: spdawson at gmail.com @ 2013-03-27 20:28 UTC (permalink / raw)
To: buildroot
From: Simon Dawson <spdawson@gmail.com>
Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
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
diff --git a/package/Config.in b/package/Config.in
index 463d1b9..5f9c6c1 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/libjson/Config.in b/package/libjson/Config.in
new file mode 100644
index 0000000..949c748
--- /dev/null
+++ b/package/libjson/Config.in
@@ -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
diff --git a/package/libjson/libjson-0001-fix-broken-makefile.patch b/package/libjson/libjson-0001-fix-broken-makefile.patch
new file mode 100644
index 0000000..8ceb0ca
--- /dev/null
+++ b/package/libjson/libjson-0001-fix-broken-makefile.patch
@@ -0,0 +1,16 @@
+Fix the broken libjson makefile.
+
+Signed-off-by: Simon Dawson <spdawson@gmail.com>
+
+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
+
diff --git a/package/libjson/libjson.mk b/package/libjson/libjson.mk
new file mode 100644
index 0000000..9bd9030
--- /dev/null
+++ b/package/libjson/libjson.mk
@@ -0,0 +1,53 @@
+#############################################################
+#
+# libjson
+#
+#############################################################
+
+LIBJSON_VERSION = 7.6.1
+LIBJSON_SITE = http://downloads.sourceforge.net/project/libjson
+LIBJSON_SOURCE = libjson_$(LIBJSON_VERSION).zip
+LIBJSON_INSTALL_STAGING = YES
+LIBJSON_LICENSE = BSD-2c
+LIBJSON_LICENSE_FILES = License.txt
+
+LIBJSON_MAKE_OPT = BUILD_TYPE= SHARED=1
+
+define LIBJSON_EXTRACT_CMDS
+ unzip -d $(@D) $(DL_DIR)/$(LIBJSON_SOURCE)
+ mv $(@D)/libjson/* $(@D)
+ $(RM) -r $(@D)/libjson
+endef
+
+define LIBJSON_BUILD_CMDS
+ mkdir -p $(@D)/Objects_shared $(@D)/_internal/Source/Dependencies
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ $(LIBJSON_MAKE_OPT) -C $(@D)
+endef
+
+define LIBJSON_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ $(LIBJSON_MAKE_OPT) prefix=$(TARGET_DIR)/usr install -C $(@D)
+endef
+
+define LIBJSON_UNINSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ $(LIBJSON_MAKE_OPT) prefix=$(TARGET_DIR)/usr uninstall -C $(@D)
+endef
+
+define LIBJSON_INSTALL_STAGING_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ $(LIBJSON_MAKE_OPT) prefix=$(STAGING_DIR)/usr install -C $(@D)
+endef
+
+define LIBJSON_UNINSTALL_STAGING_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ $(LIBJSON_MAKE_OPT) prefix=$(STAGING_DIR)/usr uninstall -C $(@D)
+endef
+
+define LIBJSON_CLEAN_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) $(LIBJSON_MAKE_OPT) \
+ clean -C $(@D)
+endef
+
+$(eval $(generic-package))
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] libjson: new package
2013-03-27 20:28 [Buildroot] [PATCH] libjson: new package spdawson at gmail.com
@ 2013-04-29 20:55 ` Peter Korsgaard
2013-04-30 6:36 ` Simon Dawson
0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2013-04-29 20:55 UTC (permalink / raw)
To: buildroot
>>>>> "spdawson" == spdawson <spdawson@gmail.com> writes:
spdawson> From: Simon Dawson <spdawson@gmail.com>
spdawson> Signed-off-by: Simon Dawson <spdawson@gmail.com>
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.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] libjson: new package
2013-04-29 20:55 ` Peter Korsgaard
@ 2013-04-30 6:36 ` Simon Dawson
0 siblings, 0 replies; 3+ messages in thread
From: Simon Dawson @ 2013-04-30 6:36 UTC (permalink / raw)
To: buildroot
On 29 April 2013 21:55, Peter Korsgaard <jacmet@uclibc.org> wrote:
>>>>>> "spdawson" == spdawson <spdawson@gmail.com> writes:
>
> spdawson> From: Simon Dawson <spdawson@gmail.com>
> spdawson> Signed-off-by: Simon Dawson <spdawson@gmail.com>
> 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.
Thanks for your help with this Peter.
Simon.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-30 6:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-27 20:28 [Buildroot] [PATCH] libjson: new package spdawson at gmail.com
2013-04-29 20:55 ` Peter Korsgaard
2013-04-30 6:36 ` Simon Dawson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.