s3.TUP Some rework on toolchain template handling (v0.14.0)
- prevent multiple calls of the _check_pkg function and show an indication of what this function does when it's executed
- display the number of elements in the toolchain and in the template menu
- introduce versioning of toolchain templates to better track changes (version is displayed in bottom line of template menu)
- colorize (bold red) template description in template menu to indicate template updates
- optimize template editor to save additional template properties (edited, copyof)
- new toolchain template properties (version, migrate, updated, copyof)
- new config option LIBS_LIST_BETA to enable list of beta libraries in update menu (e.g. OpenSSL 3.0.0 alpha), default is LIBS_LIST_BETA=0
- introduce use of latest glibc-version 2.31 (with appropriate compatibility level) in all corresponding toolchain templates
- try better toolchain template naming
- rename template ar71xx_mips to owrt_ar71xx_mips
- rename template ath79_mips to owrt_ath79_mips
- rename template ds216play_armv7 to synology_armv7
- rename template ds418_aarch64 to synology_aarch64
- rename template fritzOS-musl-LAB_mips to fos_mLAB_mips
- rename template fritzOS-uClibc-69x_mips to fos_u69x_mips
- rename template fritzOS-uClibc-71x_mips to fos_u71x_mips
- rename template mpc85xx_powerpc to owrt_mpc85xx_ppc
- display an indication to recognized renamed toolchain templates
- add templates fos_g71x_mips, fos_u71x_arm, fos_u71x_puma, fos_uLAB_mips
- some code optimizations
"\nSelect on of the templates to create the cross toolchain you want:\n\n\Z1NOTE: If you create a cross toolchain from a template with a red colored description, an existing one with the same name will be replaced without asking!\Zn" \
"\nSelect one of the $COUNT templates to create the cross toolchain you want:\n\n\Z1NOTE: \ZbIf you create a cross toolchain from a template with a red colored description, an existing one with the same name will be replaced without asking!\ZB Dark red colored descriptions indicates that the version of the template is higher than the existing toolchain. An update could make sense.\Zn" \
"${COUNT+11}" 0 0 "${MENU_OPTIONS[@]}");
"${COUNT+11}" 0 0 "${MENU_OPTIONS[@]}");
ret="$?";
ret="$?";
fi;
fi;
@ -330,7 +339,7 @@ _create_tc(){
echo -e "$y_l$sp\nbuild ($i/$icount): command list for cross toolchain $tpl:\n$sp" | tee -a "$logfile";
echo -e "$y_l$sp\nbuild ($i/$icount): command list for cross toolchain $tpl:\n$sp" | tee -a "$logfile";
echo -e "${y_l}MIGRATION -> The following cross toolchains are out of date due to the renaming of cross toolchain templates:${re_}"
echo -e "$mig_list";
echo -e "You can still use the ${y_l}old cross toolchains${re_} from above, but it's better to create new ones based on the ${p_l}new cross toolchain templates${re_} to get future template updates.\nThe ${y_l}old cross toolchains${re_} can be removed manually as follows:"
echo -e "$y_l""SYSCHECK -> Please wait while performing checks of required tools and dependencies...""$re_";
if syscheck "" "" "${pkgs[*]}" "${headers[*]}" "${libs[*]}";then
if syscheck "" "" "${pkgs[*]}" "${headers[*]}" "${libs[*]}";then
echo -e "$r_l""\nCHECK -> You need to manually install the following packages to use this plugin properly:\n"$y_l"$prefix install$packages\n""$re_" && _paktc_timer 10;
echo -e "$r_l""\nSYSCHECK -> You need to manually install the following packages to use this plugin properly:\n"$y_l"$prefix install$packages\n""$re_" && _paktc_timer 10;
fi;
fi;
};
};
_check_github_api_limits(){
_check_github_api_limits(){
@ -847,7 +903,7 @@ _check_github_api_limits(){
_check_crosstool_setup(){
_check_crosstool_setup(){
#Setup crosstool-NG automatically if not installed
#Setup crosstool-NG automatically if not installed
if [ "$1" == "CTNG" ] || [ -z "$1" ];then
if [ "$1" == "CTNG" ] || [ -z "$1" ];then
if [ ! -f "$ctsrcdir/ct-ng" ];then
if [ ! -f "$ctngsrcdir/ct-ng" ];then
clear;
clear;
echo -e "$r_l""\nCHECK -> crosstool-NG is not setup correctly. Try to fix it automatically...\n""$re_";
echo -e "$r_l""\nCHECK -> crosstool-NG is not setup correctly. Try to fix it automatically...\n""$re_";
[ -z "$1" ] && _paktc_timer 5;
[ -z "$1" ] && _paktc_timer 5;
@ -867,6 +923,7 @@ _check_crosstool_setup(){
};
};
_check_config(){
_check_config(){
nok=0;
nok=0;
[ -z ${LIBS_LIST_BETA+x} ] && nok=1;
[ -z ${FNG_REPO_URL+x} ] && nok=1;
[ -z ${FNG_REPO_URL+x} ] && nok=1;
[ -z ${CTNG_CONFIG_tasks+x} ] && nok=1;
[ -z ${CTNG_CONFIG_tasks+x} ] && nok=1;
[ -z ${CTNG_BUILD_AS_ROOT+x} ] && nok=1;
[ -z ${CTNG_BUILD_AS_ROOT+x} ] && nok=1;
@ -909,7 +966,7 @@ _create_config(){
fi;
fi;
ctng_config_tasks=( "('./ct-ng menuconfig;')"
ctng_config_tasks=( "('./ct-ng menuconfig;')"
"('TPL_SAVE=\$(\$gui --defaultno --output-fd 1 --ok-label \"Yes\" --cancel-label \"No\" --colors \$bt_ \"\$title_ - \Z0\$pdesc\Zn\" --title \"-[ Save Cross Toolchain Template ]-\" --inputbox \"\\\nWould you like to \ZrSAVE\ZR this toolchain template \Zrnow\ZR?\" 10 55 \"@TEMPLATE@\") && cp \"\$ctsrcdir/.config\" \"\$TPL_SAVE\";')" );
"('TPL_SAVE=\$(\$gui --defaultno --output-fd 1 --ok-label \"Yes\" --cancel-label \"No\" --colors \$bt_ \"\$title_ - \Z0\$pdesc\Zn\" --title \"-[ Save Cross Toolchain Template ]-\" --inputbox \"\\\nWould you like to \ZrSAVE\ZR this toolchain template \Zrnow\ZR?\" 10 55 \"@TEMPLATE@\") && cp \".config\" \"\$TPL_SAVE\";')" );
ctng_config_tasks_comment="#config command";
ctng_config_tasks_comment="#config command";
ctng_build_tasks=( "('./ct-ng show-config | tee -a \"@LOGFILE@\";')"
ctng_build_tasks=( "('./ct-ng show-config | tee -a \"@LOGFILE@\";')"
@ -923,7 +980,7 @@ _create_config(){
ctng_setup_tasks_comment="#setup command";
ctng_setup_tasks_comment="#setup command";
fng_config_tasks=( "('make menuconfig;')"
fng_config_tasks=( "('make menuconfig;')"
"('TPL_SAVE=\$(\$gui --defaultno --output-fd 1 --ok-label \"Yes\" --cancel-label \"No\" --colors \$bt_ \"\$title_ - \Z0\$pdesc\Zn\" --title \"-[ Save Cross Toolchain Template ]-\" --inputbox \"\\\nWould you like to \ZrSAVE\ZR this toolchain template \Zrnow\ZR?\" 10 55 \"@TEMPLATE@\") && cp \"\$fngsrcdir/.config\" \"\$TPL_SAVE\";')" );
"('TPL_SAVE=\$(\$gui --defaultno --output-fd 1 --ok-label \"Yes\" --cancel-label \"No\" --colors \$bt_ \"\$title_ - \Z0\$pdesc\Zn\" --title \"-[ Save Cross Toolchain Template ]-\" --inputbox \"\\\nWould you like to \ZrSAVE\ZR this toolchain template \Zrnow\ZR?\" 10 55 \"@TEMPLATE@\") && cp \".config\" \"\$TPL_SAVE\";')" );
fng_config_tasks_comment="#config command";
fng_config_tasks_comment="#config command";
fng_build_tasks=( "('make olddefconfig | tee -a \"@LOGFILE@\";')"
fng_build_tasks=( "('make olddefconfig | tee -a \"@LOGFILE@\";')"
"#Filename and optional version number to check in pkgconfig folder for an existing library to get version information"
"#Filename and optional version number to check in pkgconfig folder for an existing library to get version information"
"#Valid URL for downloading sources of library\n#List of build commands below. Pay attention to the SEMICOLON at the end of EACH\n#command and the correct quoting (' or \") for or to avoid expansion of variables.\n#Tokens @TOOLCHAIN@, @CC@, @RANLIB@, @PREFIX@, @HOST@, @VALIDATE@, @LOGFILE@ are replaced automatically."
"#Valid URL for downloading sources of library\n#List of build commands below. Pay attention to the SEMICOLON at the end of EACH\n#command and the correct quoting (' or \") for or to avoid expansion of variables.\n#Tokens @TOOLCHAIN@, @CC@, @RANLIB@, @PREFIX@, @HOST@, @VALIDATE@, @LOGFILE@ are replaced automatically."
"#build command" );
"#build command" );
lib_settings=( "" name version check url tasks );
lib_settings=( "" beta name version check url tasks );
echo 'CTNG_REPO_URL="https://github.com/crosstool-ng/crosstool-ng"; #Repository to load ct-ng from' >>"$configname";
echo 'CTNG_REPO_URL="https://github.com/crosstool-ng/crosstool-ng"; #Repository to load ct-ng from' >>"$configname";
echo 'CTNG_BUILD_AS_ROOT="0"; #Enable/Disable (1|0); You normally do *not* need to be root to build a toolchain using crosstool-NG. In fact, it is *VERY* dangerous to run as root, as crosstool-NG will, as part of the build process, remove a few directories. If anything goes wrong, running as root can ruin your host distribution.' >>"$configname";
echo 'CTNG_BUILD_AS_ROOT="0"; #Enabled/Disabled (1|0); You normally do *not* need to be root to build a toolchain using crosstool-NG. In fact, it is *VERY* dangerous to run as root, as crosstool-NG will, as part of the build process, remove a few directories. If anything goes wrong, running as root can ruin your host distribution.' >>"$configname";
echo '#List of build and setup commands below. Pay attention to the SEMICOLON at the end of EACH' >>"$configname";
echo '#List of build and setup commands below. Pay attention to the SEMICOLON at the end of EACH' >>"$configname";
echo '#command and the correct quoting ('"'"' or ") for or to avoid expansion of variables.' >>"$configname";
echo '#command and the correct quoting ('"'"' or ") for or to avoid expansion of variables.' >>"$configname";
echo '#Tokens @CTNGSOURCE@, @LOGFILE@, @TEMPLATE@, @COMPRESS@, @CREATECFG@ are replaced automatically. The commands are executed in the context of the current user.' >>"$configname";
echo '#Tokens @CTNGSOURCE@, @LOGFILE@, @TEMPLATE@, @COMPRESS@, @CREATECFG@ are replaced automatically. The commands are executed in the context of the current user.' >>"$configname";
@ -1020,6 +1082,7 @@ _create_config(){
echo -e '\n#LIBRARY update build settings\n#List of ordered libraries. Only libraries in this list are available' >>"$configname";
echo -e '\n#LIBRARY update build settings\n#List of ordered libraries. Only libraries in this list are available' >>"$configname";
echo "LIBS=(${lib_keys[@]});" >>"$configname";
echo "LIBS=(${lib_keys[@]});" >>"$configname";
echo 'LIBS_LIST_BETA="0"; #In(Ex)clude libraries defined as beta' >>"$configname";