meta-environment: Improve info messages
[meta-kc-bsp.git] / recipes-core / meta / meta-environment.bbappend
1 # Create custom settings script to become included by environment script
2
3 fakeroot do_create_kc_sdk_file() {
4         mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
5         script=${D}${SDKPATHNATIVE}/environment-setup.d/kcbsp.sh
6
7         echo 'basename -- "$0$ZSH_VERSION" | grep -q "^environment-setup$" && echo "$SHELL" | grep -q "/\(\([bd]ash\)\|\([k]sh\)\)$" && ENV=$0 POSIXLY_CORRECT=1 exec $SHELL -i' >> $script
8         echo 'basename -- "$0$ZSH_VERSION" | grep -q "^environment-setup$" && echo "Usage: . $0" && exit 1' >> $script
9         echo 'echo "Applying environment settings..."' >> $script
10         echo 'echo "Version:       ${DISTRO_VERSION}"' >> $script
11         echo 'echo "Target prefix: ${TARGET_PREFIX}"' >> $script
12         echo 'export PS1="[$ARCH] $PS1"' >> $script
13
14         echo 'SDK_PATH=$OECORE_NATIVE_SYSROOT/usr' >> $script
15         echo 'alias opkg-target="LD_LIBRARY_PATH=$SDK_PATH/lib $SDK_PATH/bin/opkg-cl -f $SDKTARGETSYSROOT/etc/opkg.conf -o $SDKTARGETSYSROOT"' >> $script
16
17         sed -i -e 's:${SDKPATHNATIVE}:$OECORE_NATIVE_SYSROOT:g' ${script}
18 }
19
20 # Deploy generic link for environment setup
21
22 do_install_append () {
23         mkdir -p ${D}/${SDKPATH}/
24         cd ${D}/${SDKPATH}/
25         ln -sf environment-setup-${REAL_MULTIMACH_TARGET_SYS} environment-setup
26         cd -
27 }
28
29 FILES_${PN} += " \
30         ${SDKPATH}/environment-setup \
31         "
32
33 addtask create_kc_sdk_file after do_install before do_package
34