You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.8 KiB

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