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.

65 lines
1.9 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_SOURCE_DATE:=2019-11-20
  10. PKG_SOURCE_VERSION:=c106c94d1a5a84e8582c936528303528608776c2
  11. PKG_RELEASE:=2
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://github.com/srdgame/librs232
  14. PKG_MIRROR_HASH:=6fcabfd1501b3a7719229334ce73f1cc74f5ac5795b8faf6d65eb2ae6b14f9a5
  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. MAKE_FLAGS += luadir='$$$${prefix}/lib/lua' luaexecdir='$$$${exec_prefix}/lib/lua'
  37. define Build/InstallDev
  38. $(INSTALL_DIR) $(1)/usr/include/librs232
  39. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/librs232/rs232* $(1)/usr/include/librs232
  40. $(INSTALL_DIR) $(1)/usr/lib
  41. $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232* $(1)/usr/lib/
  42. $(INSTALL_DIR) $(1)/usr/lib/lua
  43. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/luars232* $(1)/usr/lib/lua
  44. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  45. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/librs232.pc $(1)/usr/lib/pkgconfig
  46. endef
  47. define Package/lua-rs232/install
  48. $(INSTALL_DIR) $(1)/usr/lib/
  49. $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232.so* $(1)/usr/lib/
  50. $(INSTALL_DIR) $(1)/usr/lib/lua
  51. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/luars232* $(1)/usr/lib/lua
  52. endef
  53. $(eval $(call BuildPackage,lua-rs232))