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.

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