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.

190 lines
4.9 KiB

  1. #!/bin/sh
  2. # Note: This file uses tabs to indent. Please don't mix tabs and spaces.
  3. GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmkfirmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki."
  4. SLACKWARE_WARNING="You will need the following packages from slackbuilds.org:\n\tarm-binutils\n\tarm-gcc\n\tavr-binutils\n\tavr-gcc\n\tavr-libc\n\tavrdude\n\tdfu-programmer\n\tdfu-util\n\tnewlib\nThese packages will be installed with sudo and sboinstall, so ensure that your user is added to sudoers and that sboinstall is configured."
  5. SOLUS_INFO="Your tools are now installed. To start using them, open new terminal or source these scripts:\n\t/usr/share/defaults/etc/profile.d/50-arm-toolchain-path.sh\n\t/usr/share/defaults/etc/profile.d/50-avr-toolchain-path.sh"
  6. util_dir=$(dirname "$0")
  7. if grep ID /etc/os-release | grep -qE "fedora"; then
  8. sudo dnf install \
  9. arm-none-eabi-binutils-cs \
  10. arm-none-eabi-gcc-cs \
  11. arm-none-eabi-newlib \
  12. avr-binutils \
  13. avr-gcc \
  14. avr-libc \
  15. binutils-avr32-linux-gnu \
  16. dfu-util \
  17. dfu-programmer \
  18. diffutils \
  19. git \
  20. gcc \
  21. glibc-headers \
  22. kernel-devel \
  23. kernel-headers \
  24. make \
  25. perl \
  26. python3 \
  27. unzip \
  28. wget \
  29. zip
  30. elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
  31. DEBIAN_FRONTEND=noninteractive
  32. DEBCONF_NONINTERACTIVE_SEEN=true
  33. export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
  34. sudo apt-get update
  35. sudo apt-get -yq install \
  36. build-essential \
  37. avr-libc \
  38. binutils-arm-none-eabi \
  39. binutils-avr \
  40. dfu-programmer \
  41. dfu-util \
  42. diffutils \
  43. gcc \
  44. gcc-arm-none-eabi \
  45. gcc-avr \
  46. git \
  47. libnewlib-arm-none-eabi \
  48. python3 \
  49. unzip \
  50. wget \
  51. zip
  52. elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
  53. sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz
  54. sudo pacman -S \
  55. arm-none-eabi-binutils \
  56. arm-none-eabi-gcc \
  57. arm-none-eabi-newlib \
  58. avrdude \
  59. avr-binutils \
  60. avr-libc \
  61. avr-gcc \
  62. base-devel \
  63. dfu-util \
  64. diffutils \
  65. gcc \
  66. git \
  67. python \
  68. unzip \
  69. wget \
  70. zip
  71. git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
  72. cd /tmp/dfu-programmer || exit 1
  73. makepkg -sic
  74. rm -rf /tmp/dfu-programmer/
  75. elif grep ID /etc/os-release | grep -q gentoo; then
  76. echo "$GENTOO_WARNING" | fmt
  77. printf "\nProceed (y/N)? "
  78. read -r answer
  79. if echo "$answer" | grep -iq "^y"; then
  80. sudo touch /etc/portage/package.use/qmkfirmware
  81. # tee is used here since sudo doesn't apply to >>
  82. echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
  83. sudo emerge -auN \
  84. app-arch/unzip \
  85. app-arch/zip \
  86. app-mobilephone/dfu-util \
  87. dev-embedded/avrdude \
  88. dev-lang/python:3.5 \
  89. net-misc/wget \
  90. sys-devel/gcc \
  91. sys-devel/crossdev
  92. sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
  93. echo "Done!"
  94. else
  95. echo "Quitting..."
  96. fi
  97. elif grep ID /etc/os-release | grep -q sabayon; then
  98. sudo equo install \
  99. app-arch/unzip \
  100. app-arch/zip \
  101. app-mobilephone/dfu-util \
  102. dev-embedded/avrdude \
  103. dev-lang/python \
  104. net-misc/wget \
  105. sys-devel/gcc \
  106. sys-devel/crossdev
  107. sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
  108. echo "Done!"
  109. elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
  110. CROSS_AVR_GCC=cross-avr-gcc8
  111. CROSS_ARM_GCC=cross-arm-none-gcc8
  112. if grep ID /etc/os-release | grep -q "15."; then
  113. CROSS_AVR_GCC=cross-avr-gcc7
  114. CROSS_ARM_GCC=cross-arm-none-gcc7
  115. fi
  116. sudo zypper install \
  117. avr-libc \
  118. $CROSS_AVR_GCC \
  119. $CROSS_ARM_GCC \
  120. cross-avr-binutils \
  121. cross-arm-none-newlib-devel \
  122. cross-arm-binutils cross-arm-none-newlib-devel \
  123. dfu-tool \
  124. dfu-programmer \
  125. gcc \
  126. python3 \
  127. unzip \
  128. wget \
  129. zip
  130. elif grep ID /etc/os-release | grep -q slackware; then
  131. printf "$SLACKWARE_WARNING\n"
  132. printf "\nProceed (y/N)? "
  133. read -r answer
  134. if echo "$answer" | grep -iq "^y" ;then
  135. sudo sboinstall \
  136. avr-binutils \
  137. avr-gcc \
  138. avr-libc \
  139. avrdude \
  140. dfu-programmer \
  141. dfu-util \
  142. arm-binutils \
  143. arm-gcc \
  144. newlib \
  145. python3
  146. echo "Done!"
  147. else
  148. echo "Quitting..."
  149. fi
  150. elif grep ID /etc/os-release | grep -q solus; then
  151. sudo eopkg ur
  152. sudo eopkg it \
  153. -c system.devel \
  154. arm-none-eabi-gcc \
  155. arm-none-eabi-binutils \
  156. arm-none-eabi-newlib \
  157. avr-libc \
  158. avr-binutils \
  159. avr-gcc \
  160. avrdude \
  161. dfu-util \
  162. dfu-programmer \
  163. python3 \
  164. git \
  165. wget \
  166. zip \
  167. unzip
  168. printf "\n$SOLUS_INFO\n"
  169. else
  170. echo "Sorry, we don't recognize your OS. Help us by contributing support!"
  171. echo
  172. echo "https://docs.qmk.fm/#/contributing"
  173. fi
  174. # Global install tasks
  175. pip3 install -r ${util_dir}/../requirements.txt