python-protobuf: Add support for Python implementation of Google's Protocol Buffers
authorThiago Correa <thiago.correa@gmail.com>
Fri, 5 Oct 2012 09:36:03 +0000 (09:36 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Sun, 21 Oct 2012 19:54:38 +0000 (21:54 +0200)
Signed-off-by: Thiago A. Correa <thiago.correa@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/Config.in
package/python-protobuf/Config.in [new file with mode: 0644]
package/python-protobuf/python-protobuf.mk [new file with mode: 0644]

index 6842aab3820ee10ec5e2bf9010690abd646e7c7e..1650c71488693e5bbfe6519378ba433cdd638abe 100644 (file)
@@ -289,6 +289,7 @@ source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
 source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
+source "package/python-protobuf/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
diff --git a/package/python-protobuf/Config.in b/package/python-protobuf/Config.in
new file mode 100644 (file)
index 0000000..ec22057
--- /dev/null
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_PYTHON_PROTOBUF
+       bool "python-protobuf"
+       depends on BR2_PACKAGE_PYTHON
+       help
+         Python implementation of the Google Protocol Buffers.
+
+         Protocol buffers are Google's language-neutral, platform-neutral,
+         extensible mechanism for serializing structured data.
+
+         http://code.google.com/p/protobuf/
diff --git a/package/python-protobuf/python-protobuf.mk b/package/python-protobuf/python-protobuf.mk
new file mode 100644 (file)
index 0000000..d853dee
--- /dev/null
@@ -0,0 +1,28 @@
+#############################################################
+#
+# python-protobuf
+#
+#############################################################
+
+PYTHON_PROTOBUF_VERSION = $(PROTOBUF_VERSION)
+PYTHON_PROTOBUF_SOURCE  = $(PROTOBUF_SOURCE)
+PYTHON_PROTOBUF_SITE    = $(PROTOBUF_SITE)
+PYTHON_PROTOBUF_LICENSE = BSD-3c
+PYTHON_PROTOBUF_LICENSE_FILES = COPYING.txt
+
+PYTHON_PROTOBUF_DEPENDENCIES = python host-python-setuptools \
+        host-python-distutilscross host-protobuf
+
+define PYTHON_PROTOBUF_BUILD_CMDS
+       (cd $(@D)/python; \
+               PYTHONXCPREFIX="$(STAGING_DIR)/usr/" \
+               PATH=$(HOST_PATH) \
+       $(HOST_DIR)/usr/bin/python setup.py build -x)
+endef
+
+define PYTHON_PROTOBUF_INSTALL_TARGET_CMDS
+       (cd $(@D)/python; PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+       $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))