Browse Source

LuaRocks: Add new package

Signed-off-by: Amr Hassan <amr.hassan@gmail.com>
Amr Hassan 9 years ago
parent
commit
857a85a60d
2 changed files with 67 additions and 0 deletions
  1. 54
    0
      lang/luarocks/Makefile
  2. 13
    0
      lang/luarocks/patches/01_dont_modify_bin_shebang.diff

+ 54
- 0
lang/luarocks/Makefile View File

@@ -0,0 +1,54 @@
1
+#
2
+# Copyright (C) 2006-2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+# 
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=luarocks
11
+PKG_VERSION:=2.2.0-rc1
12
+PKG_RELEASE:=2
13
+
14
+PKG_SOURCE:=v$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=https://github.com/keplerproject/$(PKG_NAME)/archive/
16
+PKG_MAINTAINER:=Amr Hassan <amr.hassan@gmail.com>
17
+PKG_INSTALL=1
18
+PKG_BUILD_DEPENDS:=lua/host luac/host
19
+PKG_LICENSE=GPL
20
+
21
+include $(INCLUDE_DIR)/package.mk
22
+
23
+define Package/luarocks
24
+  SUBMENU:=Lua
25
+  SECTION:=lang
26
+  CATEGORY:=Languages
27
+  TITLE:=luarocks
28
+  URL:=https://github.com/keplerproject/luarocks
29
+  DEPENDS:=+lua +luac +liblua +luasocket +unzip +curl +luasec
30
+endef
31
+
32
+define Package/luarocks/description
33
+	LuaRocks is a deployment and management system for Lua modules.
34
+endef
35
+
36
+# My custom args, copied and modified from SDK_ROOT/include/package-defaults.mk
37
+CONFIGURE_ARGS = \
38
+    --prefix=$(CONFIGURE_PREFIX) \
39
+    --sysconfdir=/etc \
40
+    --with-lua=$(STAGING_DIR_HOST)
41
+
42
+define Build/Compile
43
+	$(call Build/Compile/Default,build)
44
+endef
45
+
46
+define Package/luarocks/install
47
+	$(INSTALL_DIR) $(1)/usr/bin
48
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-5.1 $(1)/usr/bin/luarocks
49
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-admin-5.1 $(1)/usr/bin/luarocks-admin
50
+	$(CP) $(PKG_INSTALL_DIR)/usr/share $(1)/usr/share
51
+	$(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
52
+endef
53
+
54
+$(eval $(call BuildPackage,luarocks))

+ 13
- 0
lang/luarocks/patches/01_dont_modify_bin_shebang.diff View File

@@ -0,0 +1,13 @@
1
+diff -rupN luarocks/Makefile luarocks.new/Makefile
2
+--- luarocks/Makefile	2015-02-19 13:24:07.027310956 +0200
3
++++ luarocks.new/Makefile	2015-02-22 13:28:24.497353543 +0200
4
+@@ -104,7 +104,7 @@ build_bins: cleanup_bins
5
+ 	for f in $(BIN_FILES) ;\
6
+ 	do \
7
+ 	   sed "1d" src/bin/$$f > src/bin/$$f.bak ;\
8
+-	   echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\
9
++	   echo "#!/usr/bin/env lua" > src/bin/$$f ;\
10
+ 	   echo "package.path = [[$(LUADIR)/?.lua;]]..package.path" | sed "s,//,/,g" >> src/bin/$$f ;\
11
+ 	   cat src/bin/$$f.bak >> src/bin/$$f ;\
12
+ 	   chmod +x src/bin/$$f ;\
13
+Binary files luarocks/src/bin/.luarocks.swp and luarocks.new/src/bin/.luarocks.swp differ