diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/distutils.bbclass | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass index 27351d9c7a..2fcf0fd6cb 100644 --- a/meta/classes/distutils.bbclass +++ b/meta/classes/distutils.bbclass | |||
@@ -1,38 +1,46 @@ | |||
1 | inherit distutils-base | 1 | inherit distutils-base |
2 | 2 | ||
3 | DISTUTILS_BUILD_ARGS ?= "" | ||
4 | DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}" | ||
5 | DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${layout_prefix} \ | ||
6 | --install-data=${STAGING_DATADIR}" | ||
7 | DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \ | ||
8 | --install-data=${D}/${datadir}" | ||
9 | |||
3 | distutils_do_compile() { | 10 | distutils_do_compile() { |
4 | STAGING_INCDIR=${STAGING_INCDIR} \ | 11 | STAGING_INCDIR=${STAGING_INCDIR} \ |
5 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 12 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
6 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | 13 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ |
7 | ${STAGING_BINDIR_NATIVE}/python setup.py build || \ | 14 | ${STAGING_BINDIR_NATIVE}/python setup.py build ${DISTUTILS_BUILD_ARGS} || \ |
8 | oefatal "python setup.py build_ext execution failed." | 15 | oefatal "python setup.py build_ext execution failed." |
9 | } | 16 | } |
10 | 17 | ||
11 | distutils_stage_headers() { | 18 | distutils_stage_headers() { |
12 | STAGING_INCDIR=${STAGING_INCDIR} \ | 19 | install -d ${STAGING_DIR_HOST}${layout_libdir}/${PYTHON_DIR}/site-packages |
13 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 20 | STAGING_INCDIR=${STAGING_INCDIR} \ |
21 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
14 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | 22 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ |
15 | ${STAGING_BINDIR_NATIVE}/python setup.py install_headers --install-dir=${STAGING_INCDIR}/${PYTHON_DIR} || \ | 23 | ${STAGING_BINDIR_NATIVE}/python setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \ |
16 | oefatal "python setup.py install_headers execution failed." | 24 | oefatal "python setup.py install_headers execution failed." |
17 | } | 25 | } |
18 | 26 | ||
19 | distutils_stage_all() { | 27 | distutils_stage_all() { |
20 | install -d ${STAGING_DIR_HOST}${layout_prefix}/${PYTHON_DIR}/site-packages | 28 | install -d ${STAGING_DIR_HOST}${layout_prefix}/${PYTHON_DIR}/site-packages |
21 | STAGING_INCDIR=${STAGING_INCDIR} \ | 29 | STAGING_INCDIR=${STAGING_INCDIR} \ |
22 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 30 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
23 | PYTHONPATH=${STAGING_DIR_HOST}${layout_prefix}/${PYTHON_DIR}/site-packages \ | 31 | PYTHONPATH=${STAGING_DIR_HOST}${layout_prefix}/${PYTHON_DIR}/site-packages \ |
24 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | 32 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ |
25 | ${STAGING_BINDIR_NATIVE}/python setup.py install --prefix=${STAGING_DIR_HOST}${layout_prefix} --install-data=${STAGING_DATADIR} || \ | 33 | ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \ |
26 | oefatal "python setup.py install (stage) execution failed." | 34 | oefatal "python setup.py install (stage) execution failed." |
27 | } | 35 | } |
28 | 36 | ||
29 | distutils_do_install() { | 37 | distutils_do_install() { |
30 | install -d ${D}${libdir}/${PYTHON_DIR}/site-packages | 38 | install -d ${D}${libdir}/${PYTHON_DIR}/site-packages |
31 | STAGING_INCDIR=${STAGING_INCDIR} \ | 39 | STAGING_INCDIR=${STAGING_INCDIR} \ |
32 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 40 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
33 | PYTHONPATH=${D}/${libdir}/${PYTHON_DIR}/site-packages \ | 41 | PYTHONPATH=${D}/${libdir}/${PYTHON_DIR}/site-packages \ |
34 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | 42 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ |
35 | ${STAGING_BINDIR_NATIVE}/python setup.py install --prefix=${D}/${prefix} --install-data=${D}/${datadir} || \ | 43 | ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_INSTALL_ARGS} || \ |
36 | oefatal "python setup.py install execution failed." | 44 | oefatal "python setup.py install execution failed." |
37 | 45 | ||
38 | for i in `find ${D} -name "*.py"` ; do \ | 46 | for i in `find ${D} -name "*.py"` ; do \ |
@@ -45,13 +53,13 @@ distutils_do_install() { | |||
45 | done | 53 | done |
46 | fi | 54 | fi |
47 | 55 | ||
48 | if test -e ${D}${sbindir} ; then | 56 | if test -e ${D}${sbindir}; then |
49 | for i in ${D}${sbindir}/* ; do \ | 57 | for i in ${D}${sbindir}/* ; do \ |
50 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i | 58 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i |
51 | done | 59 | done |
52 | fi | 60 | fi |
53 | 61 | ||
54 | rm -f ${D}${libdir}/${PYTHON_DIR}/site-packages/easy-install.pth | 62 | rm -f ${D}${libdir}/${PYTHON_DIR}/site-packages/easy-install.pth |
55 | 63 | ||
56 | find ${D}${libdir}/${PYTHON_DIR}/site-packages -iname '*.pyo' -exec rm {} \; | 64 | find ${D}${libdir}/${PYTHON_DIR}/site-packages -iname '*.pyo' -exec rm {} \; |
57 | } | 65 | } |