[Buildroot] [PATCH v2 3/3] package/protobuf-lua: new package
Thomas Petazzoni
thomas.petazzoni at free-electrons.com
Wed Jul 20 20:52:15 UTC 2016
Hello,
On Tue, 19 Jul 2016 09:31:13 -0300, Tiago Brusamarello wrote:
> 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.
Again, I already suggested that the naming conflict is not a good
enough reason, and can be resolved.
> diff --git a/package/protobuf-lua/Config.in b/package/protobuf-lua/Config.in
> new file mode 100644
> index 0000000..3c5274c
> --- /dev/null
> +++ b/package/protobuf-lua/Config.in
> @@ -0,0 +1,10 @@
> +config BR2_PACKAGE_PROTOBUF_LUA
> + bool "protobuf-lua"
> + depends on BR2_PACKAGE_LUA_5_1 || BR2_PACKAGE_LUA_5_2
> + depends on !BR2_PACKAGE_PYTHON3
depends on BR2_PACKAGE_PYTHON would be better here
> +PROTOBUF_LUA_VERSION = v1.1.1
> +PROTOBUF_LUA_SITE = $(call github,djungelorm,protobuf-lua,$(PROTOBUF_LUA_VERSION))
> +PROTOBUF_LUA_DEPENDENCIES = luainterpreter host-protobuf 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 Lua Protobuf examples
> + PATH=$(BR_PATH) $(HOST_DIR)/usr/bin/protoc --lua_out=$(@D)/example --proto_path=$(@D)/example \
> + $(@D)/example/person.proto
Why do you build examples? We generally don't care about building
example code in Buildroot.
> +endef
> +
> +PROTOBUF_LUA_FILES = \
> + containers decoder descriptor encoder init listener \
> + text_format type_checkers wire_format
> +
> +define PROTOBUF_LUA_INSTALL_TARGET_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/protobuf/pb.so \
> + $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/protobuf/pb.so
> +
> + $(foreach f,$(PROTOBUF_LUA_FILES),\
> + $(INSTALL) -D -m 0755 $(@D)/protobuf/$(f).lua \
> + $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/protobuf/$(f).lua
> + )
> +endef
> +
> +$(eval $(generic-package))
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
More information about the buildroot
mailing list