luainterpreter: create virtual package
PATCH v4 1/10 luainterpreter: create virtual package
luainterpreter is lua or luajit
--- package/Config.in | 1 + package/lbase64/Config.in | 1 + package/lbase64/lbase64.mk | 2 +- package/lua-ev/Config.in | 1 + package/lua-ev/lua-ev.mk | 2 +- package/lua-msgpack-native/Config.in | 1 + package/lua-msgpack-native/lua-msgpack-native.mk | 2 +- package/lua/Config.in | 1 + package/luacjson/Config.in | 1 + package/luacjson/luacjson.mk | 2 +- package/luaexpat/Config.in | 1 + package/luaexpat/luaexpat.mk | 2 +- package/luafilesystem/Config.in | 1 + package/luafilesystem/luafilesystem.mk | 2 +- package/luainterpreter/Config.in | 2 ++ package/luainterpreter/luainterpreter.mk | 18 ++++++++++++++++++ package/luajit/Config.in | 1 + package/luaposix/Config.in | 1 + package/luaposix/luaposix.mk | 2 +- package/luasec/Config.in | 1 + package/luasec/luasec.mk | 2 +- package/luasocket/Config.in | 1 + package/luasocket/luasocket.mk | 2 +- package/luasql/Config.in | 1 + package/luasql/luasql.mk | 2 +- package/rings/Config.in | 1 + package/rings/rings.mk | 2 +- 27 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 package/luainterpreter/Config.in create mode 100644 package/luainterpreter/luainterpreter.mk
package/Config.in +1 -0
@@ -352,6 +352,7 @@ source "package/haserl/Config.in" source "package/jamvm/Config.in" source "package/jimtcl/Config.in" source "package/lua/Config.in" +source "package/luainterpreter/Config.in" source "package/luajit/Config.in" if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT menu "Lua libraries/modules"
package/lbase64/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LBASE64 bool "lbase64" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help A base64 library for Lua
package/lbase64/lbase64.mk +1 -1
@@ -9,7 +9,7 @@ LBASE64_SITE = http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1 LBASE64_SOURCE = lbase64.tar.gz LBASE64_LICENSE = Public domain LBASE64_LICENSE_FILES = README -LBASE64_DEPENDENCIES = lua +LBASE64_DEPENDENCIES = luainterpreter define LBASE64_BUILD_CMDS $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
package/lua-ev/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUA_EV bool "lua-ev" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER select BR2_PACKAGE_LIBEV help Get access to the libev library from Lua.
package/lua-ev/lua-ev.mk +1 -1
@@ -6,7 +6,7 @@ LUA_EV_VERSION = 458165bdfe0c6eadc788813925f11a0e6a823845 LUA_EV_SITE = http://github.com/brimworks/lua-ev/tarball/$(LUA_EV_VERSION) -LUA_EV_DEPENDENCIES = lua libev +LUA_EV_DEPENDENCIES = luainterpreter libev LUA_EV_LICENSE = MIT LUA_EV_LICENSE_FILES = README LUA_EV_CONF_OPT = -DINSTALL_CMOD="/usr/lib/lua"
package/lua-msgpack-native/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUA_MSGPACK_NATIVE bool "lua-msgpack-native" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help This is a native, C language implementation of msgpack (http://msgpack.org) library/protocol for Lua language
package/lua-msgpack-native/lua-msgpack-native.mk +1 -1
@@ -6,7 +6,7 @@ LUA_MSGPACK_NATIVE_VERSION = 41cce91ab6b54e4426c6d626a0ac41a02ec2096d LUA_MSGPACK_NATIVE_SITE = http://github.com/kengonakajima/lua-msgpack-native/tarball/$(LUA_MSGPACK_NATIVE_VERSION) -LUA_MSGPACK_NATIVE_DEPENDENCIES = lua +LUA_MSGPACK_NATIVE_DEPENDENCIES = luainterpreter LUA_MSGPACK_NATIVE_LICENSE = Apache-2.0 LUA_MSGPACK_NATIVE_LICENSE_FILES = LICENSE.txt
package/lua/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUA bool "lua" + select BR2_PACKAGE_HAS_LUA_INTERPRETER help Lua is a powerful, fast, light-weight, embeddable scripting language.
package/luacjson/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUACJSON bool "luacjson" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help The Lua CJSON module provides JSON support for Lua. It features: - Fast, standards compliant encoding/parsing routines
package/luacjson/luacjson.mk +1 -1
@@ -7,7 +7,7 @@ LUACJSON_VERSION = 2.1.0 LUACJSON_SOURCE = lua-cjson-$(LUACJSON_VERSION).tar.gz LUACJSON_SITE = http://www.kyne.com.au/~mark/software/download -LUACJSON_DEPENDENCIES = lua +LUACJSON_DEPENDENCIES = luainterpreter LUACJSON_LICENSE = MIT LUACJSON_LICENSE_FILES = LICENSE
package/luaexpat/Config.in +1 -0
@@ -1,6 +1,7 @@ config BR2_PACKAGE_LUAEXPAT bool "luaexpat" select BR2_PACKAGE_EXPAT + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help LuaExpat is a SAX XML parser based on the Expat library.
package/luaexpat/luaexpat.mk +1 -1
@@ -6,7 +6,7 @@ LUAEXPAT_VERSION = 1.2.0 LUAEXPAT_SITE = http://matthewwild.co.uk/projects/luaexpat -LUAEXPAT_DEPENDENCIES = lua expat +LUAEXPAT_DEPENDENCIES = luainterpreter expat LUAEXPAT_LICENSE = MIT
package/luafilesystem/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUAFILESYSTEM bool "luafilesystem" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help LuaFileSystem offers a portable way to access the underlying directory structure and file attributes.
package/luafilesystem/luafilesystem.mk +1 -1
@@ -6,7 +6,7 @@ LUAFILESYSTEM_VERSION = 1.6.2 LUAFILESYSTEM_SITE = http://github.com/downloads/keplerproject/luafilesystem -LUAFILESYSTEM_DEPENDENCIES = lua +LUAFILESYSTEM_DEPENDENCIES = luainterpreter LUAFILESYSTEM_LICENSE = MIT ifeq ($(BR2_LARGEFILE),y)
package/luainterpreter/Config.in new file +2 -0
@@ -0,0 +1,2 @@ +config BR2_PACKAGE_HAS_LUA_INTERPRETER + bool
package/luainterpreter/luainterpreter.mk new file +18 -0
@@ -0,0 +1,18 @@ +############################################################# +# +# Virtual package for luainterpreter +# +############################################################# + +LUAINTERPRETER_VERSION = virtual +LUAINTERPRETER_SOURCE = + +ifeq ($(BR2_PACKAGE_LUA),y) +LUAINTERPRETER_DEPENDENCIES = lua +endif + +ifeq ($(BR2_PACKAGE_LUAJIT),y) +LUAINTERPRETER_DEPENDENCIES = luajit +endif + +$(eval $(generic-package))
package/luajit/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUAJIT bool "luajit" + select BR2_PACKAGE_HAS_LUA_INTERPRETER # Luajit is only available for some target architectures, and # has some complexity wrt 32/64. See luajit.mk for details. depends on BR2_i386 || (BR2_x86_64 && BR2_HOSTARCH='x86_64') || BR2_powerpc || BR2_arm || BR2_armeb
package/luaposix/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUAPOSIX bool "luaposix" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER select BR2_PACKAGE_LUABITOP if BR2_PACKAGE_LUA # LuaBitOp is already included in LuaJIT help
package/luaposix/luaposix.mk +1 -1
@@ -9,7 +9,7 @@ LUAPOSIX_SITE = https://github.com/luaposix/luaposix/archive LUAPOSIX_SOURCE = release-v$(LUAPOSIX_VERSION).tar.gz LUAPOSIX_LICENSE = MIT LUAPOSIX_LICENSE_FILES = COPYING -LUAPOSIX_DEPENDENCIES = lua host-lua +LUAPOSIX_DEPENDENCIES = luainterpreter host-lua LUAPOSIX_CONF_OPT = --libdir="/usr/lib/lua" --datarootdir="/usr/share/lua" ifeq ($(BR2_PACKAGE_NCURSES),y)
package/luasec/Config.in +1 -0
@@ -2,6 +2,7 @@ config BR2_PACKAGE_LUASEC bool "luasec" select BR2_PACKAGE_OPENSSL select BR2_PACKAGE_LUASOCKET + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help LuaSec is a binding for OpenSSL library to provide TLS/SSL communication.
package/luasec/luasec.mk +1 -1
@@ -8,7 +8,7 @@ LUASEC_VERSION = 0.4.1 LUASEC_SITE = http://www.inf.puc-rio.br/~brunoos/luasec/download/ LUASEC_LICENSE = MIT LUASEC_LICENSE_FILES = LICENSE -LUASEC_DEPENDENCIES = lua openssl +LUASEC_DEPENDENCIES = luainterpreter openssl define LUASEC_BUILD_CMDS $(MAKE) -C $(@D) CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
package/luasocket/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUASOCKET bool "luasocket" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help LuaSocket is the most comprehensive networking support library for the Lua language.
package/luasocket/luasocket.mk +1 -1
@@ -6,7 +6,7 @@ LUASOCKET_VERSION = 2.0.2 LUASOCKET_SITE = http://luaforge.net/frs/download.php/2664 -LUASOCKET_DEPENDENCIES = lua +LUASOCKET_DEPENDENCIES = luainterpreter LUASOCKET_LICENSE = MIT LUASOCKET_LICENSE_FILES = LICENSE
package/luasql/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUASQL bool "luasql" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help LuaSQL is a simple interface from Lua to a DBMS.
package/luasql/luasql.mk +1 -1
@@ -8,7 +8,7 @@ LUASQL_VERSION = v2.3.0 LUASQL_SITE = https://github.com/keplerproject/luasql/tarball/$(LUASQL_VERSION) LUASQL_LICENSE = MIT LUASQL_LICENSE_FILES = README -LUASQL_DEPENDENCIES = lua +LUASQL_DEPENDENCIES = luainterpreter LUASQL_MAKE_FLAGS = \ CC="$(TARGET_CC)" \
package/rings/Config.in +1 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_RINGS bool "rings" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help Provides a way to create new Lua states from within Lua.
package/rings/rings.mk +1 -1
@@ -6,7 +6,7 @@ RINGS_VERSION = 1.2.3 RINGS_SITE = http://github.com/downloads/keplerproject/rings -RINGS_DEPENDENCIES = lua +RINGS_DEPENDENCIES = luainterpreter RINGS_LICENSE = MIT define RINGS_BUILD_CMDS
Signature · 1 line
1.7.9.5
PATCH v4 2/10 luajit: allow to build Lua extensions without lua
--- package/luajit/luajit-05-install-inc.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 package/luajit/luajit-05-install-inc.patch
package/luajit/luajit-05-install-inc.patch new file +17 -0
@@ -0,0 +1,17 @@ +Install includes like lua's ones + +Signed-off-by: Francois Perrad <[email protected]> + +Index: b/Makefile +=================================================================== +--- a/Makefile ++++ b/Makefile +@@ -31,7 +31,7 @@ DPREFIX= $(DESTDIR)$(PREFIX) + INSTALL_BIN= $(DPREFIX)/bin + INSTALL_LIB= $(DPREFIX)/lib + INSTALL_SHARE= $(DPREFIX)/share +-INSTALL_INC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER) ++INSTALL_INC= $(DPREFIX)/include + + INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION) + INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit
Signature · 1 line
1.7.9.5
PATCH v4 2/10 luajit: allow to build Lua extensions without lua
Dear Francois Perrad,
Quoted 6 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- package/luajit/luajit-05-install-inc.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 package/luajit/luajit-05-install-inc.patch
I don't understand what are the consequence of this patch or why it is needed. Could you expand the commit log a little bit?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 2/10 luajit: allow to build Lua extensions without lua
2013/12/22 Thomas Petazzoni <[email protected]>:
Quoted 4 lines
Dear Francois Perrad,
Quoted 1 line · Francois Perrad
Quoted 9 lines
Quoted 5 lines
Signed-off-by Francois Perrad <[email protected]>--- package/luajit/luajit-05-install-inc.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 package/luajit/luajit-05-install-inc.patchI don't understand what are the consequence of this patch or why it is needed. Could you expand the commit log a little bit?
A Lua native module, like LuaFileSystem, needs the Lua includes at compile time. Both lua package and luajit package supply these files.
The lua package installs them in /usr/include, and luafilesystem, like other Lua modules, expects them at this place.
In LuaJIT upstream, these files are installed /usr/include/luajit-2.0.2 in order to not override the Lua ones if they are already installed.
Before the introduction of virtual package luainterpreter, luafilesystem depends on lua package.
Now, it depends on luainterpreter. When luainterpreter is supplied by luajit, the include from LuaJIT must be installed in the same place as Lua one's.
So, the patch luajit-05-install-inc.patch contains the comment :
"Install includes like lua's ones"
Fran?ois
Quoted 11 lines
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH v4 2/10 luajit: allow to build Lua extensions without lua
Dear Fran?ois Perrad,
Quoted 4 lines · Fran?ois Perrad
A Lua native module, like LuaFileSystem, needs the Lua includes at compile time. Both lua package and luajit package supply these files.
The lua package installs them in/usr/include, and luafilesystem, like other Lua modules, expects them at this place.
Quoted 8 lines
In LuaJIT upstream, these files are installed
/usr/include/luajit-2.0.2in order to not override the Lua ones if they are already installed.
Before the introduction of virtual package luainterpreter, luafilesystem depends on lua package.
Now, it depends on luainterpreter. When luainterpreter is supplied by luajit, the include from LuaJIT must be installed in the same place as Lua one's.
Ok, now it makes a lot of sense.
Quoted 2 lines
So, the patch luajit-05-install-inc.patch contains the comment :
"Install includes like lua's ones"
I think your patch description would have been immensely better if you had included an explanation like you did above!
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 3/10 lua: remove a too invasive patch
In reply to Francois Perradthe static version of luac is enough
--- package/lua/lua-03-shared-libs-for-luac.patch | 97 ------------------------- 1 file changed, 97 deletions(-) delete mode 100644 package/lua/lua-03-shared-libs-for-luac.patch
package/lua/lua-03-shared-libs-for-luac.patch deleted +0 -97
@@ -1,97 +0,0 @@ -Compile the luac binary with the shared library. -Many internal functions (LUAI_FUNC) must be exported (LUA_API). - -Signed-off-by: Francois Perrad <[email protected]> - -Index: b/src/ldo.h -=================================================================== ---- a/src/ldo.h -+++ b/src/ldo.h -@@ -46,7 +46,7 @@ - LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); - LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); - LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); --LUAI_FUNC void luaD_growstack (lua_State *L, int n); -+LUA_API void luaD_growstack (lua_State *L, int n); - - LUAI_FUNC void luaD_throw (lua_State *L, int errcode); - LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); -Index: b/src/lfunc.h -=================================================================== ---- a/src/lfunc.h -+++ b/src/lfunc.h -@@ -18,7 +18,7 @@ - cast(int, sizeof(TValue *)*((n)-1))) - - --LUAI_FUNC Proto *luaF_newproto (lua_State *L); -+LUA_API Proto *luaF_newproto (lua_State *L); - LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); - LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); - LUAI_FUNC UpVal *luaF_newupval (lua_State *L); -Index: b/src/lmem.h -=================================================================== ---- a/src/lmem.h -+++ b/src/lmem.h -@@ -38,9 +38,9 @@ - ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) - - --LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, -+LUA_API void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, - size_t size); --LUAI_FUNC void *luaM_toobig (lua_State *L); -+LUA_API void *luaM_toobig (lua_State *L); - LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, - size_t size_elem, int limit, - const char *errormsg); -Index: b/src/lstring.h -=================================================================== ---- a/src/lstring.h -+++ b/src/lstring.h -@@ -25,7 +25,7 @@ - - LUAI_FUNC void luaS_resize (lua_State *L, int newsize); - LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); --LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); -+LUA_API TString *luaS_newlstr (lua_State *L, const char *str, size_t l); - - - #endif -Index: b/src/lundump.h -=================================================================== ---- a/src/lundump.h -+++ b/src/lundump.h -@@ -17,7 +17,7 @@ - LUAI_FUNC void luaU_header (char* h); - - /* dump one chunk; from ldump.c */ --LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); -+LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); - - #ifdef luac_c - /* print one chunk; from print.c */ -Index: b/src/Makefile -=================================================================== ---- a/src/Makefile -+++ b/src/Makefile -@@ -34,7 +34,7 @@ - LUA_O= lua.o - - LUAC_T= luac --LUAC_O= luac.o print.o -+LUAC_O= luac.o print.o lopcodes.o - - ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) - ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T) -@@ -62,8 +62,8 @@ - $(LUA_T): $(LUA_O) $(LUA_SO) - $(CC) -o $@ -L. -llua $(MYLDFLAGS) $(LUA_O) $(LIBS) - --$(LUAC_T): $(LUAC_O) $(LUA_A) -- $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) -+$(LUAC_T): $(LUAC_O) $(LUA_SO) -+ $(CC) -o $@ -L. $(MYLDFLAGS) $(LUAC_O) -llua $(LIBS) - - clean: - $(RM) $(ALL_T) $(ALL_O)
Signature · 1 line
1.7.9.5
PATCH v4 3/10 lua: remove a too invasive patch
Dear Francois Perrad,
Quoted 7 lines · Francois Perrad
the static version of luac is enough
Signed-off-by Francois Perrad <[email protected]>--- package/lua/lua-03-shared-libs-for-luac.patch | 97 ------------------------- 1 file changed, 97 deletions(-) delete mode 100644 package/lua/lua-03-shared-libs-for-luac.patch
Peter, can you apply this patch right now? It is independent from the rest of the series, and would allow to reduce the size of the series.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 3/10 lua: remove a too invasive patch
Francois, All,
On 2013-12-22 18:24 +0100, Thomas Petazzoni spake thusly:
Quoted 10 lines · Francois Perrad
Quoted 7 lines
the static version of luac is enough
Signed-off-by Francois Perrad <[email protected]>--- package/lua/lua-03-shared-libs-for-luac.patch | 97 ------------------------- 1 file changed, 97 deletions(-) delete mode 100644 package/lua/lua-03-shared-libs-for-luac.patchReviewed-by Thomas Petazzoni <[email protected]>
Quoted 2 lines
Peter, can you apply this patch right now? It is independent from the rest of the series, and would allow to reduce the size of the series.
Yes, please! ;-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 4/10 lua*: restore version in module paths
In reply to Francois Perrad(like in upstream)
--- package/cgilua/cgilua.mk | 6 +++--- package/copas/copas.mk | 4 ++-- package/coxpcall/coxpcall.mk | 4 ++-- package/lbase64/lbase64.mk | 4 ++-- package/lua-ev/lua-ev.mk | 2 +- package/lua-msgpack-native/lua-msgpack-native.mk | 4 ++-- package/lua/lua-01-root-path.patch | 21 ++++----------------- package/luabitop/luabitop.mk | 5 ++--- package/luacjson/luacjson.mk | 4 ++-- package/luaexpat/luaexpat.mk | 10 +++++----- package/luaexpatutils/luaexpatutils.mk | 4 ++-- package/luafilesystem/luafilesystem.mk | 4 ++-- package/luajit/luajit-01-root-path.patch | 22 ---------------------- package/luaposix/luaposix.mk | 2 +- package/luasec/luasec.mk | 12 +++++------- package/luasocket/luasocket.mk | 16 ++++++++-------- package/luasql/luasql.mk | 7 +++---- package/orbit/orbit.mk | 2 +- package/rings/rings.mk | 7 +++---- package/wsapi/wsapi.mk | 6 +++--- package/xavante/xavante.mk | 10 ++++------ 21 files changed, 57 insertions(+), 99 deletions(-) delete mode 100644 package/luajit/luajit-01-root-path.patch
package/cgilua/cgilua.mk +3 -3
@@ -9,12 +9,12 @@ CGILUA_SITE = http://github.com/downloads/keplerproject/cgilua CGILUA_LICENSE = MIT define CGILUA_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) install LUA_DIR="$(TARGET_DIR)/usr/share/lua" + $(MAKE) PREFIX="$(TARGET_DIR)/usr" -C $(@D) install endef define CGILUA_UNINSTALL_TARGET_CMDS - rm -rf "$(TARGET_DIR)/usr/share/lua/cgilua" - rm -f "$(TARGET_DIR)/usr/share/lua/cgilua.lua" + rm -rf "$(TARGET_DIR)/usr/share/lua/5.1/cgilua" + rm -f "$(TARGET_DIR)/usr/share/lua/5.1/cgilua.lua" endef $(eval $(generic-package))
package/copas/copas.mk +2 -2
@@ -10,11 +10,11 @@ COPAS_LICENSE = MIT define COPAS_INSTALL_TARGET_CMDS $(INSTALL) -m 0644 -D $(@D)/src/copas/copas.lua \ - $(TARGET_DIR)/usr/share/lua/copas.lua + $(TARGET_DIR)/usr/share/lua/5.1/copas.lua endef define COPAS_UNINSTALL_TARGET_CMDS - rm -f "$(TARGET_DIR)/usr/share/lua/copas.lua" + rm -f "$(TARGET_DIR)/usr/share/lua/5.1/copas.lua" endef $(eval $(generic-package))
package/coxpcall/coxpcall.mk +2 -2
@@ -10,11 +10,11 @@ COXPCALL_LICENSE = MIT define COXPCALL_INSTALL_TARGET_CMDS $(INSTALL) -m 0644 -D $(@D)/src/coxpcall.lua \ - $(TARGET_DIR)/usr/share/lua/coxpcall.lua + $(TARGET_DIR)/usr/share/lua/5.1/coxpcall.lua endef define COXPCALL_UNINSTALL_TARGET_CMDS - rm -f "$(TARGET_DIR)/usr/share/lua/coxpcall.lua" + rm -f "$(TARGET_DIR)/usr/share/lua/5.1/coxpcall.lua" endef $(eval $(generic-package))
package/lbase64/lbase64.mk +2 -2
@@ -18,11 +18,11 @@ endef define LBASE64_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/base64.so \ - $(TARGET_DIR)/usr/lib/lua/base64.so + $(TARGET_DIR)/usr/lib/lua/5.1/base64.so endef define LBASE64_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/base64.so + rm -f $(TARGET_DIR)/usr/lib/lua/5.1/base64.so endef define LBASE64_CLEAN_CMDS
package/lua-ev/lua-ev.mk +1 -1
@@ -9,6 +9,6 @@ LUA_EV_SITE = http://github.com/brimworks/lua-ev/tarball/$(LUA_EV_VERSION) LUA_EV_DEPENDENCIES = luainterpreter libev LUA_EV_LICENSE = MIT LUA_EV_LICENSE_FILES = README -LUA_EV_CONF_OPT = -DINSTALL_CMOD="/usr/lib/lua" +LUA_EV_CONF_OPT = -DINSTALL_CMOD="/usr/lib/lua/5.1" $(eval $(cmake-package))
package/lua-msgpack-native/lua-msgpack-native.mk +2 -2
@@ -15,11 +15,11 @@ define LUA_MSGPACK_NATIVE_BUILD_CMDS endef define LUA_MSGPACK_NATIVE_INSTALL_TARGET_CMDS - $(INSTALL) -m 755 -D $(@D)/msgpack.so $(TARGET_DIR)/usr/lib/lua/msgpack.so + $(INSTALL) -m 755 -D $(@D)/msgpack.so $(TARGET_DIR)/usr/lib/lua/5.1/msgpack.so endef define LUA_MSGPACK_NATIVE_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/msgpack.so + rm -f $(TARGET_DIR)/usr/lib/lua/5.1/msgpack.so endef define LUA_MSGPACK_NATIVE_CLEAN_CMDS
package/lua/lua-01-root-path.patch +4 -17
@@ -1,5 +1,4 @@ Adjust installation location to /usr. -Remove version in module paths. Signed-off-by: Francois Perrad <[email protected]>
@@ -7,7 +6,7 @@ Index: b/etc/lua.pc =================================================================== --- a/etc/lua.pc +++ b/etc/lua.pc -@@ -8,13 +8,13 @@ +@@ -8,7 +8,7 @@ R= 5.1.5 # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
@@ -16,28 +15,16 @@ Index: b/etc/lua.pc INSTALL_BIN= ${prefix}/bin INSTALL_INC= ${prefix}/include INSTALL_LIB= ${prefix}/lib - INSTALL_MAN= ${prefix}/man/man1 --INSTALL_LMOD= ${prefix}/share/lua/${V} --INSTALL_CMOD= ${prefix}/lib/lua/${V} -+INSTALL_LMOD= ${prefix}/share/lua -+INSTALL_CMOD= ${prefix}/lib/lua - - # canonical vars - exec_prefix=${prefix} Index: b/src/luaconf.h =================================================================== --- a/src/luaconf.h +++ b/src/luaconf.h -@@ -94,9 +94,9 @@ +@@ -94,7 +94,7 @@ ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" #else -#define LUA_ROOT "/usr/local/" --#define LUA_LDIR LUA_ROOT "share/lua/5.1/" --#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" +#define LUA_ROOT "/usr/" -+#define LUA_LDIR LUA_ROOT "share/lua/" -+#define LUA_CDIR LUA_ROOT "lib/lua/" + #define LUA_LDIR LUA_ROOT "share/lua/5.1/" + #define LUA_CDIR LUA_ROOT "lib/lua/5.1/" #define LUA_PATH_DEFAULT \ - "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ - LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
package/luabitop/luabitop.mk +2 -3
@@ -12,12 +12,11 @@ LUABITOP_LICENSE_FILES = README LUABITOP_DEPENDENCIES = lua define LUABITOP_BUILD_CMDS - $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) + $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) INCLUDES="-I$(STAGING_DIR)/usr/include" endef define LUABITOP_INSTALL_TARGET_CMDS - mkdir -p $(TARGET_DIR)/usr/lib/lua - $(INSTALL) -p $(@D)/bit.so $(TARGET_DIR)/usr/lib/lua + $(INSTALL) -p $(@D)/bit.so $(TARGET_DIR)/usr/lib/lua/5.1 endef define LUABITOP_CLEAN_CMDS
package/luacjson/luacjson.mk +2 -2
@@ -21,7 +21,7 @@ define LUACJSON_BUILD_CMDS endef define LUACJSON_INSTALL_TARGET_CMDS - install -D -m 0644 $(@D)/cjson.so $(TARGET_DIR)/usr/lib/lua/cjson.so + $(MAKE) DESTDIR="$(TARGET_DIR)" PREFIX="/usr" -C $(@D) install endef define LUACJSON_CLEAN_CMDS
@@ -29,7 +29,7 @@ define LUACJSON_CLEAN_CMDS endef define LUACJSON_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/cjson.so + rm -f $(TARGET_DIR)/usr/lib/lua/5.1/cjson.so endef $(eval $(generic-package))
package/luaexpat/luaexpat.mk +5 -5
@@ -11,7 +11,7 @@ LUAEXPAT_LICENSE = MIT LUAEXPAT_MFLAGS += LUA_VERSION_NUM=501 -LUAEXPAT_MFLAGS += LUA_INC=$(STAGING_DIR)/usr/include/lua +LUAEXPAT_MFLAGS += LUA_INC=$(STAGING_DIR)/usr/include LUAEXPAT_MFLAGS += EXPAT_INC=$(STAGING_DIR)/usr/include LUAEXPAT_MFLAGS += LIBNAME=lxp.so LUAEXPAT_MFLAGS += LIB_OPTION="-shared -fPIC $(TARGET_CFLAGS)"
@@ -23,13 +23,13 @@ define LUAEXPAT_BUILD_CMDS endef define LUAEXPAT_INSTALL_TARGET_CMDS - $(INSTALL) -D $(@D)/src/lxp.so $(TARGET_DIR)/usr/lib/lua/lxp.so - $(INSTALL) -D -m 0644 $(@D)/src/lxp/lom.lua $(TARGET_DIR)/usr/share/lua/lxp/lom.lua + $(INSTALL) -D $(@D)/src/lxp.so $(TARGET_DIR)/usr/lib/lua/5.1/lxp.so + $(INSTALL) -D -m 0644 $(@D)/src/lxp/lom.lua $(TARGET_DIR)/usr/share/lua/5.1/lxp/lom.lua endef define LUAEXPAT_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/lxp.so - rm -f $(TARGET_DIR)/usr/share/lua/lxp/lom.lua + rm -f $(TARGET_DIR)/usr/lib/lua/5.1/lxp.so + rm -f $(TARGET_DIR)/usr/share/lua/5.1/lxp/lom.lua endef define LUAEXPAT_CLEAN_CMDS
package/luaexpatutils/luaexpatutils.mk +2 -2
@@ -11,11 +11,11 @@ LUAEXPATUTILS_DEPENDENCIES = luaexpat define LUAEXPATUTILS_INSTALL_TARGET_CMDS $(INSTALL) -m 0644 -D $(@D)/lua/doc.lua \ - $(TARGET_DIR)/usr/share/lua/lxp/doc.lua + $(TARGET_DIR)/usr/share/lua/5.1/lxp/doc.lua endef define LUAEXPATUTILS_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/share/lua/lxp/doc.lua + rm -f $(TARGET_DIR)/usr/share/lua/5.1/lxp/doc.lua endef $(eval $(generic-package))
package/luafilesystem/luafilesystem.mk +2 -2
@@ -18,11 +18,11 @@ define LUAFILESYSTEM_BUILD_CMDS endef define LUAFILESYSTEM_INSTALL_TARGET_CMDS - $(INSTALL) -D $(@D)/src/lfs.so $(TARGET_DIR)/usr/lib/lua/lfs.so + $(INSTALL) -D $(@D)/src/lfs.so $(TARGET_DIR)/usr/lib/lua/5.1/lfs.so endef define LUAFILESYSTEM_UNINSTALL_TARGET_CMDS - rm -f "$(TARGET_DIR)/usr/lib/lua/lfs.so" + rm -f "$(TARGET_DIR)/usr/lib/lua/5.1/lfs.so" endef define LUAFILESYSTEM_CLEAN_CMDS
package/luajit/luajit-01-root-path.patch deleted +0 -22
@@ -1,22 +0,0 @@ -Adjust installation location to /usr - -Signed-off-by: Francois Perrad <[email protected]> -Signed-off-by: Thomas Petazzoni <[email protected]> - -Index: b/src/luaconf.h -=================================================================== ---- a/src/luaconf.h -+++ b/src/luaconf.h -@@ -26,9 +26,9 @@ - ** Note to distribution maintainers: do NOT patch the following line! - ** Please read ../doc/install.html#distro and pass PREFIX=/usr instead. - */ --#define LUA_ROOT "/usr/local/" --#define LUA_LDIR LUA_ROOT "share/lua/5.1/" --#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" -+#define LUA_ROOT "/usr/" -+#define LUA_LDIR LUA_ROOT "share/lua/" -+#define LUA_CDIR LUA_ROOT "lib/lua/" - #ifdef LUA_XROOT - #define LUA_JDIR LUA_XROOT "share/luajit-2.0.0/" - #define LUA_XPATH \
package/luaposix/luaposix.mk +1 -1
@@ -10,7 +10,7 @@ LUAPOSIX_SOURCE = release-v$(LUAPOSIX_VERSION).tar.gz LUAPOSIX_LICENSE = MIT LUAPOSIX_LICENSE_FILES = COPYING LUAPOSIX_DEPENDENCIES = luainterpreter host-lua -LUAPOSIX_CONF_OPT = --libdir="/usr/lib/lua" --datarootdir="/usr/share/lua" +LUAPOSIX_CONF_OPT = --libdir="/usr/lib/lua/5.1" --datarootdir="/usr/share/lua/5.1" ifeq ($(BR2_PACKAGE_NCURSES),y) LUAPOSIX_DEPENDENCIES += ncurses
package/luasec/luasec.mk +5 -7
@@ -17,17 +17,15 @@ define LUASEC_BUILD_CMDS endef define LUASEC_INSTALL_TARGET_CMDS - mkdir -p $(TARGET_DIR)/usr/share/lua - mkdir -p $(TARGET_DIR)/usr/lib/lua $(MAKE) -C $(@D) \ - LUAPATH="$(TARGET_DIR)/usr/share/lua" \ - LUACPATH="$(TARGET_DIR)/usr/lib/lua" install + LUAPATH="$(TARGET_DIR)/usr/share/lua/5.1" \ + LUACPATH="$(TARGET_DIR)/usr/lib/lua/5.1" install endef define LUASEC_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/ssl.so - rm -rf $(TARGET_DIR)/usr/share/lua/ssl - rm -f $(TARGET_DIR)/usr/share/lua/ssl.lua + rm -f $(TARGET_DIR)/usr/lib/lua/5.1/ssl.so + rm -rf $(TARGET_DIR)/usr/share/lua/5.1/ssl + rm -f $(TARGET_DIR)/usr/share/lua/5.1/ssl.lua endef $(eval $(generic-package))
package/luasocket/luasocket.mk +8 -8
@@ -18,17 +18,17 @@ endef define LUASOCKET_INSTALL_TARGET_CMDS $(MAKE) -C $(@D) -f makefile \ - INSTALL_TOP_SHARE="$(TARGET_DIR)/usr/share/lua" \ - INSTALL_TOP_LIB="$(TARGET_DIR)/usr/lib/lua" install + INSTALL_TOP_SHARE="$(TARGET_DIR)/usr/share/lua/5.1" \ + INSTALL_TOP_LIB="$(TARGET_DIR)/usr/lib/lua/5.1" install endef define LUASOCKET_UNINSTALL_TARGET_CMDS - rm -rf "$(TARGET_DIR)/usr/lib/lua/mime" - rm -rf "$(TARGET_DIR)/usr/lib/lua/socket" - rm -rf "$(TARGET_DIR)/usr/share/lua/socket" - rm -f "$(TARGET_DIR)/usr/share/lua/socket.lua" - rm -f "$(TARGET_DIR)/usr/share/lua/mime.lua" - rm -f "$(TARGET_DIR)/usr/share/lua/ltn12.lua" + rm -rf "$(TARGET_DIR)/usr/lib/lua/5.1/mime" + rm -rf "$(TARGET_DIR)/usr/lib/lua/5.1/socket" + rm -rf "$(TARGET_DIR)/usr/share/lua/5.1/socket" + rm -f "$(TARGET_DIR)/usr/share/lua/5.1/socket.lua" + rm -f "$(TARGET_DIR)/usr/share/lua/5.1/mime.lua" + rm -f "$(TARGET_DIR)/usr/share/lua/5.1/ltn12.lua" endef define LUASOCKET_CLEAN_CMDS
package/luasql/luasql.mk +3 -4
@@ -27,13 +27,12 @@ define LUASQL_BUILD_CMDS endef define LUASQL_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) $(LUASQL_MAKE_FLAGS) PREFIX=/usr \ - LUA_DIR="$(TARGET_DIR)/usr/share/lua" \ - LUA_LIBDIR="$(TARGET_DIR)/usr/lib/lua" install + $(MAKE) -C $(@D) $(LUASQL_MAKE_FLAGS) \ + PREFIX="$(TARGET_DIR)/usr" install endef define LUASQL_UNINSTALL_TARGET_CMDS - rm -rf $(TARGET_DIR)/usr/lib/lua/luasql + rm -rf $(TARGET_DIR)/usr/lib/lua/5.1/luasql endef $(eval $(generic-package))
package/orbit/orbit.mk +1 -1
@@ -11,7 +11,7 @@ ORBIT_LICENSE_FILES = doc/us/license.md define ORBIT_INSTALL_TARGET_CMDS $(MAKE) -C $(@D) \ - LUA_DIR=$(TARGET_DIR)/usr/share/lua/ \ + LUA_DIR=$(TARGET_DIR)/usr/share/lua/5.1/ \ BIN_DIR=$(TARGET_DIR)/usr/bin \ install endef
package/rings/rings.mk +3 -4
@@ -14,13 +14,12 @@ define RINGS_BUILD_CMDS endef define RINGS_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) LUA_LIBDIR="$(TARGET_DIR)/usr/lib/lua" \ - LUA_DIR="$(TARGET_DIR)/usr/share/lua" install + $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)/usr" install endef define RINGS_UNINSTALL_TARGET_CMDS - rm -f "$(TARGET_DIR)/usr/lib/lua/rings.so" - rm -f "$(TARGET_DIR)/usr/share/lua/stable.lua" + rm -f "$(TARGET_DIR)/usr/lib/lua/5.1/rings.so" + rm -f "$(TARGET_DIR)/usr/share/lua/5.1/stable.lua" endef define RINGS_CLEAN_CMDS
package/wsapi/wsapi.mk +3 -3
@@ -9,13 +9,13 @@ WSAPI_SITE = http://github.com/downloads/keplerproject/wsapi WSAPI_LICENSE = MIT define WSAPI_INSTALL_TARGET_CMDS - mkdir -p $(TARGET_DIR)/usr/share/lua/wsapi + mkdir -p $(TARGET_DIR)/usr/share/lua/5.1/wsapi $(INSTALL) -m 0644 -D $(@D)/src/wsapi/*.lua \ - $(TARGET_DIR)/usr/share/lua/wsapi + $(TARGET_DIR)/usr/share/lua/5.1/wsapi endef define WSAPI_UNINSTALL_TARGET_CMDS - rm -rf "$(TARGET_DIR)/usr/share/lua/wsapi" + rm -rf "$(TARGET_DIR)/usr/share/lua/5.1/wsapi" endef $(eval $(generic-package))
package/xavante/xavante.mk +4 -6
@@ -9,15 +9,13 @@ XAVANTE_SITE = http://github.com/downloads/keplerproject/xavante XAVANTE_LICENSE = MIT define XAVANTE_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) PREFIX=/usr \ - LUA_DIR="$(TARGET_DIR)/usr/share/lua" \ - LUA_LIBDIR="$(TARGET_DIR)/usr/lib/lua" install + $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)/usr" install endef define XAVANTE_UNINSTALL_TARGET_CMDS - rm -rf "$(TARGET_DIR)/usr/share/xavante" - rm -f "$(TARGET_DIR)/usr/share/xavante.lua" - rm -f "$(TARGET_DIR)/usr/share/sajax.lua" + rm -rf "$(TARGET_DIR)/usr/share/5.1/xavante" + rm -f "$(TARGET_DIR)/usr/share/5.1/xavante.lua" + rm -f "$(TARGET_DIR)/usr/share/5.1/sajax.lua" endef $(eval $(generic-package))
Signature · 1 line
1.7.9.5
PATCH v4 4/10 lua*: restore version in module paths
Dear Francois Perrad,
Quoted 19 lines · Francois Perrad
(like in upstream)
Signed-off-by Francois Perrad <[email protected]>--- package/cgilua/cgilua.mk | 6 +++--- package/copas/copas.mk | 4 ++-- package/coxpcall/coxpcall.mk | 4 ++-- package/lbase64/lbase64.mk | 4 ++-- package/lua-ev/lua-ev.mk | 2 +- package/lua-msgpack-native/lua-msgpack-native.mk | 4 ++-- package/lua/lua-01-root-path.patch | 21 ++++----------------- package/luabitop/luabitop.mk | 5 ++--- package/luacjson/luacjson.mk | 4 ++-- package/luaexpat/luaexpat.mk | 10 +++++----- package/luaexpatutils/luaexpatutils.mk | 4 ++-- package/luafilesystem/luafilesystem.mk | 4 ++-- package/luajit/luajit-01-root-path.patch | 22 ---------------------- package/luaposix/luaposix.mk | 2 +- package/luasec/luasec.mk | 12 +++++-------
Quoted 8 lines
package/luasocket/luasocket.mk | 16 ++++++++-------- package/luasql/luasql.mk | 7 +++---- package/orbit/orbit.mk | 2 +- package/rings/rings.mk | 7 +++---- package/wsapi/wsapi.mk | 6 +++--- package/xavante/xavante.mk | 10 ++++------ 21 files changed, 57 insertions(+), 99 deletions(-) delete mode 100644 package/luajit/luajit-01-root-path.patch
Is this patch really necessary, since in the next patches you remove all of this code when converting the Lua packages to the Lua package infrastructure?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 5/10 luarocks: new package
In reply to Francois Perrad--- package/luarocks/luarocks-build-minimal.patch | 17 ++++++++++ package/luarocks/luarocks-unpack.patch | 24 ++++++++++++++ package/luarocks/luarocks.mk | 42 +++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 package/luarocks/luarocks-build-minimal.patch create mode 100644 package/luarocks/luarocks-unpack.patch create mode 100644 package/luarocks/luarocks.mk
package/luarocks/luarocks-build-minimal.patch new file +17 -0
@@ -0,0 +1,17 @@ +hack for buildroot which needs independant steps : download, unpack, build + +Signed-off-by: Francois Perrad <[email protected]> + +Index: b/src/luarocks/build.lua +=================================================================== +--- a/src/luarocks/build.lua ++++ b/src/luarocks/build.lua +@@ -362,6 +362,8 @@ + + if flags["pack-binary-rock"] then + return pack.pack_binary_rock(name, version, do_build, name, version, deps.get_deps_mode(flags)) ++ elseif flags["minimal"] then ++ return build_rockspec(name, false, true, "none") + else + local ok, err = fs.check_command_permissions(flags) + if not ok then return nil, err end
package/luarocks/luarocks-unpack.patch new file +24 -0
@@ -0,0 +1,24 @@ +allows unpack in existing directory + +Signed-off-by: Francois Perrad <[email protected]> + +Index: b/src/luarocks/unpack.lua +=================================================================== +--- a/src/luarocks/unpack.lua ++++ b/src/luarocks/unpack.lua +@@ -101,11 +101,10 @@ + return nil, file.." does not seem to be a valid filename." + end + +- if (fs.exists(dir_name)) then +- return nil, "Directory "..dir_name.." already exists." ++ if not fs.exists(dir_name) then ++ local ok, err = fs.make_dir(dir_name) ++ if not ok then return nil, err end + end +- local ok, err = fs.make_dir(dir_name) +- if not ok then return nil, err end + local rollback = util.schedule_function(fs.delete, fs.absolute_name(dir_name)) + + local rockspec, err +
package/luarocks/luarocks.mk new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v4 5/10 luarocks: new package
Dear Francois Perrad,
Quoted 5 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- package/luarocks/luarocks-build-minimal.patch | 17 ++++++++++ package/luarocks/luarocks-unpack.patch | 24 ++++++++++++++
We want patches to be numbered:
luarocks-001-<foo>.patch
luarocks-002-<bar>.patch
This guarantees that they are applied in the right order.
Quoted 49 lines
package/luarocks/luarocks.mk | 42 +++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 package/luarocks/luarocks-build-minimal.patch create mode 100644 package/luarocks/luarocks-unpack.patch create mode 100644 package/luarocks/luarocks.mkpackage/luarocks/luarocks-build-minimal.patch new file +17
-0@@ -0,0 +1,17 @@ +hack for buildroot which needs independant steps : download, unpack, build + +Signed-off-by: Francois Perrad <[email protected]> + +Index: b/src/luarocks/build.lua +=================================================================== +--- a/src/luarocks/build.lua ++++ b/src/luarocks/build.lua +@@ -362,6 +362,8 @@ + + if flags["pack-binary-rock"] then + return pack.pack_binary_rock(name, version, do_build, name, version, deps.get_deps_mode(flags)) ++ elseif flags["minimal"] then ++ return build_rockspec(name, false, true, "none") + else + local ok, err = fs.check_command_permissions(flags) + if not ok then return nil, err endpackage/luarocks/luarocks-unpack.patch new file +14
-0@@ -0,0 +1,24 @@ +allows unpack in existing directory + +Signed-off-by: Francois Perrad <[email protected]> + +Index: b/src/luarocks/unpack.lua +=================================================================== +--- a/src/luarocks/unpack.lua ++++ b/src/luarocks/unpack.lua +@@ -101,11 +101,10 @@ + return nil, file.." does not seem to be a valid filename." + end + +- if (fs.exists(dir_name)) then +- return nil, "Directory "..dir_name.." already exists."
package/luarocks/luarocks-unpack.patch line 24
Quoted 10 lines
package/luarocks/luarocks-unpack.patch new file +10
-0++ if not fs.exists(dir_name) then ++ local ok, err = fs.make_dir(dir_name) ++ if not ok then return nil, err end + end +- local ok, err = fs.make_dir(dir_name) +- if not ok then return nil, err end + local rollback = util.schedule_function(fs.delete, fs.absolute_name(dir_name)) + + local rockspec, err +
Any chance these patches make it their way upstream?
Quoted 20 lines
package/luarocks/luarocks.mk new file +14
-0@@ -0,0 +1,42 @@ +################################################################################ +# +# luarocks +# +################################################################################ + +LUAROCKS_VERSION = 2.1.1 +LUAROCKS_SITE = http://luarocks.org/releases/ +LUAROCKS_LICENSE = MIT +LUAROCKS_LICENSE_FILES = COPYING + +HOST_LUAROCKS_DEPENDENCIES = host-lua luainterpreter + +LUAROCKS_CONFIG_DIR = $(HOST_DIR)/usr/etc/luarocks
package/luarocks/luarocks.mk line 24
Quoted 10 lines
package/luarocks/luarocks.mk new file +10
-0+LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/config-5.1.lua + +define HOST_LUAROCKS_CONFIGURE_CMDS + cd $(@D) && ./configure \ + --prefix=$(TARGET_DIR)/usr \ + --sysconfdir=$(LUAROCKS_CONFIG_DIR) \ + --with-lua=$(HOST_DIR)/usr \ + --with-lua-include=$(STAGING_DIR)/usr/include \ + --with-lua-lib=$(STAGING_DIR)/usr/lib + @echo "$(@D)/config.unix generated"
This echo is probably not needed.
Quoted 8 lines
package/luarocks/luarocks.mk new file +8
-0+endef + +define HOST_LUAROCKS_INSTALL_CMDS + $(MAKE1) -C $(@D) install \ + PREFIX=$(HOST_DIR)/usr + echo "-- BR cross-compilation" >> $(LUAROCKS_CONFIG_FILE) + echo "variables = {" >> $(LUAROCKS_CONFIG_FILE) + echo " CC = [[$(TARGET_CC)]]," >> $(LUAROCKS_CONFIG_FILE)
package/luarocks/luarocks.mk line 42
Quoted 10 lines
package/luarocks/luarocks.mk new file +10
-0+ echo " LD = [[$(TARGET_CC)]]," >> $(LUAROCKS_CONFIG_FILE) + echo " CFLAGS = [[$(TARGET_CFLAGS)]]," >> $(LUAROCKS_CONFIG_FILE) + echo " LIBFLAG = [[-shared $(TARGET_LDFLAGS)]]," >> $(LUAROCKS_CONFIG_FILE) + echo "}" >> $(LUAROCKS_CONFIG_FILE) + echo "external_deps_dirs = { [[$(STAGING_DIR)/usr]] }" >> $(LUAROCKS_CONFIG_FILE) + echo "gcc_rpath = false" >> $(LUAROCKS_CONFIG_FILE) +endef + +$(eval $(host-generic-package)) +
Other than that, it looks ok to me.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 5/10 luarocks: new package
Francois, All,
On 2013-12-22 18:28 +0100, Thomas Petazzoni spake thusly:
Quoted 11 lines · Francois Perrad
Quoted 5 lines
Signed-off-by Francois Perrad <[email protected]>--- package/luarocks/luarocks-build-minimal.patch | 17 ++++++++++ package/luarocks/luarocks-unpack.patch | 24 ++++++++++++++We want patches to be numbered:
luarocks-001-<foo>.patch
luarocks-002-<bar>.patch
Done.
[--SNIP--]
Quoted 24 lines
Quoted 24 lines
package/luarocks/luarocks.mk new file +18
-0@@ -0,0 +1,42 @@ +################################################################################ +# +# luarocks +# +################################################################################ + +LUAROCKS_VERSION = 2.1.1 +LUAROCKS_SITE = http://luarocks.org/releases/ +LUAROCKS_LICENSE = MIT +LUAROCKS_LICENSE_FILES = COPYING + +HOST_LUAROCKS_DEPENDENCIES = host-lua luainterpreter + +LUAROCKS_CONFIG_DIR = $(HOST_DIR)/usr/etc/luarocks +LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/config-5.1.lua + +define HOST_LUAROCKS_CONFIGURE_CMDS + cd $(@D) && ./configure \
Quoted 8 lines
package/luarocks/luarocks.mk line 24
Quoted 6 lines
package/luarocks/luarocks.mk new file +6
-0+ --prefix=$(TARGET_DIR)/usr \ + --sysconfdir=$(LUAROCKS_CONFIG_DIR) \ + --with-lua=$(HOST_DIR)/usr \ + --with-lua-include=$(STAGING_DIR)/usr/include \ + --with-lua-lib=$(STAGING_DIR)/usr/lib + @echo "$(@D)/config.unix generated"This echo is probably not needed.
Done.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 5/10 luarocks: new package
In reply to Thomas Petazzoni2013/12/22 Thomas Petazzoni <[email protected]>:
Quoted 69 lines
Dear Francois Perrad,
Quoted 5 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- package/luarocks/luarocks-build-minimal.patch | 17 ++++++++++ package/luarocks/luarocks-unpack.patch | 24 ++++++++++++++We want patches to be numbered:
luarocks-001-<foo>.patch
luarocks-002-<bar>.patchThis guarantees that they are applied in the right order.
Quoted 53 lines
package/luarocks/luarocks.mk | 42 +++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 package/luarocks/luarocks-build-minimal.patch create mode 100644 package/luarocks/luarocks-unpack.patch create mode 100644 package/luarocks/luarocks.mkpackage/luarocks/luarocks-build-minimal.patch new file +17
-0@@ -0,0 +1,17 @@ +hack for buildroot which needs independant steps : download, unpack, build + +Signed-off-by: Francois Perrad <[email protected]> + +Index: b/src/luarocks/build.lua +=================================================================== +--- a/src/luarocks/build.lua ++++ b/src/luarocks/build.lua +@@ -362,6 +362,8 @@ + + if flags["pack-binary-rock"] then + return pack.pack_binary_rock(name, version, do_build, name, version, deps.get_deps_mode(flags)) ++ elseif flags["minimal"] then ++ return build_rockspec(name, false, true, "none") + else + local ok, err = fs.check_command_permissions(flags) + if not ok then return nil, err endpackage/luarocks/luarocks-unpack.patch new file +18
-0@@ -0,0 +1,24 @@ +allows unpack in existing directory + +Signed-off-by: Francois Perrad <[email protected]> + +Index: b/src/luarocks/unpack.lua +=================================================================== +--- a/src/luarocks/unpack.lua ++++ b/src/luarocks/unpack.lua +@@ -101,11 +101,10 @@ + return nil, file.." does not seem to be a valid filename." + end + +- if (fs.exists(dir_name)) then +- return nil, "Directory "..dir_name.." already exists." ++ if not fs.exists(dir_name) then ++ local ok, err = fs.make_dir(dir_name) ++ if not ok then return nil, err end + end
Quoted 9 lines
package/luarocks/luarocks-unpack.patch line 24
Quoted 6 lines
package/luarocks/luarocks-unpack.patch new file +6
-0+- local ok, err = fs.make_dir(dir_name) +- if not ok then return nil, err end + local rollback = util.schedule_function(fs.delete, fs.absolute_name(dir_name)) + + local rockspec, err +Any chance these patches make it their way upstream?
With the next release of LuaRocks, these patches will be removed.
See https://github.com/keplerproject/luarocks/commit/a1f62e69ee7fdb1dfd6dc36aad48e1306a70bb14
and the whole discussion
http://sourceforge.net/mailarchive/message.php?msg_id=31645659
Fran?ois
Quoted 65 lines
Quoted 20 lines
package/luarocks/luarocks.mk new file +14
-0@@ -0,0 +1,42 @@ +################################################################################ +# +# luarocks +# +################################################################################ + +LUAROCKS_VERSION = 2.1.1 +LUAROCKS_SITE = http://luarocks.org/releases/ +LUAROCKS_LICENSE = MIT +LUAROCKS_LICENSE_FILES = COPYING + +HOST_LUAROCKS_DEPENDENCIES = host-lua luainterpreter + +LUAROCKS_CONFIG_DIR = $(HOST_DIR)/usr/etc/luarockspackage/luarocks/luarocks.mk line 24
Quoted 10 lines
package/luarocks/luarocks.mk new file +10
-0+LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/config-5.1.lua + +define HOST_LUAROCKS_CONFIGURE_CMDS + cd $(@D) && ./configure \ + --prefix=$(TARGET_DIR)/usr \ + --sysconfdir=$(LUAROCKS_CONFIG_DIR) \ + --with-lua=$(HOST_DIR)/usr \ + --with-lua-include=$(STAGING_DIR)/usr/include \ + --with-lua-lib=$(STAGING_DIR)/usr/lib + @echo "$(@D)/config.unix generated"This echo is probably not needed.
Quoted 8 lines
package/luarocks/luarocks.mk new file +8
-0+endef + +define HOST_LUAROCKS_INSTALL_CMDS + $(MAKE1) -C $(@D) install \ + PREFIX=$(HOST_DIR)/usr + echo "-- BR cross-compilation" >> $(LUAROCKS_CONFIG_FILE) + echo "variables = {" >> $(LUAROCKS_CONFIG_FILE) + echo " CC = [[$(TARGET_CC)]]," >> $(LUAROCKS_CONFIG_FILE)package/luarocks/luarocks.mk line 42
Quoted 10 lines
package/luarocks/luarocks.mk new file +10
-0+ echo " LD = [[$(TARGET_CC)]]," >> $(LUAROCKS_CONFIG_FILE) + echo " CFLAGS = [[$(TARGET_CFLAGS)]]," >> $(LUAROCKS_CONFIG_FILE) + echo " LIBFLAG = [[-shared $(TARGET_LDFLAGS)]]," >> $(LUAROCKS_CONFIG_FILE) + echo "}" >> $(LUAROCKS_CONFIG_FILE) + echo "external_deps_dirs = { [[$(STAGING_DIR)/usr]] }" >> $(LUAROCKS_CONFIG_FILE) + echo "gcc_rpath = false" >> $(LUAROCKS_CONFIG_FILE) +endef + +$(eval $(host-generic-package)) +Other than that, it looks ok to me.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH v4 5/10 luarocks: new package
Dear Fran?ois Perrad,
Quoted 7 lines · Fran?ois Perrad
Quoted 2 lines
Any chance these patches make it their way upstream?
With the next release of LuaRocks, these patches will be removed.
See https://github.com/keplerproject/luarocks/commit/a1f62e69ee7fdb1dfd6dc36aad48e1306a70bb14
and the whole discussion
http://sourceforge.net/mailarchive/message.php?msg_id=31645659
Absolutely excellent, thanks a lot!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 6/10 luarocks: new infrastructure
In reply to Francois Perrad--- Config.in | 8 ++++++ Makefile | 1 + package/Makefile.in | 1 + package/pkg-luarocks.mk | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 package/pkg-luarocks.mk
Config.in +8 -0
@@ -207,6 +207,14 @@ config BR2_DEBIAN_MIRROR endif +config BR2_LUAROCKS_MIRROR + string "LuaRocks mirror" + default "http://luarocks.org/repositories/rocks" + help + LuaRocks repository. + + See http://luarocks.org + endmenu config BR2_JLEVEL
Makefile +1 -0
@@ -473,6 +473,7 @@ endif ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y) find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f endif + rm -rf $(TARGET_DIR)/usr/lib/luarocks $(STRIP_FIND_CMD) | xargs $(STRIPCMD) 2>/dev/null || true if test -d $(TARGET_DIR)/lib/modules; then \ find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
package/Makefile.in +1 -0
@@ -363,4 +363,5 @@ include package/pkg-utils.mk include package/pkg-download.mk include package/pkg-autotools.mk include package/pkg-cmake.mk +include package/pkg-luarocks.mk include package/pkg-generic.mk
package/pkg-luarocks.mk new file +71 -0
71 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v4 6/10 luarocks: new infrastructure
Dear Francois Perrad,
Quoted 67 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- Config.in | 8 ++++++ Makefile | 1 + package/Makefile.in | 1 + package/pkg-luarocks.mk | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 package/pkg-luarocks.mkConfig.in +8
-0@@ -207,6 +207,14 @@ config BR2_DEBIAN_MIRROR endif +config BR2_LUAROCKS_MIRROR + string "LuaRocks mirror" + default "http://luarocks.org/repositories/rocks" + help + LuaRocks repository. + + See http://luarocks.org + endmenu config BR2_JLEVELMakefile +1
-0@@ -473,6 +473,7 @@ endif ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y) find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f endif + rm -rf $(TARGET_DIR)/usr/lib/luarocks $(STRIP_FIND_CMD) | xargs $(STRIPCMD) 2>/dev/null || true if test -d $(TARGET_DIR)/lib/modules; then \ find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \package/Makefile.in +1
-0@@ -363,4 +363,5 @@ include package/pkg-utils.mk include package/pkg-download.mk include package/pkg-autotools.mk include package/pkg-cmake.mk +include package/pkg-luarocks.mk include package/pkg-generic.mkpackage/pkg-luarocks.mk new file +10
-0@@ -0,0 +1,71 @@ +################################################################################ +# LuaRocks package infrastructure +# see http://luarocks.org/ +# +# This file implements an infrastructure that eases development of +# package .mk files for LuaRocks packages. +# LuaRocks supports various build.type : builtin, make, cmake. +# This luarocks infrastructure supports only the builtin mode, +# the make & cmake modes could be directly handled by generic & cmake infrastructure. +#
package/pkg-luarocks.mk line 20
Quoted 10 lines
package/pkg-luarocks.mk new file +10
-0+# See the Buildroot documentation for details on the usage of this +# infrastructure +# +# In terms of implementation, this LuaRocks infrastructure requires +# the .mk file to only specify metadata informations about the +# package: name, version, etc. +# +################################################################################ + +LUAROCKS_RUN = $(HOST_DIR)/usr/bin/luarocks
This variable could probably be provided bypackage/luarocks/luarocks.mk.
Quoted 10 lines
package/pkg-luarocks.mk new file +10
-0+ +################################################################################ +# inner-luarocks-package -- defines how the configuration, compilation and +# installation of a LuaRocks package should be done, implements a few hooks to +# tune the build process and calls the generic package infrastructure to +# generate the necessary make targets +# +# argument 1 is the lowercase package name +# argument 2 is the uppercase package name, including an HOST_ prefix +# for host packages
package/pkg-luarocks.mk line 40
Quoted 10 lines
package/pkg-luarocks.mk new file +10
-0+# argument 3 is the uppercase package name, without the HOST_ prefix +# for host packages +# argument 4 is the package directory prefix +# argument 5 is the type (target or host) +################################################################################ + +define inner-luarocks-package + +$(2)_BUILD_OPT ?= +$(2)_SUBDIR ?= $(1)-$(shell echo "$($(3)_VERSION)" | sed -e "s/-[0-9]$$//")
Can we avoid this subdir for all packages?
package/pkg-luarocks.mk line 52
Quoted 12 lines
package/pkg-luarocks.mk new file +12
-0+$(2)_ROCKSPEC ?= $(1)-$($(3)_VERSION).rockspec +$(2)_SOURCE ?= $(1)-$($(3)_VERSION).src.rock +$(2)_SITE ?= $(call qstrip,$(BR2_LUAROCKS_MIRROR)) + +# +# Extract step +# +$(2)_EXTRACT_CMDS ?= \ + cd $$($(2)_DIR)/.. && $(LUAROCKS_RUN) unpack $(DL_DIR)/$$($(2)_SOURCE) + +# $(2)_DEPENDENCIES are handled for configure step (too late) +$(1)-extract: host-luarocks
Ok, I see the problem. However I believe I'd still like to see host-luarocks added to $(2)_DEPENDENCIES so that the dependency graph is correct, and "make source" / "make external-deps" properly show luarocks.
package/pkg-luarocks.mk line 58
Quoted 5 lines
package/pkg-luarocks.mk new file +5
-0+# +# Build/install step. +# +$(2)_INSTALL_TARGET_CMDS ?= \ + cd $$($(2)_SRCDIR) && $(LUAROCKS_RUN) build --minimal $$($(2)_ROCKSPEC) $$($(2)_BUILD_OPT)
Maybe the extract and install target steps could be written using a define ... endef block instead, for better readability?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 6/10 luarocks: new infrastructure
Francois, All,
On 2013-12-22 18:31 +0100, Thomas Petazzoni spake thusly:
Quoted 1 line · Francois Perrad
[--SNIP--]
Quoted 21 lines
Quoted 21 lines
package/pkg-luarocks.mk new file +15
-0@@ -0,0 +1,71 @@ +################################################################################ +# LuaRocks package infrastructure +# see http://luarocks.org/ +# +# This file implements an infrastructure that eases development of +# package .mk files for LuaRocks packages. +# LuaRocks supports various build.type : builtin, make, cmake. +# This luarocks infrastructure supports only the builtin mode, +# the make & cmake modes could be directly handled by generic & cmake infrastructure. +# +# See the Buildroot documentation for details on the usage of this +# infrastructure +# +# In terms of implementation, this LuaRocks infrastructure requires +# the .mk file to only specify metadata informations about the
Quoted 8 lines
package/pkg-luarocks.mk line 20
Quoted 5 lines
package/pkg-luarocks.mk new file +5
-0+# package: name, version, etc. +# +################################################################################ + +LUAROCKS_RUN = $(HOST_DIR)/usr/bin/luarocksThis variable could probably be provided by
package/luarocks/luarocks.mk.
Done.
[--SNIP--]
Quoted 9 lines
Quoted 9 lines
package/pkg-luarocks.mk new file +9
-0+$(2)_ROCKSPEC ?= $(1)-$($(3)_VERSION).rockspec +$(2)_SOURCE ?= $(1)-$($(3)_VERSION).src.rock +$(2)_SITE ?= $(call qstrip,$(BR2_LUAROCKS_MIRROR)) + +# +# Extract step +# +$(2)_EXTRACT_CMDS ?= \ + cd $$($(2)_DIR)/.. && $(LUAROCKS_RUN) unpack $(DL_DIR)/$$($(2)_SOURCE)
Quoted 8 lines
package/pkg-luarocks.mk line 52
Quoted 3 lines
package/pkg-luarocks.mk new file +3
-0+ +# $(2)_DEPENDENCIES are handled for configure step (too late) +$(1)-extract: host-luarocksOk, I see the problem. However I believe I'd still like to see host-luarocks added to $(2)_DEPENDENCIES so that the dependency graph is correct, and "make source" / "make external-deps" properly show luarocks.
Done.
I've also rephrased the comment, and moved things around to be a bit more logical (in my eyes, at least).
Quoted 8 lines
package/pkg-luarocks.mk line 58
Quoted 5 lines
package/pkg-luarocks.mk new file +5
-0+# +# Build/install step. +# +$(2)_INSTALL_TARGET_CMDS ?= \ + cd $$($(2)_SRCDIR) && $(LUAROCKS_RUN) build --minimal $$($(2)_ROCKSPEC) $$($(2)_BUILD_OPT)Maybe the extract and install target steps could be written using a define ... endef block instead, for better readability?
Done.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 6/10 luarocks: new infrastructure
In reply to Thomas Petazzoni2013/12/22 Thomas Petazzoni <[email protected]>:
Quoted 98 lines
Dear Francois Perrad,
Quoted 67 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- Config.in | 8 ++++++ Makefile | 1 + package/Makefile.in | 1 + package/pkg-luarocks.mk | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 package/pkg-luarocks.mkConfig.in +8
-0@@ -207,6 +207,14 @@ config BR2_DEBIAN_MIRROR endif +config BR2_LUAROCKS_MIRROR + string "LuaRocks mirror" + default "http://luarocks.org/repositories/rocks" + help + LuaRocks repository. + + See http://luarocks.org + endmenu config BR2_JLEVELMakefile +1
-0@@ -473,6 +473,7 @@ endif ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y) find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f endif + rm -rf $(TARGET_DIR)/usr/lib/luarocks $(STRIP_FIND_CMD) | xargs $(STRIPCMD) 2>/dev/null || true if test -d $(TARGET_DIR)/lib/modules; then \ find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \package/Makefile.in +1
-0@@ -363,4 +363,5 @@ include package/pkg-utils.mk include package/pkg-download.mk include package/pkg-autotools.mk include package/pkg-cmake.mk +include package/pkg-luarocks.mk include package/pkg-generic.mkpackage/pkg-luarocks.mk new file +10
-0@@ -0,0 +1,71 @@ +################################################################################ +# LuaRocks package infrastructure +# see http://luarocks.org/ +# +# This file implements an infrastructure that eases development of +# package .mk files for LuaRocks packages. +# LuaRocks supports various build.type : builtin, make, cmake. +# This luarocks infrastructure supports only the builtin mode, +# the make & cmake modes could be directly handled by generic & cmake infrastructure. +#package/pkg-luarocks.mk line 20
Quoted 10 lines
package/pkg-luarocks.mk new file +10
-0+# See the Buildroot documentation for details on the usage of this +# infrastructure +# +# In terms of implementation, this LuaRocks infrastructure requires +# the .mk file to only specify metadata informations about the +# package: name, version, etc. +# +################################################################################ + +LUAROCKS_RUN = $(HOST_DIR)/usr/bin/luarocksThis variable could probably be provided by
package/luarocks/luarocks.mk.Quoted 14 lines
package/pkg-luarocks.mk new file +14
-0+ +################################################################################ +# inner-luarocks-package -- defines how the configuration, compilation and +# installation of a LuaRocks package should be done, implements a few hooks to +# tune the build process and calls the generic package infrastructure to +# generate the necessary make targets +# +# argument 1 is the lowercase package name +# argument 2 is the uppercase package name, including an HOST_ prefix +# for host packages +# argument 3 is the uppercase package name, without the HOST_ prefix +# for host packages +# argument 4 is the package directory prefix +# argument 5 is the type (target or host)
Quoted 8 lines
package/pkg-luarocks.mk line 40
Quoted 6 lines
package/pkg-luarocks.mk new file +6
-0+################################################################################ + +define inner-luarocks-package + +$(2)_BUILD_OPT ?= +$(2)_SUBDIR ?= $(1)-$(shell echo "$($(3)_VERSION)" | sed -e "s/-[0-9]$$//")Can we avoid this subdir for all packages?
No, the rock format implies this structure with a subdirectory.
Note: the name of the subdirectory is not 'standardized' by LuaRocks, so in some package, this value is overloaded.
Fran?ois
Quoted 39 lines
package/pkg-luarocks.mk line 52
Quoted 13 lines
package/pkg-luarocks.mk new file +12
-0+$(2)_ROCKSPEC ?= $(1)-$($(3)_VERSION).rockspec +$(2)_SOURCE ?= $(1)-$($(3)_VERSION).src.rock +$(2)_SITE ?= $(call qstrip,$(BR2_LUAROCKS_MIRROR)) + +# +# Extract step +# +$(2)_EXTRACT_CMDS ?= \ + cd $$($(2)_DIR)/.. && $(LUAROCKS_RUN) unpack $(DL_DIR)/$$($(2)_SOURCE) + +# $(2)_DEPENDENCIES are handled for configure step (too late) +$(1)-extract: host-luarocksOk, I see the problem. However I believe I'd still like to see host-luarocks added to $(2)_DEPENDENCIES so that the dependency graph is correct, and "make source" / "make external-deps" properly show luarocks.
package/pkg-luarocks.mk line 58
Quoted 5 lines
package/pkg-luarocks.mk new file +5
-0+# +# Build/install step. +# +$(2)_INSTALL_TARGET_CMDS ?= \ + cd $$($(2)_SRCDIR) && $(LUAROCKS_RUN) build --minimal $$($(2)_ROCKSPEC) $$($(2)_BUILD_OPT)Maybe the extract and install target steps could be written using a define ... endef block instead, for better readability?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH v4 7/10 lua-cjson: restore official name
In reply to Francois Perrad(need by LuaRocks)
---
Config.in.legacy | 10 ++++++++++
package/Config.in | 2 +-
package/{luacjson => lua-cjson}/Config.in | 4 ++--
.../luacjson.mk => lua-cjson/lua-cjson.mk} | 21 ++++++++++----------
4 files changed, 23 insertions(+), 14 deletions(-)
rename package/{luacjson => lua-cjson}/Config.in (90%)
rename package/{luacjson/luacjson.mk => lua-cjson/lua-cjson.mk} (56%)Config.in.legacy +10 -0
@@ -99,6 +99,16 @@ comment "----------------------------------------------------" endif ############################################################################### +comment "Legacy options removed in 2014.02" + +config BR2_PACKAGE_LUACJSON + bool "luacjson has been replaced by lua-cjson" + select BR2_PACKAGE_LUA_CJSON + select BR2_LEGACY + help + The option has been renamed BR2_PACKAGE_LUA_CJSON. + +############################################################################### comment "Legacy options removed in 2013.11" config BR2_PACKAGE_QT_JAVASCRIPTCORE
package/Config.in +1 -1
@@ -361,7 +361,6 @@ source "package/copas/Config.in" source "package/coxpcall/Config.in" source "package/lbase64/Config.in" source "package/luabitop/Config.in" -source "package/luacjson/Config.in" source "package/luacrypto/Config.in" source "package/luaexpat/Config.in" source "package/luaexpatutils/Config.in"
@@ -370,6 +369,7 @@ source "package/luaposix/Config.in" source "package/luasec/Config.in" source "package/luasocket/Config.in" source "package/luasql/Config.in" +source "package/lua-cjson/Config.in" source "package/lua-ev/Config.in" source "package/lua-msgpack-native/Config.in" source "package/orbit/Config.in"
package/lua-cjson/Config.in renamed from package/luacjson/Config.in +2 -2
@@ -1,5 +1,5 @@ -config BR2_PACKAGE_LUACJSON - bool "luacjson" +config BR2_PACKAGE_LUA_CJSON + bool "lua-cjson" depends on BR2_PACKAGE_HAS_LUA_INTERPRETER help The Lua CJSON module provides JSON support for Lua. It features:
package/lua-cjson/lua-cjson.mk renamed from package/luacjson/luacjson.mk +10 -11
@@ -1,17 +1,16 @@ ################################################################################ # -# luacjson +# lua-cjson # ################################################################################ -LUACJSON_VERSION = 2.1.0 -LUACJSON_SOURCE = lua-cjson-$(LUACJSON_VERSION).tar.gz -LUACJSON_SITE = http://www.kyne.com.au/~mark/software/download -LUACJSON_DEPENDENCIES = luainterpreter -LUACJSON_LICENSE = MIT -LUACJSON_LICENSE_FILES = LICENSE +LUA_CJSON_VERSION = 2.1.0 +LUA_CJSON_SITE = http://www.kyne.com.au/~mark/software/download +LUA_CJSON_DEPENDENCIES = luainterpreter +LUA_CJSON_LICENSE = MIT +LUA_CJSON_LICENSE_FILES = LICENSE -define LUACJSON_BUILD_CMDS +define LUA_CJSON_BUILD_CMDS $(MAKE) -C $(@D) \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \
@@ -20,15 +19,15 @@ define LUACJSON_BUILD_CMDS PREFIX=$(STAGING_DIR)/usr endef -define LUACJSON_INSTALL_TARGET_CMDS +define LUA_CJSON_INSTALL_TARGET_CMDS $(MAKE) DESTDIR="$(TARGET_DIR)" PREFIX="/usr" -C $(@D) install endef -define LUACJSON_CLEAN_CMDS +define LUA_CJSON_CLEAN_CMDS $(MAKE) -C $(@D) clean endef -define LUACJSON_UNINSTALL_TARGET_CMDS +define LUA_CJSON_UNINSTALL_TARGET_CMDS rm -f $(TARGET_DIR)/usr/lib/lua/5.1/cjson.so endef
Signature · 1 line
1.7.9.5
PATCH v4 7/10 lua-cjson: restore official name
Dear Francois Perrad,
Quoted 11 lines · Francois Perrad
(need by LuaRocks)
Signed-off-by Francois Perrad <[email protected]>--- Config.in.legacy | 10 ++++++++++ package/Config.in | 2 +- package/{luacjson => lua-cjson}/Config.in | 4 ++-- .../luacjson.mk => lua-cjson/lua-cjson.mk} | 21 ++++++++++---------- 4 files changed, 23 insertions(+), 14 deletions(-) rename package/{luacjson => lua-cjson}/Config.in (90%) rename package/{luacjson/luacjson.mk => lua-cjson/lua-cjson.mk} (56%)
This looks good to me.
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 8/10 luasql-sqlite3: renamed like with LuaRocks
In reply to Francois Perrad--- Config.in.legacy | 7 ++++++ package/Config.in | 2 +- package/luasql-sqlite3/Config.in | 8 +++++++ package/luasql-sqlite3/luasql-sqlite3.mk | 33 ++++++++++++++++++++++++++ package/luasql/Config.in | 22 ----------------- package/luasql/luasql.mk | 38 ------------------------------ 6 files changed, 49 insertions(+), 61 deletions(-) create mode 100644 package/luasql-sqlite3/Config.in create mode 100644 package/luasql-sqlite3/luasql-sqlite3.mk delete mode 100644 package/luasql/Config.in delete mode 100644 package/luasql/luasql.mk
Config.in.legacy +7 -0
@@ -101,6 +101,13 @@ endif ############################################################################### comment "Legacy options removed in 2014.02" +config BR2_PACKAGE_LUASQL + bool "luasql has been replaced by luasql-sqlite3" + select BR2_PACKAGE_LUASQL_SQLITE3 + select BR2_LEGACY + help + The option has been renamed BR2_PACKAGE_LUASQL_SQLITE3. + config BR2_PACKAGE_LUACJSON bool "luacjson has been replaced by lua-cjson" select BR2_PACKAGE_LUA_CJSON
package/Config.in +1 -1
@@ -368,7 +368,7 @@ source "package/luafilesystem/Config.in" source "package/luaposix/Config.in" source "package/luasec/Config.in" source "package/luasocket/Config.in" -source "package/luasql/Config.in" +source "package/luasql-sqlite3/Config.in" source "package/lua-cjson/Config.in" source "package/lua-ev/Config.in" source "package/lua-msgpack-native/Config.in"
package/luasql-sqlite3/Config.in new file +8 -0
@@ -0,0 +1,8 @@ +config BR2_PACKAGE_LUASQL_SQLITE3 + bool "luasql-sqlite3" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER + help + LuaSQL is a simple interface from Lua to a DBMS. + + http://www.keplerproject.org/luasql +
package/luasql-sqlite3/luasql-sqlite3.mk new file +33 -0
@@ -0,0 +1,33 @@ +################################################################################ +# +# luasql-sqlite3 +# +################################################################################ + +LUASQL_SQLITE3_VERSION = v2.3.0 +LUASQL_SQLITE3_SITE = https://github.com/keplerproject/luasql/tarball/$(LUASQL_SQLITE3_VERSION) +LUASQL_SQLITE3_LICENSE = MIT +LUASQL_SQLITE3_LICENSE_FILES = README +LUASQL_SQLITE3_DEPENDENCIES = luainterpreter sqlite + +LUASQL_SQLITE3_MAKE_FLAGS = \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -fPIC" \ + T="sqlite3" \ + DRIVER_LIBS="-L$(STAGING_DIR)/usr/lib -lsqlite3" + +define LUASQL_SQLITE3_BUILD_CMDS + $(MAKE) -C $(@D) $(LUASQL_SQLITE3_MAKE_FLAGS) +endef + +define LUASQL_SQLITE3_INSTALL_TARGET_CMDS + $(MAKE) -C $(@D) $(LUASQL_SQLITE3_MAKE_FLAGS) \ + PREFIX="$(TARGET_DIR)/usr" install +endef + +define LUASQL_SQLITE3_UNINSTALL_TARGET_CMDS + rm -rf $(TARGET_DIR)/usr/lib/lua/5.1/luasql +endef + +$(eval $(generic-package))
package/luasql/Config.in deleted +0 -22
@@ -1,22 +0,0 @@ -config BR2_PACKAGE_LUASQL - bool "luasql" - depends on BR2_PACKAGE_HAS_LUA_INTERPRETER - help - LuaSQL is a simple interface from Lua to a DBMS. - - http://www.keplerproject.org/luasql - -if BR2_PACKAGE_LUASQL -choice - prompt "LuaSQL Driver" - help - Select backend driver for LuaSQL. - -config BR2_PACKAGE_LUASQL_DRIVER_SQLITE3 - bool "SQLite3" - select BR2_PACKAGE_SQLITE - help - Select if you wish to use the SQLite3 LuaSQL driver. - -endchoice -endif
package/luasql/luasql.mk deleted +0 -38
@@ -1,38 +0,0 @@ -################################################################################ -# -# luasql -# -################################################################################ - -LUASQL_VERSION = v2.3.0 -LUASQL_SITE = https://github.com/keplerproject/luasql/tarball/$(LUASQL_VERSION) -LUASQL_LICENSE = MIT -LUASQL_LICENSE_FILES = README -LUASQL_DEPENDENCIES = luainterpreter - -LUASQL_MAKE_FLAGS = \ - CC="$(TARGET_CC)" \ - LD="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -fPIC" - -ifeq ($(BR2_PACKAGE_LUASQL_DRIVER_SQLITE3),y) -LUASQL_DEPENDENCIES += sqlite -LUASQL_MAKE_FLAGS += \ - T="sqlite3" \ - DRIVER_LIBS="-L$(STAGING_DIR)/usr/lib -lsqlite3" -endif - -define LUASQL_BUILD_CMDS - $(MAKE) -C $(@D) $(LUASQL_MAKE_FLAGS) -endef - -define LUASQL_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) $(LUASQL_MAKE_FLAGS) \ - PREFIX="$(TARGET_DIR)/usr" install -endef - -define LUASQL_UNINSTALL_TARGET_CMDS - rm -rf $(TARGET_DIR)/usr/lib/lua/5.1/luasql -endef - -$(eval $(generic-package))
Signature · 1 line
1.7.9.5
PATCH v4 9/10 lua*: refactor with luarocks infrastructure
In reply to Francois Perrad--- package/cgilua/cgilua.mk | 14 ++------ package/copas/copas.mk | 14 ++------ package/lbase64/lbase64.mk | 28 +++------------ package/lua-cjson/lua-cjson.mk | 32 +++-------------- package/luabitop/luabitop.mk | 23 +++---------- package/luaexpat/luaexpat.mk | 36 +++----------------- .../luafilesystem-without_large_file.patch | 8 ++--- package/luafilesystem/luafilesystem.mk | 26 ++------------ package/luasec/luasec.mk | 29 ++++------------ package/luasql-sqlite3/luasql-sqlite3.mk | 30 +++------------- package/orbit/orbit-01-fix-installation.patch | 26 -------------- package/orbit/orbit.mk | 16 +++------ package/rings/rings.mk | 23 ++----------- package/wsapi/wsapi.mk | 15 ++------ package/xavante/xavante.mk | 15 ++------ 15 files changed, 50 insertions(+), 285 deletions(-) delete mode 100644 package/orbit/orbit-01-fix-installation.patch
package/cgilua/cgilua.mk +2 -12
@@ -4,17 +4,7 @@ # ################################################################################ -CGILUA_VERSION = 5.1.4 -CGILUA_SITE = http://github.com/downloads/keplerproject/cgilua +CGILUA_VERSION = 5.1.4-1 CGILUA_LICENSE = MIT -define CGILUA_INSTALL_TARGET_CMDS - $(MAKE) PREFIX="$(TARGET_DIR)/usr" -C $(@D) install -endef - -define CGILUA_UNINSTALL_TARGET_CMDS - rm -rf "$(TARGET_DIR)/usr/share/lua/5.1/cgilua" - rm -f "$(TARGET_DIR)/usr/share/lua/5.1/cgilua.lua" -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/copas/copas.mk +2 -12
@@ -4,17 +4,7 @@ # ################################################################################ -COPAS_VERSION = 1.1.6 -COPAS_SITE = http://github.com/downloads/keplerproject/copas +COPAS_VERSION = 1.1.6-1 COPAS_LICENSE = MIT -define COPAS_INSTALL_TARGET_CMDS - $(INSTALL) -m 0644 -D $(@D)/src/copas/copas.lua \ - $(TARGET_DIR)/usr/share/lua/5.1/copas.lua -endef - -define COPAS_UNINSTALL_TARGET_CMDS - rm -f "$(TARGET_DIR)/usr/share/lua/5.1/copas.lua" -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/lbase64/lbase64.mk +4 -24
@@ -4,29 +4,9 @@ # ################################################################################ -LBASE64_VERSION = 20100323 -LBASE64_SITE = http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1 -LBASE64_SOURCE = lbase64.tar.gz +LBASE64_VERSION = 20120820-1 +LBASE64_SUBDIR = base64 LBASE64_LICENSE = Public domain -LBASE64_LICENSE_FILES = README -LBASE64_DEPENDENCIES = luainterpreter +LBASE64_LICENSE_FILES = $(LBASE64_SUBDIR)/README -define LBASE64_BUILD_CMDS - $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS) -fPIC" so -endef - -define LBASE64_INSTALL_TARGET_CMDS - $(INSTALL) -D -m 0755 $(@D)/base64.so \ - $(TARGET_DIR)/usr/lib/lua/5.1/base64.so -endef - -define LBASE64_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/5.1/base64.so -endef - -define LBASE64_CLEAN_CMDS - $(MAKE) -C $(@D) clean -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/lua-cjson/lua-cjson.mk +5 -27
@@ -4,31 +4,9 @@ # ################################################################################ -LUA_CJSON_VERSION = 2.1.0 -LUA_CJSON_SITE = http://www.kyne.com.au/~mark/software/download -LUA_CJSON_DEPENDENCIES = luainterpreter -LUA_CJSON_LICENSE = MIT -LUA_CJSON_LICENSE_FILES = LICENSE +LUA_CJSON_VERSION_UPSTREAM = 2.1.0 +LUA_CJSON_VERSION = $(LUA_CJSON_VERSION_UPSTREAM)-1 +LUA_CJSON_LICENSE = MIT +LUA_CJSON_LICENSE_FILES = lua-cjson-$(LUA_CJSON_VERSION_UPSTREAM)/LICENSE -define LUA_CJSON_BUILD_CMDS - $(MAKE) -C $(@D) \ - CFLAGS="$(TARGET_CFLAGS)" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - CC="$(TARGET_CC)" \ - LD="$(TARGET_LD)" \ - PREFIX=$(STAGING_DIR)/usr -endef - -define LUA_CJSON_INSTALL_TARGET_CMDS - $(MAKE) DESTDIR="$(TARGET_DIR)" PREFIX="/usr" -C $(@D) install -endef - -define LUA_CJSON_CLEAN_CMDS - $(MAKE) -C $(@D) clean -endef - -define LUA_CJSON_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/5.1/cjson.so -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/luabitop/luabitop.mk +5 -18
@@ -4,23 +4,10 @@ # ################################################################################ -LUABITOP_VERSION = 1.0.2 -LUABITOP_SOURCE = LuaBitOp-$(LUABITOP_VERSION).tar.gz -LUABITOP_SITE = http://bitop.luajit.org/download +LUABITOP_VERSION_UPSTREAM = 1.0.2 +LUABITOP_VERSION = $(LUABITOP_VERSION_UPSTREAM)-1 +LUABITOP_SUBDIR = LuaBitOp-$(LUABITOP_VERSION_UPSTREAM) LUABITOP_LICENSE = MIT -LUABITOP_LICENSE_FILES = README -LUABITOP_DEPENDENCIES = lua +LUABITOP_LICENSE_FILES = $(LUABITOP_SUBDIR)/README -define LUABITOP_BUILD_CMDS - $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) INCLUDES="-I$(STAGING_DIR)/usr/include" -endef - -define LUABITOP_INSTALL_TARGET_CMDS - $(INSTALL) -p $(@D)/bit.so $(TARGET_DIR)/usr/lib/lua/5.1 -endef - -define LUABITOP_CLEAN_CMDS - $(MAKE) -C $(@D) clean -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/luaexpat/luaexpat.mk +4 -32
@@ -4,36 +4,8 @@ # ################################################################################ -LUAEXPAT_VERSION = 1.2.0 -LUAEXPAT_SITE = http://matthewwild.co.uk/projects/luaexpat -LUAEXPAT_DEPENDENCIES = luainterpreter expat -LUAEXPAT_LICENSE = MIT +LUAEXPAT_VERSION = 1.2.0-1 +LUAEXPAT_DEPENDENCIES = expat +LUAEXPAT_LICENSE = MIT - -LUAEXPAT_MFLAGS += LUA_VERSION_NUM=501 -LUAEXPAT_MFLAGS += LUA_INC=$(STAGING_DIR)/usr/include -LUAEXPAT_MFLAGS += EXPAT_INC=$(STAGING_DIR)/usr/include -LUAEXPAT_MFLAGS += LIBNAME=lxp.so -LUAEXPAT_MFLAGS += LIB_OPTION="-shared -fPIC $(TARGET_CFLAGS)" -LUAEXPAT_MFLAGS += CC="$(TARGET_CC) -fPIC $(TARGET_CFLAGS)" - - -define LUAEXPAT_BUILD_CMDS - $(MAKE) -C $(@D) $(LUAEXPAT_MFLAGS) -endef - -define LUAEXPAT_INSTALL_TARGET_CMDS - $(INSTALL) -D $(@D)/src/lxp.so $(TARGET_DIR)/usr/lib/lua/5.1/lxp.so - $(INSTALL) -D -m 0644 $(@D)/src/lxp/lom.lua $(TARGET_DIR)/usr/share/lua/5.1/lxp/lom.lua -endef - -define LUAEXPAT_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/5.1/lxp.so - rm -f $(TARGET_DIR)/usr/share/lua/5.1/lxp/lom.lua -endef - -define LUAEXPAT_CLEAN_CMDS - $(MAKE) -C $(@D) $(LUAEXPAT_MFLAGS) clean -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/luafilesystem/luafilesystem-without_large_file.patch +4 -4
@@ -1,7 +1,7 @@ -diff --git a/src/lfs.c b/src/lfs.c -index 85f01e3..ed49f50 100644 ---- a/src/lfs.c -+++ b/src/lfs.c +Index: b/luafilesystem-1.6.2/src/lfs.c +=================================================================== +--- a/luafilesystem-1.6.2/src/lfs.c ++++ b/luafilesystem-1.6.2/src/lfs.c @@ -22,13 +22,13 @@ #ifndef _WIN32
package/luafilesystem/luafilesystem.mk +2 -24
@@ -4,29 +4,7 @@ # ################################################################################ -LUAFILESYSTEM_VERSION = 1.6.2 -LUAFILESYSTEM_SITE = http://github.com/downloads/keplerproject/luafilesystem -LUAFILESYSTEM_DEPENDENCIES = luainterpreter +LUAFILESYSTEM_VERSION = 1.6.2-1 LUAFILESYSTEM_LICENSE = MIT -ifeq ($(BR2_LARGEFILE),y) -LFS_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -endif - -define LUAFILESYSTEM_BUILD_CMDS - $(MAKE) -C $(@D) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS) $(LFS_CFLAGS) -fPIC" -endef - -define LUAFILESYSTEM_INSTALL_TARGET_CMDS - $(INSTALL) -D $(@D)/src/lfs.so $(TARGET_DIR)/usr/lib/lua/5.1/lfs.so -endef - -define LUAFILESYSTEM_UNINSTALL_TARGET_CMDS - rm -f "$(TARGET_DIR)/usr/lib/lua/5.1/lfs.so" -endef - -define LUAFILESYSTEM_CLEAN_CMDS - $(MAKE) -C $(@D) clean -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/luasec/luasec.mk +6 -23
@@ -4,28 +4,11 @@ # ################################################################################ -LUASEC_VERSION = 0.4.1 -LUASEC_SITE = http://www.inf.puc-rio.br/~brunoos/luasec/download/ +LUASEC_VERSION_UPSTREAM = 0.4.1 +LUASEC_VERSION = $(LUASEC_VERSION_UPSTREAM)-2 +LUASEC_SUBDIR = luasec-luasec-$(LUASEC_VERSION_UPSTREAM) LUASEC_LICENSE = MIT -LUASEC_LICENSE_FILES = LICENSE -LUASEC_DEPENDENCIES = luainterpreter openssl +LUASEC_LICENSE_FILES = $(LUASEC_SUBDIR)/LICENSE +LUASEC_DEPENDENCIES = openssl -define LUASEC_BUILD_CMDS - $(MAKE) -C $(@D) CC="$(TARGET_CC)" LD="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -fPIC" \ - LDFLAGS="$(TARGET_LDFLAGS) -shared" linux -endef - -define LUASEC_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) \ - LUAPATH="$(TARGET_DIR)/usr/share/lua/5.1" \ - LUACPATH="$(TARGET_DIR)/usr/lib/lua/5.1" install -endef - -define LUASEC_UNINSTALL_TARGET_CMDS - rm -f $(TARGET_DIR)/usr/lib/lua/5.1/ssl.so - rm -rf $(TARGET_DIR)/usr/share/lua/5.1/ssl - rm -f $(TARGET_DIR)/usr/share/lua/5.1/ssl.lua -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/luasql-sqlite3/luasql-sqlite3.mk +5 -25
@@ -4,30 +4,10 @@ # ################################################################################ -LUASQL_SQLITE3_VERSION = v2.3.0 -LUASQL_SQLITE3_SITE = https://github.com/keplerproject/luasql/tarball/$(LUASQL_SQLITE3_VERSION) +LUASQL_SQLITE3_VERSION = 2.3.0-1 +LUASQL_SQLITE3_SUBDIR = luasql LUASQL_SQLITE3_LICENSE = MIT -LUASQL_SQLITE3_LICENSE_FILES = README -LUASQL_SQLITE3_DEPENDENCIES = luainterpreter sqlite +LUASQL_SQLITE3_LICENSE_FILES = $(LUASQL_SQLITE3_SUBDIR)/README +LUASQL_SQLITE3_DEPENDENCIES = sqlite -LUASQL_SQLITE3_MAKE_FLAGS = \ - CC="$(TARGET_CC)" \ - LD="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -fPIC" \ - T="sqlite3" \ - DRIVER_LIBS="-L$(STAGING_DIR)/usr/lib -lsqlite3" - -define LUASQL_SQLITE3_BUILD_CMDS - $(MAKE) -C $(@D) $(LUASQL_SQLITE3_MAKE_FLAGS) -endef - -define LUASQL_SQLITE3_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) $(LUASQL_SQLITE3_MAKE_FLAGS) \ - PREFIX="$(TARGET_DIR)/usr" install -endef - -define LUASQL_SQLITE3_UNINSTALL_TARGET_CMDS - rm -rf $(TARGET_DIR)/usr/lib/lua/5.1/luasql -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/orbit/orbit-01-fix-installation.patch deleted +0 -26
@@ -1,26 +0,0 @@ -Fix installation commands - -The installation commands did not match the location of the source -files within the Orbit source tree. - -Signed-off-by: Thomas Petazzoni <[email protected]> - -Index: b/Makefile -=================================================================== ---- a/Makefile -+++ b/Makefile -@@ -11,12 +11,9 @@ - mkdir -p $(LUA_DIR) - cp src/orbit.lua $(LUA_DIR) - mkdir -p $(LUA_DIR)/orbit -- cp src/model.lua $(LUA_DIR)/orbit -- cp src/cache.lua $(LUA_DIR)/orbit -- cp src/pages.lua $(LUA_DIR)/orbit -- cp src/ophandler.lua $(LUA_DIR)/orbit -+ cp src/orbit/*.lua $(LUA_DIR)/orbit - mkdir -p $(BIN_DIR) -- cp src/orbit $(BIN_DIR) -+ cp src/launchers/* $(BIN_DIR) - if [ -f ./wsapi/Makefile ]; then \ - cd wsapi && make install; \ - fi
package/orbit/orbit.mk +5 -11
@@ -4,16 +4,10 @@ # ################################################################################ -ORBIT_VERSION = 2.2.0 -ORBIT_SITE = http://github.com/downloads/keplerproject/orbit +ORBIT_VERSION_UPSTREAM = 2.2.0 +ORBIT_VERSION = $(ORBIT_VERSION_UPSTREAM)-2 +ORBIT_SUBDIR = orbit-$(ORBIT_VERSION_UPSTREAM) ORBIT_LICENSE = MIT -ORBIT_LICENSE_FILES = doc/us/license.md +ORBIT_LICENSE_FILES = $(ORBIT_SUBDIR)/doc/us/license.md -define ORBIT_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) \ - LUA_DIR=$(TARGET_DIR)/usr/share/lua/5.1/ \ - BIN_DIR=$(TARGET_DIR)/usr/bin \ - install -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/rings/rings.mk +2 -21
@@ -4,26 +4,7 @@ # ################################################################################ -RINGS_VERSION = 1.2.3 -RINGS_SITE = http://github.com/downloads/keplerproject/rings -RINGS_DEPENDENCIES = luainterpreter +RINGS_VERSION = 1.2.3-2 RINGS_LICENSE = MIT -define RINGS_BUILD_CMDS - $(MAKE) -C $(@D) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS) -fPIC" -endef - -define RINGS_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)/usr" install -endef - -define RINGS_UNINSTALL_TARGET_CMDS - rm -f "$(TARGET_DIR)/usr/lib/lua/5.1/rings.so" - rm -f "$(TARGET_DIR)/usr/share/lua/5.1/stable.lua" -endef - -define RINGS_CLEAN_CMDS - $(MAKE) -C $(@D) clean -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/wsapi/wsapi.mk +2 -13
@@ -4,18 +4,7 @@ # ################################################################################ -WSAPI_VERSION = 1.5 -WSAPI_SITE = http://github.com/downloads/keplerproject/wsapi +WSAPI_VERSION = 1.5-1 WSAPI_LICENSE = MIT -define WSAPI_INSTALL_TARGET_CMDS - mkdir -p $(TARGET_DIR)/usr/share/lua/5.1/wsapi - $(INSTALL) -m 0644 -D $(@D)/src/wsapi/*.lua \ - $(TARGET_DIR)/usr/share/lua/5.1/wsapi -endef - -define WSAPI_UNINSTALL_TARGET_CMDS - rm -rf "$(TARGET_DIR)/usr/share/lua/5.1/wsapi" -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
package/xavante/xavante.mk +2 -13
@@ -4,18 +4,7 @@ # ################################################################################ -XAVANTE_VERSION = 2.2.1 -XAVANTE_SITE = http://github.com/downloads/keplerproject/xavante +XAVANTE_VERSION = 2.2.0-1 XAVANTE_LICENSE = MIT -define XAVANTE_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)/usr" install -endef - -define XAVANTE_UNINSTALL_TARGET_CMDS - rm -rf "$(TARGET_DIR)/usr/share/5.1/xavante" - rm -f "$(TARGET_DIR)/usr/share/5.1/xavante.lua" - rm -f "$(TARGET_DIR)/usr/share/5.1/sajax.lua" -endef - -$(eval $(generic-package)) +$(eval $(luarocks-package))
Signature · 1 line
1.7.9.5
PATCH v4 9/10 lua*: refactor with luarocks infrastructure
Dear Francois Perrad,
Quoted 12 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- package/cgilua/cgilua.mk | 14 ++------ package/copas/copas.mk | 14 ++------ package/lbase64/lbase64.mk | 28 +++------------ package/lua-cjson/lua-cjson.mk | 32 +++-------------- package/luabitop/luabitop.mk | 23 +++---------- package/luaexpat/luaexpat.mk | 36 +++----------------- .../luafilesystem-without_large_file.patch | 8 ++--- package/luafilesystem/luafilesystem.mk | 26 ++------------ package/luasec/luasec.mk | 29 ++++------------
Quoted 8 lines
package/luasql-sqlite3/luasql-sqlite3.mk | 30 +++------------- package/orbit/orbit-01-fix-installation.patch | 26 -------------- package/orbit/orbit.mk | 16 +++------ package/rings/rings.mk | 23 ++----------- package/wsapi/wsapi.mk | 15 ++------ package/xavante/xavante.mk | 15 ++------ 15 files changed, 50 insertions(+), 285 deletions(-) delete mode 100644 package/orbit/orbit-01-fix-installation.patch
This generally looks good, but I have one question (related to a question I've asked earlier on the luarocks infrastructure itself).
package/lbase64/lbase64.mk line 10
Quoted 4 lines
LBASE64_LICENSE= Public domainpackage/lbase64/lbase64.mk +1
-2-LBASE64_LICENSE_FILES = README -LBASE64_DEPENDENCIES = luainterpreter +LBASE64_LICENSE_FILES = $(LBASE64_SUBDIR)/README
Can we avoid this subdirectory in all packages, to make things easier?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 10/10 manual: adding packages luarocks
In reply to Francois Perrad--- docs/manual/adding-packages-luarocks.txt | 91 ++++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 + 2 files changed, 93 insertions(+) create mode 100644 docs/manual/adding-packages-luarocks.txt
docs/manual/adding-packages-luarocks.txt new file +91 -0
@@ -0,0 +1,91 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +Infrastructure for LuaRocks-based packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[[luarocks-package-tutorial]] + ++luarocks-package+ tutorial +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +First, let's see how to write a +.mk+ file for a LuaRocks-based package, +with an example : + +------------------------ +01: ################################################################################ +02: # +03: # luafoo +04: # +05: ################################################################################ +06: +07: LUAFOO_VERSION = 1.0.2-1 +08: LUAFOO_DEPENDENCIES = foo +09: +10: LUAFOO_BUILD_OPT += FOO_INCDIR=$(STAGING_DIR)/usr/include +11: LUAFOO_BUILD_OPT += FOO_LIBDIR=$(STAGING_DIR)/usr/lib +12: +13: $(eval $(luarocks-package)) +------------------------ + +On line 7, we declare the version of the package (the same as in the rockspec, +which is the concatenation of the upstream version and the rockspec revision). + +On line 8, we declare our dependencies, so that they are built +before the build process of our package starts. + +On line 10-11, we tell Buildroot to pass custom options to LuaRocks when it is +building the package. + +Finally, on line 13, we invoke the +luarocks-package+ +macro that generates all the Makefile rules that actually allows the +package to be built. + +[[luarocks-package-reference]] + ++luarocks-package+ reference +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +LuaRocks is a deployment and management system for Lua modules. + +LuaRocks supports various +build.type+ : +builtin+, +make+, +cmake+. +This infrastructure supports only the +builtin+ mode, +the +make+ & +cmake+ modes could be directly handled by generic & cmake infrastructure. + +The main macro of the LuaRocks package infrastructure is ++luarocks-package+. It is similar to the +generic-package+ macro. +The +host-luarocks-package+ macro is not available, +only the +luarocks-package+ macro is available. + +Just like the generic infrastructure, the LuaRocks infrastructure works +by defining a number of variables before calling the +luarocks-package+ +macro. + +First, all the package metadata information variables that exist in +the generic infrastructure also exist in the LuaRocks infrastructure: ++LUAFOO_VERSION+, +LUAFOO_SOURCE+, +LUAFOO_SITE+, ++LUAFOO_DEPENDENCIES+. + +Two of them are populate by the LuaRocks infrastructure (for the ++download+ step) : + +* +LUAFOO_SITE+ with the +BR2_LUAROCKS_MIRROR+ value + +* +LUAFOO_SOURCE+ with +foo-$(FOO_VERSION).src.rock+ + +A few additional variables, specific to the LuaRocks infrastructure, are +also defined. They could be overridden in specific cases. + +* +LUAFOO_ROCKSPEC+ with +foo-$(FOO_VERSION).rockspec+ + +* +LUAFOO_SUBDIR+ with +foo-$(FOO_VERSION_WITHOUT_ROCKSPEC_REVISION)+ + +* +LUAFOO_BUILD_OPT+ contains the build options for the +luarocks build+ call. + The default is empty. + +With the LuaRocks infrastructure, only 2 steps use +luarocks+ : +extract and install-target. +luarocks+ handles building and install +in the same step. + +The step +patch+ is handled by the generic infrastructure. +The step +configure+ and +build+ stay empty.
docs/manual/adding-packages.txt +2 -0
@@ -18,6 +18,8 @@ include::adding-packages-autotools.txt[] include::adding-packages-cmake.txt[] +include::adding-packages-luarocks.txt[] + include::adding-packages-hooks.txt[] include::adding-packages-gettext.txt[]
Signature · 1 line
1.7.9.5
PATCH v4 10/10 manual: adding packages luarocks
Dear Francois Perrad,
Quoted 10 lines · Francois Perrad
docs/manual/adding-packages-luarocks.txt new file +10
-0+Infrastructure for LuaRocks-based packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[[luarocks-package-tutorial]] + ++luarocks-package+ tutorial +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +First, let's see how to write a +.mk+ file for a LuaRocks-based package, +with an example :
docs/manual/adding-packages-luarocks.txt line 23
Quoted 10 lines
docs/manual/adding-packages-luarocks.txt new file +10
-0+ +------------------------ +01: ################################################################################ +02: # +03: # luafoo +04: # +05: ################################################################################ +06: +07: LUAFOO_VERSION = 1.0.2-1 +08: LUAFOO_DEPENDENCIES = foo
Maybe add LUAFOO_LICENSE and LUAFOO_LICENSE_FILES here.
docs/manual/adding-packages-luarocks.txt line 32
Quoted 8 lines
+10:
LUAFOO_BUILD_OPT+= FOO_INCDIR=$(STAGING_DIR)/usr/include +11:LUAFOO_BUILD_OPT+= FOO_LIBDIR=$(STAGING_DIR)/usr/lib +12:
+13: $(eval $(luarocks-package))
+------------------------docs/manual/adding-packages-luarocks.txt new file +3
-0+ +On line 7, we declare the version of the package (the same as in the rockspec, +which is the concatenation of the upstream version and the rockspec revision).
Maybe indicate that the upstream version and the rockspec version are separated by a '-' sign ?
docs/manual/adding-packages-luarocks.txt line 35
Quoted 2 lines
docs/manual/adding-packages-luarocks.txt new file +2
-0+On line 8, we declare our dependencies, so that they are built +before the build process of our package starts.
Maybe mention that dependencies are only needed for packages that link against native libraries?
docs/manual/adding-packages-luarocks.txt line 38
Quoted 2 lines
docs/manual/adding-packages-luarocks.txt new file +2
-0+On line 10-11, we tell Buildroot to pass custom options to LuaRocks when it is +building the package.
Ditto here?
Quoted 5 lines
docs/manual/adding-packages-luarocks.txt new file +5
-0+ +Finally, on line 13, we invoke the +luarocks-package+ +macro that generates all the Makefile rules that actually allows the +package to be built. +
docs/manual/adding-packages-luarocks.txt line 53
Quoted 10 lines
docs/manual/adding-packages-luarocks.txt new file +10
-0+[[luarocks-package-reference]] + ++luarocks-package+ reference +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +LuaRocks is a deployment and management system for Lua modules. + +LuaRocks supports various +build.type+ : +builtin+, +make+, +cmake+. +This infrastructure supports only the +builtin+ mode, +the +make+ & +cmake+ modes could be directly handled by generic & cmake infrastructure.
LuaRocks is a deployment and management system for Lua modules, and supports various +build.type+: +builtin+, +make+ and +cmake+. In the contetx of Buildroot, the +luarocks-package+ infrastructure only supports the +builtin+ mode. LuaRocks packages that use the +make+ or +cmake+ build mechanisms should instead be packaged using the +generic-package+ and +cmake-package+ infrastructures in Buildroot, respectively.
docs/manual/adding-packages-luarocks.txt line 62
Quoted 8 lines
docs/manual/adding-packages-luarocks.txt new file +8
-0+The main macro of the LuaRocks package infrastructure is ++luarocks-package+. It is similar to the +generic-package+ macro. +The +host-luarocks-package+ macro is not available, +only the +luarocks-package+ macro is available. + +Just like the generic infrastructure, the LuaRocks infrastructure works +by defining a number of variables before calling the +luarocks-package+ +macro.
The main macro of the LuaRocks package infrastructure is +luarocks-package+: like +generic-package+ it works by defining a number of variables providing meta informations about the package, and then calling +luarocks-package+. It is worth mentioning that building LuaRocks packages for the host is not supported, so the macro +host-luarocks-package+ is not implemented.
docs/manual/adding-packages-luarocks.txt line 67
Quoted 4 lines
docs/manual/adding-packages-luarocks.txt new file +4
-0+First, all the package metadata information variables that exist in +the generic infrastructure also exist in the LuaRocks infrastructure: ++LUAFOO_VERSION+, +LUAFOO_SOURCE+, +LUAFOO_SITE+, ++LUAFOO_DEPENDENCIES+.
LUAFOO_LICENSE, LUAFOO_LICENSE_FILES
Quoted 1 line
+Two of them are populate by the LuaRocks infrastructure (for the
populated
docs/manual/adding-packages-luarocks.txt line 74
Quoted 5 lines
++download+ step) :
docs/manual/adding-packages-luarocks.txt new file +4
-0+ +* +LUAFOO_SITE+ with the +BR2_LUAROCKS_MIRROR+ value + +* +LUAFOO_SOURCE+ with +foo-$(FOO_VERSION).src.rock+
If they are populated by the LuaRocks infrastructure, then there is no point to mention them here.
docs/manual/adding-packages-luarocks.txt line 79
Quoted 4 lines
docs/manual/adding-packages-luarocks.txt new file +4
-0+A few additional variables, specific to the LuaRocks infrastructure, are +also defined. They could be overridden in specific cases. + +* +LUAFOO_ROCKSPEC+ with +foo-$(FOO_VERSION).rockspec+
What does "with" means? I guess it means it is the default value, but it should be explained.
Review
Quoted 2 lines
(quoted diff) +2
-0+ +* +LUAFOO_SUBDIR+ with +foo-$(FOO_VERSION_WITHOUT_ROCKSPEC_REVISION)+
Ditto.
docs/manual/adding-packages-luarocks.txt line 84
Quoted 3 lines
docs/manual/adding-packages-luarocks.txt new file +3
-0+ +* +LUAFOO_BUILD_OPT+ contains the build options for the +luarocks build+ call. + The default is empty.
What is it useful for.
docs/manual/adding-packages-luarocks.txt line 91
Quoted 6 lines
docs/manual/adding-packages-luarocks.txt new file +6
-0+With the LuaRocks infrastructure, only 2 steps use +luarocks+ : +extract and install-target. +luarocks+ handles building and install +in the same step. + +The step +patch+ is handled by the generic infrastructure. +The step +configure+ and +build+ stay empty.
These last two paragraphs are not needed I believe: they give internal details of how the infrastructure works, which are transparent to the user of the infrastructure.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 10/10 manual: adding packages luarocks
Francois, All,
On 2013-12-22 18:40 +0100, Thomas Petazzoni spake thusly:
Quoted 16 lines · Francois Perrad
Quoted 15 lines
docs/manual/adding-packages-luarocks.txt new file +14
-0+Infrastructure for LuaRocks-based packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[[luarocks-package-tutorial]] + ++luarocks-package+ tutorial +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +First, let's see how to write a +.mk+ file for a LuaRocks-based package, +with an example : + +------------------------ +01: ################################################################################ +02: #
Quoted 8 lines
Quoted 6 lines
+03: # luafoo
+04: #
+05: ################################################################################ +06:
+07:LUAFOO_VERSION= 1.0.2-1
+08:LUAFOO_DEPENDENCIES= fooMaybe add
LUAFOO_LICENSEandLUAFOO_LICENSE_FILEShere.
Done.
Quoted 11 lines
docs/manual/adding-packages-luarocks.txt line 32
Quoted 8 lines
+10:
LUAFOO_BUILD_OPT+= FOO_INCDIR=$(STAGING_DIR)/usr/include +11:LUAFOO_BUILD_OPT+= FOO_LIBDIR=$(STAGING_DIR)/usr/lib +12:
+13: $(eval $(luarocks-package))
+------------------------docs/manual/adding-packages-luarocks.txt new file +3
-0+ +On line 7, we declare the version of the package (the same as in the rockspec, +which is the concatenation of the upstream version and the rockspec revision).Maybe indicate that the upstream version and the rockspec version are separated by a '-' sign ?
Done.
Plus my previous comment still stands: provide two versions, one for the upstream version of the package, one for the LuaRocks packaging.
Quoted 5 lines
docs/manual/adding-packages-luarocks.txt line 35
Quoted 2 lines
docs/manual/adding-packages-luarocks.txt new file +2
-0+On line 8, we declare our dependencies, so that they are built +before the build process of our package starts.Maybe mention that dependencies are only needed for packages that link against native libraries?
Done.
Quoted 4 lines
docs/manual/adding-packages-luarocks.txt line 38
Quoted 2 lines
docs/manual/adding-packages-luarocks.txt new file +2
-0+On line 10-11, we tell Buildroot to pass custom options to LuaRocks when it is +building the package.Ditto here?
Ditto.
Quoted 22 lines
Quoted 5 lines
docs/manual/adding-packages-luarocks.txt new file +5
-0+ +Finally, on line 13, we invoke the +luarocks-package+ +macro that generates all the Makefile rules that actually allows the +package to be built. +docs/manual/adding-packages-luarocks.txt line 53
Quoted 10 lines
docs/manual/adding-packages-luarocks.txt new file +10
-0+[[luarocks-package-reference]] + ++luarocks-package+ reference +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +LuaRocks is a deployment and management system for Lua modules. + +LuaRocks supports various +build.type+ : +builtin+, +make+, +cmake+. +This infrastructure supports only the +builtin+ mode, +the +make+ & +cmake+ modes could be directly handled by generic & cmake infrastructure.LuaRocks is a deployment and management system for Lua modules, and supports various +build.type+: +builtin+, +make+ and +cmake+. In the contetx of Buildroot, the +luarocks-package+ infrastructure only supports the +builtin+ mode. LuaRocks packages that use the +make+ or
(quoted diff) +2
-0+cmake+ build mechanisms should instead be packaged using the +generic-package+ and +cmake-package+ infrastructures in Buildroot,
Quoted 1 line
respectively.
Done.
Quoted 7 lines
Quoted 7 lines
docs/manual/adding-packages-luarocks.txt new file +7
-0+The main macro of the LuaRocks package infrastructure is ++luarocks-package+. It is similar to the +generic-package+ macro. +The +host-luarocks-package+ macro is not available, +only the +luarocks-package+ macro is available. + +Just like the generic infrastructure, the LuaRocks infrastructure works +by defining a number of variables before calling the +luarocks-package+
Quoted 8 lines
Quoted 1 line
+macro.
The main macro of the LuaRocks package infrastructure is +luarocks-package+: like +generic-package+ it works by defining a number of variables providing meta informations about the package, and then calling +luarocks-package+. It is worth mentioning that building LuaRocks packages for the host is not supported, so the macro +host-luarocks-package+ is not implemented.
Done.
Quoted 6 lines
docs/manual/adding-packages-luarocks.txt line 67
Quoted 4 lines
docs/manual/adding-packages-luarocks.txt new file +4
-0+First, all the package metadata information variables that exist in +the generic infrastructure also exist in the LuaRocks infrastructure: ++LUAFOO_VERSION+, +LUAFOO_SOURCE+, +LUAFOO_SITE+, ++LUAFOO_DEPENDENCIES+.
LUAFOO_LICENSE,LUAFOO_LICENSE_FILES
Done.
Quoted 3 lines
Quoted 1 line
+Two of them are populate by the LuaRocks infrastructure (for the
populated
Done.
Quoted 8 lines
docs/manual/adding-packages-luarocks.txt line 74
Quoted 5 lines
++download+ step) :
docs/manual/adding-packages-luarocks.txt new file +4
-0+ +* +LUAFOO_SITE+ with the +BR2_LUAROCKS_MIRROR+ value + +* +LUAFOO_SOURCE+ with +foo-$(FOO_VERSION).src.rock+If they are populated by the LuaRocks infrastructure, then there is no point to mention them here.
I've added some wording: in case they do not come from the LuaRocks official mirror, or the BR2_LUAROCKS_MIRROR.
Quoted 7 lines
docs/manual/adding-packages-luarocks.txt line 79
Quoted 4 lines
docs/manual/adding-packages-luarocks.txt new file +4
-0+A few additional variables, specific to the LuaRocks infrastructure, are +also defined. They could be overridden in specific cases. + +* +LUAFOO_ROCKSPEC+ with +foo-$(FOO_VERSION).rockspec+What does "with" means? I guess it means it is the default value, but it should be explained.
Fixed.
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +* +LUAFOO_SUBDIR+ with +foo-$(FOO_VERSION_WITHOUT_ROCKSPEC_REVISION)+Ditto.
Ditto.
Quoted 5 lines
docs/manual/adding-packages-luarocks.txt line 84
Quoted 3 lines
docs/manual/adding-packages-luarocks.txt new file +3
-0+ +* +LUAFOO_BUILD_OPT+ contains the build options for the +luarocks build+ call. + The default is empty.What is it useful for.
The same as for the Python infra's _BUILD_OPT, I guess? ;-)
Quoted 10 lines
docs/manual/adding-packages-luarocks.txt line 91
Quoted 6 lines
docs/manual/adding-packages-luarocks.txt new file +6
-0+With the LuaRocks infrastructure, only 2 steps use +luarocks+ : +extract and install-target. +luarocks+ handles building and install +in the same step. + +The step +patch+ is handled by the generic infrastructure. +The step +configure+ and +build+ stay empty.These last two paragraphs are not needed I believe: they give internal details of how the infrastructure works, which are transparent to the user of the infrastructure.
Done.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 10/10 manual: adding packages luarocks
In reply to Francois PerradFrancois, All,
On 2013-11-15 14:07 +0100, Francois Perrad spake thusly:
Quoted 25 lines
Signed-off-by Francois Perrad <[email protected]>--- docs/manual/adding-packages-luarocks.txt | 91 ++++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 + 2 files changed, 93 insertions(+) create mode 100644 docs/manual/adding-packages-luarocks.txtdocs/manual/adding-packages-luarocks.txt new file +12
-0@@ -0,0 +1,91 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +Infrastructure for LuaRocks-based packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[[luarocks-package-tutorial]] + ++luarocks-package+ tutorial +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +First, let's see how to write a +.mk+ file for a LuaRocks-based package,
docs/manual/adding-packages-luarocks.txt line 22
Quoted 10 lines
docs/manual/adding-packages-luarocks.txt new file +10
-0+with an example : + +------------------------ +01: ################################################################################ +02: # +03: # luafoo +04: # +05: ################################################################################ +06: +07: LUAFOO_VERSION = 1.0.2-1
I wonder if we should not split this in two:
- LUAFOO_VERSION: the version of the package itself, as released by upstream
- LUAFOO_ROCKS_VERSION: the version of the LuaRocks packaging
Then, the ifnrastrucutre would just concatenate the two version strings. In my opinion, I think this is better to separate them: it makes it explixit what the package version is, and what the packaging version is.
docs/manual/adding-packages-luarocks.txt line 26
Quoted 4 lines
docs/manual/adding-packages-luarocks.txt new file +4
-0+08: LUAFOO_DEPENDENCIES = foo +09: +10: LUAFOO_BUILD_OPT += FOO_INCDIR=$(STAGING_DIR)/usr/include +11: LUAFOO_BUILD_OPT += FOO_LIBDIR=$(STAGING_DIR)/usr/lib
I wonder if those two are good example of _BUILD_OPT, since they are (probably) already handled by the LuaRocks infrastrucutre.
And since no converted Lua package so far needed any of the above, and the build was successfull on my machine (not run-time tested, though), I guess they are not needed.
Maybe a very generic exampel should be used, such as:
LUAFOO_BUILD_OPT += --enable-option
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 10/10 manual: adding packages luarocks
Francois, All,
On 2013-12-22 21:02 +0100, Yann E. MORIN spake thusly:
Quoted 42 lines
On 2013-11-15 14:07 +0100, Francois Perrad spake thusly:
Quoted 25 lines
Signed-off-by Francois Perrad <[email protected]>--- docs/manual/adding-packages-luarocks.txt | 91 ++++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 + 2 files changed, 93 insertions(+) create mode 100644 docs/manual/adding-packages-luarocks.txtdocs/manual/adding-packages-luarocks.txt new file +12
-0@@ -0,0 +1,91 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +Infrastructure for LuaRocks-based packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[[luarocks-package-tutorial]] + ++luarocks-package+ tutorial +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +First, let's see how to write a +.mk+ file for a LuaRocks-based package,docs/manual/adding-packages-luarocks.txt line 22
Quoted 10 lines
docs/manual/adding-packages-luarocks.txt new file +10
-0+with an example : + +------------------------ +01: ################################################################################ +02: # +03: # luafoo +04: # +05: ################################################################################ +06: +07: LUAFOO_VERSION = 1.0.2-1I wonder if we should not split this in two:
-LUAFOO_VERSION: the version of the package itself, as released by upstream
-LUAFOO_ROCKS_VERSION: the version of the LuaRocks packaging
Quoted 3 lines
Then, the ifnrastrucutre would just concatenate the two version strings. In my opinion, I think this is better to separate them: it makes it explixit what the package version is, and what the packaging version is.
Since I just forgot to do it, I'll let you implement it on your side if you agree with that. ;-)
Quoted 8 lines
docs/manual/adding-packages-luarocks.txt line 26
Quoted 4 lines
docs/manual/adding-packages-luarocks.txt new file +4
-0+08: LUAFOO_DEPENDENCIES = foo +09: +10: LUAFOO_BUILD_OPT += FOO_INCDIR=$(STAGING_DIR)/usr/include +11: LUAFOO_BUILD_OPT += FOO_LIBDIR=$(STAGING_DIR)/usr/libI wonder if those two are good example of
_BUILD_OPT, since they are (probably) already handled by the LuaRocks infrastrucutre.
Quoted 6 lines
And since no converted Lua package so far needed any of the above, and the build was successfull on my machine (not run-time tested, though), I guess they are not needed.
Maybe a very generic exampel should be used, such as:
LUAFOO_BUILD_OPT += --enable-option
Francois, care to provide a proper example of a _BUILD_OPT ?
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 1/10 luainterpreter: create virtual package
In reply to Francois PerradDear Francois Perrad,
Quoted 1 line · Francois Perrad
luainterpreter is lua or luajit
It would be good to have slightly more verbose commit logs. Something like:
"""
This commit introduces the 'luainterpreter' package, which serves as a virtual package depending either on the 'lua' package or the 'luajit' package depending on which interpreter is selected.
In order to achieve this, it also updates all the existing Lua packages to depend on luainterpreter... blablabla.
"""
package/Config.in source "package/haserl/Config.in" · line 357
Quoted 11 lines
package/Config.in +1
-0@@ -352,6 +352,7 @@ source "package/haserl/Config.in" source "package/jamvm/Config.in" source "package/jimtcl/Config.in" source "package/lua/Config.in" +source "package/luainterpreter/Config.in" source "package/luajit/Config.in" if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT
Why not replace this condition by:
if BR2_PACKAGE_HAS_LUA_INTERPRETER
so that you can remove the "depends on BR2_PACKAGE_HAS_LUA_INTERPRETER" in all of the Lua packages.
package/lbase64/Config.in line 3
Quoted 9 lines
package/Config.in +0
-0menu "Lua libraries/modules"package/lbase64/Config.in +1
-0@@ -1,5 +1,6 @@ config BR2_PACKAGE_LBASE64 bool "lbase64" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
Like this one.
Quoted 21 lines
package/lbase64/Config.in +0
-0help A base64 library for Luapackage/lbase64/lbase64.mk +1
-1@@ -9,7 +9,7 @@ LBASE64_SITE = http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1 LBASE64_SOURCE = lbase64.tar.gz LBASE64_LICENSE = Public domain LBASE64_LICENSE_FILES = README -LBASE64_DEPENDENCIES = lua +LBASE64_DEPENDENCIES = luainterpreter define LBASE64_BUILD_CMDS $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \package/lua-ev/Config.in +0
-0
package/lua-ev/Config.in line 3
Quoted 3 lines
package/lua-ev/Config.in +1
-0@@ -1,5 +1,6 @@ config BR2_PACKAGE_LUA_EV bool "lua-ev" + depends on BR2_PACKAGE_HAS_LUA_INTERPRETER
This one. And so on.
package/luainterpreter/luainterpreter.mk line 5
Quoted 11 lines
package/luainterpreter/luainterpreter.mk new file +5
-0@@ -0,0 +1,18 @@ +############################################################# +# +# Virtual package for luainterpreter +# +#############################################################
No need for a special comment. Just "luainterpreter" is sufficient.
package/luainterpreter/luainterpreter.mk line 18
Quoted 12 lines
package/luainterpreter/luainterpreter.mk new file +12
-0+LUAINTERPRETER_VERSION = virtual +LUAINTERPRETER_SOURCE = + +ifeq ($(BR2_PACKAGE_LUA),y) +LUAINTERPRETER_DEPENDENCIES = lua +endif + +ifeq ($(BR2_PACKAGE_LUAJIT),y) +LUAINTERPRETER_DEPENDENCIES = luajit +endif + +$(eval $(generic-package))
This should probably be converted to use the new virtual package scheme proposed by Yann. But Yann is telling me on IRC that he has already done so.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 1/10 luainterpreter: create virtual package
Francois, All,
On 2013-12-22 18:22 +0100, Thomas Petazzoni spake thusly:
Quoted 6 lines · Francois Perrad
Quoted 1 line
luainterpreter is lua or luajit
It would be good to have slightly more verbose commit logs. Something like:
Quoted 8 lines
"""
This commit introduces the 'luainterpreter' package, which serves as a virtual package depending either on the 'lua' package or the 'luajit' package depending on which interpreter is selected.In order to achieve this, it also updates all the existing Lua packages to depend on luainterpreter... blablabla.
"""
I've tried to be a bit more verbose in the commit log. To be reviewed.
Quoted 14 lines
package/Config.in source "package/haserl/Config.in" · line 357
Quoted 11 lines
package/Config.in +1
-0@@ -352,6 +352,7 @@ source "package/haserl/Config.in" source "package/jamvm/Config.in" source "package/jimtcl/Config.in" source "package/lua/Config.in" +source "package/luainterpreter/Config.in" source "package/luajit/Config.in" if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJITWhy not replace this condition by:
Quoted 1 line
if
BR2_PACKAGE_HAS_LUA_INTERPRETER
Done.
Quoted 2 lines
so that you can remove the "depends on
BR2_PACKAGE_HAS_LUA_INTERPRETER" in all of the Lua packages.
Doh, I forgot that one... :-(
Quoted 5 lines
Quoted 5 lines
package/luainterpreter/luainterpreter.mk new file +0
-0
Quoted 8 lines
package/luainterpreter/luainterpreter.mk line 5
Quoted 6 lines
package/luainterpreter/luainterpreter.mk new file +5
-0@@ -0,0 +1,18 @@ +############################################################# +# +# Virtual package for luainterpreter +# +#############################################################No need for a special comment. Just "luainterpreter" is sufficient.
Done.
Quoted 8 lines
Quoted 8 lines
package/luainterpreter/luainterpreter.mk new file +8
-0+LUAINTERPRETER_VERSION = virtual +LUAINTERPRETER_SOURCE = + +ifeq ($(BR2_PACKAGE_LUA),y) +LUAINTERPRETER_DEPENDENCIES = lua +endif + +ifeq ($(BR2_PACKAGE_LUAJIT),y)
Quoted 8 lines
package/luainterpreter/luainterpreter.mk line 18
Quoted 4 lines
package/luainterpreter/luainterpreter.mk new file +4
-0+LUAINTERPRETER_DEPENDENCIES = luajit +endif + +$(eval $(generic-package))This should probably be converted to use the new virtual package scheme proposed by Yann. But Yann is telling me on IRC that he has already done so.
Yep, done.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 1/10 luainterpreter: create virtual package
In reply to Francois PerradFrancois, All,
On 2013-11-15 14:07 +0100, Francois Perrad spake thusly:
Quoted 1 line
luainterpreter is lua or luajit
As you may have guessed from Thomas replies, I've been working with that lua series of yours, and rebased it on-top of current master.
I also converted it to the new 'pacakge-defined providers' scheme for virtual package, that we are switching to.
To avoid duplicated work, I'll apply all of Thomas suggestions I can deal with, and will push the update series for you to take back and reply to Thomas comments I did not address.
I'll get you posted when that's been done.
Note: I'm not really interested in lua, but I find it interesting we have this infra applied. So, don't expect me to be too much active in this series, besides this bump. ;-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 1/10 luainterpreter: create virtual package
Francois, All,
On 2013-12-22 18:37 +0100, Yann E. MORIN spake thusly:
Quoted 6 lines
On 2013-11-15 14:07 +0100, Francois Perrad spake thusly:
Quoted 1 line
luainterpreter is lua or luajit
As you may have guessed from Thomas replies, I've been working with that lua series of yours, and rebased it on-top of current master.
Quoted 8 lines
I also converted it to the new 'pacakge-defined providers' scheme for virtual package, that we are switching to.
To avoid duplicated work, I'll apply all of Thomas suggestions I can deal with, and will push the update series for you to take back and reply to Thomas comments I did not address.
I'll get you posted when that's been done.
So, I've pushed my branch to:
git://gitorious.org/buildroot/buildroot.git yem/lua-infra
which you can pull from, or alternatively, apply the patches that have been sent to the list.
I replied on Thomas' suggestions to indicate what I've done, so you can see what is missing. Basically, I did not address Thomas' comments that deals with the actual LuaRocks infrastructure (such as a the _SUB_DIR stuff), since I don;t really know what to do about those, and you are probably more knowledgeable than I in this matter. ;-)
Thank you for your initial work, and I hope we can see this updated and merged soon! :-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'