aboutsummaryrefslogtreecommitdiff
path: root/util/install
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-11-27 01:37:54 +1100
committerGitHub <noreply@github.com>2020-11-26 14:37:54 +0000
commitc21d5a09735e84412ee5b3efb4c3f5d3fc734393 (patch)
treec2b8405f45fb6f00b063561056fca4c5aad28bf8 /util/install
parent3afe0ea9b9f67ae33f54c1393b15d988764241a2 (diff)
downloadqmk_firmware-c21d5a09735e84412ee5b3efb4c3f5d3fc734393.tar.gz
qmk_firmware-c21d5a09735e84412ee5b3efb4c3f5d3fc734393.zip
Refactor qmk_install.sh (#10681)
Diffstat (limited to 'util/install')
-rwxr-xr-xutil/install/arch.sh16
-rwxr-xr-xutil/install/debian.sh22
-rwxr-xr-xutil/install/fedora.sh15
-rwxr-xr-xutil/install/freebsd.sh18
-rwxr-xr-xutil/install/gentoo.sh33
-rwxr-xr-xutil/install/linux_shared.sh13
-rwxr-xr-xutil/install/macos.sh26
-rwxr-xr-xutil/install/msys2.sh36
-rwxr-xr-xutil/install/opensuse.sh31
-rwxr-xr-xutil/install/sabayon.sh15
-rwxr-xr-xutil/install/slackware.sh25
-rwxr-xr-xutil/install/solus.sh19
-rwxr-xr-xutil/install/void.sh15
13 files changed, 284 insertions, 0 deletions
diff --git a/util/install/arch.sh b/util/install/arch.sh
new file mode 100755
index 000000000..7442e2f13
--- /dev/null
+++ b/util/install/arch.sh
@@ -0,0 +1,16 @@
1#!/bin/bash
2
3_qmk_install() {
4 echo "Installing dependencies"
5
6 sudo pacman --needed --noconfirm -S \
7 base-devel clang diffutils gcc git unzip wget zip \
8 python-pip \
9 avr-binutils \
10 arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \
11 avrdude dfu-programmer dfu-util
12 sudo pacman --needed --noconfirm -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz
13 sudo pacman --needed --noconfirm -S avr-libc # Must be installed after the above, or it will bring in the latest avr-gcc instead
14
15 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
16}
diff --git a/util/install/debian.sh b/util/install/debian.sh
new file mode 100755
index 000000000..e7180c651
--- /dev/null
+++ b/util/install/debian.sh
@@ -0,0 +1,22 @@
1#!/bin/bash
2
3DEBIAN_FRONTEND=noninteractive
4DEBCONF_NONINTERACTIVE_SEEN=true
5export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
6
7_qmk_install_prepare() {
8 sudo apt-get update
9}
10
11_qmk_install() {
12 echo "Installing dependencies"
13
14 sudo apt-get -yq install \
15 build-essential clang-format diffutils gcc git unzip wget zip \
16 python3-pip \
17 binutils-avr gcc-avr avr-libc \
18 binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi \
19 avrdude dfu-programmer dfu-util teensy-loader-cli
20
21 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
22}
diff --git a/util/install/fedora.sh b/util/install/fedora.sh
new file mode 100755
index 000000000..250cda662
--- /dev/null
+++ b/util/install/fedora.sh
@@ -0,0 +1,15 @@
1#!/bin/bash
2
3_qmk_install() {
4 echo "Installing dependencies"
5
6 # TODO: Check whether devel/headers packages are really needed
7 sudo dnf -y install \
8 clang diffutils git gcc glibc-headers kernel-devel kernel-headers make unzip wget zip \
9 python3 \
10 avr-binutils avr-gcc avr-libc \
11 arm-none-eabi-binutils-cs arm-none-eabi-gcc-cs arm-none-eabi-newlib \
12 avrdude dfu-programmer dfu-util
13
14 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
15}
diff --git a/util/install/freebsd.sh b/util/install/freebsd.sh
new file mode 100755
index 000000000..353c52d64
--- /dev/null
+++ b/util/install/freebsd.sh
@@ -0,0 +1,18 @@
1#!/bin/bash
2
3_qmk_install_prepare() {
4 sudo pkg update
5}
6
7_qmk_install() {
8 echo "Installing dependencies"
9
10 sudo pkg install -y \
11 git wget gmake gcc zip unzip diffutils \
12 python3 \
13 avr-binutils avr-gcc avr-libc \
14 arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \
15 avrdude dfu-programmer dfu-util
16
17 sudo python3 -m pip install -r $QMK_FIRMWARE_DIR/requirements.txt
18}
diff --git a/util/install/gentoo.sh b/util/install/gentoo.sh
new file mode 100755
index 000000000..d4284e9a9
--- /dev/null
+++ b/util/install/gentoo.sh
@@ -0,0 +1,33 @@
1#!/bin/bash
2
3_qmk_install_prepare() {
4 echo "This script will make a USE change in order to ensure that that QMK works on your system."
5 echo "All changes will be sent to the file /etc/portage/package.use/qmkfirmware -- please review it, and read Portage's output carefully before installing any packages on your system."
6 echo "You will also need to ensure that your kernel is compiled with support for the microcontroller that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki."
7
8 read -p "Proceed? [y/N] " res
9 case $res in
10 [Yy]*)
11 return 0;;
12 *)
13 return 1;;
14 esac
15}
16
17_qmk_install() {
18 echo "Installing dependencies"
19
20 sudo touch /etc/portage/package.use/qmkfirmware
21 # tee is used here since sudo doesn't apply to >>
22 echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
23 sudo emerge -auN sys-devel/gcc
24 sudo emerge -au --noreplace \
25 app-arch/unzip app-arch/zip net-misc/wget sys-devel/clang sys-devel/crossdev \
26 \>=dev-lang/python-3.6 \
27 dev-embedded/avrdude dev-embedded/dfu-programmer app-mobilephone/dfu-util
28
29 sudo crossdev -s4 --stable --g \<9 --portage --verbose --target avr
30 sudo crossdev -s4 --stable --g \<9 --portage --verbose --target arm-none-eabi
31
32 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
33}
diff --git a/util/install/linux_shared.sh b/util/install/linux_shared.sh
new file mode 100755
index 000000000..cb81e8611
--- /dev/null
+++ b/util/install/linux_shared.sh
@@ -0,0 +1,13 @@
1#!/bin/bash
2
3# For those distros that do not package bootloadHID
4_qmk_install_bootloadhid() {
5 if ! command -v bootloadHID > /dev/null; then
6 wget https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz -O - | tar -xz -C /tmp
7 pushd /tmp/bootloadHID.2012-12-08/commandline/ > /dev/null
8 if make; then
9 sudo cp bootloadHID /usr/local/bin
10 fi
11 popd > /dev/null
12 fi
13}
diff --git a/util/install/macos.sh b/util/install/macos.sh
new file mode 100755
index 000000000..93fda9121
--- /dev/null
+++ b/util/install/macos.sh
@@ -0,0 +1,26 @@
1#!/bin/bash
2
3_qmk_install_prepare() {
4 echo "Checking Homebrew installation"
5
6 if ! brew --version >/dev/null 2>&1; then
7 echo "Error! Homebrew is broken or not installed."
8 echo "Please run \`brew doctor\` or follow the installation instructions at https://brew.sh/, then re-run this script."
9 return 1
10 fi
11
12 brew update && brew upgrade
13}
14
15_qmk_install() {
16 echo "Installing dependencies"
17
18 # All macOS dependencies are managed in the Homebrew package:
19 # https://github.com/qmk/homebrew-qmk
20 brew install qmk/qmk/qmk
21
22 brew link --force avr-gcc@8
23 brew link --force arm-gcc-bin@8
24
25 python3 -m pip install -r $QMK_FIRMWARE_DIR/requirements.txt
26}
diff --git a/util/install/msys2.sh b/util/install/msys2.sh
new file mode 100755
index 000000000..c8598a60f
--- /dev/null
+++ b/util/install/msys2.sh
@@ -0,0 +1,36 @@
1#!/bin/bash
2
3_qmk_install_prepare() {
4 pacman -Syu
5}
6
7_qmk_install() {
8 echo "Installing dependencies"
9
10 pacman --needed --noconfirm --disable-download-timeout -S pactoys-git
11 pacboy sync --needed --noconfirm --disable-download-timeout \
12 base-devel: toolchain:x clang:x git: unzip: \
13 python3-pip:x \
14 avr-binutils:x avr-gcc:x avr-libc:x \
15 arm-none-eabi-binutils:x arm-none-eabi-gcc:x arm-none-eabi-newlib:x \
16 avrdude:x bootloadhid:x dfu-programmer:x dfu-util:x teensy-loader-cli:x
17
18 _qmk_install_drivers
19
20 python3 -m pip install -r "$QMK_FIRMWARE_DIR/requirements.txt"
21}
22
23_qmk_install_drivers() {
24 echo "Installing drivers"
25
26 tmpdir=$(mktemp -d)
27 cp "$QMK_FIRMWARE_UTIL_DIR/drivers.txt" $tmpdir
28 pushd $tmpdir > /dev/null
29
30 wget "https://github.com/qmk/qmk_driver_installer/releases/download/v1.01/qmk_driver_installer.exe"
31
32 cmd.exe //c "qmk_driver_installer.exe --all --force drivers.txt"
33
34 popd > /dev/null
35 rm -r $tmpdir
36}
diff --git a/util/install/opensuse.sh b/util/install/opensuse.sh
new file mode 100755
index 000000000..47b44ae36
--- /dev/null
+++ b/util/install/opensuse.sh
@@ -0,0 +1,31 @@
1#!/bin/bash
2
3_qmk_install_prepare() {
4 case $(grep ID /etc/os-release) in
5 *15.1*)
6 REPO_RELEASE=Leap_15.1;;
7 *15.2*)
8 REPO_RELEASE=Leap_15.2;;
9 *)
10 #REPO_RELEASE=Tumbleweed;;
11 echo "ERROR: Tumbleweed is currently not supported."
12 exit 1
13 esac
14
15 sudo zypper addrepo https://download.opensuse.org/repositories/devel:gcc/openSUSE_$REPO_RELEASE/devel:gcc.repo
16 sudo zypper addrepo https://download.opensuse.org/repositories/hardware/openSUSE_$REPO_RELEASE/hardware.repo
17 sudo zypper --gpg-auto-import-keys refresh
18}
19
20_qmk_install() {
21 echo "Installing dependencies"
22
23 sudo zypper install -y \
24 make clang gcc unzip wget zip \
25 python3-pip \
26 cross-avr-binutils cross-avr-gcc8 avr-libc \
27 cross-arm-binutils cross-arm-none-gcc8 cross-arm-none-newlib-devel \
28 avrdude dfu-programmer dfu-util
29
30 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
31}
diff --git a/util/install/sabayon.sh b/util/install/sabayon.sh
new file mode 100755
index 000000000..fd4f4d8df
--- /dev/null
+++ b/util/install/sabayon.sh
@@ -0,0 +1,15 @@
1#!/bin/bash
2
3_qmk_install() {
4 echo "Installing dependencies"
5
6 sudo equo install \
7 app-arch/unzip app-arch/zip net-misc/wget dev-vcs/git sys-devel/clang sys-devel/gcc sys-devel/crossdev \
8 dev-python/pip \
9 dev-embedded/avrdude dev-embedded/dfu-programmer app-mobilephone/dfu-util
10
11 sudo crossdev -s4 --stable --g \<9 --portage --verbose --target avr
12 sudo crossdev -s4 --stable --g \<9 --portage --verbose --target arm-none-eabi
13
14 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
15}
diff --git a/util/install/slackware.sh b/util/install/slackware.sh
new file mode 100755
index 000000000..d73303159
--- /dev/null
+++ b/util/install/slackware.sh
@@ -0,0 +1,25 @@
1#!/bin/bash
2
3_qmk_install_prepare() {
4 echo "Before you continue, please ensure that your user is added to sudoers and that sboinstall is configured."
5 read -p "Proceed? [y/N] " res
6
7 case $res in
8 [Yy]*)
9 ;;
10 *)
11 return 1;;
12 esac
13}
14
15_qmk_install() {
16 echo "Installing dependencies"
17
18 sudo sboinstall \
19 avr-binutils avr-gcc avr-libc \
20 arm-binutils arm-gcc newlib \
21 python3 \
22 avrdude dfu-programmer dfu-util teensy_loader_cli
23
24 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
25}
diff --git a/util/install/solus.sh b/util/install/solus.sh
new file mode 100755
index 000000000..5633f7039
--- /dev/null
+++ b/util/install/solus.sh
@@ -0,0 +1,19 @@
1#!/bin/bash
2
3_qmk_install_prepare() {
4 sudo eopkg -y update-repo
5 sudo eopkg -y upgrade
6}
7
8_qmk_install() {
9 echo "Installing dependencies"
10
11 sudo eopkg -y install \
12 -c system.devel git wget zip unzip \
13 python3 \
14 avr-binutils avr-gcc avr-libc \
15 arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \
16 avrdude dfu-programmer dfu-util
17
18 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
19}
diff --git a/util/install/void.sh b/util/install/void.sh
new file mode 100755
index 000000000..9ec7019e5
--- /dev/null
+++ b/util/install/void.sh
@@ -0,0 +1,15 @@
1#!/bin/bash
2
3_qmk_install() {
4 echo "Installing dependencies"
5
6 sudo xbps-install \
7 gcc git make wget unzip zip \
8 python3-pip \
9 avr-binutils avr-gcc avr-libc \
10 cross-arm-none-eabi-binutils cross-arm-none-eabi-gcc cross-arm-none-eabi-newlib \
11 avrdude dfu-programmer dfu-util teensy_loader_cli \
12 libusb-compat-devel
13
14 python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt
15}