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.

156 lines
4.2 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/qmk_firmware -- 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. if grep ID /etc/os-release | grep -qE "fedora"; then
  6. sudo dnf install \
  7. arm-none-eabi-binutils-cs \
  8. arm-none-eabi-gcc-cs \
  9. arm-none-eabi-newlib \
  10. avr-binutils \
  11. avr-gcc \
  12. avr-libc \
  13. binutils-avr32-linux-gnu \
  14. dfu-util \
  15. dfu-programmer \
  16. diffutils \
  17. git \
  18. gcc \
  19. glibc-headers \
  20. kernel-devel \
  21. kernel-headers \
  22. make \
  23. perl \
  24. unzip \
  25. wget \
  26. zip
  27. elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then
  28. DEBIAN_FRONTEND=noninteractive
  29. DEBCONF_NONINTERACTIVE_SEEN=true
  30. export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
  31. sudo apt-get update
  32. sudo apt-get install \
  33. build-essential \
  34. avr-libc \
  35. binutils-arm-none-eabi \
  36. binutils-avr \
  37. dfu-programmer \
  38. dfu-util \
  39. diffutils \
  40. gcc \
  41. gcc-arm-none-eabi \
  42. gcc-avr \
  43. git \
  44. libnewlib-arm-none-eabi \
  45. unzip \
  46. wget \
  47. zip
  48. elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
  49. # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug.
  50. sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz
  51. sudo pacman -S \
  52. arm-none-eabi-binutils \
  53. arm-none-eabi-gcc \
  54. arm-none-eabi-newlib \
  55. avr-binutils \
  56. avr-libc \
  57. avr-gcc \
  58. base-devel \
  59. dfu-util \
  60. diffutils \
  61. gcc \
  62. git \
  63. unzip \
  64. wget \
  65. zip
  66. git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
  67. cd /tmp/dfu-programmer || exit 1
  68. makepkg -sic
  69. rm -rf /tmp/dfu-programmer/
  70. elif grep ID /etc/os-release | grep -q gentoo; then
  71. echo "$GENTOO_WARNING" | fmt
  72. printf "\nProceed (y/N)? "
  73. read -r answer
  74. if echo "$answer" | grep -iq "^y"; then
  75. sudo touch /etc/portage/package.use/qmkfirmware
  76. # tee is used here since sudo doesn't apply to >>
  77. echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
  78. sudo emerge -auN \
  79. app-arch/unzip \
  80. app-arch/zip \
  81. app-mobilephone/dfu-util \
  82. dev-embedded/avrdude \
  83. net-misc/wget \
  84. sys-devel/gcc \
  85. sys-devel/crossdev
  86. sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
  87. echo "Done!"
  88. else
  89. echo "Quitting..."
  90. fi
  91. elif grep ID /etc/os-release | grep -q sabayon; then
  92. sudo equo install \
  93. app-arch/unzip \
  94. app-arch/zip \
  95. app-mobilephone/dfu-util \
  96. dev-embedded/avrdude \
  97. net-misc/wget \
  98. sys-devel/gcc \
  99. sys-devel/crossdev
  100. sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
  101. echo "Done!"
  102. elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
  103. CROSS_AVR_GCC=cross-avr-gcc8
  104. CROSS_ARM_GCC=cross-arm-none-gcc8
  105. if grep ID /etc/os-release | grep -q "15.0"; then
  106. CROSS_AVR_GCC=cross-avr-gcc7
  107. CROSS_ARM_GCC=cross-arm-none-gcc7
  108. fi
  109. sudo zypper install \
  110. avr-libc \
  111. $CROSS_AVR_GCC \
  112. $CROSS_ARM_GCC \
  113. cross-avr-binutils \
  114. cross-arm-none-newlib-devel \
  115. cross-arm-binutils cross-arm-none-newlib-devel \
  116. dfu-tool \
  117. dfu-programmer \
  118. gcc \
  119. unzip \
  120. wget \
  121. zip
  122. elif grep ID /etc/os-release | grep -q slackware; then
  123. printf "$SLACKWARE_WARNING\n"
  124. printf "\nProceed (y/N)? "
  125. read -r answer
  126. if echo "$answer" | grep -iq "^y" ;then
  127. sudo sboinstall \
  128. avr-binutils \
  129. avr-gcc \
  130. avr-libc \
  131. avrdude \
  132. dfu-programmer \
  133. dfu-util \
  134. arm-binutils \
  135. arm-gcc \
  136. newlib
  137. echo "Done!"
  138. else
  139. echo "Quitting..."
  140. fi
  141. else
  142. echo "Sorry, we don't recognize your OS. Help us by contributing support!"
  143. echo
  144. echo "https://docs.qmk.fm/#/contributing"
  145. fi