Skip to content

Commit

Permalink
libiio: fix build when python bindings are enabled
Browse files Browse the repository at this point in the history
See openembedded#248

Signed-off-by: Sam Van Den Berge <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
  • Loading branch information
S4mw1s3 authored and kraj committed Mar 5, 2021
1 parent f6f0d17 commit 51f9886
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions meta-oe/recipes-support/libiio/libiio_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"

S = "${WORKDIR}/git"

inherit cmake python3native systemd
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

EXTRA_OECMAKE = " \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUDEV_RULES_INSTALL_DIR=${nonarch_base_libdir}/udev/rules.d \
Expand All @@ -31,8 +33,6 @@ PACKAGECONFIG[usb_backend] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libus
PACKAGECONFIG[network_backend] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2"
PACKAGECONFIG[libiio-python3] = "-DPYTHON_BINDINGS=ON,-DPYTHON_BINDINGS=OFF"

inherit ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'distutils3-base', '', d)}

PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-${PYTHON_PN}"

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

SYSTEMD_PACKAGES = "${PN}-iiod"
SYSTEMD_SERVICE_${PN}-iiod = "iiod.service"

# Explicitly define do_configure, do_compile and do_install because both cmake and setuptools3 have
# EXPORT_FUNCTIONS do_configure do_compile do_install
do_configure() {
cmake_do_configure
}

do_compile() {
if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
distutils3_do_compile
fi
cmake_do_compile
}

do_install() {
if ${@bb.utils.contains('PACKAGECONFIG', 'libiio-python3', 'true', 'false', d)}; then
distutils3_do_install
fi
cmake_do_install
}

0 comments on commit 51f9886

Please sign in to comment.