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.

155 lines
4.5 KiB

  1. #
  2. # Copyright (C) 2017-2018 Michael Heimpold <mhei@heimpold.de>
  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:=libiio
  9. PKG_VERSION:=0.21
  10. PKG_RELEASE:=4
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/analogdevicesinc/libiio/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=03d13165cbeb83b036743cbd9a10e336c728da162714f39d13250a3d94305cac
  14. PKG_LICENSE:=LGPL-2.1
  15. PKG_LICENSE_FILES:=COPYING.txt
  16. PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. CMAKE_INSTALL:=1
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_IPV6 \
  22. CONFIG_LIBIIO_LOCAL_BACKEND \
  23. CONFIG_LIBIIO_NETWORK_BACKEND \
  24. CONFIG_LIBIIO_USB_BACKEND \
  25. CONFIG_LIBIIO_XML_BACKEND
  26. include $(INCLUDE_DIR)/package.mk
  27. include $(INCLUDE_DIR)/cmake.mk
  28. include $(INCLUDE_DIR)/nls.mk
  29. CMAKE_OPTIONS += -DWITH_DOC=OFF
  30. CMAKE_OPTIONS += -DENABLE_IPV6=$(if $(CONFIG_IPV6),ON,OFF)
  31. CMAKE_OPTIONS += -DENABLE_AIO=OFF
  32. CMAKE_OPTIONS += -DWITH_LOCAL_BACKEND=$(if $(CONFIG_LIBIIO_LOCAL_BACKEND),ON,OFF)
  33. CMAKE_OPTIONS += -DWITH_LOCAL_CONFIG=OFF
  34. CMAKE_OPTIONS += -DWITH_NETWORK_BACKEND=$(if $(CONFIG_LIBIIO_NETWORK_BACKEND),ON,OFF)
  35. # serial backend requires libserial which is not packaged yet
  36. CMAKE_OPTIONS += -DWITH_SERIAL_BACKEND=OFF
  37. CMAKE_OPTIONS += -DWITH_USB_BACKEND=$(if $(CONFIG_LIBIIO_USB_BACKEND),ON,OFF)
  38. CMAKE_OPTIONS += -DWITH_XML_BACKEND=$(if $(CONFIG_LIBIIO_XML_BACKEND),ON,OFF)
  39. define Package/libiio
  40. SECTION:=libs
  41. CATEGORY:=Libraries
  42. TITLE:=Library for interfacing with Linux IIO devices
  43. URL:=https://github.com/analogdevicesinc/libiio
  44. DEPENDS:=\
  45. +zlib \
  46. +LIBIIO_USB_BACKEND:libusb-1.0 \
  47. +LIBIIO_NETWORK_BACKEND:libavahi-client \
  48. +LIBIIO_XML_BACKEND:libxml2 \
  49. $(ICONV_DEPENDS)
  50. MENU:=1
  51. endef
  52. define Package/libiio/config
  53. config LIBIIO_LOCAL_BACKEND
  54. bool "Enable local backend"
  55. depends on PACKAGE_libiio
  56. default y
  57. config LIBIIO_NETWORK_BACKEND
  58. bool "Enable network backend"
  59. depends on PACKAGE_libiio
  60. select LIBIIO_XML_BACKEND
  61. default y
  62. config LIBIIO_USB_BACKEND
  63. bool "Enable USB backend"
  64. depends on PACKAGE_libiio
  65. select LIBIIO_XML_BACKEND
  66. default n
  67. config LIBIIO_XML_BACKEND
  68. bool
  69. depends on PACKAGE_libiio
  70. default y
  71. endef
  72. define Package/libiio/description
  73. libiio is used to interface to the Linux Industrial Input/Output (IIO) Subsystem.
  74. The Linux IIO subsystem is intended to provide support for devices that in some
  75. sense are analog to digital or digital to analog converters (ADCs, DACs). This
  76. includes, but is not limited to ADCs, Accelerometers, Gyros, IMUs, Capacitance
  77. to Digital Converters (CDCs), Pressure Sensors, Color, Light and Proximity Sensors,
  78. Temperature Sensors, Magnetometers, DACs, DDS (Direct Digital Synthesis),
  79. PLLs (Phase Locked Loops), Variable/Programmable Gain Amplifiers (VGA, PGA),
  80. and RF transceivers. You can use libiio natively on an embedded Linux
  81. target (local mode), or use libiio to communicate remotely to that same target
  82. from a host Linux, Windows or MAC over USB or Ethernet or Serial.
  83. endef
  84. define Package/iiod
  85. SECTION:=net
  86. CATEGORY:=Network
  87. TITLE:=Linux IIO daemon
  88. URL:=https://github.com/analogdevicesinc/libiio
  89. DEPENDS:=+libiio
  90. endef
  91. define Package/iiod/description
  92. Daemon to access IIO devices via network.
  93. endef
  94. define Package/iio-utils
  95. SECTION:=utils
  96. CATEGORY:=Utilities
  97. TITLE:=Linux IIO tools
  98. URL:=https://github.com/analogdevicesinc/libiio
  99. DEPENDS:=+libiio
  100. endef
  101. define Package/iio-utils/description
  102. Command line tools for IIO devices.
  103. endef
  104. define Build/InstallDev
  105. $(INSTALL_DIR) $(1)/usr/include
  106. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/iio.h $(1)/usr/include/
  107. $(INSTALL_DIR) $(1)/usr/lib
  108. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiio.so* $(1)/usr/lib/
  109. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  110. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libiio.pc $(1)/usr/lib/pkgconfig/
  111. endef
  112. define Package/libiio/install
  113. $(INSTALL_DIR) $(1)/usr/lib
  114. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiio.so.* $(1)/usr/lib/
  115. endef
  116. define Package/iiod/install
  117. $(INSTALL_DIR) $(1)/etc/init.d
  118. $(INSTALL_BIN) ./files/iiod.init $(1)/etc/init.d/iiod
  119. $(INSTALL_DIR) $(1)/usr/sbin
  120. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/iiod $(1)/usr/sbin/
  121. endef
  122. define Package/iio-utils/install
  123. $(INSTALL_DIR) $(1)/usr/bin
  124. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  125. endef
  126. $(eval $(call BuildPackage,libiio))
  127. $(eval $(call BuildPackage,iiod))
  128. $(eval $(call BuildPackage,iio-utils))