blob: bc2f1de2957105e41dd38f3f4aefb059d24c58db [file] [log] [blame]
Patrick Williamsd849ec72016-08-17 14:59:38 -05001inherit pythonnative python-dir
2
3export STAGING_INCDIR
4export STAGING_LIBDIR
5export BUILD_SYS
6export HOST_SYS
7
8RDEPENDS_${PN}-python += "python"
9PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python"
10
11PACKAGES += "${PN}-python-staticdev ${PN}-python-dev ${PN}-python-dbg ${PN}-python"
12
13FILES_${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
14FILES_${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
15FILES_${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/"
16FILES_${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*"
17
18SRC_URI += "http://libvirt.org/sources/python/libvirt-python-${PV}.tar.gz;name=libvirt_python"
19SRC_URI += "file://libvirt_api_xml_path.patch;patchdir=../libvirt-python-${PV}"
20
Patrick Williamse69d2352017-02-23 20:56:04 -060021SRC_URI[libvirt_python.md5sum] = "4dbd7ef9ee9c4dea5887b5b31eb04529"
22SRC_URI[libvirt_python.sha256sum] = "a0508a57637fd18a3584fb9d2322fb172f65708c9db16e0438a70eb0f36fa5c2"
Patrick Williamsd849ec72016-08-17 14:59:38 -050023
24export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml"
25export LIBVIRT_CFLAGS = "-I${S}/include"
26export LIBVIRT_LIBS = "-L${B}/src/.libs -lvirt -ldl"
27export LDFLAGS="-L${B}/src/.libs"
28
29LIBVIRT_INSTALL_ARGS = "--root=${D} \
30 --prefix=${prefix} \
31 --install-lib=${PYTHON_SITEPACKAGES_DIR} \
32 --install-data=${datadir}"
33
34python __anonymous () {
35 pkgconfig = d.getVar('PACKAGECONFIG', True)
36 if ('python') in pkgconfig.split():
37 d.setVar('LIBVIRT_PYTHON_ENABLE', '1')
38 else:
39 d.setVar('LIBVIRT_PYTHON_ENABLE', '0')
40}
41
42do_compile_append() {
43 if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then
Patrick Williamse69d2352017-02-23 20:56:04 -060044 cd ${WORKDIR}/${BPN}-python-${PV} && \
Patrick Williamsd849ec72016-08-17 14:59:38 -050045 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build
46 fi
47}
48
49do_install_append() {
50 if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then
Patrick Williamse69d2352017-02-23 20:56:04 -060051 cd ${WORKDIR}/${BPN}-python-${PV} && \
Patrick Williamsd849ec72016-08-17 14:59:38 -050052 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install \
53 --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
54 fi
55}