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 --noconfirm --disable-download-timeout -Sy base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang msys/git msys/p7zip mingw-w64-x86_64-python3-pip msys/unzip
13 source "$dir/win_shared_install.sh"
15 function install_avr {
17 wget "https://blog.zakkemble.net/download/avr-gcc-8.3.0-x86-mingw.zip"
18 echo "Extracting AVR toolchain..."
19 unzip -q -d . avr-gcc-8.3.0-x86-mingw.zip
20 mv avr-gcc-8.3.0-x86-mingw avr8-gnu-toolchain
21 rm avr8-gnu-toolchain/bin/make.exe
22 rm avr-gcc-8.3.0-x86-mingw.zip
23 pacman --needed --disable-download-timeout -S mingw-w64-x86_64-avrdude
26 function install_arm {
28 wget -O gcc-arm-none-eabi-8-2019-q3-update-win32.zip "https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-win32.zip"
29 echo "Extracting ARM toolchain..."
30 unzip -q -d gcc-arm-none-eabi gcc-arm-none-eabi-8-2019-q3-update-win32.zip
31 rm gcc-arm-none-eabi-8-2019-q3-update-win32.zip
34 function extract_flip {
36 7z -oflip x FlipInstaller.exe
41 if [ -f "FlipInstaller.exe" ]; then
43 echo "Extracting flip"
47 if [ ! -d "$avrtools" ]; then
49 echo "The AVR toolchain is not installed."
50 echo "This is needed for building AVR based keyboards."
55 echo "The AVR toolchain is already installed"
56 read -p "Do you want to reinstall? (Y/N) " res
58 [Yy]* ) install_avr; break;;
60 * ) echo "Invalid answer";;
65 if [ ! -d "$armtools" ]; then
67 echo "The ARM toolchain is not installed."
68 echo "This is needed for building ARM based keyboards."
73 echo "The ARM toolchain is already installed"
74 read -p "Do you want to reinstall? (Y/N) " res
76 [Yy]* ) install_arm; break;;
78 * ) echo "Invalid answer";;
84 pip3 install -r ${util_dir}/../requirements.txt
86 cp -f "$dir/activate_msys2.sh" "$download_dir/"
88 if grep "^source ~/qmk_utils/activate_msys2.sh$" ~/.bashrc
91 echo "The line source ~/qmk_utils/activate_msys2.sh is already added to your /.bashrc"
92 echo "Not adding it twice!"
95 echo "Adding 'source ~/qmk_utils/activate_msys2.sh' to the end of your"
96 echo ".bashrc file. Without this make won't find the needed utils."
97 echo "source ~/qmk_utils/activate_msys2.sh" >> ~/.bashrc;
101 echo "******************************************************************************"
102 echo "Installation completed!"
103 echo "Please close this Window and restart MSYS2 MinGW"
104 echo "******************************************************************************"