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.

99 lines
2.6 KiB

  1. #
  2. # Copyright (C) 2009-2013 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:=luasocket
  9. PKG_SOURCE_DATE:=2019-04-21
  10. PKG_SOURCE_VERSION:=733af884f1aa18ff469bf3c4d18810e815853211
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://github.com/diegonehab/luasocket
  14. PKG_MIRROR_HASH:=60aef7544426cae3e6c7560a6e4ad556a04b879ca0ad0311645b2c513c872128
  15. PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=LICENSE
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/luasocket/default
  20. SUBMENU:=Lua
  21. SECTION:=lang
  22. CATEGORY:=Languages
  23. URL:=http://w3.impa.br/~diego/software/luasocket
  24. endef
  25. define Package/luasocket
  26. $(Package/luasocket/default)
  27. TITLE:=LuaSocket
  28. DEPENDS:=+lua
  29. VARIANT:=lua-51
  30. DEFAULT_VARIANT:=1
  31. endef
  32. define Package/luasocket5.3
  33. $(Package/luasocket/default)
  34. TITLE:=LuaSocket 5.3
  35. DEPENDS:=+liblua5.3
  36. VARIANT:=lua-53
  37. endef
  38. ifeq ($(BUILD_VARIANT),lua-51)
  39. LUA_VERSION=5.1
  40. endif
  41. ifeq ($(BUILD_VARIANT),lua-53)
  42. LUA_VERSION=5.3
  43. endif
  44. define Package/luasocket/default/description
  45. LuaSocket is the most comprehensive networking support
  46. library for the Lua language. It provides easy access to
  47. TCP, UDP, DNS, SMTP, FTP, HTTP, MIME and much more.
  48. endef
  49. Package/luasocket/description = $(Package/luasocket/default/description)
  50. Package/luasocket5.3/description = $(Package/luasocket/default/description)
  51. define Build/Configure
  52. endef
  53. define Build/Compile
  54. $(MAKE) -C $(PKG_BUILD_DIR)/ \
  55. LIBDIR="$(TARGET_LDFLAGS)" \
  56. CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  57. LD="$(TARGET_CROSS)ld -shared" \
  58. LUAV=$(LUA_VERSION) LUAINC_linux_base=$(STAGING_DIR)/usr/include \
  59. all
  60. endef
  61. define Package/luasocket/install
  62. $(INSTALL_DIR) $(1)/usr/lib/lua
  63. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ltn12,mime,socket}.lua $(1)/usr/lib/lua
  64. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mime-1.0.3.so $(1)/usr/lib/lua
  65. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/socket-3.0-rc1.so $(1)/usr/lib/lua
  66. $(INSTALL_DIR) $(1)/usr/lib/lua/mime
  67. ln -sf ../mime-1.0.3.so $(1)/usr/lib/lua/mime/core.so
  68. $(INSTALL_DIR) $(1)/usr/lib/lua/socket
  69. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ftp,http,smtp,tp,url,headers}.lua $(1)/usr/lib/lua/socket
  70. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/unix.so $(1)/usr/lib/lua/socket
  71. ln -sf ../socket-3.0-rc1.so $(1)/usr/lib/lua/socket/core.so
  72. endef
  73. define Package/luasocket5.3/install
  74. $(MAKE) -C $(PKG_BUILD_DIR)/src \
  75. DESTDIR="$(1)" \
  76. LUAV=$(LUA_VERSION) \
  77. install
  78. endef
  79. $(eval $(call BuildPackage,luasocket))
  80. $(eval $(call BuildPackage,luasocket5.3))