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.

64 lines
1.8 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_RELEASE:=1
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL:=https://github.com/srdgame/librs232
  12. PKG_SOURCE_DATE:=2019-09-17
  13. PKG_SOURCE_VERSION:=1c29a279484ee4850611b76a6571566e0ec133bb
  14. PKG_MIRROR_HASH:=c9063a729935135278f17dd98ca31757acfd4405bdf9f6e49d77ed0df8ddc823
  15. PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  21. PKG_BUILD_DEPENDS:=lua/host
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/lua-rs232
  24. SUBMENU:=Lua
  25. SECTION:=lang
  26. CATEGORY:=Languages
  27. TITLE:=Lua Serial Library
  28. URL:=https://github.com/srdgame/librs232
  29. DEPENDS:= +lua
  30. endef
  31. define Package/lua-rs232/description
  32. multiplatform library for serial communications over RS-232
  33. endef
  34. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  35. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  36. define Build/InstallDev
  37. $(INSTALL_DIR) $(1)/usr/include/librs232
  38. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/librs232/rs232* $(1)/usr/include/librs232
  39. $(INSTALL_DIR) $(1)/usr/lib
  40. $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232* $(1)/usr/lib/
  41. $(INSTALL_DIR) $(1)/usr/lib/lua/5.1
  42. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/luars232* $(1)/usr/lib/lua/5.1
  43. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  44. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/librs232.pc $(1)/usr/lib/pkgconfig
  45. endef
  46. define Package/lua-rs232/install
  47. $(INSTALL_DIR) $(1)/usr/lib/
  48. $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232.so* $(1)/usr/lib/
  49. $(INSTALL_DIR) $(1)/usr/lib/lua/5.1
  50. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/luars232* $(1)/usr/lib/lua/5.1
  51. endef
  52. $(eval $(call BuildPackage,lua-rs232))