summaryrefslogtreecommitdiff
path: root/util/install_dependencies.sh
diff options
context:
space:
mode:
authorChristopher Browne <cbbrowne@ca.afilias.info>2016-07-04 12:32:08 -0400
committerChristopher Browne <cbbrowne@ca.afilias.info>2016-07-04 12:32:08 -0400
commit2e1cfaf73fccdfaba2d7542f00bd7c3d49998d5d (patch)
tree9d8e9c6b71116f01c56c870a9e1071760899ff77 /util/install_dependencies.sh
parent44a5f7630f18b40b36270d49449a43cd42b802f0 (diff)
parent9e01b219f32b0086728c10658928b8bffcc26ef7 (diff)
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'util/install_dependencies.sh')
-rw-r--r--util/install_dependencies.sh92
1 files changed, 92 insertions, 0 deletions
diff --git a/util/install_dependencies.sh b/util/install_dependencies.sh
new file mode 100644
index 0000000000..24564a2ac5
--- /dev/null
+++ b/util/install_dependencies.sh
@@ -0,0 +1,92 @@
+#!/usr/bin/env bash
+# This script will attempt to setup the Linux dependencies for compiling QMK/TMK
+
+# This could probably go much lower, but since we are including an Arch vagrant,
+# making it the first match makes sense
+
+if [[ -n "$(type -P pacman )" ]]; then
+ # Arch linux and derivatives like Apricity
+ # Future improvements:
+ # Allow user to speed up package installs using powerpill/wget tweaks
+ # Always run the pacman mirror update script if possible when vagrant comes up
+ # This will ensure that users never get stalled on a horribly slow mirror
+ pacman -Syyu --needed --noconfirm
+ pacman -S --needed --noconfirm \
+ base-devel \
+ avr-gcc \
+ avr-binutils \
+ avr-libc \
+ dfu-util \
+ arm-none-eabi-gcc \
+ arm-none-eabi-binutils \
+ arm-none-eabi-newlib \
+ git
+
+elif [[ -n "$(type -P apt-get)" ]]; then
+ # Debian and derivatives
+ # This block performs completely non-interactive updates {{
+ export DEBIAN_FRONTEND=noninteractive
+ export DEBCONF_NONINTERACTIVE_SEEN=true
+ echo "grub-pc hold" | dpkg --set-selections
+ apt-get -y update
+ apt-get -y --allow-unauthenticated upgrade \
+ -o Dpkg::Options::="--force-confdef" \
+ -o Dpkg::Options::="--force-confold"
+ # }}
+ apt-get install -y \
+ build-essential \
+ gcc \
+ unzip \
+ wget \
+ zip \
+ gcc-avr \
+ binutils-avr \
+ avr-libc \
+ dfu-programmer \
+ dfu-util \
+ gcc-arm-none-eabi \
+ binutils-arm-none-eabi \
+ libnewlib-arm-none-eabi \
+ git
+
+elif [[ -n "$(type -P yum)" ]]; then
+ # Fedora, CentOS or RHEL and derivatives
+ yum -y makecache && yum -y update
+ yum -y install \
+ gcc \
+ glibc-headers \
+ kernel-devel \
+ kernel-headers \
+ make \
+ perl \
+ git \
+ wget \
+ avr-binutils \
+ avr-gcc \
+ avr-libc \
+ dfu-programmer \
+ dfu-util \
+ gcc-arm-none-eabi \
+ binutils-arm-none-eabi \
+ libnewlib-arm-none-eabi \
+ git
+ # The listed eabi pacackes do unfortunately not exist for CentOS,
+ # But at least in Fedora they do, so try to install them anyway
+ # TODO: Build them from sources, if the installation fails
+
+elif [[ -n "$(type -P zypper)" ]]; then
+ # openSUSE
+ zypper --non-interactive refresh && zypper --non-interactive update
+ zypper --non-interactive install \
+ git \
+ make \
+ gcc \
+ kernel-devel \
+ patch \
+ wget \
+ dfu-programmer \
+ git
+ # TODO: The avr and eabi tools are not available as default packages, so we need
+ # another way to install them
+
+fi