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.

95 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2019 Xue Liu <liuxuenetmail@gmail>
  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:=lora-gateway-hal
  9. PKG_VERSION:=5.0.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=https://codeload.github.com/Lora-net/lora_gateway/tar.gz/v$(PKG_VERSION)?
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_HASH:=1a0447d5e8183d08e6dce5f739f6872b9c57824b98f4078830d5ee21b15782c1
  14. PKG_MAINTAINER:=Xue Liu <liuxuenetmail@gmail.com>
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/lora_gateway-$(PKG_VERSION)
  17. include $(INCLUDE_DIR)/package.mk
  18. include $(INCLUDE_DIR)/cmake.mk
  19. define Package/libloragw
  20. SECTION:=libs
  21. CATEGORY:=Libraries
  22. TITLE:=Driver/HAL library for Semtech SX1301
  23. URL:=https://www.semtech.com/products/wireless-rf/lora-gateways/sx1301
  24. DEPENDS:=+kmod-spi-dev @(!PACKAGE_lora-picogw-hal)
  25. endef
  26. define Package/libloragw/description
  27. Driver/HAL library for Semtech SX1301 multi-channel modem and
  28. SX1257/SX1255 RF transceivers.
  29. endef
  30. define Package/libloragw/config
  31. source "$(SOURCE)/Config.in"
  32. endef
  33. define Package/libloragw-tests
  34. SECTION:=net
  35. CATEGORY:=Network
  36. SUBMENU:=LoRaWAN
  37. TITLE:=Test programs for libloragw to check functionality
  38. DEPENDS:=+libloragw
  39. endef
  40. define Package/libloragw-utils
  41. SECTION:=net
  42. CATEGORY:=Network
  43. SUBMENU:=LoRaWAN
  44. TITLE:=Utility programs for libloragw
  45. DEPENDS:=+libloragw
  46. endef
  47. CMAKE_OPTIONS += \
  48. -DSPI_DEV_PATH:FILEPATH=$(CONFIG_SX1301_SPI_PATH) \
  49. -DSPI_SPEED:STRING=$(CONFIG_SX1301_SPI_SPEED) \
  50. -Dlora_gateway_build_shared_libs=ON
  51. define Build/InstallDev
  52. $(INSTALL_DIR) $(1)/usr/include/libloragw
  53. $(CP) $(PKG_BUILD_DIR)/libloragw/inc/loragw_* $(1)/usr/include/libloragw
  54. $(CP) $(PKG_BUILD_DIR)/libloragw/config.h $(1)/usr/include/libloragw
  55. $(INSTALL_DIR) $(1)/usr/lib
  56. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libloragw/libloragw.so* $(1)/usr/lib/
  57. $(LN) libloragw.so.0 $(1)/usr/lib/libloragw.so
  58. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  59. $(CP) $(PKG_BUILD_DIR)/loragw.pc $(1)/usr/lib/pkgconfig/
  60. endef
  61. define Package/libloragw/install
  62. $(INSTALL_DIR) $(1)/usr/lib
  63. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libloragw/libloragw.so.* $(1)/usr/lib/
  64. endef
  65. define Package/libloragw-tests/install
  66. $(INSTALL_DIR) $(1)/usr/sbin
  67. $(INSTALL_BIN) $(PKG_BUILD_DIR)/libloragw/test* $(1)/usr/sbin
  68. endef
  69. define Package/libloragw-utils/install
  70. $(INSTALL_DIR) $(1)/usr/sbin
  71. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/util_lbt_test $(1)/usr/sbin
  72. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/util_pkt_logger $(1)/usr/sbin
  73. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/util_spectral_scan $(1)/usr/sbin
  74. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/util_tx_continuous $(1)/usr/sbin
  75. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/util_spi_stress $(1)/usr/sbin
  76. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/util_tx_test $(1)/usr/sbin
  77. endef
  78. $(eval $(call BuildPackage,libloragw))
  79. $(eval $(call BuildPackage,libloragw-tests))
  80. $(eval $(call BuildPackage,libloragw-utils))