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/qmkfirmware -- 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 SLACKWARE_WARNING="You will need the following packages from slackbuilds.org:\n\tarm-binutils\n\tarm-gcc\n\tavr-binutils\n\tavr-gcc\n\tavr-libc\n\tavrdude\n\tdfu-programmer\n\tdfu-util\n\tnewlib\nThese packages will be installed with sudo and sboinstall, so ensure that your user is added to sudoers and that sboinstall is configured."
9 SOLUS_INFO="Your tools are now installed. To start using them, open new terminal or source these scripts:\n\t/usr/share/defaults/etc/profile.d/50-arm-toolchain-path.sh\n\t/usr/share/defaults/etc/profile.d/50-avr-toolchain-path.sh"
11 util_dir=$(dirname "$0")
13 if grep ID /etc/os-release | grep -qE "fedora"; then
15 arm-none-eabi-binutils-cs \
16 arm-none-eabi-gcc-cs \
17 arm-none-eabi-newlib \
21 binutils-avr32-linux-gnu \
37 elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
38 DEBIAN_FRONTEND=noninteractive
39 DEBCONF_NONINTERACTIVE_SEEN=true
40 export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
42 sudo apt-get -yq install \
45 binutils-arm-none-eabi \
54 libnewlib-arm-none-eabi \
60 elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
61 sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz
63 arm-none-eabi-binutils \
65 arm-none-eabi-newlib \
79 git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
80 cd /tmp/dfu-programmer || exit 1
82 rm -rf /tmp/dfu-programmer/
84 elif grep ID /etc/os-release | grep -q gentoo; then
85 echo "$GENTOO_WARNING" | fmt
86 printf "\nProceed (y/N)? "
88 if echo "$answer" | grep -iq "^y"; then
89 sudo touch /etc/portage/package.use/qmkfirmware
90 # tee is used here since sudo doesn't apply to >>
91 echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
95 app-mobilephone/dfu-util \
96 dev-embedded/avrdude \
101 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
107 elif grep ID /etc/os-release | grep -q sabayon; then
111 app-mobilephone/dfu-util \
112 dev-embedded/avrdude \
117 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
120 elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
121 CROSS_AVR_GCC=cross-avr-gcc8
122 CROSS_ARM_GCC=cross-arm-none-gcc8
123 if grep ID /etc/os-release | grep -q "15."; then
124 CROSS_AVR_GCC=cross-avr-gcc7
125 CROSS_ARM_GCC=cross-arm-none-gcc7
127 sudo zypper install \
132 cross-arm-none-newlib-devel \
133 cross-arm-binutils cross-arm-none-newlib-devel \
142 elif grep ID /etc/os-release | grep -q slackware; then
143 printf "$SLACKWARE_WARNING\n"
144 printf "\nProceed (y/N)? "
146 if echo "$answer" | grep -iq "^y" ;then
163 elif grep ID /etc/os-release | grep -q solus; then
168 arm-none-eabi-binutils \
169 arm-none-eabi-newlib \
181 printf "\n$SOLUS_INFO\n"
184 echo "Sorry, we don't recognize your OS. Help us by contributing support!"
186 echo "https://docs.qmk.fm/#/contributing"
189 # Global install tasks
190 pip3 install -r ${util_dir}/../requirements.txt