]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/avr_setup.sh
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
[qmk_firmware.git] / util / avr_setup.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
21 elif [[ -n "$(type -P apt-get)" ]]; then
22   # Debian and derivatives
23   # This block performs completely non-interactive updates {{
24   export DEBIAN_FRONTEND=noninteractive
25   export DEBCONF_NONINTERACTIVE_SEEN=true
26   echo "grub-pc hold" | dpkg --set-selections
27   apt-get -y update
28   apt-get -y --allow-unauthenticated upgrade \
29           -o Dpkg::Options::="--force-confdef" \
30           -o Dpkg::Options::="--force-confold"
31   # }}
32   apt-get install -y \
33     build-essential \
34     gcc \
35     unzip \
36     wget \
37     zip \
38     gcc-avr \
39     binutils-avr \
40     avr-libc \
41     dfu-programmer \
42     dfu-util
43
44 elif [[ -n "$(type -P yum)" ]]; then
45   # Fedora, CentOS or RHEL and derivatives
46   yum -y makecache && yum -y update
47   yum -y install \
48     gcc \
49     glibc-headers \
50     kernel-devel \
51     kernel-headers \
52     make \
53     perl \
54     git \
55     wget \
56     avr-binutils \
57     avr-gcc \
58     avr-libc \
59     dfu-programmer \
60     dfu-util
61
62 elif [[ -n "$(type -P zypper)" ]]; then
63   # openSUSE
64   zypper --non-interactive refresh  && zypper --non-interactive update
65   zypper --non-interactive install \
66     git \
67     make \
68     gcc \
69     kernel-devel \
70     patch \
71     wget \
72     dfu-programmer
73
74 fi