Skip to contentSkip to conversation

libiio: depend on avahi only when network backed is used

RFC PATCH In review Nandor Han 2 participants 3 messages Oct 13, 2021

lore
Share & tools
lore

Nandor Han

author
#0 lore raw

RFC PATCH 1/1 libiio: depend on avahi only when network backed is used

The avahi dependency is needed only when network backend is used. The current dependency configuration will add the avahi dependency regardless if network backend is used or not.

Move the avahi dependency to be part of PACKAGECONFIG configuration which will insert the dependency only when needed.

---

Notes:
Testing
-------
1. Verify that libiio recipe builds successfully with or without the network backend configured: PASS

 meta-oe/recipes-support/libiio/libiio_git.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta-oe/recipes-support/libiio/libiio_git.bb +6 -2
index 6ac534a28..488d4e3b0 100644
@@ -18,7 +18,6 @@ DISTUTILS_SETUP_PATH ?= "${B}/bindings/python/"
 
 DEPENDS = " \
     flex-native bison-native libaio \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
 "
 
 inherit cmake python3native systemd setuptools3
@@ -31,8 +30,13 @@ EXTRA_OECMAKE = " \
 
 PACKAGECONFIG ??= "usb_backend network_backend serial_backend"
 
+NETWORK_BACKEND_DEPENDENCIES = "\
+    libxml2 \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+"
+
 PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2"
-PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2"
+PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF, ${NETWORK_BACKEND_DEPENDENCIES}"
 PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2"
 PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF"
 
Signature · 1 line
2.26.3
#1 lore raw

this is already applied with
https://git.openembedded.org/meta-openembedded/commit/?id=e078ffd4ce
if we missed anything please send a rebased patch.

Quoted 50 lines · Nandor Han

The avahi dependency is needed only when network backend is used. The current dependency configuration will add the avahi dependency regardless if network backend is used or not.

Move the avahi dependency to be part of PACKAGECONFIG configuration which will insert the dependency only when needed.

---

Notes:
Testing
-------
1. Verify that libiio recipe builds successfully with or without the network backend configured: PASS

 meta-oe/recipes-support/libiio/libiio_git.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta-oe/recipes-support/libiio/libiio_git.bb +6 -3
index 6ac534a28..488d4e3b0 100644
@@ -18,7 +18,6 @@ DISTUTILS_SETUP_PATH ?= "${B}/bindings/python/"
 
 DEPENDS = " \
     flex-native bison-native libaio \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
 "
 
 inherit cmake python3native systemd setuptools3
@@ -31,8 +30,13 @@ EXTRA_OECMAKE = " \
 
 PACKAGECONFIG ??= "usb_backend network_backend serial_backend"
 
+NETWORK_BACKEND_DEPENDENCIES = "\
+    libxml2 \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+"
+
 PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1 libxml2"
-PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2"
+PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF, ${NETWORK_BACKEND_DEPENDENCIES}"
 PACKAGECONFIG[serial_backend] = "-DWITH_SERIAL_BACKEND=ON,-DWITH_SERIAL_BACKEND=off,libserialport libxml2"
 PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF"
 
--

2.26.3

author
#2 lore raw