blob: c1dafe9dca18199388e7cd107ba35e3f8b0aea2b [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
21SRC_URI[libvirt_python.md5sum] = "ed018c714d7ddbe93221c796dff283ed"
22SRC_URI[libvirt_python.sha256sum] = "6d35ae9e7801573393b9c92471f39e6700d479f10b641df81d041b469f160bf8"
23
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
44 cd ${WORKDIR}/libvirt-python-${PV} && \
45 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build
46 fi
47}
48
49do_install_append() {
50 if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then
51 cd ${WORKDIR}/${PN}-python-${PV} && \
52 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install \
53 --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS}
54 fi
55}