aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmr Hassan <amr.hassan@codescalers.com>2015-02-22 13:34:42 +0200
committerAmr Hassan <amr.hassan@gmail.com>2015-03-01 14:59:19 +0200
commit857a85a60dbc7ae61d722e32ae9934fb8f387c94 (patch)
tree5a0caa2e8a5810ab1f7fb611c2f1f9bd78104ff7
parentc36bc9cee05ad01ea6b51b4976b61ce2f154e056 (diff)
LuaRocks: Add new package
Signed-off-by: Amr Hassan <amr.hassan@gmail.com>
2 files changed, 67 insertions, 0 deletions
diff --git a/lang/luarocks/Makefile b/lang/luarocks/Makefile
new file mode 100644
index 000000000..15643ff5d
--- /dev/null
+++ b/lang/luarocks/Makefile
@@ -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
index 000000000..a1bad2151
--- /dev/null
+++ b/lang/luarocks/patches/01_dont_modify_bin_shebang.diff
@@ -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