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.

89 lines
2.2 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
  21. HOST_BUILD_DEPENDS:=$(PKG_BUILD_DEPENDS)
  22. HOST_BUILD_PARALLEL:=1
  23. HOST_BUILD_PREFIX:=$(STAGING_DIR)/host
  24. HOST_BUILD_DIR:=$(BUILD_DIR)/host/$(PKG_NAME)-$(PKG_VERSION)
  25. include $(INCLUDE_DIR)/host-build.mk
  26. include $(INCLUDE_DIR)/package.mk
  27. define Package/luarocks
  28. SUBMENU:=Lua
  29. SECTION:=lang
  30. CATEGORY:=Languages
  31. TITLE:=luarocks
  32. URL:=https://github.com/keplerproject/luarocks
  33. DEPENDS:=+lua +luac +liblua +luasocket +unzip +curl +luasec
  34. endef
  35. define Package/luarocks/description
  36. LuaRocks is a deployment and management system for Lua modules.
  37. endef
  38. # My custom args, copied and modified from SDK_ROOT/include/package-defaults.mk
  39. CONFIGURE_ARGS = \
  40. --prefix=$(CONFIGURE_PREFIX) \
  41. --sysconfdir=/etc \
  42. --with-lua=$(STAGING_DIR_HOSTPKG)
  43. HOST_CONFIGURE_ARGS= \
  44. --prefix=$(STAGING_DIR)/host \
  45. --sysconfdir=$(STAGING_DIR)/host/etc \
  46. --with-lua=$(STAGING_DIR_HOSTPKG)
  47. CONFIGURE_VARS = \
  48. LUAROCKS_UNAME_S="Linux" \
  49. LUAROCKS_UNAME_M="$(ARCH)"
  50. HOST_CONFIGURE_VARS = \
  51. LUAROCKS_UNAME_S="Linux" \
  52. LUAROCKS_UNAME_M="$(ARCH)"
  53. define Build/Compile
  54. $(call Build/Compile/Default,build)
  55. endef
  56. define Host/Compile
  57. $(call Host/Compile/Default,build)
  58. endef
  59. define Package/luarocks/install
  60. $(INSTALL_DIR) $(1)/usr/bin
  61. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-5.1 $(1)/usr/bin/luarocks
  62. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-admin-5.1 $(1)/usr/bin/luarocks-admin
  63. $(CP) $(PKG_INSTALL_DIR)/usr/share $(1)/usr/share
  64. $(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
  65. endef
  66. define Host/Install
  67. $(MAKE) -C $(HOST_BUILD_DIR) install
  68. endef
  69. $(eval $(call BuildPackage,luarocks))
  70. $(eval $(call HostBuild))