diff options
| author | Drashna Jaelre <drashna@live.com> | 2019-11-21 23:09:02 -0800 |
|---|---|---|
| committer | fauxpark <fauxpark@gmail.com> | 2019-11-22 18:09:02 +1100 |
| commit | 66d473437110508af747b6ca09517bfad6c50d0b (patch) | |
| tree | 0f5b5184b483f56e1b6eaaf5a91ed03d554780e9 /util/msys2_install.sh | |
| parent | 6cf574396adfb08f7fe7fe6f7ce68387fd474018 (diff) | |
| download | qmk_firmware-66d473437110508af747b6ca09517bfad6c50d0b.tar.gz qmk_firmware-66d473437110508af747b6ca09517bfad6c50d0b.zip | |
Improve and streamline MSYS2 installation (#7232)
* Make MSYS force install
* Cleanup msys script
* Update to gcc 8.3 for arm and avr
And cleanup install scripts for both
* Fix path and scripts
* Fix links
* No confirmation for msys
* Tweak arm function since file structure changed
* Fix spacing and wording
Co-Authored-By: fauxpark <fauxpark@gmail.com>
* Only use MSYS2's make binary
Co-Authored-By: fauxpark <fauxpark@gmail.com>
* Some wordsmithing
Co-Authored-By: Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com>
* Add "disable download timeout" for download issues in MSYS
Co-Authored-By: Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com>
* Clean up URL for arm gcc download
Co-Authored-By: Joel Challis <git@zvecr.com>
* add pip
Co-Authored-By: fauxpark <fauxpark@gmail.com>
Diffstat (limited to 'util/msys2_install.sh')
| -rwxr-xr-x | util/msys2_install.sh | 66 |
1 files changed, 23 insertions, 43 deletions
diff --git a/util/msys2_install.sh b/util/msys2_install.sh index 58397c7a3..d1e24ca6d 100755 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh | |||
| @@ -8,25 +8,27 @@ installflip=false | |||
| 8 | util_dir=$(dirname "$0") | 8 | util_dir=$(dirname "$0") |
| 9 | 9 | ||
| 10 | echo "Installing dependencies needed for the installation (quazip)" | 10 | echo "Installing dependencies needed for the installation (quazip)" |
| 11 | pacman --needed -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang msys/git msys/p7zip msys/python3 msys/unzip | 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 |
| 12 | 12 | ||
| 13 | source "$dir/win_shared_install.sh" | 13 | source "$dir/win_shared_install.sh" |
| 14 | 14 | ||
| 15 | function install_avr { | 15 | function install_avr { |
| 16 | rm -f -r "$avrtools" | 16 | rm -f -r "$avrtools" |
| 17 | wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip" | 17 | wget "https://blog.zakkemble.net/download/avr-gcc-8.3.0-x86-mingw.zip" |
| 18 | echo "Extracting AVR toolchain..." | 18 | echo "Extracting AVR toolchain..." |
| 19 | unzip -q avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip | 19 | unzip -q -d . avr-gcc-8.3.0-x86-mingw.zip |
| 20 | mv avr8-gnu-toolchain-win32_x86/ avr8-gnu-toolchain | 20 | mv avr-gcc-8.3.0-x86-mingw avr8-gnu-toolchain |
| 21 | rm __MACOSX -R | 21 | rm avr8-gnu-toolchain/bin/make.exe |
| 22 | rm avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip | 22 | rm avr-gcc-8.3.0-x86-mingw.zip |
| 23 | pacman --needed -S mingw-w64-x86_64-avrdude | 23 | pacman --needed --disable-download-timeout -S mingw-w64-x86_64-avrdude |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | function install_arm { | 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" | 27 | rm -f -r "$armtools" |
| 28 | unzip -d gcc-arm-none-eabi gcc-arm-none-eabi.zip | 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 | rm gcc-arm-none-eabi.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 | ||
| 30 | } | 32 | } |
| 31 | 33 | ||
| 32 | function extract_flip { | 34 | function extract_flip { |
| @@ -43,17 +45,10 @@ if [ -f "FlipInstaller.exe" ]; then | |||
| 43 | fi | 45 | fi |
| 44 | 46 | ||
| 45 | if [ ! -d "$avrtools" ]; then | 47 | if [ ! -d "$avrtools" ]; then |
| 46 | while true; do | 48 | echo |
| 47 | echo | 49 | echo "The AVR toolchain is not installed." |
| 48 | echo "The AVR toolchain is not installed." | 50 | echo "This is needed for building AVR based keyboards." |
| 49 | echo "This is needed for building AVR based keboards." | 51 | install_avr |
| 50 | read -p "Do you want to install it? (Y/N) " res | ||
| 51 | case $res in | ||
| 52 | [Yy]* ) install_avr; break;; | ||
| 53 | [Nn]* ) break;; | ||
| 54 | * ) echo "Invalid answer";; | ||
| 55 | esac | ||
| 56 | done | ||
| 57 | else | 52 | else |
| 58 | while true; do | 53 | while true; do |
| 59 | echo | 54 | echo |
| @@ -68,17 +63,10 @@ else | |||
| 68 | fi | 63 | fi |
| 69 | 64 | ||
| 70 | if [ ! -d "$armtools" ]; then | 65 | if [ ! -d "$armtools" ]; then |
| 71 | while true; do | 66 | echo |
| 72 | echo | 67 | echo "The ARM toolchain is not installed." |
| 73 | echo "The ARM toolchain is not installed." | 68 | echo "This is needed for building ARM based keyboards." |
| 74 | echo "This is needed for building ARM based keyboards." | 69 | install_arm |
| 75 | read -p "Do you want to install it? (Y/N) " res | ||
| 76 | case $res in | ||
| 77 | [Yy]* ) install_arm; break;; | ||
| 78 | [Nn]* ) break;; | ||
| 79 | * ) echo "Invalid answer";; | ||
| 80 | esac | ||
| 81 | done | ||
| 82 | else | 70 | else |
| 83 | while true; do | 71 | while true; do |
| 84 | echo | 72 | echo |
| @@ -103,18 +91,10 @@ then | |||
| 103 | echo "The line source ~/qmk_utils/activate_msys2.sh is already added to your /.bashrc" | 91 | echo "The line source ~/qmk_utils/activate_msys2.sh is already added to your /.bashrc" |
| 104 | echo "Not adding it twice!" | 92 | echo "Not adding it twice!" |
| 105 | else | 93 | else |
| 106 | while true; do | ||
| 107 | echo | 94 | echo |
| 108 | echo "Do you want to add 'source ~/qmk_utils/activate_msys2.sh' to the end of your" | 95 | echo "Adding '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" | 96 | echo ".bashrc file. Without this make won't find the needed utils." |
| 110 | echo "want to do it automatically, then you have to do it manually later." | 97 | echo "source ~/qmk_utils/activate_msys2.sh" >> ~/.bashrc; |
| 111 | read -p "(Y/N)? " res | ||
| 112 | case $res in | ||
| 113 | [Yy]* ) echo "source ~/qmk_utils/activate_msys2.sh" >> ~/.bashrc; break;; | ||
| 114 | [Nn]* ) break;; | ||
| 115 | * ) echo "Invalid answer";; | ||
| 116 | esac | ||
| 117 | done | ||
| 118 | fi | 98 | fi |
| 119 | 99 | ||
| 120 | echo | 100 | echo |
