diff options
author | Ross Burton <ross.burton@intel.com> | 2019-12-10 13:42:06 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-28 23:25:41 +0000 |
commit | 8b1eb782c32d8ce31e8f033ef3197e4be76bfc84 (patch) | |
tree | 78f2fa128147b0874f213cc77f28754822452a3b /meta/classes/distutils3.bbclass | |
parent | 8b57f9c53444dc5f00119c814a9a6ded71f49c25 (diff) | |
download | poky-8b1eb782c32d8ce31e8f033ef3197e4be76bfc84.tar.gz |
distutils3: do out of tree builds
Pass --build-base so the build tree is a location we specify, which we
can ensure is empty when building.
This means we can stub out do_configure entirely and use cleandirs
instead.
When installing we need to tell it to do a build so that we can pass
--build-base, so also pass --skip-build to avoid the potential rebuild.
(From OE-Core rev: de1b57acedaaf01e10059792eb0031ceafcc8b97)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/distutils3.bbclass')
-rw-r--r-- | meta/classes/distutils3.bbclass | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/meta/classes/distutils3.bbclass b/meta/classes/distutils3.bbclass index a277921dd0..7356b5245a 100644 --- a/meta/classes/distutils3.bbclass +++ b/meta/classes/distutils3.bbclass | |||
@@ -1,5 +1,8 @@ | |||
1 | inherit distutils3-base | 1 | inherit distutils3-base |
2 | 2 | ||
3 | B = "${WORKDIR}/build" | ||
4 | distutils_do_configure[cleandirs] = "${B}" | ||
5 | |||
3 | DISTUTILS_BUILD_ARGS ?= "" | 6 | DISTUTILS_BUILD_ARGS ?= "" |
4 | DISTUTILS_INSTALL_ARGS ?= "--root=${D} \ | 7 | DISTUTILS_INSTALL_ARGS ?= "--root=${D} \ |
5 | --prefix=${prefix} \ | 8 | --prefix=${prefix} \ |
@@ -10,28 +13,28 @@ DISTUTILS_PYTHON = "python3" | |||
10 | DISTUTILS_PYTHON_class-native = "nativepython3" | 13 | DISTUTILS_PYTHON_class-native = "nativepython3" |
11 | 14 | ||
12 | distutils3_do_configure() { | 15 | distutils3_do_configure() { |
13 | if [ "${CLEANBROKEN}" != "1" ] ; then | 16 | : |
14 | NO_FETCH_BUILD=1 \ | ||
15 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py clean ${DISTUTILS_BUILD_ARGS} | ||
16 | fi | ||
17 | } | 17 | } |
18 | 18 | ||
19 | distutils3_do_compile() { | 19 | distutils3_do_compile() { |
20 | cd ${S} | ||
20 | NO_FETCH_BUILD=1 \ | 21 | NO_FETCH_BUILD=1 \ |
21 | STAGING_INCDIR=${STAGING_INCDIR} \ | 22 | STAGING_INCDIR=${STAGING_INCDIR} \ |
22 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 23 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
23 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \ | 24 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} ${S}/setup.py \ |
24 | build ${DISTUTILS_BUILD_ARGS} || \ | 25 | build --build-base=${B} ${DISTUTILS_BUILD_ARGS} || \ |
25 | bbfatal_log "'${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS}' execution failed." | 26 | bbfatal_log "'${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS}' execution failed." |
26 | } | 27 | } |
27 | distutils3_do_compile[vardepsexclude] = "MACHINE" | 28 | distutils3_do_compile[vardepsexclude] = "MACHINE" |
28 | 29 | ||
29 | distutils3_do_install() { | 30 | distutils3_do_install() { |
31 | cd ${S} | ||
30 | install -d ${D}${PYTHON_SITEPACKAGES_DIR} | 32 | install -d ${D}${PYTHON_SITEPACKAGES_DIR} |
31 | STAGING_INCDIR=${STAGING_INCDIR} \ | 33 | STAGING_INCDIR=${STAGING_INCDIR} \ |
32 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 34 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
33 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ | 35 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ |
34 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \ | 36 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} ${S}/setup.py \ |
37 | build --build-base=${B} install --skip-build ${DISTUTILS_INSTALL_ARGS} || \ | ||
35 | bbfatal_log "'${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS}' execution failed." | 38 | bbfatal_log "'${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS}' execution failed." |
36 | 39 | ||
37 | # support filenames with *spaces* | 40 | # support filenames with *spaces* |