diff options
| author | Ryan <fauxpark@gmail.com> | 2020-08-25 19:04:42 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-25 19:04:42 +1000 |
| commit | c9c63806a7a068cbc4d12d5739fdd0b05742241d (patch) | |
| tree | 66affb54cd142093125f90ece3068647b4a24139 /util | |
| parent | 5460489b5177245371d23b84b94673951866d003 (diff) | |
| download | qmk_firmware-c9c63806a7a068cbc4d12d5739fdd0b05742241d.tar.gz qmk_firmware-c9c63806a7a068cbc4d12d5739fdd0b05742241d.zip | |
MSYS2: install packages for AVR toolchain (#10078)
Diffstat (limited to 'util')
| -rwxr-xr-x | util/activate_msys2.sh | 1 | ||||
| -rwxr-xr-x | util/msys2_install.sh | 33 |
2 files changed, 5 insertions, 29 deletions
diff --git a/util/activate_msys2.sh b/util/activate_msys2.sh index b003c1a78..3fc149dbb 100755 --- a/util/activate_msys2.sh +++ b/util/activate_msys2.sh | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | function export_variables { | 3 | function export_variables { |
| 4 | local util_dir=~/qmk_utils | 4 | local util_dir=~/qmk_utils |
| 5 | export PATH=$PATH:$util_dir | 5 | export PATH=$PATH:$util_dir |
| 6 | export PATH=$PATH:$util_dir/avr8-gnu-toolchain/bin | ||
| 7 | export PATH=$PATH:$util_dir/gcc-arm-none-eabi/bin | 6 | export PATH=$PATH:$util_dir/gcc-arm-none-eabi/bin |
| 8 | } | 7 | } |
| 9 | 8 | ||
diff --git a/util/msys2_install.sh b/util/msys2_install.sh index 1351aa5d7..b92199647 100755 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh | |||
| @@ -2,25 +2,18 @@ | |||
| 2 | 2 | ||
| 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 | ||
| 6 | armtools=gcc-arm-none-eabi | 5 | armtools=gcc-arm-none-eabi |
| 7 | util_dir=$(dirname "$0") | 6 | util_dir=$(dirname "$0") |
| 8 | 7 | ||
| 9 | echo "Installing dependencies needed for the installation (quazip)" | 8 | echo "Installing dependencies needed for the installation" |
| 10 | pacman --needed --noconfirm --disable-download-timeout -Sy base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang git mingw-w64-x86_64-python3-pip unzip | 9 | pacman --needed --noconfirm --disable-download-timeout -Sy base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang git mingw-w64-x86_64-python3-pip unzip |
| 11 | 10 | ||
| 12 | source "$dir/win_shared_install.sh" | 11 | source "$dir/win_shared_install.sh" |
| 13 | 12 | ||
| 14 | function install_avr { | 13 | function install_avr { |
| 15 | rm -f -r "$avrtools" | 14 | pacman --needed --noconfirm --disable-download-timeout -S \ |
| 16 | wget "https://blog.zakkemble.net/download/avr-gcc-8.3.0-x86-mingw.zip" | 15 | mingw-w64-x86_64-avr-binutils mingw-w64-x86_64-avr-gcc mingw-w64-x86_64-avr-libc \ |
| 17 | echo "Extracting AVR toolchain..." | 16 | mingw-w64-x86_64-avrdude mingw-w64-x86_64-bootloadhid mingw-w64-x86_64-dfu-programmer mingw-w64-x86_64-teensy-loader-cli |
| 18 | unzip -q -d . avr-gcc-8.3.0-x86-mingw.zip | ||
| 19 | mv avr-gcc-8.3.0-x86-mingw avr8-gnu-toolchain | ||
| 20 | rm avr8-gnu-toolchain/bin/make.exe | ||
| 21 | rm avr-gcc-8.3.0-x86-mingw.zip | ||
| 22 | |||
| 23 | pacman --needed --noconfirm --disable-download-timeout -S mingw-w64-x86_64-avrdude mingw-w64-x86_64-bootloadhid mingw-w64-x86_64-dfu-programmer mingw-w64-x86_64-teensy-loader-cli | ||
| 24 | } | 17 | } |
| 25 | 18 | ||
| 26 | function install_arm { | 19 | function install_arm { |
| @@ -35,23 +28,7 @@ function install_arm { | |||
| 35 | 28 | ||
| 36 | pushd "$download_dir" | 29 | pushd "$download_dir" |
| 37 | 30 | ||
| 38 | if [ ! -d "$avrtools" ]; then | 31 | install_avr |
| 39 | echo | ||
| 40 | echo "The AVR toolchain is not installed." | ||
| 41 | echo "This is needed for building AVR based keyboards." | ||
| 42 | install_avr | ||
| 43 | else | ||
| 44 | while true; do | ||
| 45 | echo | ||
| 46 | echo "The AVR toolchain is already installed" | ||
| 47 | read -p "Do you want to reinstall? (Y/N) " res | ||
| 48 | case $res in | ||
| 49 | [Yy]* ) install_avr; break;; | ||
| 50 | [Nn]* ) break;; | ||
| 51 | * ) echo "Invalid answer";; | ||
| 52 | esac | ||
| 53 | done | ||
| 54 | fi | ||
| 55 | 32 | ||
| 56 | if [ ! -d "$armtools" ]; then | 33 | if [ ! -d "$armtools" ]; then |
| 57 | echo | 34 | echo |
