Skip to contentSkip to conversation

python: set PYTHONHOME for nativesdk

PATCH New Christopher Larson 1 participant 2 messages Feb 5, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 python: set PYTHONHOME for nativesdk

From: Christopher Larson <[email protected]>

This ensures that the nativesdk python functions correctly without needing to set PYTHONHOME in the sdk environment setup script.

---
 meta/recipes-devtools/python/python_2.7.11.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/python/python_2.7.11.bb +1 -1
index 0287c19..0c00d6e 100644
@@ -123,7 +123,7 @@ do_install() {
 }
 
 do_install_append_class-nativesdk () {
-	create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
+	create_wrapper ${D}${bindir}/python2.7 PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
 }
 
 SSTATE_SCAN_FILES += "Makefile"
Signature · 1 line
2.2.1
#1 lore raw

PATCH 2/2 toolchain-scripts: drop PYTHONHOME

From: Christopher Larson <[email protected]>

If this is set when nativesdk-python is not installed, it will break the host python, so it's better to handle this in python.

---
 meta/classes/toolchain-scripts.bbclass | 1 -
 1 file changed, 1 deletion(-)
meta/classes/toolchain-scripts.bbclass +0 -1
index ab4feb0..1566dd6 100644
@@ -31,7 +31,6 @@ toolchain_create_sdk_env_script () {
 	echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script
 	echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script
 	echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script
-	echo "export PYTHONHOME=$sdkpathnative$prefix" >> $script
 	echo 'unset command_not_found_handle' >> $script
 
 	toolchain_shared_env_script
Signature · 1 line
2.2.1