[Buildroot] [PATCH] package/middleclass: new package

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Jun 7 11:25:00 UTC 2016


Hello,

On Mon,  6 Jun 2016 15:04:09 +0200, Marcin Niestroj wrote:
> Signed-off-by: Marcin Niestroj <m.niestroj at grinn-global.com>

Thanks for this contribution! However I have a few comments, see below.

> diff --git a/package/middleclass/Config.in b/package/middleclass/Config.in
> new file mode 100644
> index 0000000..712064a
> --- /dev/null
> +++ b/package/middleclass/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_MIDDLECLASS
> +	bool "middleclass"
> +	depends on BR2_PACKAGE_HAS_LUAINTERPRETER

This dependency is not necessary, since you're already including
package/middleclass/Config.in within the following condition:

if BR2_PACKAGE_HAS_LUAINTERPRETER && !BR2_STATIC_LIBS

> diff --git a/package/middleclass/middleclass.mk b/package/middleclass/middleclass.mk
> new file mode 100644
> index 0000000..3e21452
> --- /dev/null
> +++ b/package/middleclass/middleclass.mk
> @@ -0,0 +1,18 @@
> +################################################################################
> +#
> +# middleclass
> +#
> +################################################################################
> +
> +MIDDLECLASS_VERSION = v4.0.0
> +MIDDLECLASS_SITE = $(call github,kikito,middleclass,$(MIDDLECLASS_VERSION))
> +MIDDLECLASS_DEPENDENCIES = luainterpreter
> +MIDDLECLASS_LICENSE = MIT
> +MIDDLECLASS_LICENSE_FILES = MIT-LICENSE.txt
> +
> +define MIDDLECLASS_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0644 -D $(@D)/middleclass.lua \
> +		$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/middleclass.lua
> +endef
> +
> +$(eval $(generic-package))

Could you use the luarocks package infrastructure instead? The
middleclass package is available in luarocks, and it greatly simplifies
the Lua packages. See the luaexpat package for an example. The
Buildroot manual also has extensive documentation about the luarocks
package infrastructure.

Thanks a lot!

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



More information about the buildroot mailing list