Skip to content

Commit 51f9886

Browse files
S4mw1s3kraj
authored andcommitted
libiio: fix build when python bindings are enabled
See #248 Signed-off-by: Sam Van Den Berge <[email protected]> Signed-off-by: Khem Raj <[email protected]>
1 parent f6f0d17 commit 51f9886

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

meta-oe/recipes-support/libiio/libiio_git.bb

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
1212

1313
S = "${WORKDIR}/git"
1414

15-
inherit cmake python3native systemd
15+
DISTUTILS_SETUP_PATH ?= "${B}/bindings/python/"
1616

1717
DEPENDS = " \
1818
flex-native bison-native libaio \
1919
${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
2020
"
2121

22+
inherit cmake python3native systemd setuptools3
23+
2224
EXTRA_OECMAKE = " \
2325
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
2426
-DUDEV_RULES_INSTALL_DIR=${nonarch_base_libdir}/udev/rules.d \
@@ -31,8 +33,6 @@ PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libus
3133
PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2"
3234
PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF"
3335

34-
inherit ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'distutils3-base', '', d)}
35-
3636
PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}"
3737

3838
RDEPENDS_${PN}-${PYTHON_PN} = "${PN} ${PYTHON_PN}-ctypes ${PYTHON_PN}-stringold"
@@ -46,3 +46,23 @@ FILES_${PN}-${PYTHON_PN} = "${PYTHON_SITEPACKAGES_DIR}"
4646

4747
SYSTEMD_PACKAGES = "${PN}-iiod"
4848
SYSTEMD_SERVICE_${PN}-iiod = "iiod.service"
49+
50+
# Explicitly define do_configure, do_compile and do_install because both cmake and setuptools3 have
51+
# EXPORT_FUNCTIONS do_configure do_compile do_install
52+
do_configure() {
53+
cmake_do_configure
54+
}
55+
56+
do_compile() {
57+
if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
58+
distutils3_do_compile
59+
fi
60+
cmake_do_compile
61+
}
62+
63+
do_install() {
64+
if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
65+
distutils3_do_install
66+
fi
67+
cmake_do_install
68+
}

0 commit comments

Comments
 (0)