]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/linux_install.sh
Fold install_dependencies.sh into linux_install.sh and freebsd_install.sh
[qmk_firmware.git] / util / linux_install.sh
1 #!/bin/sh
2
3 # Note: This file uses tabs to indent. Please don't mix tabs and spaces.
4
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."
6
7 if grep ID /etc/os-release | grep -qE "fedora"; then
8         sudo dnf install \
9                 arm-none-eabi-binutils-cs \
10                 arm-none-eabi-gcc-cs \
11                 arm-none-eabi-newlib
12                 avr-binutils \
13                 avr-gcc \
14                 avr-libc \
15                 binutils-avr32-linux-gnu \
16                 dfu-util \
17                 dfu-programmer \
18                 diffutils \
19                 git \
20                 gcc \
21                 glibc-headers \
22                 kernel-devel \
23                 kernel-headers \
24                 make \
25                 perl \
26                 unzip \
27                 wget \
28                 zip
29
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
34         sudo apt-get update
35         sudo apt-get install \
36                 build-essential \
37                 avr-libc \
38                 binutils-arm-none-eabi \
39                 binutils-avr \
40                 dfu-programmer \
41                 dfu-util \
42                 diffutils \
43                 gcc \
44                 gcc-arm-none-eabi \
45                 gcc-avr \
46                 git \
47                 libnewlib-arm-none-eabi \
48                 unzip \
49                 wget \
50                 zip
51
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
55         sudo pacman -S \
56                 arm-none-eabi-binutils \
57                 arm-none-eabi-gcc \
58                 arm-none-eabi-newlib \
59                 avr-binutils \
60                 avr-libc \
61                 avr-gcc \
62                 base-devel \
63                 dfu-util \
64                 diff-utils \
65                 gcc \
66                 git \
67                 unzip \
68                 wget \
69                 zip
70         git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
71         cd /tmp/dfu-programmer
72         makepkg -sic
73         rm -rf /tmp/dfu-programmer/
74
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)
79         stty raw -echo
80         answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
81         stty $old_stty_cfg
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
85                 sudo emerge -auN \
86                         app-arch/unzip \
87                         app-arch/zip \
88                         app-mobilephone/dfu-util \
89                         net-misc/wget \
90                         sys-devel/gcc \
91                         sys-devel/crossdev dev-embedded/avrdude
92                 sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
93                 echo Done!
94         else
95                 echo "Quitting..."
96         fi
97
98 else
99         echo "Sorry, we don't recognize your OS. Help us by contributing support!"
100         echo
101         echo "https://docs.qmk.fm/#/contributing"
102 fi