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.

62 lines
1.5 KiB

  1. #
  2. # Copyright (C) 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:=lua-rs232
  9. PKG_VERSION:=1.0.3
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
  12. PKG_LICENSE:=MIT
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
  15. PKG_SOURCE_PROTO:=git
  16. PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
  17. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/lua-rs232
  21. SUBMENU:=Lua
  22. SECTION:=lang
  23. CATEGORY:=Languages
  24. TITLE:=Lua Serial Library
  25. URL:=https://github.com/srdgame/librs232
  26. DEPENDS:= +lua
  27. endef
  28. define Package/lua-rs232/description
  29. multiplatform library for serial communications over RS-232
  30. endef
  31. CONFIGURE_ARGS += \
  32. --with-lua-inc=$(STAGING_DIR)/usr/include \
  33. --with-lua-lib=$(STAGING_DIR)/usr/lib
  34. #define Build/Configure
  35. # ( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
  36. # $(call Build/Configure/Default)
  37. #endef
  38. define Build/Configure
  39. endef
  40. define Build/Compile
  41. (cd "$(PKG_BUILD_DIR)"; $(TARGET_CC) src/rs232.c src/rs232_posix.c bindings/lua/luars232.c -DLUAROCKS_HACK -std=gnu99 -I./include -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib -fPIC -shared -o luars232.so)
  42. endef
  43. define Build/Install
  44. endef
  45. define Package/lua-rs232/install
  46. $(INSTALL_DIR) $(1)/usr/lib/lua
  47. $(INSTALL_BIN) $(PKG_BUILD_DIR)/luars232.so $(1)/usr/lib/lua/
  48. endef
  49. $(eval $(call BuildPackage,lua-rs232))