avr_setup.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env bash
  2. # This script will attempt to setup the Linux dependencies for compiling QMK/TMK
  3. # This could probably go much lower, but since we are including an Arch vagrant,
  4. # making it the first match makes sense
  5. if [[ -n "$(type -P pacman )" ]]; then
  6. # Arch linux and derivatives like Apricity
  7. # Future improvements:
  8. # Allow user to speed up package installs using powerpill/wget tweaks
  9. # Always run the pacman mirror update script if possible when vagrant comes up
  10. # This will ensure that users never get stalled on a horribly slow mirror
  11. pacman -Syyu --needed --noconfirm
  12. pacman -S --needed --noconfirm \
  13. base-devel \
  14. avr-gcc \
  15. avr-binutils \
  16. avr-libc \
  17. dfu-util
  18. elif [[ -n "$(type -P apt-get)" ]]; then
  19. # Debian and derivatives
  20. apt-get update -y && apt-get upgrade -y
  21. apt-get install -y \
  22. build-essential \
  23. gcc \
  24. unzip \
  25. wget \
  26. zip \
  27. gcc-avr \
  28. binutils-avr \
  29. avr-libc \
  30. dfu-util
  31. elif [[ -n "$(type -P yum)" ]]; then
  32. # Fedora, CentOS or RHEL and derivatives
  33. yum -y makecache && yum -y update
  34. yum -y install \
  35. gcc \
  36. glibc-headers \
  37. kernel-devel \
  38. kernel-headers \
  39. make \
  40. perl \
  41. git \
  42. wget \
  43. avr-binutils \
  44. avr-gcc \
  45. avr-libc \
  46. dfu-util
  47. elif [[ -n "$(type -P zypper)" ]]; then
  48. # openSUSE
  49. zypper refresh --non-interactive && zypper update --non-interactive
  50. zypper --non-interactive install \
  51. git \
  52. make \
  53. gcc \
  54. kernel-devel \
  55. patch \
  56. wget \
  57. dfu-util
  58. fi