Browse Source

Merge pull request #26 from gorgone/next

Next
pull/41/head
Gorgone 5 years ago
committed by GitHub
parent
commit
afd0eb0079
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 44
      support/functions/_plugin_update_toolchain
  2. 2
      support/functions/_sys_check
  3. 20
      support/os/debian_ubuntu.install
  4. 27
      support/os/manjaro.install
  5. 34
      support/os/redhat_centos_fedora.install
  6. 24
      support/os/suse.install

44
support/functions/_plugin_update_toolchain

@ -3,7 +3,7 @@
#simplebuild_plugin tcupdate #simplebuild_plugin tcupdate
tcupdate(){ tcupdate(){
pversion="0.11.3"; pversion="0.11.4";
pname="s3.TUP"; pname="s3.TUP";
pdesc="Plugin $pname v$pversion"; pdesc="Plugin $pname v$pversion";
configname="$configdir/plugin_update_toolchain.config"; configname="$configdir/plugin_update_toolchain.config";
@ -17,7 +17,7 @@ tcupdate(){
[ -z "$4" ] && FLAG="0" || FLAG="$4"; #1 - tcupdate call from s3 main menu, 2 - tcupdate call from s3 toolchain menu; [ -z "$4" ] && FLAG="0" || FLAG="$4"; #1 - tcupdate call from s3 main menu, 2 - tcupdate call from s3 toolchain menu;
tc="$CMDTC"; tc="$CMDTC";
clear && _check_bin; clear && _check_pkg;
#backup config #backup config
if [ "$CMDTC" == "-r" ] || [ "$CMDTC" == "--reset" ];then if [ "$CMDTC" == "-r" ] || [ "$CMDTC" == "--reset" ];then
@ -179,7 +179,7 @@ tcupdate(){
[ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no libraries found" "no libraries found") && counter; [ $COUNT -eq 0 ] && MENU_OPTIONS+=("" "no libraries found" "no libraries found") && counter;
if [ ${#OPTION1} -gt 0 ];then #Force build library call if [ ${#OPTION1} -gt 0 ];then #Force build library call
opts=$(echo "$OPTION1" | tr ',' "\n"); opts=$(echo "$OPTION1" | tr ',' '\n');
ret="0"; ret="0";
else else
clear;clear; clear;clear;
@ -303,13 +303,13 @@ _create_tc(){
icount=$(echo $opts | wc -w);i=0; icount=$(echo $opts | wc -w);i=0;
for tpl in $opts;do for tpl in $opts;do
if [ -f "$cttpldir/$tpl" ]; then if [ -f "$cttpldir/$tpl" ]; then
logfile="$ldir/$(date +%F)_$(date +%T)_update_toolchain_crosstoolchain_"$tpl".log"; ((i++)); logfile="$ldir/$(date +%F)_$(date +%T)_update_toolchain_crosstoolchain_"$tpl".log"; ((i++));
clear; clear;
sp=$(printf '%*s' 80 | tr ' ' '=') sp=$(printf '%*s' 80 | tr ' ' '=')
echo -e "$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";
#copy template and patching them #copy template and patching them
echo "rm \"$ctsrcdir/.config\"* 2>/dev/null;cp --no-preserve=mode,ownership -f \"$cttpldir/$tpl\" \"$ctsrcdir/.config\";" | tee -a "$logfile"; echo "rm \"$ctsrcdir/.config\"* 2>/dev/null;cp --no-preserve=mode,ownership -f \"$cttpldir/$tpl\" \"$ctsrcdir/.config\";" | tee -a "$logfile";
rm "$ctsrcdir/.config"* 2>/dev/null;cp --no-preserve=mode,ownership -f "$cttpldir/$tpl" "$ctsrcdir/.config"; rm "$ctsrcdir/.config"* 2>/dev/null;cp --no-preserve=mode,ownership -f "$cttpldir/$tpl" "$ctsrcdir/.config";
@ -326,11 +326,13 @@ _create_tc(){
#run build #run build
bcl=$(printf '%s\n' "${CTNG_BUILD_tasks[@]}"); bcl=$(printf '%s\n' "${CTNG_BUILD_tasks[@]}");
echo -e "cd \"$ctsrcdir\";\n$(_replace_tokens "$bcl")\n$sp" | tee -a "$logfile"; echo -e "cd \"$ctsrcdir\";\n$(_replace_tokens "$bcl")\n$sp""$re_" | tee -a "$logfile";
sleep 2; sleep 2;
if [ $START_BUILD -eq 1 ]; then if [ $START_BUILD -eq 1 ]; then
cd "$ctsrcdir"; cd "$ctsrcdir";
#print out crosstool-NG version
echo -e "$g_l\n$(./ct-ng | grep 'crosstool-NG version' &2>/dev/null | tail -1)\n""$re_" | tee -a "$logfile";
#generate build command list #generate build command list
unset buildtasks; unset buildtasks;
for task in "${CTNG_BUILD_tasks[@]}";do for task in "${CTNG_BUILD_tasks[@]}";do
@ -619,7 +621,7 @@ _check_lib(){
case "$1" in case "$1" in
"PCSC") #Create symlink to the PCSC header files, if the last include path of the compiler don't point to it "PCSC") #Create symlink to the PCSC header files, if the last include path of the compiler don't point to it
echo -e "\nCheck for PCSC header files and try to symlink to the correct PCSC header files if the last compiler include path points to the wrong location..."; echo -e "\nCheck for PCSC header files and try to symlink to the correct PCSC header files if the last compiler include path points to the wrong location...";
if [ ${#incdir} -gt 0 ] && [ ! -d "$incdir/PCSC" ]; then if [ ${#incdir} -gt 0 ] && [ ! -d "$incdir/PCSC" ];then
headerdir="$(dirname $(find "$prefixdir" -type f -name "pcsclite.h" | head -n 1))"; headerdir="$(dirname $(find "$prefixdir" -type f -name "pcsclite.h" | head -n 1))";
[ ${#headerdir} -gt 0 ] && ln -s "$(realpath --relative-to="$incdir" "$headerdir")" "$incdir/PCSC"; [ ${#headerdir} -gt 0 ] && ln -s "$(realpath --relative-to="$incdir" "$headerdir")" "$incdir/PCSC";
[ ${#headerdir} -gt 0 ] && echo "Symlink $incdir/PCSC -> $headerdir created, to point to the PCSC header files." || "No PCSC header files found in $prefixdir and it's sub directories!"; [ ${#headerdir} -gt 0 ] && echo "Symlink $incdir/PCSC -> $headerdir created, to point to the PCSC header files." || "No PCSC header files found in $prefixdir and it's sub directories!";
@ -629,22 +631,14 @@ _check_lib(){
*) echo "not implemented yet!"; *) echo "not implemented yet!";
esac; esac;
}; };
_check_bin(){ _check_pkg(){
pkgs=( git patch curl jq gcc g++ gperf bison flex makeinfo help2man make file cmp \
bins=( git curl jq gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \ python3-config autoconf automake libtoolize libtool gawk wget bzip2 xz unzip rsync );
python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \ headers=( ncurses );
patch libstdc++6 rsync ); libs=( libstdc++.so.6 );
failed=0; if syscheck "" "" "${pkgs[*]}" "${headers[*]}" "${libs[*]}";then
for e in "${bins[@]}"; echo -e "$r_l""\nCHECK -> You need to manually install the following packages to use this plugin properly:\n"$y_l"$prefix apt install$packages\n""$re_" && _paktc_timer 10;
do fi;
dpkg -s "$e" &>/dev/null;
if [ ! "$?" -eq "0" ];then
packages="$packages $e";
failed=1;
fi;
done;
[ "$failed" == 1 ] && echo -e "$r_l""\nCHECK -> You need to install the following tools to use this plugin properly:\n"$y_l"apt install$packages\n""$re_" && _paktc_timer 10;
return $failed;
}; };
_check_config(){ _check_config(){
nok=0; nok=0;

2
support/functions/_sys_check

@ -150,7 +150,7 @@ then
[ -f /etc/redhat-release ] && installer="redhat_os" [ -f /etc/redhat-release ] && installer="redhat_os"
# Manjaro (/etc/os-release) # Manjaro (/etc/os-release)
[ -f /etc/manjaro-release ] && installer="manjaro_os" [ -f /etc/manjaro-release ] || [ -f /etc/arch-release ] && installer="manjaro_os"
# SuSE (/etc/SuSE-release is depreciated -> check for YaST2) # SuSE (/etc/SuSE-release is depreciated -> check for YaST2)
[ -d /etc/YaST2 ] && installer="suse_os" [ -d /etc/YaST2 ] && installer="suse_os"

20
support/os/debian_ubuntu.install

@ -18,6 +18,20 @@ do
xz) xz)
inst="xz-utils"; inst="xz-utils";
;; ;;
makeinfo)
inst="texinfo";
;;
python3-config)
inst="python3-dev";
;;
libtoolize)
inst="libtool";
;;
libtool)
inst="libtool-bin";
;;
cmp)
inst="diffutils";
esac; esac;
printf -v pad %40s; e=$e$pad; e=${e:0:15}; printf -v pad %40s; e=$e$pad; e=${e:0:15};
echo -e "$w_l select $g_l$e$y_l from: $inst"; echo -e "$w_l select $g_l$e$y_l from: $inst";
@ -42,6 +56,9 @@ do
pthread.h) pthread.h)
inst="libc-dev-bin"; inst="libc-dev-bin";
;; ;;
ncurses)
inst="libncurses-dev";
;;
esac; esac;
printf -v pad %40s; e=$e$pad; e=${e:0:15}; printf -v pad %40s; e=$e$pad; e=${e:0:15};
echo -e "$w_l select $g_l$e$y_l from: $inst"; echo -e "$w_l select $g_l$e$y_l from: $inst";
@ -57,6 +74,9 @@ do
libccidtwin.so) libccidtwin.so)
inst="libccid"; inst="libccid";
;; ;;
libstdc++.so.6)
inst="libstdc++6";
;;
esac; esac;
printf -v pad %40s; e=$e$pad; e=${e:0:15}; printf -v pad %40s; e=$e$pad; e=${e:0:15};
echo -e "$w_l select $g_l$e$y_l from: $inst"; echo -e "$w_l select $g_l$e$y_l from: $inst";

27
support/os/manjaro.install

@ -29,6 +29,21 @@ do
xz) xz)
inst="xz-utils"; inst="xz-utils";
;; ;;
scp)
inst="scponly";
;;
makeinfo)
inst="texinfo";
;;
python3-config)
inst="python3-devel";
;;
libtool|libtoolize)
inst="libtool";
;;
cmp)
inst="diffutils";
;;
esac; esac;
echo -e "$w_l select $g_l$e$y_l\tfrom: $inst"; echo -e "$w_l select $g_l$e$y_l\tfrom: $inst";
packages="$packages $inst"; packages="$packages $inst";
@ -52,6 +67,9 @@ do
pthread.h) pthread.h)
inst="libc-dev-bin"; inst="libc-dev-bin";
;; ;;
ncurses)
inst="ncurses";
;;
esac; esac;
echo -e "$w_l select $g_l$e$y_l\tfrom: $inst"; echo -e "$w_l select $g_l$e$y_l\tfrom: $inst";
packages="$packages $inst"; packages="$packages $inst";
@ -66,16 +84,19 @@ do
libccidtwin.so) libccidtwin.so)
inst="ccid"; inst="ccid";
;; ;;
libstdc++.so.6)
inst="gcc-libs";
;;
esac; esac;
echo -e "$w_l select $g_l$e$y_l\tfrom: $inst"; echo -e "$w_l select $g_l$e$y_l\tfrom: $inst";
packages="$packages $inst"; packages="$packages $inst";
fi; fi;
done; done;
if [ "$(uname -m)" == "x86_64" ] && [ ! -f /usr/lib32/libz.so.1 ]; then if [ "$(uname -m)" == "x86_64" ] && [ ! -f /usr/lib/libz.so ]; then
if [ ! -f /usr/lib32/libz.so.1 ]; then if [ ! -f /usr/lib/libz.so ]; then
e="zlib32"; e="zlib32";
inst="lib32z1"; inst="lib32-zlib";
echo -e "$w_l select $g_l$e$y_l\tfrom: $inst"; echo -e "$w_l select $g_l$e$y_l\tfrom: $inst";
packages="$packages $inst"; packages="$packages $inst";
fi fi

34
support/os/redhat_centos_fedora.install

@ -26,14 +26,17 @@ case $rh_version in
[6-7]) [6-7])
# Redhat/CentOS 6+7 ok # Redhat/CentOS 6+7 ok
;; ;;
2[2-3]) [8])
# Fedora 22+23 ok # Redhat/CentOS 8 ok
installer="dnf"; installer="dnf";
;; ;;
24) 2?)
# Fedora 24 still beta # Fedora 20+23 ok
installer="dnf";
;;
3?)
# Fedora 30+ ok
installer="dnf"; installer="dnf";
echo -e "$r_l This installer is still in the testing stage!";
;; ;;
*) *)
echo "This version is not supported!" >"$install_log" 2>/dev/null; echo "This version is not supported!" >"$install_log" 2>/dev/null;
@ -67,6 +70,24 @@ do
svn) svn)
inst="subversion"; inst="subversion";
;; ;;
xz)
inst="xz-utils";
;;
makeinfo)
inst="texinfo";
;;
python3-config)
inst="python3-devel";
;;
libtool|libtoolize)
inst="libtool";
;;
cmp)
inst="diffutils";
;;
g++)
inst="gcc-c++";
;;
# the following guys have no official packages # the following guys have no official packages
sshpass) sshpass)
continue; continue;
@ -101,6 +122,9 @@ do
pthread.h) pthread.h)
inst="glibc-headers"; inst="glibc-headers";
;; ;;
ncurses)
inst="ncurses-devel";
;;
esac; esac;
echo -e "$w_l select $g_l$e$y_l\tfrom: $inst"; echo -e "$w_l select $g_l$e$y_l\tfrom: $inst";
packages="$packages $inst"; packages="$packages $inst";

24
support/os/suse.install

@ -49,6 +49,24 @@ do
xz) xz)
inst="xz-utils"; inst="xz-utils";
;; ;;
makeinfo)
inst="texinfo";
;;
python3-config)
inst="python3-devel";
;;
libtoolize)
inst="libtool";
;;
libtool)
inst="libtool-bin";
;;
cmp)
inst="diffutils";
;;
g++)
inst="gcc-c++";
;;
esac; esac;
echo -e "$w_l select $g_l$e$y_l\tfrom: $inst"; echo -e "$w_l select $g_l$e$y_l\tfrom: $inst";
packages="$packages $inst"; packages="$packages $inst";
@ -72,6 +90,9 @@ do
pthread.h) pthread.h)
inst="glibc-devel"; inst="glibc-devel";
;; ;;
ncurses)
inst="ncurses-devel";
;;
esac; esac;
echo -e "$w_l select $g_l$e$y_l\tfrom: $inst"; echo -e "$w_l select $g_l$e$y_l\tfrom: $inst";
packages="$packages $inst"; packages="$packages $inst";
@ -86,6 +107,9 @@ do
libccidtwin.so) libccidtwin.so)
inst="pcsc-ccid"; inst="pcsc-ccid";
;; ;;
libstdc++.so.6)
inst="libstdc++6";
;;
esac; esac;
echo -e "$w_l select $g_l$e$y_l\tfrom: $inst"; echo -e "$w_l select $g_l$e$y_l\tfrom: $inst";
packages="$packages $inst"; packages="$packages $inst";

Loading…
Cancel
Save