1
0
Fork 0

download_and_compile.sh: small fixes for TerraGear and TerraGear GUI

- make all generated scripts executable;
- use correct path for 'terragear' in the generated default config file
  ~/.config/TerraGear/TerraGearGUI.conf (not the 'bin' subdirectory);
- add default for the 'flightgear' path in the same file;
- don't write temporary TerraGearGUI.conf in $CBD (it's useless and
  might overwrite a user-created file);
- simplify a bit (esp. using a here document for generating
  run_terrageargui.sh).
This commit is contained in:
Florent Rougon 2019-04-29 22:28:21 +02:00
parent f3423dba60
commit 882ab6ae59

View file

@ -1294,6 +1294,8 @@ if _elementIn "TERRAGEAR" "${WHATTOBUILD[@]}"; then
echo "export LD_LIBRARY_PATH='$INSTALL_DIR_SIMGEAR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \ echo "export LD_LIBRARY_PATH='$INSTALL_DIR_SIMGEAR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \
>> run_genapts850.sh >> run_genapts850.sh
echo "./genapts850 \"\$@\"" >> run_genapts850.sh echo "./genapts850 \"\$@\"" >> run_genapts850.sh
chmod 755 run_tg-construct.sh run_ogr-decode.sh run_genapts850.sh
fi fi
_logSep _logSep
@ -1328,22 +1330,26 @@ if _elementIn "TERRAGEARGUI" "${WHATTOBUILD[@]}"; then
_make terrageargui _make terrageargui
cd "$CBD" cd "$CBD"
# Fill TerraGear Root field
if [ ! -f ~/.config/TerraGear/TerraGearGUI.conf ]; then cfgFile="$HOME/.config/TerraGear/TerraGearGUI.conf"
_log "Fill TerraGear Root field" if [ ! -f "$cfgFile" ]; then
echo "[paths]" > TerraGearGUI.conf _log "Writing a default config file for TerraGear GUI: $cfgFile"
echo "terragear=$INSTALL_DIR_TG/bin" >> TerraGearGUI.conf
mkdir -p ~/.config/TerraGear mkdir -p ~/.config/TerraGear
mv TerraGearGUI.conf ~/.config/TerraGear echo "[paths]" > "$cfgFile"
echo "terragear=$INSTALL_DIR_TG" >> "$cfgFile"
echo "flightgear=$INSTALL_DIR_FGFS" >> "$cfgFile"
fi fi
_log "Create run_terrageargui.sh" SCRIPT=run_terrageargui.sh
echo "#!/bin/sh" > run_terrageargui.sh _log "Creating $SCRIPT"
echo "cd \"\$(dirname \"\$0\")\"" >> run_terrageargui.sh cat >"$SCRIPT" <<EndOfScriptText
echo "cd install/terrageargui/bin" >> run_terrageargui.sh #! /bin/sh
echo "export LD_LIBRARY_PATH='$INSTALL_DIR_SIMGEAR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \ cd "\$(dirname "\$0")"
>> run_terrageargui.sh cd '$SUB_INSTALL_DIR/$TGGUI_INSTALL_DIR/bin'
echo "./TerraGUI \"\$@\"" >> run_terrageargui.sh export LD_LIBRARY_PATH='$INSTALL_DIR_SIMGEAR/lib'"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}"
./TerraGUI "\$@"
EndOfScriptText
chmod 755 "$SCRIPT"
fi fi
# Print optional package alternatives that didn't match (this helps with # Print optional package alternatives that didn't match (this helps with