summaryrefslogtreecommitdiffstats
path: root/recipes-extended/libvirt/libvirt-python.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/libvirt/libvirt-python.inc')
-rw-r--r--recipes-extended/libvirt/libvirt-python.inc55
1 files changed, 55 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt-python.inc b/recipes-extended/libvirt/libvirt-python.inc
new file mode 100644
index 00000000..195a9dee
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt-python.inc
@@ -0,0 +1,55 @@
1inherit 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] = "cd3b75c0eb64e933f0b648fbdca6e868"
22SRC_URI[libvirt_python.sha256sum] = "94d79d662b6010f6c688b8856b2d95077736d48ffa35feed5a339d7fafbf8c39"
23
24export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml"
25export LIBVIRT_CFLAGS = "-I${S}/include"
26export LIBVIRT_LIBS = "-L${S}/src/.libs -lvirt -ldl"
27export LDFLAGS="-L${S}/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}