libiio: Bump version to 0.5
authorPaul Cercueil <paul.cercueil@analog.com>
Wed, 25 Mar 2015 09:00:37 +0000 (10:00 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 18 Jul 2015 19:56:00 +0000 (21:56 +0200)
The package now offers the possibility to install Python and/or C#
bindings if the Python and Mono packages are detected.

v2: Patch generated with 'git format-patch -M' and fix indentation in libiio.mk
v3: Updated libiio.hash file

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/libiio/0001-cmake-let-BUILD_SHARED_LIBS-drive-the-type-of-librar.patch [deleted file]
package/libiio/0001-cmake-libxml2-detection-try-first-the-CMake-module-f.patch [new file with mode: 0644]
package/libiio/0002-cmake-libxml2-detection-try-first-the-CMake-module-f.patch [deleted file]
package/libiio/Config.in
package/libiio/libiio.hash
package/libiio/libiio.mk

diff --git a/package/libiio/0001-cmake-let-BUILD_SHARED_LIBS-drive-the-type-of-librar.patch b/package/libiio/0001-cmake-let-BUILD_SHARED_LIBS-drive-the-type-of-librar.patch
deleted file mode 100644 (file)
index 9ee0299..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-From 4d036f3708f1f427bf91c5925394d39ef76ad96a Mon Sep 17 00:00:00 2001
-From: Samuel Martin <s.martin49@gmail.com>
-Date: Sat, 27 Dec 2014 16:36:50 +0100
-Subject: [PATCH] cmake: let BUILD_SHARED_LIBS drive the type of library built
-
-Do not force the type of library because some architectures (such as
-BlackFin from AnalogDevice) do not support shared object.
-
-Signed-off-by: Samuel Martin <s.martin49@gmail.com>
----
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index cd82a96..393fee3 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -115,7 +115,7 @@ install(FILES ${LIBIIO_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}")
- #set(SETUP_PY ${CMAKE_CURRENT_SOURCE_DIR}/bindings/python/setup.py)
- #configure_file(python/setup.py.in ${SETUP_PY} @ONLY)
--add_library(iio SHARED ${LIBIIO_CFILES} ${LIBIIO_HEADERS})
-+add_library(iio ${LIBIIO_CFILES} ${LIBIIO_HEADERS})
- set_target_properties(iio PROPERTIES VERSION ${VERSION} SOVERSION ${LIBIIO_VERSION_MAJOR})
- target_link_libraries(iio LINK_PRIVATE ${LIBS_TO_LINK})
--- 
-2.2.1
-
diff --git a/package/libiio/0001-cmake-libxml2-detection-try-first-the-CMake-module-f.patch b/package/libiio/0001-cmake-libxml2-detection-try-first-the-CMake-module-f.patch
new file mode 100644 (file)
index 0000000..9f44169
--- /dev/null
@@ -0,0 +1,42 @@
+From 4f849e1d2287206cfb7ff0fdeca96c22383b0d53 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Mon, 29 Dec 2014 19:05:13 +0100
+Subject: [PATCH] cmake: libxml2 detection: try first the CMake module from
+ libxml2
+
+Libxml2 >=2.9.2 provides its own CMake module, so check for it before
+falling back on the CMake's module FindLibXml2.cmake.
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+---
+ CMakeLists.txt | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 393fee3..b4f1d26 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -38,7 +38,19 @@ endif()
+ find_library(AVAHI_CLIENT_LIBRARIES avahi-client)
+ find_library(AVAHI_COMMON_LIBRARIES avahi-common)
+ find_library(PTHREAD_LIBRARIES pthread)
+-include(FindLibXml2)
++
++# Since libxml2-2.9.2, libxml2 provides its own LibXml2-config.cmake, with all
++# variables correctly set.
++# So, try first to find the CMake module provided by libxml2 package, then fallback
++# on the CMake's FindLibXml2.cmake module (which can lack some definition, especially
++# in static build case).
++find_package(LibXml2 QUIET NO_MODULE)
++if(DEFINED LIBXML2_VERSION_STRING)
++  set(LIBXML2_FOUND ON)
++  set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS})
++else()
++  include(FindLibXml2)
++endif()
+ set(LIBIIO_CFILES channel.c device.c context.c buffer.c utilities.c)
+ set(LIBIIO_HEADERS iio.h)
+-- 
+2.2.1
+
diff --git a/package/libiio/0002-cmake-libxml2-detection-try-first-the-CMake-module-f.patch b/package/libiio/0002-cmake-libxml2-detection-try-first-the-CMake-module-f.patch
deleted file mode 100644 (file)
index 9f44169..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-From 4f849e1d2287206cfb7ff0fdeca96c22383b0d53 Mon Sep 17 00:00:00 2001
-From: Samuel Martin <s.martin49@gmail.com>
-Date: Mon, 29 Dec 2014 19:05:13 +0100
-Subject: [PATCH] cmake: libxml2 detection: try first the CMake module from
- libxml2
-
-Libxml2 >=2.9.2 provides its own CMake module, so check for it before
-falling back on the CMake's module FindLibXml2.cmake.
-
-Signed-off-by: Samuel Martin <s.martin49@gmail.com>
----
- CMakeLists.txt | 14 +++++++++++++-
- 1 file changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 393fee3..b4f1d26 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -38,7 +38,19 @@ endif()
- find_library(AVAHI_CLIENT_LIBRARIES avahi-client)
- find_library(AVAHI_COMMON_LIBRARIES avahi-common)
- find_library(PTHREAD_LIBRARIES pthread)
--include(FindLibXml2)
-+
-+# Since libxml2-2.9.2, libxml2 provides its own LibXml2-config.cmake, with all
-+# variables correctly set.
-+# So, try first to find the CMake module provided by libxml2 package, then fallback
-+# on the CMake's FindLibXml2.cmake module (which can lack some definition, especially
-+# in static build case).
-+find_package(LibXml2 QUIET NO_MODULE)
-+if(DEFINED LIBXML2_VERSION_STRING)
-+  set(LIBXML2_FOUND ON)
-+  set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS})
-+else()
-+  include(FindLibXml2)
-+endif()
- set(LIBIIO_CFILES channel.c device.c context.c buffer.c utilities.c)
- set(LIBIIO_HEADERS iio.h)
--- 
-2.2.1
-
index 680d5dcc8c6d7771a0a6faa6bd3699fa13cc406a..21496ed7c501bca38b31e10e232fa3a062eac424 100644 (file)
@@ -40,4 +40,16 @@ config BR2_PACKAGE_LIBIIO_TESTS
        help
          Install the test programs (iio_info, iio_genxml, iio_readdev).
 
+config BR2_PACKAGE_LIBIIO_BINDINGS_CSHARP
+       bool "Install C# bindings"
+       depends on BR2_PACKAGE_MONO
+       help
+         Install the C# bindings.
+
+config BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON
+       bool "Install Python bindings"
+       depends on BR2_PACKAGE_PYTHON
+       help
+         Install the Python bindings.
+
 endif
index bbca4c88c899a62f63ea5e18d98de48615a14a27..28b9c63e6249a0a47ae5f70060be26a5dce437f5 100644 (file)
@@ -1,2 +1,2 @@
-# From https://github.com/analogdevicesinc/libiio/archive/v0.3/
-sha256 a3571bbf7e80b9e0a8d6bd4b39a5bcd18f80a3d36c4a6f2092dfeefc98e20e07        libiio-v0.3.tar.gz
+# From https://github.com/analogdevicesinc/libiio/archive/v0.5/
+sha256 c41cdcfeae8717e72f1100b4dac9d7cc9d86f4e0731da3354149cb7e051666f3        libiio-0.5.tar.gz
index 9b63e12874cd3371fbfcc72053a744136e002144..0e92b738a800a2505934a4f2717b9aaf2c4cc6c8 100644 (file)
@@ -4,15 +4,16 @@
 #
 ################################################################################
 
-LIBIIO_VERSION = v0.3
-LIBIIO_SITE = $(call github,analogdevicesinc,libiio,$(LIBIIO_VERSION))
+LIBIIO_VERSION = 0.5
+LIBIIO_SITE = $(call github,analogdevicesinc,libiio,v$(LIBIIO_VERSION))
 LIBIIO_INSTALL_STAGING = YES
 LIBIIO_LICENSE = LGPLv2.1+
 LIBIIO_LICENSE_FILES = COPYING
 
 LIBIIO_CONF_OPTS = -DENABLE_IPV6=ON \
        -DWITH_LOCAL_BACKEND=$(if $(BR2_PACKAGE_LIBIIO_LOCAL_BACKEND),ON,OFF) \
-       -DWITH_TESTS=$(if $(BR2_PACKAGE_LIBIIO_TESTS),ON,OFF)
+       -DWITH_TESTS=$(if $(BR2_PACKAGE_LIBIIO_TESTS),ON,OFF) \
+       -DWITH_DOC=OFF
 
 ifeq ($(BR2_PACKAGE_LIBIIO_NETWORK_BACKEND),y)
 LIBIIO_DEPENDENCIES += libxml2
@@ -33,6 +34,31 @@ ifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_AVAHI_DAEMON),yy)
 LIBIIO_DEPENDENCIES += avahi
 endif
 
+ifeq ($(BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON),y)
+LIBIIO_DEPENDENCIES += python
+LIBIIO_CONF_OPTS += -DPYTHON_BINDINGS=ON
+else
+LIBIIO_CONF_OPTS += -DPYTHON_BINDINGS=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBIIO_BINDINGS_CSHARP),y)
+define LIBIIO_INSTALL_CSHARP_BINDINGS_TO_TARGET
+       rm $(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll.mdb
+       $(HOST_DIR)/usr/bin/gacutil -root $(TARGET_DIR)/usr/lib -i \
+               $(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll
+endef
+define LIBIIO_INSTALL_CSHARP_BINDINGS_TO_STAGING
+       $(HOST_DIR)/usr/bin/gacutil -root $(STAGING_DIR)/usr/lib -i \
+               $(STAGING_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll
+endef
+LIBIIO_POST_INSTALL_TARGET_HOOKS += LIBIIO_INSTALL_CSHARP_BINDINGS_TO_TARGET
+LIBIIO_POST_INSTALL_STAGING_HOOKS += LIBIIO_INSTALL_CSHARP_BINDINGS_TO_STAGING
+LIBIIO_DEPENDENCIES += mono
+LIBIIO_CONF_OPTS += -DCSHARP_BINDINGS=ON
+else
+LIBIIO_CONF_OPTS += -DCSHARP_BINDINGS=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_LIBIIO_IIOD),y)
 define LIBIIO_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 0755 package/libiio/S99iiod \