install_dependencies.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. arm-none-eabi-gcc \
  19. arm-none-eabi-binutils \
  20. arm-none-eabi-newlib \
  21. git
  22. elif [[ -n "$(type -P apt-get)" ]]; then
  23. # Debian and derivatives
  24. # This block performs completely non-interactive updates {{
  25. export DEBIAN_FRONTEND=noninteractive
  26. export DEBCONF_NONINTERACTIVE_SEEN=true
  27. echo "grub-pc hold" | dpkg --set-selections
  28. apt-get -y update
  29. apt-get -y --allow-unauthenticated upgrade \
  30. -o Dpkg::Options::="--force-confdef" \
  31. -o Dpkg::Options::="--force-confold"
  32. # }}
  33. apt-get install -y \
  34. build-essential \
  35. gcc \
  36. unzip \
  37. wget \
  38. zip \
  39. gcc-avr \
  40. binutils-avr \
  41. avr-libc \
  42. dfu-programmer \
  43. dfu-util \
  44. gcc-arm-none-eabi \
  45. binutils-arm-none-eabi \
  46. libnewlib-arm-none-eabi \
  47. git
  48. elif [[ -n "$(type -P yum)" ]]; then
  49. # Fedora, CentOS or RHEL and derivatives
  50. yum -y makecache && yum -y update
  51. yum -y install \
  52. gcc \
  53. glibc-headers \
  54. kernel-devel \
  55. kernel-headers \
  56. make \
  57. perl \
  58. git \
  59. wget \
  60. avr-binutils \
  61. avr-gcc \
  62. avr-libc \
  63. dfu-programmer \
  64. dfu-util \
  65. gcc-arm-none-eabi \
  66. binutils-arm-none-eabi \
  67. libnewlib-arm-none-eabi \
  68. git
  69. # The listed eabi pacackes do unfortunately not exist for CentOS,
  70. # But at least in Fedora they do, so try to install them anyway
  71. # TODO: Build them from sources, if the installation fails
  72. elif [[ -n "$(type -P zypper)" ]]; then
  73. # openSUSE
  74. zypper --non-interactive refresh && zypper --non-interactive update
  75. zypper --non-interactive install \
  76. git \
  77. make \
  78. gcc \
  79. kernel-devel \
  80. patch \
  81. wget \
  82. dfu-programmer \
  83. git
  84. # TODO: The avr and eabi tools are not available as default packages, so we need
  85. # another way to install them
  86. fi