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.

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