Patchwork [1/1] python-scons-native: fix invoking scons failed on Fedora-17

login
register
mail settings
Submitter Hongxu Jia
Date May 28, 2013, 1:13 p.m.
Message ID <7310117a341c8389bf66c80ad9aec87b38e1fe12.1369654710.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/50623/
State Accepted
Commit f5d0f6becc6d1eb3a525a9e66ffd8bba52e2ae4e
Headers show

Comments

Hongxu Jia - May 28, 2013, 1:13 p.m.
While the destro didn't install scons, build scons by python-scons-native,
and invoke it with the error:
...
$scons -h
Traceback (most recent call last):
  File "/buildarea2/hongxujia/build-20130520-udev-emenlow/tmp/sysroots/x86_64-linux/usr/bin/scons", line 188, in <module>
    import SCons.Script
ImportError: No module named SCons.Script
...

1, While building scons as default, scons's lib will be install in the dir of
`scons' or `scons-2.3.0' if the option `--install-lib' is not set explicitly.

2, While build python-scons-native, `--install-lib' is explicitly set, and
scons's lib was not installed in the dir of `scons' or `scons-2.3.0'.

3, While invoke scons-native, the scons searches the lib in ${STAGING_DIR_HOST}/
${PYTHON_SITEPACKAGES_DIR}/scons, ${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}/
scons-2.3.0 rather than ${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}.

Use create_wrapper to relocate scons-native to add `${STAGING_DIR_HOST}/${PYTHON
_SITEPACKAGES_DIR}' to PYTHONPATH, so scons-native could find out the lib.

[YOCTO #4562]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/python/python-scons-native_2.3.0.bb |    4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/meta/recipes-devtools/python/python-scons-native_2.3.0.bb b/meta/recipes-devtools/python/python-scons-native_2.3.0.bb
index 1e4ec27..067ed61 100644
--- a/meta/recipes-devtools/python/python-scons-native_2.3.0.bb
+++ b/meta/recipes-devtools/python/python-scons-native_2.3.0.bb
@@ -2,3 +2,7 @@  require python-scons_${PV}.bb
 inherit native pythonnative
 DEPENDS = "python-native"
 RDEPENDS_${PN} = ""
+
+do_install_append() {
+    create_wrapper ${D}${bindir}/scons  PYTHONPATH='$PYTHONPATH:${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
+}