lua*: refactor with luarocks infrastructure
authorFrancois Perrad <fperrad@gmail.com>
Sat, 11 Jan 2014 15:42:10 +0000 (16:42 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 13 Jan 2014 22:18:29 +0000 (23:18 +0100)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
15 files changed:
package/cgilua/cgilua.mk
package/copas/copas.mk
package/lbase64/lbase64.mk
package/lua-cjson/lua-cjson.mk
package/luabitop/luabitop.mk
package/luaexpat/luaexpat.mk
package/luafilesystem/luafilesystem-without_large_file.patch
package/luafilesystem/luafilesystem.mk
package/luasec/luasec.mk
package/luasql-sqlite3/luasql-sqlite3.mk
package/orbit/orbit-01-fix-installation.patch [deleted file]
package/orbit/orbit.mk
package/rings/rings.mk
package/wsapi/wsapi.mk
package/xavante/xavante.mk

index 3dd2d7754dc8bff889dfbf8c20a92025c2d16d69..bdb141120c4e203f82a9a96ba0f406076c4cf29e 100644 (file)
@@ -4,12 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index b8cd4259450665f0fdf4a4fd2d4f689713f10185..302113956e0b73b1e05b765230fd2a5cd823a787 100644 (file)
@@ -4,13 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index cb8ef17289e0b0f4b6a1b9e171b1626b36876e30..4289f58cc48873ecfd82269d2fb53103c0859cc8 100644 (file)
@@ -4,21 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index 92af23f1dc82525570cf6e3aa0c53d1920c34154..16cb97412a074964ac65e4fe5333ca98032d9401 100644 (file)
@@ -4,23 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index 083be3572ca370b1eaeb916e915c95ff8333b84c..4368c94b4d9c8e23fb1cfd94cb40e71150c116a5 100644 (file)
@@ -4,19 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index 734478a7acf97591614e3a625aa26e8d4e37eef8..d507c2a79512e428db6e0b3ce91976538e63fb7b 100644 (file)
@@ -4,27 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index b1f41c09daa210bc287b2dcb9796836c697a46ed..5b24b991c33050c86055c670ca1cbac0c25f0bdf 100644 (file)
@@ -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
index 908d02e2ab1efad0a0052d5ab4278d4fa38f8f08..7943201705a9c590a4e77fcf5dc00095cfdde9b0 100644 (file)
@@ -4,21 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index a2a2cc2998d657be3e0be6f6fd5c4819d1ccc8c1..354e805434188380cf22aef995860a58c1e08611 100644 (file)
@@ -4,22 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index b114f0237b98251f2d3c793e3a4e45c83c1e98cd..0e7ae6a14c141daa7209d01ae8071f3c320b831b 100644 (file)
@@ -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))
diff --git a/package/orbit/orbit-01-fix-installation.patch b/package/orbit/orbit-01-fix-installation.patch
deleted file mode 100644 (file)
index ae50ad9..0000000
+++ /dev/null
@@ -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 <thomas.petazzoni@free-electrons.com>
-
-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
index 711589665fe561bce695ffbd713fe08ea9ccc898..e5a8676408657b8d480245c55ae4a1378f282285 100644 (file)
@@ -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))
index fe1c2b2e7c90f8dfbcdfced64cc4e83652d096f8..c23f8797441dd5b376e6149d29a6d617ecea7d47 100644 (file)
@@ -4,17 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index 46baebf84c72682445b76e66b2f6ff397569a83d..f1ea9b561d1ddf92c8053e2c250d0e28fbbfe6e8 100644 (file)
@@ -4,14 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))
index 7c01ee61ea20f319475387cb074ffa190140a56b..c8d4d93f7c23f5f527e1b3ab9f4c9fa3ad935b5f 100644 (file)
@@ -4,12 +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
-
-$(eval $(generic-package))
+$(eval $(luarocks-package))