From 9c8f8bd3bcfebf93ded0269ca1ba9e99720bc4b4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 9 Aug 2018 21:14:29 -0700 Subject: Fix minor typo in qmk_install.sh for MSYS/MINGW64 detection --- util/qmk_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/qmk_install.sh') diff --git a/util/qmk_install.sh b/util/qmk_install.sh index 5a1a38fce..67be6f477 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -10,7 +10,7 @@ case $(uname) in Linux) exec "${util_dir}/linux_install.sh" ;; - MSYS_NT*|MINGW_64*) + MSYS_NT*|MINGW64_NT*) exec "${util_dir}/msys2_install.sh" ;; esac -- cgit v1.2.3-70-g09d2 From 99cb107b717d75acae4278d62dfd2f400e0de600 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 11 Aug 2018 12:47:25 -0700 Subject: Add 32 bit MINGW support .... --- util/qmk_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/qmk_install.sh') diff --git a/util/qmk_install.sh b/util/qmk_install.sh index 67be6f477..dcfa894b9 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -10,7 +10,7 @@ case $(uname) in Linux) exec "${util_dir}/linux_install.sh" ;; - MSYS_NT*|MINGW64_NT*) + MSYS_NT*|MINGW64_NT*|MINGW32_NT*) exec "${util_dir}/msys2_install.sh" ;; esac -- cgit v1.2.3-70-g09d2 From bcdd7735c8fca998d7d609ebb4be22ee29b6e340 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 11 Aug 2018 12:52:09 -0700 Subject: Add error message if config not detected --- util/qmk_install.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util/qmk_install.sh') diff --git a/util/qmk_install.sh b/util/qmk_install.sh index dcfa894b9..fede835db 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -13,4 +13,6 @@ case $(uname) in MSYS_NT*|MINGW64_NT*|MINGW32_NT*) exec "${util_dir}/msys2_install.sh" ;; + *) + echo "Environment not support. Pleas see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools" esac -- cgit v1.2.3-70-g09d2 From bd4ba8d1808b11deaf3298cec9a1573fbd5e9cdf Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 11 Aug 2018 12:59:26 -0700 Subject: Add WSL support to script --- util/qmk_install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'util/qmk_install.sh') diff --git a/util/qmk_install.sh b/util/qmk_install.sh index fede835db..fefbc6f86 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -3,11 +3,14 @@ util_dir=$(dirname "$0") -case $(uname) in - Darwin) +case $(uname -a) in + *Darwin*) exec "${util_dir}/macos_install.sh" ;; - Linux) + *Linux*Microsoft*) + exec "${util_dir}/wsl_install.sh" + ;; + *Linux*) exec "${util_dir}/linux_install.sh" ;; MSYS_NT*|MINGW64_NT*|MINGW32_NT*) -- cgit v1.2.3-70-g09d2 From c909c4ea50ee6cef77e54f746c11f2c896181e48 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 11 Aug 2018 13:01:01 -0700 Subject: Fix Typos in echo --- util/qmk_install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/qmk_install.sh') diff --git a/util/qmk_install.sh b/util/qmk_install.sh index fefbc6f86..6f35e4c71 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -17,5 +17,6 @@ case $(uname -a) in exec "${util_dir}/msys2_install.sh" ;; *) - echo "Environment not support. Pleas see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools" + echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." + ;; esac -- cgit v1.2.3-70-g09d2 From ca56c2145f25ab04daa6bb96f31b948be9e57ef2 Mon Sep 17 00:00:00 2001 From: skullY Date: Tue, 9 Oct 2018 09:40:10 -0700 Subject: Fold install_dependencies.sh into linux_install.sh and freebsd_install.sh --- util/freebsd_install.sh | 18 +++++++ util/install_dependencies.sh | 118 ------------------------------------------- util/linux_install.sh | 116 ++++++++++++++++++++++++++++++++---------- util/qmk_install.sh | 13 +++-- 4 files changed, 114 insertions(+), 151 deletions(-) create mode 100644 util/freebsd_install.sh delete mode 100755 util/install_dependencies.sh (limited to 'util/qmk_install.sh') diff --git a/util/freebsd_install.sh b/util/freebsd_install.sh new file mode 100644 index 000000000..25ea80a7f --- /dev/null +++ b/util/freebsd_install.sh @@ -0,0 +1,18 @@ +#!/bin/sh +pkg update +pkg install -y \ + git \ + wget \ + gmake \ + gcc \ + zip \ + unzip \ + avr-binutils \ + avr-gcc \ + avr-libc \ + dfu-programmer \ + dfu-util \ + arm-none-eabi-gcc \ + arm-none-eabi-binutils \ + arm-none-eabi-newlib \ + diffutils diff --git a/util/install_dependencies.sh b/util/install_dependencies.sh deleted file mode 100755 index 227c86f87..000000000 --- a/util/install_dependencies.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash -# This script will attempt to setup the Linux dependencies for compiling QMK/TMK - -# This could probably go much lower, but since we are including an Arch vagrant, -# making it the first match makes sense - -if [[ -n "$(type -P pacman )" ]]; then - # Arch linux and derivatives like Apricity - # Future improvements: - # Allow user to speed up package installs using powerpill/wget tweaks - # Always run the pacman mirror update script if possible when vagrant comes up - # This will ensure that users never get stalled on a horribly slow mirror - pacman -Syyu --needed --noconfirm - pacman -S --needed --noconfirm \ - base-devel \ - avr-gcc \ - avr-binutils \ - avr-libc \ - dfu-util \ - arm-none-eabi-gcc \ - arm-none-eabi-binutils \ - arm-none-eabi-newlib \ - git \ - diffutils - -elif [[ -n "$(type -P apt-get)" ]]; then - # Debian and derivatives - # This block performs completely non-interactive updates {{ - export DEBIAN_FRONTEND=noninteractive - export DEBCONF_NONINTERACTIVE_SEEN=true - echo "grub-pc hold" | dpkg --set-selections - apt-get -y update - apt-get -y --allow-unauthenticated upgrade \ - -o Dpkg::Options::="--force-confdef" \ - -o Dpkg::Options::="--force-confold" - # }} - apt-get install -y \ - build-essential \ - gcc \ - unzip \ - wget \ - zip \ - gcc-avr \ - binutils-avr \ - avr-libc \ - dfu-programmer \ - dfu-util \ - gcc-arm-none-eabi \ - binutils-arm-none-eabi \ - libnewlib-arm-none-eabi \ - git \ - diffutils - -elif [[ -n "$(type -P yum)" ]]; then - # Fedora, CentOS or RHEL and derivatives - yum -y makecache && yum -y update - yum -y install \ - gcc \ - glibc-headers \ - kernel-devel \ - kernel-headers \ - make \ - perl \ - git \ - wget \ - avr-binutils \ - avr-gcc \ - avr-libc \ - dfu-programmer \ - dfu-util \ - arm-none-eabi-gcc-cs \ - arm-none-eabi-newlib \ - git \ - diffutils - # 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 - zypper --non-interactive refresh && zypper --non-interactive update - zypper --non-interactive install \ - git \ - make \ - gcc \ - kernel-devel \ - patch \ - wget \ - dfu-programmer \ - git \ - diffutils - # TODO: The avr and eabi tools are not available as default packages, so we need - # another way to install them - -elif [[ -n "$(type -P pkg)" ]]; then - # FreeBSD - pkg update - pkg install -y \ - git \ - wget \ - gmake \ - gcc \ - zip \ - unzip \ - avr-binutils \ - avr-gcc \ - avr-libc \ - dfu-programmer \ - dfu-util \ - arm-none-eabi-gcc \ - arm-none-eabi-binutils \ - arm-none-eabi-newlib \ - diffutils -elif [[ -n "$(type -P emerge)" ]]; then - echo 'Please check that your gcc is built with the multilib use flag enabled.' - emerge -vq sys-devel/crossdev - USE="-openmp -hardened -sanitize -vtv" crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr -fi diff --git a/util/linux_install.sh b/util/linux_install.sh index 0e4e26fd9..a6a053276 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -1,40 +1,100 @@ #!/bin/sh -if grep ID /etc/os-release | grep -qE "rhel|fedora"; then - # RPM based OS - sudo dnf install gcc unzip wget zip dfu-util dfu-programmer avr-gcc \ - avr-libc binutils-avr32-linux-gnu arm-none-eabi-gcc-cs \ - arm-none-eabi-binutils-cs arm-none-eabi-newlib + +# Note: This file uses tabs to indent. Please don't mix tabs and spaces. + +GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmk_firmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki." + +if grep ID /etc/os-release | grep -qE "fedora"; then + sudo dnf install \ + arm-none-eabi-binutils-cs \ + arm-none-eabi-gcc-cs \ + arm-none-eabi-newlib + avr-binutils \ + avr-gcc \ + avr-libc \ + binutils-avr32-linux-gnu \ + dfu-util \ + dfu-programmer \ + diffutils \ + git \ + gcc \ + glibc-headers \ + kernel-devel \ + kernel-headers \ + make \ + perl \ + unzip \ + wget \ + zip + elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then + DEBIAN_FRONTEND=noninteractive + DEBCONF_NONINTERACTIVE_SEEN=true + export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN sudo apt-get update - sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc \ - dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi \ - libnewlib-arm-none-eabi + sudo apt-get install \ + build-essential \ + avr-libc \ + binutils-arm-none-eabi \ + binutils-avr \ + dfu-programmer \ + dfu-util \ + diffutils \ + gcc \ + gcc-arm-none-eabi \ + gcc-avr \ + git \ + libnewlib-arm-none-eabi \ + unzip \ + wget \ + zip + elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then - # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug. - sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz - sudo pacman -S gcc unzip wget zip avr-binutils avr-libc \ - dfu-util arm-none-eabi-gcc arm-none-eabi-binutils \ - arm-none-eabi-newlib + # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug. + sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz + sudo pacman -S \ + arm-none-eabi-binutils \ + arm-none-eabi-gcc \ + arm-none-eabi-newlib \ + avr-binutils \ + avr-libc \ + avr-gcc \ + base-devel \ + dfu-util \ + diff-utils \ + gcc \ + git \ + unzip \ + wget \ + zip git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer cd /tmp/dfu-programmer makepkg -sic rm -rf /tmp/dfu-programmer/ + elif grep ID /etc/os-release | grep -q gentoo; then - echo "This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmk_firmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki." - echo -n "Proceed (y/N)? " - old_stty_cfg=$(stty -g) - stty raw -echo - answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) - stty $old_stty_cfg - if echo "$answer" | grep -iq "^y" ;then - sudo touch /etc/portage/package.use/qmkfirmware - echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null - sudo emerge -auN sys-devel/gcc app-arch/unzip app-arch/zip net-misc/wget app-mobilephone/dfu-util sys-devel/crossdev dev-embedded/avrdude - sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr - echo Done! - else - echo "Quitting..." -fi + echo GENTOO_WARNING | fmt + echo -n "Proceed (y/N)? " + old_stty_cfg=$(stty -g) + stty raw -echo + answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) + stty $old_stty_cfg + if echo "$answer" | grep -iq "^y" ;then + sudo touch /etc/portage/package.use/qmkfirmware + echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null + sudo emerge -auN \ + app-arch/unzip \ + app-arch/zip \ + app-mobilephone/dfu-util \ + net-misc/wget \ + sys-devel/gcc \ + sys-devel/crossdev dev-embedded/avrdude + sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr + echo Done! + else + echo "Quitting..." + fi + else echo "Sorry, we don't recognize your OS. Help us by contributing support!" echo diff --git a/util/qmk_install.sh b/util/qmk_install.sh index 6f35e4c71..76ecf5fc0 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -7,16 +7,19 @@ case $(uname -a) in *Darwin*) exec "${util_dir}/macos_install.sh" ;; - *Linux*Microsoft*) + *Linux*Microsoft*) exec "${util_dir}/wsl_install.sh" - ;; + ;; + *FreeBSD*) + exec "${util_dir}/freebsd_install.sh" + ;; *Linux*) exec "${util_dir}/linux_install.sh" ;; MSYS_NT*|MINGW64_NT*|MINGW32_NT*) exec "${util_dir}/msys2_install.sh" ;; - *) - echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." - ;; + *) + echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." + ;; esac -- cgit v1.2.3-70-g09d2