diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/1-setup-path-win.bat | 11 | ||||
-rw-r--r-- | util/2-setup-environment-win.bat | 31 | ||||
-rw-r--r-- | util/ergodox_ez.html | 1 | ||||
-rw-r--r-- | util/install_dependencies.sh (renamed from util/avr_setup.sh) | 26 | ||||
-rwxr-xr-x | util/new_project.sh | 28 | ||||
-rw-r--r-- | util/travis_compiled_push.sh | 27 |
6 files changed, 94 insertions, 30 deletions
diff --git a/util/1-setup-path-win.bat b/util/1-setup-path-win.bat index 92e91be3e2..699aee2152 100644 --- a/util/1-setup-path-win.bat +++ b/util/1-setup-path-win.bat @@ -2,12 +2,12 @@ @ECHO OFF SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe -CD UTIL +DEL script1.log > NUL 2>&1 DEL add-paths.log > NUL 2>&1 DEL add-paths-detail.log > NUL 2>&1 DEL UPDATE > NUL 2>&1 -ELEVATE -wait %cd%\add-paths.bat > NUL 2>&1 +ELEVATE -wait add-paths.bat >> script1.log 2>&1 IF ERRORLEVEL 1 ( ECHO You denied admin access. Rerun the script, and be sure to press the yes button this time. @@ -44,9 +44,14 @@ EXIT /b :: ----------------------------------------------------------------------------- :KillExplorer +ECHO. +ECHO. ECHO Your desktop will be restarted. +ECHO. ECHO All file explorer windows except for the one you launched this script from WILL BE CLOSED. +ECHO. ECHO Press enter when ready, or close this window if you would rather do a full restart of your computer at a later time. +ECHO. PAUSE ping -n 5 127.0.0.1 > NUL 2>&1 ECHO Killing process Explorer.exe. . . @@ -57,5 +62,5 @@ ECHO Your desktop is now loading. . . ECHO. ping -n 5 127.0.0.1 > NUL 2>&1 START explorer.exe -START explorer.exe %CD%\.. +START explorer.exe %CD% EXIT /b
\ No newline at end of file diff --git a/util/2-setup-environment-win.bat b/util/2-setup-environment-win.bat index 905338087a..3e54cc776c 100644 --- a/util/2-setup-environment-win.bat +++ b/util/2-setup-environment-win.bat @@ -1,46 +1,55 @@ @SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION @ECHO OFF +CD %~dp0 + SET STARTINGDIR=%CD% +echo %STARTINGDIR% :: Check for admin privilages SETX /M test test > nul 2>&1 IF NOT ["%ERRORLEVEL%"]==["0"] ( - ECHO FAILED. Rerun with administrator privileges. - GOTO ExitBatch + ELEVATE -wait 2-setup-environment-win.bat & goto :EOF ) +DEL %STARTINGDIR%\environment-setup.log + :: Make sure path to MinGW exists - if so, CD to it SET MINGWPATH="C:\MinGW\bin" -IF NOT EXIST !MINGWPATH! (ECHO Path not found: %MINGWPATH% && GOTO ExitBatch) +IF NOT EXIST !MINGWPATH! (ECHO Path not found: %MINGWPATH%. Did you install MinGW to the default location? && GOTO ExitBatch) CD /D %MINGWPATH% - +ECHO. ECHO ------------------------------------------ ECHO Installing wget and unzip ECHO ------------------------------------------ -mingw-get install msys-wget-bin msys-unzip-bin +ECHO. +mingw-get install msys-wget-bin msys-unzip-bin MKDIR temp CD temp +ECHO. ECHO ------------------------------------------ ECHO Installing dfu-programmer. ECHO ------------------------------------------ -wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip -unzip dfu-programmer-win-0.7.2.zip -COPY dfu-programmer.exe .. +ECHO. +wget 'http://downloads.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip' >> %STARTINGDIR%\environment-setup.log +unzip -o dfu-programmer-win-0.7.2.zip >> %STARTINGDIR%\environment-setup.log +COPY dfu-programmer.exe .. >> %STARTINGDIR%\environment-setup.log ECHO ------------------------------------------ ECHO Downloading driver ECHO ------------------------------------------ -wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip -unzip libusb-win32-bin-1.2.6.0.zip -COPY libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll +wget http://downloads.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip >> %STARTINGDIR%\environment-setup.log +unzip -o libusb-win32-bin-1.2.6.0.zip >> %STARTINGDIR%\environment-setup.log +COPY libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll >> %STARTINGDIR%\environment-setup.log +ECHO. ECHO ------------------------------------------ ECHO Installing driver. Accept prompt. ECHO ------------------------------------------ +ECHO. IF EXIST "%WinDir%\System32\PnPUtil.exe" (%WinDir%\System32\PnPUtil.exe -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf && GOTO PNPUTILFOUND) IF EXIST "%WinDir%\Sysnative\PnPUtil.exe" (%WinDir%\Sysnative\PnPUtil.exe -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf && GOTO PNPUTILFOUND) diff --git a/util/ergodox_ez.html b/util/ergodox_ez.html new file mode 100644 index 0000000000..8e92866070 --- /dev/null +++ b/util/ergodox_ez.html @@ -0,0 +1 @@ +<html><head><meta http-equiv="refresh" content="0; url=http://qmk.fm/keyboards/ergodox/" /></head></html>
\ No newline at end of file diff --git a/util/avr_setup.sh b/util/install_dependencies.sh index 916d0378b4..24564a2ac5 100644 --- a/util/avr_setup.sh +++ b/util/install_dependencies.sh @@ -16,7 +16,11 @@ if [[ -n "$(type -P pacman )" ]]; then avr-gcc \ avr-binutils \ avr-libc \ - dfu-util + dfu-util \ + arm-none-eabi-gcc \ + arm-none-eabi-binutils \ + arm-none-eabi-newlib \ + git elif [[ -n "$(type -P apt-get)" ]]; then # Debian and derivatives @@ -39,7 +43,11 @@ elif [[ -n "$(type -P apt-get)" ]]; then binutils-avr \ avr-libc \ dfu-programmer \ - dfu-util + dfu-util \ + gcc-arm-none-eabi \ + binutils-arm-none-eabi \ + libnewlib-arm-none-eabi \ + git elif [[ -n "$(type -P yum)" ]]; then # Fedora, CentOS or RHEL and derivatives @@ -57,7 +65,14 @@ elif [[ -n "$(type -P yum)" ]]; then avr-gcc \ avr-libc \ dfu-programmer \ - dfu-util + dfu-util \ + gcc-arm-none-eabi \ + binutils-arm-none-eabi \ + libnewlib-arm-none-eabi \ + git + # The listed eabi pacackes do unfortunately not exist for CentOS, + # But at least in Fedora they do, so try to install them anyway + # TODO: Build them from sources, if the installation fails elif [[ -n "$(type -P zypper)" ]]; then # openSUSE @@ -69,6 +84,9 @@ elif [[ -n "$(type -P zypper)" ]]; then kernel-devel \ patch \ wget \ - dfu-programmer + dfu-programmer \ + git + # TODO: The avr and eabi tools are not available as default packages, so we need + # another way to install them fi diff --git a/util/new_project.sh b/util/new_project.sh index b85bbc31cf..b3535f449e 100755 --- a/util/new_project.sh +++ b/util/new_project.sh @@ -7,21 +7,25 @@ if [ -z "$1" ]; then exit 1 fi +cd "$(dirname "$0")/.." + KEYBOARD=$1 KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}') -mkdir keyboard/$1 -mkdir keyboard/$1/keymaps -mkdir keyboard/$1/keymaps/default -sed -e "s;%KEYBOARD%;$KEYBOARD;g" -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" quantum/template/template.h > keyboard/$KEYBOARD/$KEYBOARD.h -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboard/$KEYBOARD/$KEYBOARD.c -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboard/$KEYBOARD/config.h -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/README.md > keyboard/$KEYBOARD/README.md -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboard/$KEYBOARD/Makefile -sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/keymap.c > keyboard/$KEYBOARD/keymaps/default/keymap.c +mkdir keyboards/$1 +mkdir keyboards/$1/keymaps +mkdir keyboards/$1/keymaps/default +sed -e "s;%KEYBOARD%;$KEYBOARD;g" -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" quantum/template/template.h > keyboards/$KEYBOARD/$KEYBOARD.h +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboards/$KEYBOARD/$KEYBOARD.c +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboards/$KEYBOARD/config.h +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/readme.md > keyboards/$KEYBOARD/readme.md +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboards/$KEYBOARD/Makefile +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/config.h > keyboards/$KEYBOARD/keymaps/default/config.h +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/keymap.c > keyboards/$KEYBOARD/keymaps/default/keymap.c +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/Makefile > keyboards/$KEYBOARD/keymaps/default/Makefile +sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/readme.md > keyboards/$KEYBOARD/keymaps/default/readme.md echo "######################################################" -echo "# keyboard/$KEYBOARD project created. To start" -echo "# working on things, use the following command:" -echo "# cd keyboard/$KEYBOARD" +echo "# /keyboards/$KEYBOARD project created. To start" +echo "# working on things, cd into keyboards/$KEYBOARD" echo "######################################################" diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh new file mode 100644 index 0000000000..c2a994ef02 --- /dev/null +++ b/util/travis_compiled_push.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -o errexit -o nounset + +rev=$(git rev-parse --short HEAD) + +git config --global user.name "Travis CI" +git config --global user.email "jack.humb+travis.ci@gmail.com" + +make all-keymaps keyboard=ergodox/ez AUTOGEN=true + +find . -name ".build" | xargs rm -rf +cd .. +git clone https://$GH_TOKEN@github.com/jackhumbert/qmk.fm.git +cd qmk.fm +git submodule update --init --recursive +rm -rf keyboard +rm -rf keyboards +cp -r ../qmk_firmware/keyboards . +mkdir keyboards/ergodox_ez/ +cp ../qmk_firmware/util/ergodox_ez.html keyboards/ergodox_ez/index.html +cp ../qmk_firmware/readme.md qmk_readme.md +./generate.sh + +git add -A +git commit -m "generated from qmk_firmware/$TRAVIS_BRANCH@${rev}" +git push
\ No newline at end of file |