]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/install_dependencies.sh
Add 'quantum/serial_link/' from commit 'a20d513e3cdacbf6e0e70a80402497ad10166434'
[qmk_firmware.git] / util / install_dependencies.sh
1 #!/usr/bin/env bash
2 # This script will attempt to setup the Linux dependencies for compiling QMK/TMK
3
4 # This could probably go much lower, but since we are including an Arch vagrant,
5 # making it the first match makes sense
6
7 if [[ -n "$(type -P pacman )" ]]; then
8   # Arch linux and derivatives like Apricity
9   # Future improvements:
10   # Allow user to speed up package installs using powerpill/wget tweaks
11   # Always run the pacman mirror update script if possible when vagrant comes up
12   # This will ensure that users never get stalled on a horribly slow mirror
13   pacman -Syyu --needed --noconfirm
14   pacman -S --needed --noconfirm \
15     base-devel \
16     avr-gcc \
17     avr-binutils \
18     avr-libc \
19     dfu-util \
20     arm-none-eabi-gcc \
21     arm-none-eabi-binutils \
22     arm-none-eabi-newlib \
23     git
24
25 elif [[ -n "$(type -P apt-get)" ]]; then
26   # Debian and derivatives
27   # This block performs completely non-interactive updates {{
28   export DEBIAN_FRONTEND=noninteractive
29   export DEBCONF_NONINTERACTIVE_SEEN=true
30   echo "grub-pc hold" | dpkg --set-selections
31   apt-get -y update
32   apt-get -y --allow-unauthenticated upgrade \
33           -o Dpkg::Options::="--force-confdef" \
34           -o Dpkg::Options::="--force-confold"
35   # }}
36   apt-get install -y \
37     build-essential \
38     gcc \
39     unzip \
40     wget \
41     zip \
42     gcc-avr \
43     binutils-avr \
44     avr-libc \
45     dfu-programmer \
46     dfu-util \
47     gcc-arm-none-eabi \
48     binutils-arm-none-eabi \
49     libnewlib-arm-none-eabi \
50     git
51
52 elif [[ -n "$(type -P yum)" ]]; then
53   # Fedora, CentOS or RHEL and derivatives
54   yum -y makecache && yum -y update
55   yum -y install \
56     gcc \
57     glibc-headers \
58     kernel-devel \
59     kernel-headers \
60     make \
61     perl \
62     git \
63     wget \
64     avr-binutils \
65     avr-gcc \
66     avr-libc \
67     dfu-programmer \
68     dfu-util \
69     gcc-arm-none-eabi \
70     binutils-arm-none-eabi \
71     libnewlib-arm-none-eabi \
72     git
73   # The listed eabi pacackes do unfortunately not exist for CentOS,
74   # But at least in Fedora they do, so try to install them anyway
75   # TODO: Build them from sources, if the installation fails
76
77 elif [[ -n "$(type -P zypper)" ]]; then
78   # openSUSE
79   zypper --non-interactive refresh  && zypper --non-interactive update
80   zypper --non-interactive install \
81     git \
82     make \
83     gcc \
84     kernel-devel \
85     patch \
86     wget \
87     dfu-programmer \
88     git
89   # TODO: The avr and eabi tools are not available as default packages, so we need 
90   # another way to install them
91
92 fi