LuaRocks: Add new package 943/head
authorAmr Hassan <amr.hassan@codescalers.com>
Sun, 22 Feb 2015 11:34:42 +0000 (13:34 +0200)
committerAmr Hassan <amr.hassan@gmail.com>
Sun, 1 Mar 2015 12:59:19 +0000 (14:59 +0200)
Signed-off-by: Amr Hassan <amr.hassan@gmail.com>
lang/luarocks/Makefile [new file with mode: 0644]
lang/luarocks/patches/01_dont_modify_bin_shebang.diff [new file with mode: 0644]

diff --git a/lang/luarocks/Makefile b/lang/luarocks/Makefile
new file mode 100644 (file)
index 0000000..15643ff
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# 
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luarocks
+PKG_VERSION:=2.2.0-rc1
+PKG_RELEASE:=2
+
+PKG_SOURCE:=v$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/$(PKG_NAME)/archive/
+PKG_MAINTAINER:=Amr Hassan <amr.hassan@gmail.com>
+PKG_INSTALL=1
+PKG_BUILD_DEPENDS:=lua/host luac/host
+PKG_LICENSE=GPL
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luarocks
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=luarocks
+  URL:=https://github.com/keplerproject/luarocks
+  DEPENDS:=+lua +luac +liblua +luasocket +unzip +curl +luasec
+endef
+
+define Package/luarocks/description
+       LuaRocks is a deployment and management system for Lua modules.
+endef
+
+# My custom args, copied and modified from SDK_ROOT/include/package-defaults.mk
+CONFIGURE_ARGS = \
+    --prefix=$(CONFIGURE_PREFIX) \
+    --sysconfdir=/etc \
+    --with-lua=$(STAGING_DIR_HOST)
+
+define Build/Compile
+       $(call Build/Compile/Default,build)
+endef
+
+define Package/luarocks/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-5.1 $(1)/usr/bin/luarocks
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-admin-5.1 $(1)/usr/bin/luarocks-admin
+       $(CP) $(PKG_INSTALL_DIR)/usr/share $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
+endef
+
+$(eval $(call BuildPackage,luarocks))
diff --git a/lang/luarocks/patches/01_dont_modify_bin_shebang.diff b/lang/luarocks/patches/01_dont_modify_bin_shebang.diff
new file mode 100644 (file)
index 0000000..a1bad21
--- /dev/null
@@ -0,0 +1,13 @@
+diff -rupN luarocks/Makefile luarocks.new/Makefile
+--- luarocks/Makefile  2015-02-19 13:24:07.027310956 +0200
++++ luarocks.new/Makefile      2015-02-22 13:28:24.497353543 +0200
+@@ -104,7 +104,7 @@ build_bins: cleanup_bins
+       for f in $(BIN_FILES) ;\
+       do \
+          sed "1d" src/bin/$$f > src/bin/$$f.bak ;\
+-         echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\
++         echo "#!/usr/bin/env lua" > src/bin/$$f ;\
+          echo "package.path = [[$(LUADIR)/?.lua;]]..package.path" | sed "s,//,/,g" >> src/bin/$$f ;\
+          cat src/bin/$$f.bak >> src/bin/$$f ;\
+          chmod +x src/bin/$$f ;\
+Binary files luarocks/src/bin/.luarocks.swp and luarocks.new/src/bin/.luarocks.swp differ