diff options
| -rw-r--r-- | util/msys2_install.sh | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/util/msys2_install.sh b/util/msys2_install.sh index 1b99806b5..0bb75f94c 100644 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh | |||
| @@ -3,12 +3,11 @@ | |||
| 3 | dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) | 3 | dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) |
| 4 | download_dir=~/qmk_utils | 4 | download_dir=~/qmk_utils |
| 5 | avrtools=avr8-gnu-toolchain | 5 | avrtools=avr8-gnu-toolchain |
| 6 | armtools=gcc-arm-none-eabi | ||
| 6 | 7 | ||
| 7 | echo "Installing dependencies needed for the installation (quazip)" | 8 | echo "Installing dependencies needed for the installation (quazip)" |
| 8 | pacman --needed -S msys/unzip msys/p7zip | 9 | pacman --needed -S msys/unzip msys/p7zip |
| 9 | 10 | ||
| 10 | |||
| 11 | |||
| 12 | source "$dir/win_shared_install.sh" | 11 | source "$dir/win_shared_install.sh" |
| 13 | 12 | ||
| 14 | function install_avr { | 13 | function install_avr { |
| @@ -18,8 +17,13 @@ function install_avr { | |||
| 18 | rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe | 17 | rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe |
| 19 | } | 18 | } |
| 20 | 19 | ||
| 21 | pushd "$download_dir" | 20 | function install_arm { |
| 21 | wget -O gcc-arm-none-eabi.zip "https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-win32.zip?product=GNU%20ARM%20Embedded%20Toolchain,ZIP,,Windows,6-2017-q2-update" | ||
| 22 | unzip -d gcc-arm-none-eabi gcc-arm-none-eabi.zip | ||
| 23 | rm gcc-arm-none-eabi.zip | ||
| 24 | } | ||
| 22 | 25 | ||
| 26 | pushd "$download_dir" | ||
| 23 | 27 | ||
| 24 | if [ ! -d "$avrtools" ]; then | 28 | if [ ! -d "$avrtools" ]; then |
| 25 | while true; do | 29 | while true; do |
| @@ -45,6 +49,31 @@ else | |||
| 45 | esac | 49 | esac |
| 46 | done | 50 | done |
| 47 | fi | 51 | fi |
| 52 | |||
| 53 | if [ ! -d "$armtools" ]; then | ||
| 54 | while true; do | ||
| 55 | echo | ||
| 56 | echo "The ARM toolchain is not installed." | ||
| 57 | echo "This is needed for building ARM based keboards." | ||
| 58 | read -p "Do you want to install it? (Y/N) " res | ||
| 59 | case $res in | ||
| 60 | [Yy]* ) install_arm; break;; | ||
| 61 | [Nn]* ) break;; | ||
| 62 | * ) echo "Invalid answer";; | ||
| 63 | esac | ||
| 64 | done | ||
| 65 | else | ||
| 66 | while true; do | ||
| 67 | echo | ||
| 68 | echo "The ARM toolchain is already installed" | ||
| 69 | read -p "Do you want to reinstall? (Y/N) " res | ||
| 70 | case $res in | ||
| 71 | [Yy]* ) install_arm; break;; | ||
| 72 | [Nn]* ) break;; | ||
| 73 | * ) echo "Invalid answer";; | ||
| 74 | esac | ||
| 75 | done | ||
| 76 | fi | ||
| 48 | popd | 77 | popd |
| 49 | 78 | ||
| 50 | echo | 79 | echo |
