aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/activate_msys2.sh2
-rwxr-xr-xutil/chibios-upgrader.sh6
-rwxr-xr-xutil/msys2_install.sh72
-rwxr-xr-xutil/travis_compiled_push.sh2
4 files changed, 13 insertions, 69 deletions
diff --git a/util/activate_msys2.sh b/util/activate_msys2.sh
index b003c1a78..b37bee859 100755
--- a/util/activate_msys2.sh
+++ b/util/activate_msys2.sh
@@ -3,8 +3,6 @@
3function export_variables { 3function 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
8} 6}
9 7
10export_variables 8export_variables
diff --git a/util/chibios-upgrader.sh b/util/chibios-upgrader.sh
index 2174da3cf..ebc12abe7 100755
--- a/util/chibios-upgrader.sh
+++ b/util/chibios-upgrader.sh
@@ -38,7 +38,11 @@ find_chibi_files() {
38 local search_path="$1" 38 local search_path="$1"
39 shift 39 shift
40 local conditions=( "$@" ) 40 local conditions=( "$@" )
41 find -L "$search_path" -not -path '*/lib/chibios*' -and -not -path '*/lib/ugfx*' -and -not -path '*/util/*' -and \( "${conditions[@]}" \) | sort 41 for file in $(find -L "$search_path" -not -path '*/lib/chibios*' -and -not -path '*/lib/ugfx*' -and -not -path '*/util/*' -and \( "${conditions[@]}" \) | sort) ; do
42 if [ -z "$(grep 'include_next' "$file")" ] ; then
43 echo $file
44 fi
45 done
42} 46}
43 47
44revert_chibi_files() { 48revert_chibi_files() {
diff --git a/util/msys2_install.sh b/util/msys2_install.sh
index 1351aa5d7..c223e52fa 100755
--- a/util/msys2_install.sh
+++ b/util/msys2_install.sh
@@ -2,76 +2,18 @@
2 2
3dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) 3dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
4download_dir=~/qmk_utils 4download_dir=~/qmk_utils
5avrtools=avr8-gnu-toolchain
6armtools=gcc-arm-none-eabi
7util_dir=$(dirname "$0") 5util_dir=$(dirname "$0")
8 6
9echo "Installing dependencies needed for the installation (quazip)" 7echo "Installing dependencies needed for the installation"
10pacman --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 8pacman --needed --noconfirm --disable-download-timeout -Sy \
9 base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang git unzip \
10 mingw-w64-x86_64-python-pip \
11 mingw-w64-x86_64-avr-binutils mingw-w64-x86_64-avr-gcc mingw-w64-x86_64-avr-libc \
12 mingw-w64-x86_64-arm-none-eabi-binutils mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-arm-none-eabi-newlib \
13 mingw-w64-x86_64-avrdude mingw-w64-x86_64-bootloadhid mingw-w64-x86_64-dfu-programmer mingw-w64-x86_64-dfu-util mingw-w64-x86_64-teensy-loader-cli
11 14
12source "$dir/win_shared_install.sh" 15source "$dir/win_shared_install.sh"
13 16
14function install_avr {
15 rm -f -r "$avrtools"
16 wget "https://blog.zakkemble.net/download/avr-gcc-8.3.0-x86-mingw.zip"
17 echo "Extracting AVR toolchain..."
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}
25
26function install_arm {
27 rm -f -r "$armtools"
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
32
33 pacman --needed --noconfirm --disable-download-timeout -S mingw-w64-x86_64-dfu-util
34}
35
36pushd "$download_dir"
37
38if [ ! -d "$avrtools" ]; then
39 echo
40 echo "The AVR toolchain is not installed."
41 echo "This is needed for building AVR based keyboards."
42 install_avr
43else
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
54fi
55
56if [ ! -d "$armtools" ]; then
57 echo
58 echo "The ARM toolchain is not installed."
59 echo "This is needed for building ARM based keyboards."
60 install_arm
61else
62 while true; do
63 echo
64 echo "The ARM toolchain is already installed"
65 read -p "Do you want to reinstall? (Y/N) " res
66 case $res in
67 [Yy]* ) install_arm; break;;
68 [Nn]* ) break;;
69 * ) echo "Invalid answer";;
70 esac
71 done
72fi
73popd
74
75pip3 install -r "${util_dir}/../requirements.txt" 17pip3 install -r "${util_dir}/../requirements.txt"
76 18
77cp -f "$dir/activate_msys2.sh" "$download_dir/" 19cp -f "$dir/activate_msys2.sh" "$download_dir/"
diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh
index 68f6d5c11..195a87208 100755
--- a/util/travis_compiled_push.sh
+++ b/util/travis_compiled_push.sh
@@ -13,7 +13,7 @@ if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; the
13# fix formatting 13# fix formatting
14git checkout master 14git checkout master
15git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 dos2unix 15git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 dos2unix
16git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} '*.c' '*.h' '*.cpp' | grep -z -e '^drivers' -e '^quantum' -e '^tests' -e '^tmk_core' | grep -zv -e 'quantum/template' -e 'tmk_core/protocol/usb_hid' | xargs -0 clang-format-7 -i 16git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} '*.c' '*.h' '*.cpp' | grep -z -e '^drivers' -e '^quantum' -e '^tests' -e '^tmk_core' | grep -zv -e 'quantum/template' -e 'tmk_core/protocol/usb_hid' -e 'platforms/chibios' | xargs -0 clang-format-7 -i
17git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add 17git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add
18git commit -m "format code according to conventions [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master 18git commit -m "format code according to conventions [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master
19 19