summaryrefslogtreecommitdiffstats
path: root/meta/classes/distutils3.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-12-10 13:42:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-28 23:25:41 +0000
commit8b1eb782c32d8ce31e8f033ef3197e4be76bfc84 (patch)
tree78f2fa128147b0874f213cc77f28754822452a3b /meta/classes/distutils3.bbclass
parent8b57f9c53444dc5f00119c814a9a6ded71f49c25 (diff)
downloadpoky-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.bbclass17
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 @@
1inherit distutils3-base 1inherit distutils3-base
2 2
3B = "${WORKDIR}/build"
4distutils_do_configure[cleandirs] = "${B}"
5
3DISTUTILS_BUILD_ARGS ?= "" 6DISTUTILS_BUILD_ARGS ?= ""
4DISTUTILS_INSTALL_ARGS ?= "--root=${D} \ 7DISTUTILS_INSTALL_ARGS ?= "--root=${D} \
5 --prefix=${prefix} \ 8 --prefix=${prefix} \
@@ -10,28 +13,28 @@ DISTUTILS_PYTHON = "python3"
10DISTUTILS_PYTHON_class-native = "nativepython3" 13DISTUTILS_PYTHON_class-native = "nativepython3"
11 14
12distutils3_do_configure() { 15distutils3_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
19distutils3_do_compile() { 19distutils3_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}
27distutils3_do_compile[vardepsexclude] = "MACHINE" 28distutils3_do_compile[vardepsexclude] = "MACHINE"
28 29
29distutils3_do_install() { 30distutils3_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*