3 dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
4 download_dir=~/qmk_utils
5 avrtools=avr8-gnu-toolchain
6 armtools=gcc-arm-none-eabi
8 util_dir=$(dirname "$0")
10 echo "Installing dependencies needed for the installation (quazip)"
11 pacman --needed -S base-devel mingw-w64-x86_64-toolchain msys/clang msys/git msys/p7zip msys/python3 msys/unzip
13 source "$dir/win_shared_install.sh"
15 function install_avr {
17 wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip"
18 echo "Extracting AVR toolchain..."
19 unzip -q avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip
20 mv avr8-gnu-toolchain-win32_x86/ avr8-gnu-toolchain
22 rm avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip
23 pacman --needed -S mingw-w64-x86_64-avrdude
26 function install_arm {
27 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"
28 unzip -d gcc-arm-none-eabi gcc-arm-none-eabi.zip
29 rm gcc-arm-none-eabi.zip
32 function extract_flip {
34 7z -oflip x FlipInstaller.exe
39 if [ -f "FlipInstaller.exe" ]; then
41 echo "Extracting flip"
45 if [ ! -d "$avrtools" ]; then
48 echo "The AVR toolchain is not installed."
49 echo "This is needed for building AVR based keboards."
50 read -p "Do you want to install it? (Y/N) " res
52 [Yy]* ) install_avr; break;;
54 * ) echo "Invalid answer";;
60 echo "The AVR toolchain is already installed"
61 read -p "Do you want to reinstall? (Y/N) " res
63 [Yy]* ) install_avr; break;;
65 * ) echo "Invalid answer";;
70 if [ ! -d "$armtools" ]; then
73 echo "The ARM toolchain is not installed."
74 echo "This is needed for building ARM based keyboards."
75 read -p "Do you want to install it? (Y/N) " res
77 [Yy]* ) install_arm; break;;
79 * ) echo "Invalid answer";;
85 echo "The ARM toolchain is already installed"
86 read -p "Do you want to reinstall? (Y/N) " res
88 [Yy]* ) install_arm; break;;
90 * ) echo "Invalid answer";;
96 pip3 install -r ${util_dir}/../requirements.txt
98 cp -f "$dir/activate_msys2.sh" "$download_dir/"
100 if grep "^source ~/qmk_utils/activate_msys2.sh$" ~/.bashrc
103 echo "The line source ~/qmk_utils/activate_msys2.sh is already added to your /.bashrc"
104 echo "Not adding it twice!"
108 echo "Do you want to add 'source ~/qmk_utils/activate_msys2.sh' to the end of your"
109 echo ".bashrc file? Without this make won't find the needed utils, so if you don't"
110 echo "want to do it automatically, then you have to do it manually later."
111 read -p "(Y/N)? " res
113 [Yy]* ) echo "source ~/qmk_utils/activate_msys2.sh" >> ~/.bashrc; break;;
115 * ) echo "Invalid answer";;
121 echo "******************************************************************************"
122 echo "Installation completed!"
123 echo "Please close this Window and restart MSYS2 MinGW"
124 echo "******************************************************************************"