meta-virtualization/recipes-extended/libvirt/libvirt-python.inc
Bruce Ashfield 41101a7a51 libvirt: fix python packaging race
The tasks responsible for compiling and installing the python support
were racing against packaging. As a result, a clean build would not
have anything in libvirt-python, but subsequent builds would.

By moving to _appends, we control the order and always get properly
packaged.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2014-02-05 16:41:55 -05:00

56 lines
1.9 KiB
PHP

inherit pythonnative python-dir
export STAGING_INCDIR
export STAGING_LIBDIR
export BUILD_SYS
export HOST_SYS
RDEPENDS_${PN}-python += "python"
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}/*"
SRC_URI += "http://libvirt.org/sources/python/libvirt-python-${PV}.tar.gz;name=libvirt_python"
SRC_URI += "file://libvirt_api_xml_path.patch;patchdir=../libvirt-python-${PV}"
SRC_URI[libvirt_python.md5sum] = "e1effd6007b2ebd5d024c6c3838456fb"
SRC_URI[libvirt_python.sha256sum] = "bce558606b157d0717ee7bd6537d85dd4c0321c59b4235c967db7a3aad80e246"
export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml"
export LIBVIRT_CFLAGS = "-I${S}/include"
export LIBVIRT_LIBS = "-L${S}/src/.libs -lvirt -ldl"
export LDFLAGS="-L${S}/src/.libs"
LIBVIRT_INSTALL_ARGS = "--root=${D} \
--prefix=${prefix} \
--install-lib=${PYTHON_SITEPACKAGES_DIR} \
--install-data=${datadir}"
python __anonymous () {
pkgconfig = d.getVar('PACKAGECONFIG', True)
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
cd ${WORKDIR}/libvirt-python-${PV} && \
${STAGING_BINDIR_NATIVE}/python-native/python setup.py build
fi
}
do_install_append() {
if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then
cd ${WORKDIR}/${PN}-python-${PV} && \
${STAGING_BINDIR_NATIVE}/python-native/python setup.py install \
--install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
fi
}