summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Little <morgan.little@windriver.com>2012-07-19 13:46:06 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-22 11:42:20 +0100
commit093ed41b0f0d89cb6344acdf6bb62cb9ca597f2f (patch)
tree56d957638ae1769a111c9bb178cada565d8c9740
parent5bdd9988d9e64814191fb7480d6a4c1355b019cc (diff)
downloadpoky-093ed41b0f0d89cb6344acdf6bb62cb9ca597f2f.tar.gz
python-native: Put binaries in seperate directory
Update python-native to install the binaries in the python-native directory, add pythonnative.bbclass to let recipes that need python-native use the binaries and update disutils access the new binaries. Update distutils-base to inherit pythonnative. (From OE-Core rev: a2e554f731437545e9483a7a73e6847c03f6f48a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/distutils-base.bbclass2
-rw-r--r--meta/classes/distutils.bbclass8
-rw-r--r--meta/classes/pythonnative.bbclass3
-rw-r--r--meta/recipes-devtools/python/python-native_2.7.3.bb10
4 files changed, 14 insertions, 9 deletions
diff --git a/meta/classes/distutils-base.bbclass b/meta/classes/distutils-base.bbclass
index 6d18e08f14..c761b3602b 100644
--- a/meta/classes/distutils-base.bbclass
+++ b/meta/classes/distutils-base.bbclass
@@ -1,5 +1,5 @@
1DEPENDS += "${@["python-native python", ""][(d.getVar('PACKAGES', True) == '')]}" 1DEPENDS += "${@["python-native python", ""][(d.getVar('PACKAGES', True) == '')]}"
2RDEPENDS_${PN} += "${@['', 'python-core']['${PN}' == '${BPN}']}" 2RDEPENDS_${PN} += "${@['', 'python-core']['${PN}' == '${BPN}']}"
3 3
4inherit distutils-common-base 4inherit distutils-common-base pythonnative
5 5
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index bcddf8d978..690df73717 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -11,14 +11,14 @@ 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 setup.py build ${DISTUTILS_BUILD_ARGS} || \ 14 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
15 bbfatal "python setup.py build_ext execution failed." 15 bbfatal "python setup.py build_ext execution failed."
16} 16}
17 17
18distutils_stage_headers() { 18distutils_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 setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \ 21 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
22 bbfatal "python setup.py install_headers execution failed." 22 bbfatal "python setup.py install_headers execution failed."
23} 23}
24 24
@@ -28,7 +28,7 @@ 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 setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \ 31 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
32 bbfatal "python setup.py install (stage) execution failed." 32 bbfatal "python setup.py install (stage) execution failed."
33} 33}
34 34
@@ -38,7 +38,7 @@ distutils_do_install() {
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 setup.py install ${DISTUTILS_INSTALL_ARGS} || \ 41 ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install ${DISTUTILS_INSTALL_ARGS} || \
42 bbfatal "python setup.py install execution failed." 42 bbfatal "python setup.py install execution failed."
43 43
44 for i in `find ${D} -name "*.py"` ; do \ 44 for i in `find ${D} -name "*.py"` ; do \
diff --git a/meta/classes/pythonnative.bbclass b/meta/classes/pythonnative.bbclass
new file mode 100644
index 0000000000..bc346da58d
--- /dev/null
+++ b/meta/classes/pythonnative.bbclass
@@ -0,0 +1,3 @@
1PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python"
2PATH_prepend = "${STAGING_BINDIR_NATIVE}/python-native:"
3DEPENDS += " python-native "
diff --git a/meta/recipes-devtools/python/python-native_2.7.3.bb b/meta/recipes-devtools/python/python-native_2.7.3.bb
index 50bf894d0c..bfdcd12687 100644
--- a/meta/recipes-devtools/python/python-native_2.7.3.bb
+++ b/meta/recipes-devtools/python/python-native_2.7.3.bb
@@ -1,6 +1,6 @@
1require python.inc 1require python.inc
2DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native" 2DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native"
3PR = "${INC_PR}.0" 3PR = "${INC_PR}.1"
4 4
5SRC_URI += "file://04-default-is-optimized.patch \ 5SRC_URI += "file://04-default-is-optimized.patch \
6 file://05-enable-ctypes-cross-build.patch \ 6 file://05-enable-ctypes-cross-build.patch \
@@ -20,6 +20,8 @@ inherit native
20 20
21RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-core-native" 21RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-core-native"
22 22
23EXTRA_OECONF += " --bindir=${bindir}/${PN}"
24
23EXTRA_OEMAKE = '\ 25EXTRA_OEMAKE = '\
24 BUILD_SYS="" \ 26 BUILD_SYS="" \
25 HOST_SYS="" \ 27 HOST_SYS="" \
@@ -34,11 +36,11 @@ do_configure_prepend() {
34 36
35do_install() { 37do_install() {
36 oe_runmake 'DESTDIR=${D}' install 38 oe_runmake 'DESTDIR=${D}' install
37 install -d ${D}${bindir}/ 39 install -d ${D}${bindir}/${PN}
38 install -m 0755 Parser/pgen ${D}${bindir}/ 40 install -m 0755 Parser/pgen ${D}${bindir}/${PN}
39 41
40 # Make sure we use /usr/bin/env python 42 # Make sure we use /usr/bin/env python
41 for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do 43 for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
42 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT 44 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
43 done 45 done
44} 46}