Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | DISTUTILS_BUILD_ARGS ?= "" |
| 2 | DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}" |
| 3 | DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \ |
| 4 | --install-data=${STAGING_DATADIR}" |
| 5 | DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \ |
| 6 | --install-data=${D}/${datadir}" |
| 7 | |
| 8 | distutils_do_compile() { |
| 9 | STAGING_INCDIR=${STAGING_INCDIR} \ |
| 10 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 12 | bbfatal_log "${PYTHON_PN} setup.py build_ext execution failed." |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | distutils_stage_headers() { |
| 16 | install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 18 | bbfatal_log "${PYTHON_PN} setup.py install_headers execution failed." |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | distutils_stage_all() { |
| 22 | STAGING_INCDIR=${STAGING_INCDIR} \ |
| 23 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
| 24 | install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} |
| 25 | PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 27 | bbfatal_log "${PYTHON_PN} setup.py install (stage) execution failed." |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | distutils_do_install() { |
| 31 | echo "Beginning ${PN} Install ..." |
| 32 | install -d ${D}${PYTHON_SITEPACKAGES_DIR} |
| 33 | echo "Step 2 of ${PN} Install ..." |
| 34 | STAGING_INCDIR=${STAGING_INCDIR} \ |
| 35 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
| 36 | PYTHONPATH=${D}/${PYTHON_SITEPACKAGES_DIR} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 38 | bbfatal_log "${PYTHON_PN} setup.py install execution failed." |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | |
| 40 | echo "Step 3 of ${PN} Install ..." |
| 41 | # support filenames with *spaces* |
| 42 | find ${D} -name "*.py" -print0 | while read -d $'\0' i ; do \ |
| 43 | sed -i -e s:${D}::g $i |
| 44 | done |
| 45 | |
| 46 | echo "Step 4 of ${PN} Install ..." |
| 47 | if test -e ${D}${bindir} ; then |
| 48 | for i in ${D}${bindir}/* ; do \ |
| 49 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i |
| 50 | done |
| 51 | fi |
| 52 | |
| 53 | echo "Step 4 of ${PN} Install ..." |
| 54 | if test -e ${D}${sbindir}; then |
| 55 | for i in ${D}${sbindir}/* ; do \ |
| 56 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i |
| 57 | done |
| 58 | fi |
| 59 | |
| 60 | echo "Step 5 of ${PN} Install ..." |
| 61 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth |
| 62 | |
| 63 | # |
| 64 | # FIXME: Bandaid against wrong datadir computation |
| 65 | # |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 66 | if [ -e ${D}${datadir}/share ]; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 67 | mv -f ${D}${datadir}/share/* ${D}${datadir}/ |
| 68 | fi |
| 69 | } |
| 70 | |
| 71 | #EXPORT_FUNCTIONS do_compile do_install |
| 72 | |
| 73 | export LDSHARED="${CCLD} -shared" |