meta-virtualization/recipes-extended/libvirt/libvirt-python.inc
Hieu Van Nguyen 6ab94f2c68 libvirt: convert more WORKDIR references to UNPACKDIR
unpacked source files are now in UNPACKDIR, so we adjust our
operations to match.

Some references were missed in previous commit as they
are behind conditional.

Use BP subdir for python, to build it inside ${S}.

Need cd - to go back to $${B} so that gnutls-helper.py
is executed there instead of python subdirectory.

Use mix of tabs and spaces for indentation like other lines
around :).

Signed-off-by: Hieu Van Nguyen <hieu2.nguyen@lge.com>
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2024-05-31 16:20:17 +00:00

67 lines
2.2 KiB
PHP

inherit python3native python3-dir python3targetconfig
export STAGING_INCDIR
export STAGING_LIBDIR
export BUILD_SYS
export HOST_SYS
RDEPENDS:${PN}-python += "python3"
PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python"
PACKAGES += "${PN}-python-staticdev ${PN}-python-dev ${PN}-python-dbg ${PN}-python"
FILES:${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
FILES:${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
FILES:${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/"
FILES:${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*"
# Currently the libvirt-python debug libraries contain buildpaths
INSANE_SKIP:${PN}-dbg += "buildpaths"
SRC_URI += "http://libvirt.org/sources/python/${BPN}-python-${PV}.tar.gz;name=libvirt_python;subdir=${BP}"
SRC_URI[libvirt_python.sha256sum] = "a82588f0e7db53eda7b7dbcbc448b0ec43e00a8c77cac69644495299b410c20d"
export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml"
export LIBVIRT_CFLAGS = "-I${S}/include"
export LIBVIRT_LIBS = "-L${B}/src/.libs -lvirt -ldl"
export LDFLAGS="-L${B}/src/.libs"
LIBVIRT_INSTALL_ARGS = "--root=${D} \
--prefix=${prefix} \
--install-lib=${PYTHON_SITEPACKAGES_DIR} \
--install-data=${datadir}"
python __anonymous () {
pkgconfig = d.getVar('PACKAGECONFIG')
if ('python') in pkgconfig.split():
d.setVar('LIBVIRT_PYTHON_ENABLE', '1')
else:
d.setVar('LIBVIRT_PYTHON_ENABLE', '0')
}
do_compile:append() {
if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then
# we need the python bindings to look into our source dir, not
# the syroot staged pkgconfig entries. So we clear the sysroot
# for just this portion.
export PKG_CONFIG_SYSROOT_DIR=
cd ${S}/${BPN}-python-${PV} && \
${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py build
cd -
fi
}
do_install:append() {
if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then
# we need the python bindings to look into our source dir, not
# the syroot staged pkgconfig entries. So we clear the sysroot
# for just this portion.
export PKG_CONFIG_SYSROOT_DIR=
cd ${S}/${BPN}-python-${PV} && \
${STAGING_BINDIR_NATIVE}/python3-native/python3 setup.py install \
--install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
cd -
fi
}