diff options
author | Khem Raj <raj.khem@gmail.com> | 2013-03-09 22:03:59 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-02 22:37:38 +0000 |
commit | 8314590f099ec3e0592355b192ef80a2e71daac0 (patch) | |
tree | bedb57ee3e0ab89f8c236bdef3bbf69ca7cfeabd /meta/classes | |
parent | 867b1eee25344d0b891dc539c6eb01f527165ae2 (diff) | |
download | poky-8314590f099ec3e0592355b192ef80a2e71daac0.tar.gz |
classes/distutils: Introduce PYTHON_PN
This is needed to accomodate python3 alongside
python2
(From OE-Core rev: ae931c2cf9e48e1fb74b4b727dbf668ea880023f)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/distutils-base.bbclass | 5 | ||||
-rw-r--r-- | meta/classes/distutils-native-base.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/distutils.bbclass | 23 | ||||
-rw-r--r-- | meta/classes/python-dir.bbclass | 1 | ||||
-rw-r--r-- | meta/classes/pythonnative.bbclass | 9 |
5 files changed, 23 insertions, 19 deletions
diff --git a/meta/classes/distutils-base.bbclass b/meta/classes/distutils-base.bbclass index 3b43e7629f..aa18e8b292 100644 --- a/meta/classes/distutils-base.bbclass +++ b/meta/classes/distutils-base.bbclass | |||
@@ -1,5 +1,4 @@ | |||
1 | DEPENDS += "${@["python-native python", ""][(d.getVar('PACKAGES', True) == '')]}" | 1 | DEPENDS += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES', True) == '')]}" |
2 | RDEPENDS_${PN} += "${@['', 'python-core']['${CLASSOVERRIDE}' == 'class-target']}" | 2 | RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}" |
3 | 3 | ||
4 | inherit distutils-common-base pythonnative | 4 | inherit distutils-common-base pythonnative |
5 | |||
diff --git a/meta/classes/distutils-native-base.bbclass b/meta/classes/distutils-native-base.bbclass index ceda512e39..509cb9551a 100644 --- a/meta/classes/distutils-native-base.bbclass +++ b/meta/classes/distutils-native-base.bbclass | |||
@@ -1,3 +1,3 @@ | |||
1 | DEPENDS += "${@["python-native", ""][(d.getVar('PACKAGES', True) == '')]}" | ||
2 | |||
3 | inherit distutils-common-base | 1 | inherit distutils-common-base |
2 | |||
3 | DEPENDS += "${@["${PYTHON_PN}-native", ""][(d.getVar('PACKAGES', True) == '')]}" | ||
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass index 80f6df8ed8..f3da023942 100644 --- a/meta/classes/distutils.bbclass +++ b/meta/classes/distutils.bbclass | |||
@@ -11,15 +11,15 @@ distutils_do_compile() { | |||
11 | STAGING_INCDIR=${STAGING_INCDIR} \ | 11 | STAGING_INCDIR=${STAGING_INCDIR} \ |
12 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 12 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
13 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | 13 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ |
14 | ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \ | 14 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \ |
15 | bbfatal "python setup.py build_ext execution failed." | 15 | bbfatal "${PYTHON_PN} setup.py build_ext execution failed." |
16 | } | 16 | } |
17 | 17 | ||
18 | distutils_stage_headers() { | 18 | distutils_stage_headers() { |
19 | install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} | 19 | install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} |
20 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | 20 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ |
21 | ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \ | 21 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \ |
22 | bbfatal "python setup.py install_headers execution failed." | 22 | bbfatal "${PYTHON_PN} setup.py install_headers execution failed." |
23 | } | 23 | } |
24 | 24 | ||
25 | distutils_stage_all() { | 25 | distutils_stage_all() { |
@@ -28,21 +28,22 @@ distutils_stage_all() { | |||
28 | install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} | 28 | install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} |
29 | PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \ | 29 | PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \ |
30 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | 30 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ |
31 | ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \ | 31 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \ |
32 | bbfatal "python setup.py install (stage) execution failed." | 32 | bbfatal "${PYTHON_PN} setup.py install (stage) execution failed." |
33 | } | 33 | } |
34 | 34 | ||
35 | distutils_do_install() { | 35 | distutils_do_install() { |
36 | install -d ${D}${PYTHON_SITEPACKAGES_DIR} | 36 | install -d ${D}${PYTHON_SITEPACKAGES_DIR} |
37 | STAGING_INCDIR=${STAGING_INCDIR} \ | 37 | STAGING_INCDIR=${STAGING_INCDIR} \ |
38 | STAGING_LIBDIR=${STAGING_LIBDIR} \ | 38 | STAGING_LIBDIR=${STAGING_LIBDIR} \ |
39 | PYTHONPATH=${D}/${PYTHON_SITEPACKAGES_DIR} \ | 39 | PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \ |
40 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ | 40 | BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ |
41 | ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \ | 41 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \ |
42 | bbfatal "python setup.py install execution failed." | 42 | bbfatal "${PYTHON_PN} setup.py install execution failed." |
43 | 43 | ||
44 | for i in `find ${D} -name "*.py"` ; do \ | 44 | # support filenames with *spaces* |
45 | sed -i -e s:${D}::g $i | 45 | find ${D} -name "*.py" -print0 | while read -d $'\0' i ; do \ |
46 | sed -i -e s:${D}::g "$i" | ||
46 | done | 47 | done |
47 | 48 | ||
48 | if test -e ${D}${bindir} ; then | 49 | if test -e ${D}${bindir} ; then |
diff --git a/meta/classes/python-dir.bbclass b/meta/classes/python-dir.bbclass index 0b6a33c2ed..b4b5ab0eab 100644 --- a/meta/classes/python-dir.bbclass +++ b/meta/classes/python-dir.bbclass | |||
@@ -1,3 +1,4 @@ | |||
1 | PYTHON_BASEVERSION ?= "2.7" | 1 | PYTHON_BASEVERSION ?= "2.7" |
2 | PYTHON_DIR = "python${PYTHON_BASEVERSION}" | 2 | PYTHON_DIR = "python${PYTHON_BASEVERSION}" |
3 | PYTHON_PN = "python${@'' if '${PYTHON_BASEVERSION}'.startswith('2') else '3'}" | ||
3 | PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages" | 4 | PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages" |
diff --git a/meta/classes/pythonnative.bbclass b/meta/classes/pythonnative.bbclass index 7886207d06..fdd22bbc86 100644 --- a/meta/classes/pythonnative.bbclass +++ b/meta/classes/pythonnative.bbclass | |||
@@ -1,3 +1,6 @@ | |||
1 | PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python" | 1 | |
2 | EXTRANATIVEPATH += "python-native" | 2 | inherit python-dir |
3 | DEPENDS += " python-native " | 3 | |
4 | PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}" | ||
5 | EXTRANATIVEPATH += "${PYTHON_PN}-native" | ||
6 | DEPENDS += " ${PYTHON_PN}-native " | ||