All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf
@ 2016-06-30 12:53 Tiago Brusamarello
  2016-06-30 12:53 ` [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package Tiago Brusamarello
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tiago Brusamarello @ 2016-06-30 12:53 UTC (permalink / raw)
  To: buildroot

This change allows use of python-protobuf libraries on the host, so
'protoc-gen-lua' plugin for the 'protoc' tool can be run on host.

Signed-off-by: Tiago Brusamarello <tiago.brusamarello@datacom.ind.br>
---
 package/python-protobuf/python-protobuf.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/python-protobuf/python-protobuf.mk b/package/python-protobuf/python-protobuf.mk
index d8be76d..b328e3e 100644
--- a/package/python-protobuf/python-protobuf.mk
+++ b/package/python-protobuf/python-protobuf.mk
@@ -14,3 +14,4 @@ PYTHON_PROTOBUF_SETUP_TYPE = setuptools
 PYTHON_PROTOBUF_SUBDIR = python
 
 $(eval $(python-package))
+$(eval $(host-python-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package
  2016-06-30 12:53 [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf Tiago Brusamarello
@ 2016-06-30 12:53 ` Tiago Brusamarello
  2016-07-16 10:01   ` Romain Naour
  2016-07-16 10:36   ` Thomas Petazzoni
  2016-06-30 12:53 ` [Buildroot] [PATCH 3/3] package/protobuf-lua: " Tiago Brusamarello
  2016-07-16  9:56 ` [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf Romain Naour
  2 siblings, 2 replies; 10+ messages in thread
From: Tiago Brusamarello @ 2016-06-30 12:53 UTC (permalink / raw)
  To: buildroot

This package adds support to compile Google's Protocol buffers
for use with Lua scripts. This tool is needed to allow use of the
'protobuf-lua' package.

Signed-off-by: Tiago Brusamarello <tiago.brusamarello@datacom.ind.br>
---
 package/Config.in                        |  1 +
 package/protoc-gen-lua/Config.in         |  6 ++++++
 package/protoc-gen-lua/protoc-gen-lua.mk | 19 +++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 package/protoc-gen-lua/Config.in
 create mode 100644 package/protoc-gen-lua/protoc-gen-lua.mk

diff --git a/package/Config.in b/package/Config.in
index e5ddc3e..715f8ab 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1299,6 +1299,7 @@ endif
 	source "package/poco/Config.in"
 	source "package/protobuf/Config.in"
 	source "package/protobuf-c/Config.in"
+	source "package/protoc-gen-lua/Config.in"
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
 	source "package/startup-notification/Config.in"
diff --git a/package/protoc-gen-lua/Config.in b/package/protoc-gen-lua/Config.in
new file mode 100644
index 0000000..9c71216
--- /dev/null
+++ b/package/protoc-gen-lua/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PROTOC_GEN_LUA
+	bool "protoc-gen-lua"
+	help
+		Code generator plugin to use Protocol Buffers from Lua scripts
+
+		https://github.com/djungelorm/protobuf-lua
diff --git a/package/protoc-gen-lua/protoc-gen-lua.mk b/package/protoc-gen-lua/protoc-gen-lua.mk
new file mode 100644
index 0000000..315f581
--- /dev/null
+++ b/package/protoc-gen-lua/protoc-gen-lua.mk
@@ -0,0 +1,19 @@
+################################################################################
+#
+# protoc-gen-lua
+#
+################################################################################
+
+PROTOC_GEN_LUA_VERSION = v1.1.1
+PROTOC_GEN_LUA_SITE = $(call github,djungelorm,protobuf-lua,$(PROTOC_GEN_LUA_VERSION))
+PROTOC_GEN_LUA_DEPENDENCIES = host-python-protobuf
+PROTOC_GEN_LUA_LICENSE = BSD-3c
+PROTOC_GEN_LUA_LICENSE_FILES = LICENSE
+
+define HOST_PROTOC_GEN_LUA_INSTALL_CMDS
+	# install protoc Lua plugin
+	$(INSTALL) -m 0755 $(@D)/protoc-plugin/plugin_pb2.py $(HOST_DIR)/usr/bin
+	$(INSTALL) -m 0755 $(@D)/protoc-plugin/protoc-gen-lua $(HOST_DIR)/usr/bin
+endef
+
+$(eval $(host-generic-package))
\ No newline at end of file
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 3/3] package/protobuf-lua: new package
  2016-06-30 12:53 [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf Tiago Brusamarello
  2016-06-30 12:53 ` [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package Tiago Brusamarello
@ 2016-06-30 12:53 ` Tiago Brusamarello
  2016-07-16 10:25   ` Romain Naour
  2016-07-16 10:39   ` Thomas Petazzoni
  2016-07-16  9:56 ` [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf Romain Naour
  2 siblings, 2 replies; 10+ messages in thread
From: Tiago Brusamarello @ 2016-06-30 12:53 UTC (permalink / raw)
  To: buildroot

This package adds support to use Google's Protocol buffers
from Lua scripts.

The original package from GitHub supports deployment as
a LuaRocks package, but the module name as set to 'protobuf'
and not 'protobuf-lua' which causes naming problems when
building it in Buildroot so the 'generick-package' method
was used instead.

This package depends on the 'protoc-gen-lua' plugin package
for generation of Protobuf messages types in Lua format.

Signed-off-by: Tiago Brusamarello <tiago.brusamarello@datacom.ind.br>
---
 package/Config.in                    |  1 +
 package/protobuf-lua/Config.in       |  7 +++++
 package/protobuf-lua/protobuf-lua.mk | 60 ++++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+)
 create mode 100644 package/protobuf-lua/Config.in
 create mode 100644 package/protobuf-lua/protobuf-lua.mk

diff --git a/package/Config.in b/package/Config.in
index 715f8ab..dc32465 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -548,6 +548,7 @@ menu "Lua libraries/modules"
 	source "package/luvi/Config.in"
 	source "package/lzlib/Config.in"
 	source "package/orbit/Config.in"
+	source "package/protobuf-lua/Config.in"
 	source "package/rings/Config.in"
 	source "package/turbolua/Config.in"
 	source "package/wsapi/Config.in"
diff --git a/package/protobuf-lua/Config.in b/package/protobuf-lua/Config.in
new file mode 100644
index 0000000..e602111
--- /dev/null
+++ b/package/protobuf-lua/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PROTOBUF_LUA
+	bool "protobuf-lua"
+	depends on BR2_PACKAGE_LUA_5_1 || BR2_PACKAGE_LUA_5_2
+	help
+		Runtime libraries to use Protocol Buffers from Lua scripts.
+
+		https://github.com/djungelorm/protobuf-lua
diff --git a/package/protobuf-lua/protobuf-lua.mk b/package/protobuf-lua/protobuf-lua.mk
new file mode 100644
index 0000000..1a6c693
--- /dev/null
+++ b/package/protobuf-lua/protobuf-lua.mk
@@ -0,0 +1,60 @@
+################################################################################
+#
+# protobuf-lua
+#
+################################################################################
+
+
+PROTOBUF_LUA_VERSION = v1.1.1
+PROTOBUF_LUA_SITE = $(call github,djungelorm,protobuf-lua,$(PROTOBUF_LUA_VERSION))
+PROTOBUF_LUA_DEPENDENCIES = luainterpreter host-protoc-gen-lua
+PROTOBUF_LUA_LICENSE = BSD-3c
+PROTOBUF_LUA_LICENSE_FILES = LICENSE
+
+define PROTOBUF_LUA_BUILD_CMDS
+	# build Lua Protobuf shared lib
+	$(TARGET_CC) -Os -shared -std=gnu99 -fPIC $(@D)/protobuf/pb.c -o $(@D)/protobuf/pb.so
+
+	# build Protobuf examples
+	PATH=$(BR_PATH) $(HOST_DIR)/usr/bin/protoc --lua_out=$(@D)/example --proto_path=$(@D)/example \
+		$(@D)/example/person.proto
+endef
+
+define PROTOBUF_LUA_INSTALL_TARGET_CMDS
+	# install Lua Protobuf support
+	mkdir -p $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/pb.so \
+		$(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf/pb.so
+	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/containers.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/decoder.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/descriptor.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/encoder.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/init.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/listener.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/text_format.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+	$(INSTALL) -m 0755 $(@D)/protobuf/wire_format.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
+
+	# install example files
+	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
+	$(INSTALL) -m 0755 $(@D)/example/person_pb.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
+	$(INSTALL) -m 0755 $(@D)/example/person.proto \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
+	$(INSTALL) -m 0755 $(@D)/example/test.lua \
+		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
+endef
+
+$(eval $(generic-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf
  2016-06-30 12:53 [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf Tiago Brusamarello
  2016-06-30 12:53 ` [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package Tiago Brusamarello
  2016-06-30 12:53 ` [Buildroot] [PATCH 3/3] package/protobuf-lua: " Tiago Brusamarello
@ 2016-07-16  9:56 ` Romain Naour
  2 siblings, 0 replies; 10+ messages in thread
From: Romain Naour @ 2016-07-16  9:56 UTC (permalink / raw)
  To: buildroot

Hi Tiago,

Le 30/06/2016 ? 14:53, Tiago Brusamarello a ?crit :
> This change allows use of python-protobuf libraries on the host, so
> 'protoc-gen-lua' plugin for the 'protoc' tool can be run on host.

Thanks for the improved commit log.

Reviewed-by: Romain Naour <romain.naour@gmail.com>

Best regards,
Romain

> 
> Signed-off-by: Tiago Brusamarello <tiago.brusamarello@datacom.ind.br>
> ---
>  package/python-protobuf/python-protobuf.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/python-protobuf/python-protobuf.mk b/package/python-protobuf/python-protobuf.mk
> index d8be76d..b328e3e 100644
> --- a/package/python-protobuf/python-protobuf.mk
> +++ b/package/python-protobuf/python-protobuf.mk
> @@ -14,3 +14,4 @@ PYTHON_PROTOBUF_SETUP_TYPE = setuptools
>  PYTHON_PROTOBUF_SUBDIR = python
>  
>  $(eval $(python-package))
> +$(eval $(host-python-package))
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package
  2016-06-30 12:53 ` [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package Tiago Brusamarello
@ 2016-07-16 10:01   ` Romain Naour
  2016-07-16 10:36   ` Thomas Petazzoni
  1 sibling, 0 replies; 10+ messages in thread
From: Romain Naour @ 2016-07-16 10:01 UTC (permalink / raw)
  To: buildroot

Hi Tiago,

Le 30/06/2016 ? 14:53, Tiago Brusamarello a ?crit :
> This package adds support to compile Google's Protocol buffers
> for use with Lua scripts. This tool is needed to allow use of the
> 'protobuf-lua' package.
> 
> Signed-off-by: Tiago Brusamarello <tiago.brusamarello@datacom.ind.br>
> ---
>  package/Config.in                        |  1 +
>  package/protoc-gen-lua/Config.in         |  6 ++++++
>  package/protoc-gen-lua/protoc-gen-lua.mk | 19 +++++++++++++++++++
>  3 files changed, 26 insertions(+)
>  create mode 100644 package/protoc-gen-lua/Config.in
>  create mode 100644 package/protoc-gen-lua/protoc-gen-lua.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index e5ddc3e..715f8ab 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1299,6 +1299,7 @@ endif
>  	source "package/poco/Config.in"
>  	source "package/protobuf/Config.in"
>  	source "package/protobuf-c/Config.in"
> +	source "package/protoc-gen-lua/Config.in"

protoc-gen-lua is a host package, so it mustn't be listed here.

>  	source "package/qhull/Config.in"
>  	source "package/qlibc/Config.in"
>  	source "package/startup-notification/Config.in"
> diff --git a/package/protoc-gen-lua/Config.in b/package/protoc-gen-lua/Config.in
> new file mode 100644
> index 0000000..9c71216
> --- /dev/null
> +++ b/package/protoc-gen-lua/Config.in

For the same reason, Config.in must be removed.
Config.in is intended for target packages only.

> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_PROTOC_GEN_LUA
> +	bool "protoc-gen-lua"
> +	help
> +		Code generator plugin to use Protocol Buffers from Lua scripts
> +
> +		https://github.com/djungelorm/protobuf-lua
> diff --git a/package/protoc-gen-lua/protoc-gen-lua.mk b/package/protoc-gen-lua/protoc-gen-lua.mk
> new file mode 100644
> index 0000000..315f581
> --- /dev/null
> +++ b/package/protoc-gen-lua/protoc-gen-lua.mk
> @@ -0,0 +1,19 @@
> +################################################################################
> +#
> +# protoc-gen-lua
> +#
> +################################################################################
> +
> +PROTOC_GEN_LUA_VERSION = v1.1.1
> +PROTOC_GEN_LUA_SITE = $(call github,djungelorm,protobuf-lua,$(PROTOC_GEN_LUA_VERSION))
> +PROTOC_GEN_LUA_DEPENDENCIES = host-python-protobuf
> +PROTOC_GEN_LUA_LICENSE = BSD-3c
> +PROTOC_GEN_LUA_LICENSE_FILES = LICENSE
> +
> +define HOST_PROTOC_GEN_LUA_INSTALL_CMDS
> +	# install protoc Lua plugin
> +	$(INSTALL) -m 0755 $(@D)/protoc-plugin/plugin_pb2.py $(HOST_DIR)/usr/bin
> +	$(INSTALL) -m 0755 $(@D)/protoc-plugin/protoc-gen-lua $(HOST_DIR)/usr/bin
> +endef
> +
> +$(eval $(host-generic-package))
> \ No newline at end of file

Please add a new line here.

Also, provide a hash file.

Best regards,
Romain


> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 3/3] package/protobuf-lua: new package
  2016-06-30 12:53 ` [Buildroot] [PATCH 3/3] package/protobuf-lua: " Tiago Brusamarello
@ 2016-07-16 10:25   ` Romain Naour
  2016-07-18 17:31     ` Tiago Brusamarello
  2016-07-16 10:39   ` Thomas Petazzoni
  1 sibling, 1 reply; 10+ messages in thread
From: Romain Naour @ 2016-07-16 10:25 UTC (permalink / raw)
  To: buildroot

Hi Tiago,

Le 30/06/2016 ? 14:53, Tiago Brusamarello a ?crit :
> This package adds support to use Google's Protocol buffers
> from Lua scripts.
> 
> The original package from GitHub supports deployment as
> a LuaRocks package, but the module name as set to 'protobuf'
> and not 'protobuf-lua' which causes naming problems when
> building it in Buildroot so the 'generick-package' method
s/generik/generic/

> was used instead.
> 
> This package depends on the 'protoc-gen-lua' plugin package
> for generation of Protobuf messages types in Lua format.
> 
> Signed-off-by: Tiago Brusamarello <tiago.brusamarello@datacom.ind.br>
> ---
>  package/Config.in                    |  1 +
>  package/protobuf-lua/Config.in       |  7 +++++
>  package/protobuf-lua/protobuf-lua.mk | 60 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 68 insertions(+)
>  create mode 100644 package/protobuf-lua/Config.in
>  create mode 100644 package/protobuf-lua/protobuf-lua.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index 715f8ab..dc32465 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -548,6 +548,7 @@ menu "Lua libraries/modules"
>  	source "package/luvi/Config.in"
>  	source "package/lzlib/Config.in"
>  	source "package/orbit/Config.in"
> +	source "package/protobuf-lua/Config.in"
>  	source "package/rings/Config.in"
>  	source "package/turbolua/Config.in"
>  	source "package/wsapi/Config.in"
> diff --git a/package/protobuf-lua/Config.in b/package/protobuf-lua/Config.in
> new file mode 100644
> index 0000000..e602111
> --- /dev/null
> +++ b/package/protobuf-lua/Config.in
> @@ -0,0 +1,7 @@
> +config BR2_PACKAGE_PROTOBUF_LUA
> +	bool "protobuf-lua"
> +	depends on BR2_PACKAGE_LUA_5_1 || BR2_PACKAGE_LUA_5_2

Why protobuf-lua depends on lua 5.1 and 5.2 only ?
What was the issue ?

Also, is protobuf-lua can be used with luajit ?
If yes, maybe you can use "depends on BR2_PACKAGE_HAS_LUAINTERPRETER" instead.

> +	help
> +		Runtime libraries to use Protocol Buffers from Lua scripts.
> +
> +		https://github.com/djungelorm/protobuf-lua

Indent with one tab and two space.

> diff --git a/package/protobuf-lua/protobuf-lua.mk b/package/protobuf-lua/protobuf-lua.mk
> new file mode 100644
> index 0000000..1a6c693
> --- /dev/null
> +++ b/package/protobuf-lua/protobuf-lua.mk
> @@ -0,0 +1,60 @@
> +################################################################################
> +#
> +# protobuf-lua
> +#
> +################################################################################
> +
> +

remove one empty line

> +PROTOBUF_LUA_VERSION = v1.1.1
> +PROTOBUF_LUA_SITE = $(call github,djungelorm,protobuf-lua,$(PROTOBUF_LUA_VERSION))
> +PROTOBUF_LUA_DEPENDENCIES = luainterpreter host-protoc-gen-lua

There is a missing dependency on host-protobuf which provide protoc

> +PROTOBUF_LUA_LICENSE = BSD-3c
> +PROTOBUF_LUA_LICENSE_FILES = LICENSE
> +
> +define PROTOBUF_LUA_BUILD_CMDS
> +	# build Lua Protobuf shared lib
> +	$(TARGET_CC) -Os -shared -std=gnu99 -fPIC $(@D)/protobuf/pb.c -o $(@D)/protobuf/pb.so
> +
> +	# build Protobuf examples
> +	PATH=$(BR_PATH) $(HOST_DIR)/usr/bin/protoc --lua_out=$(@D)/example --proto_path=$(@D)/example \
> +		$(@D)/example/person.proto
> +endef

protoc-gen-lua doesn't work with any host-python version:

host-python3:

Traceback (most recent call last):
  File "output/host/usr/bin/protoc-gen-lua", line 15, in <module>
    from cStringIO import StringIO
ImportError: No module named 'cStringIO'
--lua_out: protoc-gen-lua: Plugin failed with status code 1.

host-python2:

Traceback (most recent call last):
  File "output/host/usr/bin/protoc-gen-lua", line 17, in <module>
    import plugin_pb2
  File "output/host/usr/bin/plugin_pb2.py", line 3, in <module>
    from google.protobuf import descriptor
ImportError: No module named google.protobuf
--lua_out: protoc-gen-lua: Plugin failed with status code 1.

So, I've marked your patch as Changes Requested in patchwork. Feel free
to submit an updated version that takes into account the comments and fixed the
build issue.

Thanks!

Best regards,
Romain


> +
> +define PROTOBUF_LUA_INSTALL_TARGET_CMDS
> +	# install Lua Protobuf support
> +	mkdir -p $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/pb.so \
> +		$(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf/pb.so
> +	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/containers.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/decoder.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/descriptor.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/encoder.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/init.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/listener.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/text_format.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/wire_format.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +
> +	# install example files
> +	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
> +	$(INSTALL) -m 0755 $(@D)/example/person_pb.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
> +	$(INSTALL) -m 0755 $(@D)/example/person.proto \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
> +	$(INSTALL) -m 0755 $(@D)/example/test.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
> +endef
> +
> +$(eval $(generic-package))
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package
  2016-06-30 12:53 ` [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package Tiago Brusamarello
  2016-07-16 10:01   ` Romain Naour
@ 2016-07-16 10:36   ` Thomas Petazzoni
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-07-16 10:36 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 30 Jun 2016 09:53:37 -0300, Tiago Brusamarello wrote:

> +define HOST_PROTOC_GEN_LUA_INSTALL_CMDS
> +	# install protoc Lua plugin

Please put this comment above the variable definition.

> +	$(INSTALL) -m 0755 $(@D)/protoc-plugin/plugin_pb2.py $(HOST_DIR)/usr/bin
> +	$(INSTALL) -m 0755 $(@D)/protoc-plugin/protoc-gen-lua $(HOST_DIR)/usr/bin

Please use:

	$(INSTALL) -D -m 0755 $(@D)/protoc-plugin/protoc-gen-lua $(HOST_DIR)/usr/bin/protoc-gen-lua

(for both files)

I.e: use the -D option, and specify a full destination path.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 3/3] package/protobuf-lua: new package
  2016-06-30 12:53 ` [Buildroot] [PATCH 3/3] package/protobuf-lua: " Tiago Brusamarello
  2016-07-16 10:25   ` Romain Naour
@ 2016-07-16 10:39   ` Thomas Petazzoni
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-07-16 10:39 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 30 Jun 2016 09:53:38 -0300, Tiago Brusamarello wrote:

> +define PROTOBUF_LUA_BUILD_CMDS
> +	# build Lua Protobuf shared lib
> +	$(TARGET_CC) -Os -shared -std=gnu99 -fPIC $(@D)/protobuf/pb.c -o $(@D)/protobuf/pb.so
> +
> +	# build Protobuf examples
> +	PATH=$(BR_PATH) $(HOST_DIR)/usr/bin/protoc --lua_out=$(@D)/example --proto_path=$(@D)/example \
> +		$(@D)/example/person.proto
> +endef
> +
> +define PROTOBUF_LUA_INSTALL_TARGET_CMDS
> +	# install Lua Protobuf support
> +	mkdir -p $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf

Not needed if you use the -D option of $(INSTALL) and specify a full
destination path.

> +	$(INSTALL) -m 0755 $(@D)/protobuf/pb.so \
> +		$(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf/pb.so
> +	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf

Ditto/

> +	$(INSTALL) -m 0755 $(@D)/protobuf/containers.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/decoder.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/descriptor.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/encoder.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/init.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/listener.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/text_format.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
> +	$(INSTALL) -m 0755 $(@D)/protobuf/wire_format.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf

Could you replace this either with a copy of all *.lua files (if it's
OK), or otherwise by something like:

PROTOBUF_LUA_FILES = \
	decoder descriptor encoder \
	init listener ... ... ..

and then:

	$(foreach f,$(PROTOBUF_LUA_FILES),\
		$(INSTALL) -D -m 0755 $(@D)/protobuf/$(f).lua \
			$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/$(f).lua
	)

> +	# install example files
> +	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
> +	$(INSTALL) -m 0755 $(@D)/example/person_pb.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
> +	$(INSTALL) -m 0755 $(@D)/example/person.proto \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
> +	$(INSTALL) -m 0755 $(@D)/example/test.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example

We don't normally install examples to the target, so I think you could
get rid of those lines.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 3/3] package/protobuf-lua: new package
  2016-07-16 10:25   ` Romain Naour
@ 2016-07-18 17:31     ` Tiago Brusamarello
  2016-07-18 20:06       ` Romain Naour
  0 siblings, 1 reply; 10+ messages in thread
From: Tiago Brusamarello @ 2016-07-18 17:31 UTC (permalink / raw)
  To: buildroot

Hi Romain.

Em 16-07-2016 07:25, Romain Naour escreveu:
> Hi Tiago,
>
> Le 30/06/2016 ? 14:53, Tiago Brusamarello a ?crit :
>> This package adds support to use Google's Protocol buffers
>> from Lua scripts.
>>
>> The original package from GitHub supports deployment as
>> a LuaRocks package, but the module name as set to 'protobuf'
>> and not 'protobuf-lua' which causes naming problems when
>> building it in Buildroot so the 'generick-package' method
> s/generik/generic/
>
>> was used instead.
>>
>> This package depends on the 'protoc-gen-lua' plugin package
>> for generation of Protobuf messages types in Lua format.
>>
>> Signed-off-by: Tiago Brusamarello<tiago.brusamarello@datacom.ind.br>
>> ---
>>   package/Config.in                    |  1 +
>>   package/protobuf-lua/Config.in       |  7 +++++
>>   package/protobuf-lua/protobuf-lua.mk | 60 ++++++++++++++++++++++++++++++++++++
>>   3 files changed, 68 insertions(+)
>>   create mode 100644 package/protobuf-lua/Config.in
>>   create mode 100644 package/protobuf-lua/protobuf-lua.mk
>>
>> diff --git a/package/Config.in b/package/Config.in
>> index 715f8ab..dc32465 100644
>> --- a/package/Config.in
>> +++ b/package/Config.in
>> @@ -548,6 +548,7 @@ menu "Lua libraries/modules"
>>   	source "package/luvi/Config.in"
>>   	source "package/lzlib/Config.in"
>>   	source "package/orbit/Config.in"
>> +	source "package/protobuf-lua/Config.in"
>>   	source "package/rings/Config.in"
>>   	source "package/turbolua/Config.in"
>>   	source "package/wsapi/Config.in"
>> diff --git a/package/protobuf-lua/Config.in b/package/protobuf-lua/Config.in
>> new file mode 100644
>> index 0000000..e602111
>> --- /dev/null
>> +++ b/package/protobuf-lua/Config.in
>> @@ -0,0 +1,7 @@
>> +config BR2_PACKAGE_PROTOBUF_LUA
>> +	bool "protobuf-lua"
>> +	depends on BR2_PACKAGE_LUA_5_1 || BR2_PACKAGE_LUA_5_2
> Why protobuf-lua depends on lua 5.1 and 5.2 only ?
> What was the issue ?
It seems that the shared library 'pb.so' built by the package is only 
compatible
with Lua 5.2 and Lua 5.2.

> Also, is protobuf-lua can be used with luajit ?
> If yes, maybe you can use "depends on BR2_PACKAGE_HAS_LUAINTERPRETER" instead.
I can't tell you if it's compatible with 'luajit' or not.
>> +	help
>> +		Runtime libraries to use Protocol Buffers from Lua scripts.
>> +
>> +		https://github.com/djungelorm/protobuf-lua
> Indent with one tab and two space.
>
>> diff --git a/package/protobuf-lua/protobuf-lua.mk b/package/protobuf-lua/protobuf-lua.mk
>> new file mode 100644
>> index 0000000..1a6c693
>> --- /dev/null
>> +++ b/package/protobuf-lua/protobuf-lua.mk
>> @@ -0,0 +1,60 @@
>> +################################################################################
>> +#
>> +# protobuf-lua
>> +#
>> +################################################################################
>> +
>> +
> remove one empty line
>
>> +PROTOBUF_LUA_VERSION = v1.1.1
>> +PROTOBUF_LUA_SITE = $(call github,djungelorm,protobuf-lua,$(PROTOBUF_LUA_VERSION))
>> +PROTOBUF_LUA_DEPENDENCIES = luainterpreter host-protoc-gen-lua
> There is a missing dependency on host-protobuf which provide protoc
>
>> +PROTOBUF_LUA_LICENSE = BSD-3c
>> +PROTOBUF_LUA_LICENSE_FILES = LICENSE
>> +
>> +define PROTOBUF_LUA_BUILD_CMDS
>> +	# build Lua Protobuf shared lib
>> +	$(TARGET_CC) -Os -shared -std=gnu99 -fPIC $(@D)/protobuf/pb.c -o $(@D)/protobuf/pb.so
>> +
>> +	# build Protobuf examples
>> +	PATH=$(BR_PATH) $(HOST_DIR)/usr/bin/protoc --lua_out=$(@D)/example --proto_path=$(@D)/example \
>> +		$(@D)/example/person.proto
>> +endef
> protoc-gen-lua doesn't work with any host-python version:
>
> host-python3:
>
> Traceback (most recent call last):
>    File "output/host/usr/bin/protoc-gen-lua", line 15, in <module>
>      from cStringIO import StringIO
> ImportError: No module named 'cStringIO'
> --lua_out: protoc-gen-lua: Plugin failed with status code 1.
I guess it will not work whit Python 3 because the missing 'cStringIO '.
> host-python2:
>
> Traceback (most recent call last):
>    File "output/host/usr/bin/protoc-gen-lua", line 17, in <module>
>      import plugin_pb2
>    File "output/host/usr/bin/plugin_pb2.py", line 3, in <module>
>      from google.protobuf import descriptor
> ImportError: No module named google.protobuf
> --lua_out: protoc-gen-lua: Plugin failed with status code 1.
I've tested it with Python 2.7.11 and it worked well for me. Maybe this 
error is caused
by the missing dependency to 'host-protobuf'.

> So, I've marked your patch as Changes Requested in patchwork. Feel free
> to submit an updated version that takes into account the comments and fixed the
> build issue.
>
> Thanks!
>
> Best regards,
> Romain
>
>
>> +
>> +define PROTOBUF_LUA_INSTALL_TARGET_CMDS
>> +	# install Lua Protobuf support
>> +	mkdir -p $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/pb.so \
>> +		$(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf/pb.so
>> +	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/containers.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/decoder.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/descriptor.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/encoder.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/init.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/listener.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/text_format.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +	$(INSTALL) -m 0755 $(@D)/protobuf/wire_format.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>> +
>> +	# install example files
>> +	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
>> +	$(INSTALL) -m 0755 $(@D)/example/person_pb.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
>> +	$(INSTALL) -m 0755 $(@D)/example/person.proto \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
>> +	$(INSTALL) -m 0755 $(@D)/example/test.lua \
>> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
>> +endef
>> +
>> +$(eval $(generic-package))
>>
Best Regards,

Tiago.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 3/3] package/protobuf-lua: new package
  2016-07-18 17:31     ` Tiago Brusamarello
@ 2016-07-18 20:06       ` Romain Naour
  0 siblings, 0 replies; 10+ messages in thread
From: Romain Naour @ 2016-07-18 20:06 UTC (permalink / raw)
  To: buildroot

Hi Tiago,

Le 18/07/2016 ? 19:31, Tiago Brusamarello a ?crit :
> Hi Romain.
> 
> Em 16-07-2016 07:25, Romain Naour escreveu:
>> Hi Tiago,
>>
>> Le 30/06/2016 ? 14:53, Tiago Brusamarello a ?crit :
>>> This package adds support to use Google's Protocol buffers
>>> from Lua scripts.
>>>
>>> The original package from GitHub supports deployment as
>>> a LuaRocks package, but the module name as set to 'protobuf'
>>> and not 'protobuf-lua' which causes naming problems when
>>> building it in Buildroot so the 'generick-package' method
>> s/generik/generic/
>>
>>> was used instead.
>>>
>>> This package depends on the 'protoc-gen-lua' plugin package
>>> for generation of Protobuf messages types in Lua format.
>>>
>>> Signed-off-by: Tiago Brusamarello<tiago.brusamarello@datacom.ind.br>
>>> ---
>>>   package/Config.in                    |  1 +
>>>   package/protobuf-lua/Config.in       |  7 +++++
>>>   package/protobuf-lua/protobuf-lua.mk | 60 ++++++++++++++++++++++++++++++++++++
>>>   3 files changed, 68 insertions(+)
>>>   create mode 100644 package/protobuf-lua/Config.in
>>>   create mode 100644 package/protobuf-lua/protobuf-lua.mk
>>>
>>> diff --git a/package/Config.in b/package/Config.in
>>> index 715f8ab..dc32465 100644
>>> --- a/package/Config.in
>>> +++ b/package/Config.in
>>> @@ -548,6 +548,7 @@ menu "Lua libraries/modules"
>>>       source "package/luvi/Config.in"
>>>       source "package/lzlib/Config.in"
>>>       source "package/orbit/Config.in"
>>> +    source "package/protobuf-lua/Config.in"
>>>       source "package/rings/Config.in"
>>>       source "package/turbolua/Config.in"
>>>       source "package/wsapi/Config.in"
>>> diff --git a/package/protobuf-lua/Config.in b/package/protobuf-lua/Config.in
>>> new file mode 100644
>>> index 0000000..e602111
>>> --- /dev/null
>>> +++ b/package/protobuf-lua/Config.in
>>> @@ -0,0 +1,7 @@
>>> +config BR2_PACKAGE_PROTOBUF_LUA
>>> +    bool "protobuf-lua"
>>> +    depends on BR2_PACKAGE_LUA_5_1 || BR2_PACKAGE_LUA_5_2
>> Why protobuf-lua depends on lua 5.1 and 5.2 only ?
>> What was the issue ?
> It seems that the shared library 'pb.so' built by the package is only compatible
> with Lua 5.2 and Lua 5.2.

Then, can you add a comment about pd.so?

> 
>> Also, is protobuf-lua can be used with luajit ?
>> If yes, maybe you can use "depends on BR2_PACKAGE_HAS_LUAINTERPRETER" instead.
> I can't tell you if it's compatible with 'luajit' or not.

It's ok to disable luajit support now and if someone want to use it, it can be
enabled later with a followup patch.

>>> +    help
>>> +        Runtime libraries to use Protocol Buffers from Lua scripts.
>>> +
>>> +        https://github.com/djungelorm/protobuf-lua
>> Indent with one tab and two space.
>>
>>> diff --git a/package/protobuf-lua/protobuf-lua.mk
>>> b/package/protobuf-lua/protobuf-lua.mk
>>> new file mode 100644
>>> index 0000000..1a6c693
>>> --- /dev/null
>>> +++ b/package/protobuf-lua/protobuf-lua.mk
>>> @@ -0,0 +1,60 @@
>>> +################################################################################
>>>
>>> +#
>>> +# protobuf-lua
>>> +#
>>> +################################################################################
>>>
>>> +
>>> +
>> remove one empty line
>>
>>> +PROTOBUF_LUA_VERSION = v1.1.1
>>> +PROTOBUF_LUA_SITE = $(call
>>> github,djungelorm,protobuf-lua,$(PROTOBUF_LUA_VERSION))
>>> +PROTOBUF_LUA_DEPENDENCIES = luainterpreter host-protoc-gen-lua
>> There is a missing dependency on host-protobuf which provide protoc
>>
>>> +PROTOBUF_LUA_LICENSE = BSD-3c
>>> +PROTOBUF_LUA_LICENSE_FILES = LICENSE
>>> +
>>> +define PROTOBUF_LUA_BUILD_CMDS
>>> +    # build Lua Protobuf shared lib
>>> +    $(TARGET_CC) -Os -shared -std=gnu99 -fPIC $(@D)/protobuf/pb.c -o
>>> $(@D)/protobuf/pb.so
>>> +
>>> +    # build Protobuf examples
>>> +    PATH=$(BR_PATH) $(HOST_DIR)/usr/bin/protoc --lua_out=$(@D)/example
>>> --proto_path=$(@D)/example \
>>> +        $(@D)/example/person.proto
>>> +endef
>> protoc-gen-lua doesn't work with any host-python version:
>>
>> host-python3:
>>
>> Traceback (most recent call last):
>>    File "output/host/usr/bin/protoc-gen-lua", line 15, in <module>
>>      from cStringIO import StringIO
>> ImportError: No module named 'cStringIO'
>> --lua_out: protoc-gen-lua: Plugin failed with status code 1.
> I guess it will not work whit Python 3 because the missing 'cStringIO '.

It seems you're right "The StringIO and cStringIO modules are gone."
http://stackoverflow.com/questions/28200366/python-3-4-0-email-package-install-importerror-no-module-named-cstringio

>> host-python2:
>>
>> Traceback (most recent call last):
>>    File "output/host/usr/bin/protoc-gen-lua", line 17, in <module>
>>      import plugin_pb2
>>    File "output/host/usr/bin/plugin_pb2.py", line 3, in <module>
>>      from google.protobuf import descriptor
>> ImportError: No module named google.protobuf
>> --lua_out: protoc-gen-lua: Plugin failed with status code 1.
> I've tested it with Python 2.7.11 and it worked well for me. Maybe this error is
> caused
> by the missing dependency to 'host-protobuf'.

Well, I tried to build it with host-protobuf dependency fixed... not sure what's
going on.

I can retry when you send a new patch version.

Best regards,
Romain

> 
>> So, I've marked your patch as Changes Requested in patchwork. Feel free
>> to submit an updated version that takes into account the comments and fixed the
>> build issue.
>>
>> Thanks!
>>
>> Best regards,
>> Romain
>>
>>
>>> +
>>> +define PROTOBUF_LUA_INSTALL_TARGET_CMDS
>>> +    # install Lua Protobuf support
>>> +    mkdir -p $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/pb.so \
>>> +        $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf/pb.so
>>> +    mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/containers.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/decoder.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/descriptor.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/encoder.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/init.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/listener.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/text_format.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/type_checkers.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +    $(INSTALL) -m 0755 $(@D)/protobuf/wire_format.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf
>>> +
>>> +    # install example files
>>> +    mkdir -p
>>> $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
>>> +    $(INSTALL) -m 0755 $(@D)/example/person_pb.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
>>> +    $(INSTALL) -m 0755 $(@D)/example/person.proto \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
>>> +    $(INSTALL) -m 0755 $(@D)/example/test.lua \
>>> +        $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/example
>>> +endef
>>> +
>>> +$(eval $(generic-package))
>>>
> Best Regards,
> 
> Tiago.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-07-18 20:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-30 12:53 [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf Tiago Brusamarello
2016-06-30 12:53 ` [Buildroot] [PATCH 2/3] package/protoc-gen-lua: new package Tiago Brusamarello
2016-07-16 10:01   ` Romain Naour
2016-07-16 10:36   ` Thomas Petazzoni
2016-06-30 12:53 ` [Buildroot] [PATCH 3/3] package/protobuf-lua: " Tiago Brusamarello
2016-07-16 10:25   ` Romain Naour
2016-07-18 17:31     ` Tiago Brusamarello
2016-07-18 20:06       ` Romain Naour
2016-07-16 10:39   ` Thomas Petazzoni
2016-07-16  9:56 ` [Buildroot] [PATCH 1/3] package/python-protobuf: Allow generating host-python-protobuf Romain Naour

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.