diff options
Diffstat (limited to 'recipes-extended/libvirt/libvirt-python.inc')
-rw-r--r-- | recipes-extended/libvirt/libvirt-python.inc | 55 |
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 @@ | |||
1 | inherit pythonnative python-dir | ||
2 | |||
3 | export STAGING_INCDIR | ||
4 | export STAGING_LIBDIR | ||
5 | export BUILD_SYS | ||
6 | export HOST_SYS | ||
7 | |||
8 | RDEPENDS_${PN}-python += "python" | ||
9 | PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python" | ||
10 | |||
11 | PACKAGES += "${PN}-python-staticdev ${PN}-python-dev ${PN}-python-dbg ${PN}-python" | ||
12 | |||
13 | FILES_${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" | ||
14 | FILES_${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" | ||
15 | FILES_${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/" | ||
16 | FILES_${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" | ||
17 | |||
18 | SRC_URI += "http://libvirt.org/sources/python/libvirt-python-${PV}.tar.gz;name=libvirt_python" | ||
19 | SRC_URI += "file://libvirt_api_xml_path.patch;patchdir=../libvirt-python-${PV}" | ||
20 | |||
21 | SRC_URI[libvirt_python.md5sum] = "cd3b75c0eb64e933f0b648fbdca6e868" | ||
22 | SRC_URI[libvirt_python.sha256sum] = "94d79d662b6010f6c688b8856b2d95077736d48ffa35feed5a339d7fafbf8c39" | ||
23 | |||
24 | export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml" | ||
25 | export LIBVIRT_CFLAGS = "-I${S}/include" | ||
26 | export LIBVIRT_LIBS = "-L${S}/src/.libs -lvirt -ldl" | ||
27 | export LDFLAGS="-L${S}/src/.libs" | ||
28 | |||
29 | LIBVIRT_INSTALL_ARGS = "--root=${D} \ | ||
30 | --prefix=${prefix} \ | ||
31 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
32 | --install-data=${datadir}" | ||
33 | |||
34 | python __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 | |||
42 | do_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 | |||
49 | do_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 | } | ||