3 # Note: This file uses tabs to indent. Please don't mix tabs and spaces.
5 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."
7 if grep ID /etc/os-release | grep -qE "fedora"; then
9 arm-none-eabi-binutils-cs \
10 arm-none-eabi-gcc-cs \
11 arm-none-eabi-newlib \
15 binutils-avr32-linux-gnu \
30 elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
31 DEBIAN_FRONTEND=noninteractive
32 DEBCONF_NONINTERACTIVE_SEEN=true
33 export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
35 sudo apt-get install \
38 binutils-arm-none-eabi \
47 libnewlib-arm-none-eabi \
52 elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
53 # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug.
54 sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz
56 arm-none-eabi-binutils \
58 arm-none-eabi-newlib \
70 git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
71 cd /tmp/dfu-programmer
73 rm -rf /tmp/dfu-programmer/
75 elif grep ID /etc/os-release | grep -q gentoo; then
76 echo GENTOO_WARNING | fmt
77 echo -n "Proceed (y/N)? "
78 old_stty_cfg=$(stty -g)
80 answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
82 if echo "$answer" | grep -iq "^y" ;then
83 sudo touch /etc/portage/package.use/qmkfirmware
84 echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null
88 app-mobilephone/dfu-util \
89 dev-embedded/avrdude \
93 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
99 elif grep ID /etc/os-release | grep -q sabayon; then
103 app-mobilephone/dfu-util \
104 dev-embedded/avrdude \
108 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
111 elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
112 CROSS_AVR_GCC=cross-avr-gcc8
113 if grep ID /etc/os-release | grep -q "15.0"; then
114 CROSS_AVR_GCC=cross-avr-gcc7
116 sudo zypper install \
120 cross-arm-none-newlib-devel \
121 cross-arm-binutils cross-arm-none-newlib-devel \
130 echo "Sorry, we don't recognize your OS. Help us by contributing support!"
132 echo "https://docs.qmk.fm/#/contributing"