Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 1 | inherit setuptools3-base pip_install_wheel |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 2 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 3 | # bdist_wheel builds in ./dist |
| 4 | #B = "${WORKDIR}/build" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 5 | |
| 6 | SETUPTOOLS_BUILD_ARGS ?= "" |
| 7 | SETUPTOOLS_INSTALL_ARGS ?= "--root=${D} \ |
| 8 | --prefix=${prefix} \ |
| 9 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ |
| 10 | --install-data=${datadir}" |
| 11 | |
| 12 | SETUPTOOLS_PYTHON = "python3" |
| 13 | SETUPTOOLS_PYTHON:class-native = "nativepython3" |
| 14 | |
| 15 | SETUPTOOLS_SETUP_PATH ?= "${S}" |
| 16 | |
| 17 | setuptools3_do_configure() { |
| 18 | : |
| 19 | } |
| 20 | |
| 21 | setuptools3_do_compile() { |
| 22 | cd ${SETUPTOOLS_SETUP_PATH} |
| 23 | NO_FETCH_BUILD=1 \ |
| 24 | STAGING_INCDIR=${STAGING_INCDIR} \ |
| 25 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
| 26 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 27 | bdist_wheel ${SETUPTOOLS_BUILD_ARGS} || \ |
| 28 | bbfatal_log "'${PYTHON_PN} setup.py bdist_wheel ${SETUPTOOLS_BUILD_ARGS}' execution failed." |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 29 | } |
| 30 | setuptools3_do_compile[vardepsexclude] = "MACHINE" |
| 31 | |
| 32 | setuptools3_do_install() { |
| 33 | cd ${SETUPTOOLS_SETUP_PATH} |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 34 | |
| 35 | pip_install_wheel_do_install |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 36 | |
| 37 | # support filenames with *spaces* |
| 38 | find ${D} -name "*.py" -exec grep -q ${D} {} \; \ |
| 39 | -exec sed -i -e s:${D}::g {} \; |
| 40 | |
| 41 | for i in ${D}${bindir}/* ${D}${sbindir}/*; do |
| 42 | if [ -f "$i" ]; then |
| 43 | sed -i -e s:${PYTHON}:${USRBINPATH}/env\ ${SETUPTOOLS_PYTHON}:g $i |
| 44 | sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i |
| 45 | fi |
| 46 | done |
| 47 | |
| 48 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth |
| 49 | |
| 50 | # |
| 51 | # FIXME: Bandaid against wrong datadir computation |
| 52 | # |
| 53 | if [ -e ${D}${datadir}/share ]; then |
| 54 | mv -f ${D}${datadir}/share/* ${D}${datadir}/ |
| 55 | rmdir ${D}${datadir}/share |
| 56 | fi |
| 57 | } |
| 58 | setuptools3_do_install[vardepsexclude] = "MACHINE" |
| 59 | |
| 60 | EXPORT_FUNCTIONS do_configure do_compile do_install |
| 61 | |
| 62 | export LDSHARED="${CCLD} -shared" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 63 | DEPENDS += "python3-setuptools-native python3-wheel-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 64 | |