You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.0 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=luarocks
  9. PKG_VERSION:=2.2.2
  10. PKG_RELEASE:=4
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/keplerproject/luarocks
  13. PKG_SOURCE_VERSION:=v$(PKG_VERSION)
  14. PKG_MIRROR_HASH:=e4cf874c9bce34a5accd41daaf51a3213763b8b6f7f658ca4d13a70a7ddb1c0c
  15. PKG_MAINTAINER:=Amr Hassan <amr.hassan@gmail.com>
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_BUILD_DEPENDS:=lua/host zip/host
  21. HOST_BUILD_DEPENDS:=$(PKG_BUILD_DEPENDS)
  22. HOST_BUILD_PARALLEL:=1
  23. include $(INCLUDE_DIR)/host-build.mk
  24. include $(INCLUDE_DIR)/package.mk
  25. define Package/luarocks
  26. SUBMENU:=Lua
  27. SECTION:=lang
  28. CATEGORY:=Languages
  29. TITLE:=luarocks
  30. URL:=https://github.com/keplerproject/luarocks
  31. DEPENDS:=+lua +luac +liblua +luasocket +unzip +curl +luasec
  32. endef
  33. define Package/luarocks/description
  34. LuaRocks is a deployment and management system for Lua modules.
  35. endef
  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_HOSTPKG)
  41. HOST_CONFIGURE_ARGS= \
  42. --prefix=$(STAGING_DIR_HOSTPKG) \
  43. --sysconfdir=$(STAGING_DIR_HOSTPKG)/etc \
  44. --with-lua=$(STAGING_DIR_HOSTPKG)
  45. CONFIGURE_VARS = \
  46. LUAROCKS_UNAME_S="Linux" \
  47. LUAROCKS_UNAME_M="$(ARCH)"
  48. define Build/Compile
  49. $(call Build/Compile/Default,build)
  50. endef
  51. define Host/Compile
  52. $(call Host/Compile/Default,build)
  53. endef
  54. define Package/luarocks/install
  55. $(INSTALL_DIR) $(1)/usr/bin
  56. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-5.1 $(1)/usr/bin/luarocks
  57. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-admin-5.1 $(1)/usr/bin/luarocks-admin
  58. $(CP) $(PKG_INSTALL_DIR)/usr/share $(1)/usr/share
  59. $(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
  60. endef
  61. define Host/Install
  62. $(MAKE) -C $(HOST_BUILD_DIR) install
  63. endef
  64. $(eval $(call BuildPackage,luarocks))
  65. $(eval $(call HostBuild))