-
-
Notifications
You must be signed in to change notification settings - Fork 39.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor qmk_install.sh #10681
Merged
Merged
Refactor qmk_install.sh #10681
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
921db94
Refactor qmk_install.sh
fauxpark fab8bee
Fix some dumb typos
fauxpark e39a610
Update docs to not prompt
fauxpark 14f0d0a
Update docs for Void Linux
fauxpark 136673f
Update OpenSUSE script
fauxpark f118688
Tweak Arch script
fauxpark 5d95abb
Move bootloadHID installation after distro-specific installation
fauxpark e2d6802
Tweak Solus script
fauxpark 91478aa
Tweak Sabayon script
fauxpark 7a49b2a
Update Python version for Gentoo script
fauxpark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo pacman --needed --noconfirm -S \ | ||
base-devel clang diffutils gcc git unzip wget zip \ | ||
python-pip \ | ||
avr-binutils \ | ||
arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \ | ||
avrdude dfu-programmer dfu-util | ||
sudo pacman --needed --noconfirm -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz | ||
sudo pacman --needed --noconfirm -S avr-libc # Must be installed after the above, or it will bring in the latest avr-gcc instead | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
DEBIAN_FRONTEND=noninteractive | ||
DEBCONF_NONINTERACTIVE_SEEN=true | ||
export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN | ||
|
||
_qmk_install_prepare() { | ||
sudo apt-get update | ||
} | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo apt-get -yq install \ | ||
build-essential clang-format diffutils gcc git unzip wget zip \ | ||
python3-pip \ | ||
binutils-avr gcc-avr avr-libc \ | ||
binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi \ | ||
avrdude dfu-programmer dfu-util teensy-loader-cli | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
# TODO: Check whether devel/headers packages are really needed | ||
sudo dnf -y install \ | ||
clang diffutils git gcc glibc-headers kernel-devel kernel-headers make unzip wget zip \ | ||
python3 \ | ||
avr-binutils avr-gcc avr-libc \ | ||
arm-none-eabi-binutils-cs arm-none-eabi-gcc-cs arm-none-eabi-newlib \ | ||
avrdude dfu-programmer dfu-util | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install_prepare() { | ||
sudo pkg update | ||
} | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo pkg install -y \ | ||
git wget gmake gcc zip unzip diffutils \ | ||
python3 \ | ||
avr-binutils avr-gcc avr-libc \ | ||
arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \ | ||
avrdude dfu-programmer dfu-util | ||
|
||
sudo python3 -m pip install -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install_prepare() { | ||
echo "This script will make a USE change in order to ensure that that QMK works on your system." | ||
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." | ||
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." | ||
|
||
read -p "Proceed? [y/N] " res | ||
case $res in | ||
[Yy]*) | ||
return 0;; | ||
*) | ||
return 1;; | ||
esac | ||
} | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo touch /etc/portage/package.use/qmkfirmware | ||
# tee is used here since sudo doesn't apply to >> | ||
echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null | ||
sudo emerge -auN sys-devel/gcc | ||
sudo emerge -au --noreplace \ | ||
app-arch/unzip app-arch/zip net-misc/wget sys-devel/clang sys-devel/crossdev \ | ||
\>=dev-lang/python-3.6 \ | ||
dev-embedded/avrdude dev-embedded/dfu-programmer app-mobilephone/dfu-util | ||
|
||
sudo crossdev -s4 --stable --g \<9 --portage --verbose --target avr | ||
sudo crossdev -s4 --stable --g \<9 --portage --verbose --target arm-none-eabi | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# For those distros that do not package bootloadHID | ||
_qmk_install_bootloadhid() { | ||
if ! command -v bootloadHID > /dev/null; then | ||
wget https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz -O - | tar -xz -C /tmp | ||
pushd /tmp/bootloadHID.2012-12-08/commandline/ > /dev/null | ||
if make; then | ||
sudo cp bootloadHID /usr/local/bin | ||
fi | ||
popd > /dev/null | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install_prepare() { | ||
echo "Checking Homebrew installation" | ||
|
||
if ! brew --version >/dev/null 2>&1; then | ||
echo "Error! Homebrew is broken or not installed." | ||
echo "Please run \`brew doctor\` or follow the installation instructions at https://brew.sh/, then re-run this script." | ||
return 1 | ||
fi | ||
|
||
brew update && brew upgrade | ||
} | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
# All macOS dependencies are managed in the Homebrew package: | ||
# https://github.com/qmk/homebrew-qmk | ||
brew install qmk/qmk/qmk | ||
|
||
brew link --force avr-gcc@8 | ||
brew link --force arm-gcc-bin@8 | ||
|
||
python3 -m pip install -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install_prepare() { | ||
pacman -Syu | ||
} | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
pacman --needed --noconfirm --disable-download-timeout -S pactoys-git | ||
pacboy sync --needed --noconfirm --disable-download-timeout \ | ||
base-devel: toolchain:x clang:x git: unzip: \ | ||
python3-pip:x \ | ||
avr-binutils:x avr-gcc:x avr-libc:x \ | ||
arm-none-eabi-binutils:x arm-none-eabi-gcc:x arm-none-eabi-newlib:x \ | ||
avrdude:x bootloadhid:x dfu-programmer:x dfu-util:x teensy-loader-cli:x | ||
|
||
_qmk_install_drivers | ||
|
||
python3 -m pip install -r "$QMK_FIRMWARE_DIR/requirements.txt" | ||
} | ||
|
||
_qmk_install_drivers() { | ||
echo "Installing drivers" | ||
|
||
tmpdir=$(mktemp -d) | ||
cp "$QMK_FIRMWARE_UTIL_DIR/drivers.txt" $tmpdir | ||
pushd $tmpdir > /dev/null | ||
|
||
wget "https://github.com/qmk/qmk_driver_installer/releases/download/v1.01/qmk_driver_installer.exe" | ||
|
||
cmd.exe //c "qmk_driver_installer.exe --all --force drivers.txt" | ||
|
||
popd > /dev/null | ||
rm -r $tmpdir | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install_prepare() { | ||
case $(grep ID /etc/os-release) in | ||
*15.1*) | ||
REPO_RELEASE=Leap_15.1;; | ||
*15.2*) | ||
REPO_RELEASE=Leap_15.2;; | ||
*) | ||
#REPO_RELEASE=Tumbleweed;; | ||
echo "ERROR: Tumbleweed is currently not supported." | ||
exit 1 | ||
esac | ||
|
||
sudo zypper addrepo https://download.opensuse.org/repositories/devel:gcc/openSUSE_$REPO_RELEASE/devel:gcc.repo | ||
sudo zypper addrepo https://download.opensuse.org/repositories/hardware/openSUSE_$REPO_RELEASE/hardware.repo | ||
sudo zypper --gpg-auto-import-keys refresh | ||
} | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo zypper install -y \ | ||
make clang gcc unzip wget zip \ | ||
python3-pip \ | ||
cross-avr-binutils cross-avr-gcc8 avr-libc \ | ||
cross-arm-binutils cross-arm-none-gcc8 cross-arm-none-newlib-devel \ | ||
avrdude dfu-programmer dfu-util | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo equo install \ | ||
app-arch/unzip app-arch/zip net-misc/wget dev-vcs/git sys-devel/clang sys-devel/gcc sys-devel/crossdev \ | ||
dev-python/pip \ | ||
dev-embedded/avrdude dev-embedded/dfu-programmer app-mobilephone/dfu-util | ||
|
||
sudo crossdev -s4 --stable --g \<9 --portage --verbose --target avr | ||
sudo crossdev -s4 --stable --g \<9 --portage --verbose --target arm-none-eabi | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install_prepare() { | ||
echo "Before you continue, please ensure that your user is added to sudoers and that sboinstall is configured." | ||
read -p "Proceed? [y/N] " res | ||
|
||
case $res in | ||
[Yy]*) | ||
;; | ||
*) | ||
return 1;; | ||
esac | ||
} | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo sboinstall \ | ||
avr-binutils avr-gcc avr-libc \ | ||
arm-binutils arm-gcc newlib \ | ||
python3 \ | ||
avrdude dfu-programmer dfu-util teensy_loader_cli | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install_prepare() { | ||
sudo eopkg -y update-repo | ||
sudo eopkg -y upgrade | ||
} | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo eopkg -y install \ | ||
-c system.devel git wget zip unzip \ | ||
python3 \ | ||
avr-binutils avr-gcc avr-libc \ | ||
arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \ | ||
avrdude dfu-programmer dfu-util | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
_qmk_install() { | ||
echo "Installing dependencies" | ||
|
||
sudo xbps-install \ | ||
gcc git make wget unzip zip \ | ||
python3-pip \ | ||
avr-binutils avr-gcc avr-libc \ | ||
cross-arm-none-eabi-binutils cross-arm-none-eabi-gcc cross-arm-none-eabi-newlib \ | ||
avrdude dfu-programmer dfu-util teensy_loader_cli \ | ||
libusb-compat-devel | ||
|
||
python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no Tumbleweed directory for
devel:gcc
, andcross-arm-none-gcc8
throws a bunch of linker errors on Leap... so OpenSUSE support is broken at this time. If any OpenSUSE user is able to provide a fix (or better yet, fix the packages and repos), it would be much appreciated!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth grabbing the official ARM toolchain in this circumstance, then?
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd kinda like to avoid another ~/qmk_utils folder if at all possible, considering you have to modify the .bashrc to add it to PATH (and some users may not be running bash), and then a new terminal must be opened before
qmk doctor
displays the correct results. Preferably the already existing package should be fixed.