Makefile 4.4 KB

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