merge of 'c1a6bbd234dac78ecd896a3addf55c41902cacde'
[vuplus_openembedded] / classes / distutils.bbclass
1 inherit distutils-base
2
3 distutils_do_compile() {
4          BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
5          ${STAGING_BINDIR_NATIVE}/python setup.py build || \
6          oefatal "python setup.py build_ext execution failed."
7 }
8
9 distutils_stage_headers() {
10         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
11         ${STAGING_BINDIR_NATIVE}/python setup.py install_headers --install-dir=${STAGING_INCDIR}/${PYTHON_DIR} || \
12         oefatal "python setup.py install_headers execution failed."
13 }
14
15 distutils_stage_all() {
16         PYTHONPATH=${STAGING_INCDIR}/../${PYTHON_DIR}/site-packages \
17         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
18         ${STAGING_BINDIR_NATIVE}/python setup.py install --prefix=${STAGING_INCDIR}/.. --install-data=${STAGING_INCDIR}/../share || \
19         oefatal "python setup.py install (stage) execution failed."
20 }
21
22 distutils_do_install() {
23         install -d ${D}${libdir}/${PYTHON_DIR}/site-packages
24         PYTHONPATH=${D}/${libdir}/${PYTHON_DIR}/site-packages \
25         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
26         ${STAGING_BINDIR_NATIVE}/python setup.py install --prefix=${D}/${prefix} --install-data=${D}/${datadir} || \
27         oefatal "python setup.py install execution failed."
28
29         for i in `find ${D} -name "*.py"` ; do \
30             sed -i -e s:${D}::g $i
31         done
32
33         if test -e ${D}${bindir} ; then 
34             for i in ${D}${bindir}/* ; do \
35                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
36             done
37         fi
38
39         if test -e ${D}${sbindir} ; then
40             for i in ${D}${sbindir}/* ; do \
41                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
42             done
43         fi
44
45         rm -f ${D}${libdir}/${PYTHON_DIR}/site-packages/easy-install.pth
46 }
47
48 EXPORT_FUNCTIONS do_compile do_install