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