diff options
| author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
|---|---|---|
| committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
| commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
| tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/classes/distutils.bbclass | |
| download | poky-daisy-140929.tar.gz | |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/classes/distutils.bbclass')
| -rw-r--r-- | meta/classes/distutils.bbclass | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass new file mode 100644 index 0000000000..f3da023942 --- /dev/null +++ b/meta/classes/distutils.bbclass | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | inherit distutils-base | ||
| 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}${prefix} \ | ||
| 6 | --install-data=${STAGING_DATADIR}" | ||
| 7 | DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \ | ||
| 8 | --install-data=${D}/${datadir}" | ||
| 9 | |||
| 10 | distutils_do_compile() { | ||
| 11 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
| 12 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
| 13 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
| 14 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \ | ||
| 15 | bbfatal "${PYTHON_PN} setup.py build_ext execution failed." | ||
| 16 | } | ||
| 17 | |||
| 18 | distutils_stage_headers() { | ||
| 19 | install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} | ||
| 20 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
| 21 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \ | ||
| 22 | bbfatal "${PYTHON_PN} setup.py install_headers execution failed." | ||
| 23 | } | ||
| 24 | |||
| 25 | distutils_stage_all() { | ||
| 26 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
| 27 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
| 28 | install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} | ||
| 29 | PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \ | ||
| 30 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
| 31 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \ | ||
| 32 | bbfatal "${PYTHON_PN} setup.py install (stage) execution failed." | ||
| 33 | } | ||
| 34 | |||
| 35 | distutils_do_install() { | ||
| 36 | install -d ${D}${PYTHON_SITEPACKAGES_DIR} | ||
| 37 | STAGING_INCDIR=${STAGING_INCDIR} \ | ||
| 38 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | ||
| 39 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ | ||
| 40 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | ||
| 41 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \ | ||
| 42 | bbfatal "${PYTHON_PN} setup.py install execution failed." | ||
| 43 | |||
| 44 | # support filenames with *spaces* | ||
| 45 | find ${D} -name "*.py" -print0 | while read -d $'\0' i ; do \ | ||
| 46 | sed -i -e s:${D}::g "$i" | ||
| 47 | done | ||
| 48 | |||
| 49 | if test -e ${D}${bindir} ; then | ||
| 50 | for i in ${D}${bindir}/* ; do \ | ||
| 51 | if [ ${PN} != "${BPN}-native" ]; then | ||
| 52 | sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i | ||
| 53 | fi | ||
| 54 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i | ||
| 55 | done | ||
| 56 | fi | ||
| 57 | |||
| 58 | if test -e ${D}${sbindir}; then | ||
| 59 | for i in ${D}${sbindir}/* ; do \ | ||
| 60 | if [ ${PN} != "${BPN}-native" ]; then | ||
| 61 | sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i | ||
| 62 | fi | ||
| 63 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i | ||
| 64 | done | ||
| 65 | fi | ||
| 66 | |||
| 67 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth | ||
| 68 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/site.py* | ||
| 69 | |||
| 70 | # | ||
| 71 | # FIXME: Bandaid against wrong datadir computation | ||
| 72 | # | ||
| 73 | if test -e ${D}${datadir}/share; then | ||
| 74 | mv -f ${D}${datadir}/share/* ${D}${datadir}/ | ||
| 75 | rmdir ${D}${datadir}/share | ||
| 76 | fi | ||
| 77 | } | ||
| 78 | |||
| 79 | EXPORT_FUNCTIONS do_compile do_install | ||
| 80 | |||
| 81 | export LDSHARED="${CCLD} -shared" | ||
