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.

158 lines
4.3 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
  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. echo -n "Proceed (y/N)? "
  73. old_stty_cfg=$(stty -g)
  74. stty raw -echo
  75. answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
  76. stty $old_stty_cfg
  77. if echo "$answer" | grep -iq "^y" ;then
  78. sudo touch /etc/portage/package.use/qmkfirmware
  79. echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null
  80. sudo emerge -auN \
  81. app-arch/unzip \
  82. app-arch/zip \
  83. app-mobilephone/dfu-util \
  84. dev-embedded/avrdude \
  85. net-misc/wget \
  86. sys-devel/gcc \
  87. sys-devel/crossdev
  88. sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
  89. echo "Done!"
  90. else
  91. echo "Quitting..."
  92. fi
  93. elif grep ID /etc/os-release | grep -q sabayon; then
  94. sudo equo install \
  95. app-arch/unzip \
  96. app-arch/zip \
  97. app-mobilephone/dfu-util \
  98. dev-embedded/avrdude \
  99. net-misc/wget \
  100. sys-devel/gcc \
  101. sys-devel/crossdev
  102. sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr
  103. echo "Done!"
  104. elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
  105. CROSS_AVR_GCC=cross-avr-gcc8
  106. CROSS_ARM_GCC=cross-arm-none-gcc8
  107. if grep ID /etc/os-release | grep -q "15.0"; then
  108. CROSS_AVR_GCC=cross-avr-gcc7
  109. CROSS_ARM_GCC=cross-arm-none-gcc7
  110. fi
  111. sudo zypper install \
  112. avr-libc \
  113. $CROSS_AVR_GCC \
  114. $CROSS_ARM_GCC \
  115. cross-avr-binutils \
  116. cross-arm-none-newlib-devel \
  117. cross-arm-binutils cross-arm-none-newlib-devel \
  118. dfu-tool \
  119. dfu-programmer \
  120. gcc \
  121. unzip \
  122. wget \
  123. zip
  124. elif grep ID /etc/os-release | grep -q slackware; then
  125. printf "$SLACKWARE_WARNING\n"
  126. printf "\nProceed (y/N)? "
  127. read -r answer
  128. if echo "$answer" | grep -iq "^y" ;then
  129. sudo sboinstall \
  130. avr-binutils \
  131. avr-gcc \
  132. avr-libc \
  133. avrdude \
  134. dfu-programmer \
  135. dfu-util \
  136. arm-binutils \
  137. arm-gcc \
  138. newlib
  139. echo "Done!"
  140. else
  141. echo "Quitting..."
  142. fi
  143. else
  144. echo "Sorry, we don't recognize your OS. Help us by contributing support!"
  145. echo
  146. echo "https://docs.qmk.fm/#/contributing"
  147. fi