diff mbox

rapidjson: new package

Message ID 1364472920-11835-1-git-send-email-spdawson@gmail.com
State Accepted
Commit 5734f8d03524630f37fd09814605f3bd99b053b9
Headers show

Commit Message

Simon Dawson March 28, 2013, 12:15 p.m. UTC
From: Simon Dawson <spdawson@gmail.com>

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 package/Config.in              |    1 +
 package/rapidjson/Config.in    |    6 ++++++
 package/rapidjson/rapidjson.mk |   34 ++++++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 package/rapidjson/Config.in
 create mode 100644 package/rapidjson/rapidjson.mk

Comments

Thomas Petazzoni March 28, 2013, 1:15 p.m. UTC | #1
Simon,

On Thu, 28 Mar 2013 12:15:19 +0000, spdawson@gmail.com wrote:

> diff --git a/package/rapidjson/rapidjson.mk b/package/rapidjson/rapidjson.mk
> new file mode 100644
> index 0000000..cc260e9
> --- /dev/null
> +++ b/package/rapidjson/rapidjson.mk
> @@ -0,0 +1,34 @@
> +#############################################################
> +#
> +# rapidjson
> +#
> +#############################################################
> +
> +RAPIDJSON_VERSION = 0.11
> +RAPIDJSON_SOURCE = rapidjson-$(RAPIDJSON_VERSION).zip
> +RAPIDJSON_SITE = http://rapidjson.googlecode.com/files
> +RAPIDJSON_LICENSE = MIT
> +RAPIDJSON_LICENSE_FILES = license.txt
> +RAPIDJSON_INSTALL_TARGET = NO
> +RAPIDJSON_INSTALL_STAGING = YES

How does this thing work if you install only things in staging? Is it a
code generator that runs on the host? And if so, shouldn't some stuff
be installed in $(HOST_DIR) ?

Thanks,

Thomas
Simon Dawson March 28, 2013, 1:26 p.m. UTC | #2
Hi Thomas,

On 28 March 2013 13:15, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Simon,
>
>> +RAPIDJSON_INSTALL_TARGET = NO
>> +RAPIDJSON_INSTALL_STAGING = YES
>
> How does this thing work if you install only things in staging? Is it a
> code generator that runs on the host? And if so, shouldn't some stuff
> be installed in $(HOST_DIR) ?

Thanks for looking at this. It is a header-only library. That being
the case, should the headers also be installed under $(HOST_DIR)?

Simon.
Thomas Petazzoni March 28, 2013, 1:33 p.m. UTC | #3
Dear Simon Dawson,

On Thu, 28 Mar 2013 13:26:07 +0000, Simon Dawson wrote:

> > How does this thing work if you install only things in staging? Is
> > it a code generator that runs on the host? And if so, shouldn't
> > some stuff be installed in $(HOST_DIR) ?
> 
> Thanks for looking at this. It is a header-only library. That being
> the case, should the headers also be installed under $(HOST_DIR)?

No, if it's a header only library, then what you've done is correct.
Thanks for the explanation!

Thomas
Peter Korsgaard April 21, 2013, 9:29 p.m. UTC | #4
>>>>> "spdawson" == spdawson  <spdawson@gmail.com> writes:

 spdawson> From: Simon Dawson <spdawson@gmail.com>
 spdawson> Signed-off-by: Simon Dawson <spdawson@gmail.com>

Committed, thanks.
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 463d1b9..3bd7844 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -615,6 +615,7 @@  source "package/libxml2/Config.in"
 source "package/libxslt/Config.in"
 source "package/libyaml/Config.in"
 source "package/mxml/Config.in"
+source "package/rapidjson/Config.in"
 source "package/xerces/Config.in"
 source "package/yajl/Config.in"
 endmenu
diff --git a/package/rapidjson/Config.in b/package/rapidjson/Config.in
new file mode 100644
index 0000000..d442797
--- /dev/null
+++ b/package/rapidjson/Config.in
@@ -0,0 +1,6 @@ 
+config BR2_PACKAGE_RAPIDJSON
+	bool "rapidjson"
+	help
+	  A fast JSON parser/generator for C++ with both SAX/DOM style API.
+
+	  https://code.google.com/p/rapidjson/
diff --git a/package/rapidjson/rapidjson.mk b/package/rapidjson/rapidjson.mk
new file mode 100644
index 0000000..cc260e9
--- /dev/null
+++ b/package/rapidjson/rapidjson.mk
@@ -0,0 +1,34 @@ 
+#############################################################
+#
+# rapidjson
+#
+#############################################################
+
+RAPIDJSON_VERSION = 0.11
+RAPIDJSON_SOURCE = rapidjson-$(RAPIDJSON_VERSION).zip
+RAPIDJSON_SITE = http://rapidjson.googlecode.com/files
+RAPIDJSON_LICENSE = MIT
+RAPIDJSON_LICENSE_FILES = license.txt
+RAPIDJSON_INSTALL_TARGET = NO
+RAPIDJSON_INSTALL_STAGING = YES
+
+define RAPIDJSON_EXTRACT_CMDS
+	unzip -d $(@D) $(DL_DIR)/$(RAPIDJSON_SOURCE)
+	mv $(@D)/rapidjson/* $(@D)
+	$(RM) -r $(@D)/rapidjson
+endef
+
+define RAPIDJSON_INSTALL_STAGING_CMDS
+	$(INSTALL) -m 0755 -d $(STAGING_DIR)/usr/include/rapidjson
+	$(INSTALL) -m 0755 -d $(STAGING_DIR)/usr/include/rapidjson/internal
+	$(INSTALL) -m 0644 $(@D)/include/rapidjson/*.h \
+		$(STAGING_DIR)/usr/include/rapidjson
+	$(INSTALL) -m 0644 $(@D)/include/rapidjson/internal/*.h \
+		$(STAGING_DIR)/usr/include/rapidjson/internal
+endef
+
+define RAPIDJSON_UNINSTALL_STAGING_CMDS
+	$(RM) -r $(STAGING_DIR)/usr/include/rapidjson
+endef
+
+$(eval $(generic-package))