msys2_install.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
  3. download_dir=~/qmk_utils
  4. avrtools=avr8-gnu-toolchain
  5. echo "Installing dependencies needed for the installation (quazip)"
  6. pacman --needed -S msys/unzip msys/p7zip
  7. source "$dir/win_shared_install.sh"
  8. function install_avr {
  9. rm -f -r "$avrtools"
  10. wget "http://www.atmel.com/images/avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe"
  11. 7z x avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe
  12. rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe
  13. }
  14. pushd "$download_dir"
  15. if [ ! -d "$avrtools" ]; then
  16. while true; do
  17. echo
  18. echo "The AVR toolchain is not installed."
  19. echo "This is needed for building AVR based keboards."
  20. read -p "Do you want to install it? (Y/N) " res
  21. case $res in
  22. [Yy]* ) install_avr; break;;
  23. [Nn]* ) break;;
  24. * ) echo "Invalid answer";;
  25. esac
  26. done
  27. else
  28. while true; do
  29. echo
  30. echo "The AVR toolchain is already installed"
  31. read -p "Do you want to reinstall? (Y/N) " res
  32. case $res in
  33. [Yy]* ) install_avr; break;;
  34. [Nn]* ) break;;
  35. * ) echo "Invalid answer";;
  36. esac
  37. done
  38. fi
  39. popd
  40. echo
  41. echo "******************************************************************************"
  42. echo "Installation completed!"
  43. echo "You need to open a new batch command prompt for all the utils to work properly"
  44. echo "******************************************************************************"