Audio plugin host https://kx.studio/carla
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.

build-deps.sh 8.3KB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. #!/bin/bash
  2. # ------------------------------------------------------------------------------------
  3. # stop on error
  4. set -e
  5. # ------------------------------------------------------------------------------------
  6. # cd to correct path
  7. if [ -f Makefile ]; then
  8. cd data/macos
  9. fi
  10. # ------------------------------------------------------------------------------------
  11. # function to build base libs
  12. build_base()
  13. {
  14. export CC=gcc
  15. export CXX=g++
  16. export CFLAGS="-O2 -mtune=generic -msse -msse2 -m$ARCH -fPIC -DPIC"
  17. export CXXFLAGS=$CFLAGS
  18. export LDFLAGS="-m$ARCH"
  19. export PREFIX=/opt/carla$ARCH
  20. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  21. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  22. # ------------------------------------------------------------------------------------
  23. # pkgconfig
  24. if [ ! -d pkg-config-0.28 ]; then
  25. curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
  26. tar -xf pkg-config-0.28.tar.gz
  27. fi
  28. if [ ! -f pkg-config-0.28_$ARCH/build-done ]; then
  29. cp -r pkg-config-0.28 pkg-config-0.28_$ARCH
  30. cd pkg-config-0.28_$ARCH
  31. ./configure --enable-indirect-deps --with-internal-glib --with-pc-path=$PKG_CONFIG_PATH --prefix=$PREFIX
  32. make
  33. sudo make install
  34. touch build-done
  35. cd ..
  36. fi
  37. # ------------------------------------------------------------------------------------
  38. # zlib
  39. if [ ! -d zlib-1.2.8 ]; then
  40. curl -O http://zlib.net/zlib-1.2.8.tar.gz
  41. tar -xf zlib-1.2.8.tar.gz
  42. fi
  43. if [ ! -f zlib-1.2.8_$ARCH/build-done ]; then
  44. cp -r zlib-1.2.8 zlib-1.2.8_$ARCH
  45. cd zlib-1.2.8_$ARCH
  46. ./configure --static --prefix=$PREFIX
  47. make
  48. sudo make install
  49. touch build-done
  50. cd ..
  51. fi
  52. # ------------------------------------------------------------------------------------
  53. # liblo
  54. if [ ! -d liblo-0.28 ]; then
  55. curl -L http://download.sourceforge.net/liblo/liblo-0.28.tar.gz -o liblo-0.28.tar.gz
  56. tar -xf liblo-0.28.tar.gz
  57. fi
  58. if [ ! -f liblo-0.28_$ARCH/build-done ]; then
  59. cp -r liblo-0.28 liblo-0.28_$ARCH
  60. cd liblo-0.28_$ARCH
  61. ./configure --enable-static --disable-shared --prefix=$PREFIX
  62. make
  63. sudo make install
  64. touch build-done
  65. cd ..
  66. fi
  67. # ------------------------------------------------------------------------------------
  68. # mxml
  69. if [ ! -d mxml-2.8 ]; then
  70. curl -O http://www.msweet.org/files/project3/mxml-2.8.tar.gz
  71. tar -xf mxml-2.8.tar.gz
  72. fi
  73. if [ ! -f mxml-2.8_$ARCH/build-done ]; then
  74. cp -r mxml-2.8 mxml-2.8_$ARCH
  75. cd mxml-2.8_$ARCH
  76. ./configure --enable-static --disable-shared --prefix=$PREFIX
  77. make
  78. sudo cp *.a $PREFIX/lib/
  79. sudo cp *.pc $PREFIX/lib/pkgconfig/
  80. sudo cp mxml.h $PREFIX/include/
  81. touch build-done
  82. cd ..
  83. fi
  84. # ------------------------------------------------------------------------------------
  85. # fftw3
  86. if [ ! -d fftw-3.3.4 ]; then
  87. curl -O http://www.fftw.org/fftw-3.3.4.tar.gz
  88. tar -xf fftw-3.3.4.tar.gz
  89. fi
  90. if [ ! -f fftw-3.3.4_$ARCH/build-done ]; then
  91. export CFLAGS="-O2 -mtune=generic -msse -msse2 -ffast-math -mfpmath=sse -m$ARCH -fPIC -DPIC"
  92. export CXXFLAGS=$CFLAGS
  93. cp -r fftw-3.3.4 fftw-3.3.4_$ARCH
  94. cd fftw-3.3.4_$ARCH
  95. ./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=$PREFIX
  96. make
  97. sudo make install
  98. make clean
  99. ./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=$PREFIX
  100. make
  101. sudo make install
  102. make clean
  103. touch build-done
  104. cd ..
  105. fi
  106. }
  107. # ------------------------------------------------------------------------------------
  108. # build base libs
  109. export ARCH=32
  110. build_base
  111. export ARCH=64
  112. build_base
  113. # ------------------------------------------------------------------------------------
  114. # switch to clang for Qt5
  115. export CC=clang
  116. export CXX=clang
  117. # ------------------------------------------------------------------------------------
  118. # set flags for qt stuff
  119. export CFLAGS="-O2 -mtune=generic -msse -msse2 -m64 -fPIC -DPIC"
  120. export CXXFLAGS=$CFLAGS
  121. export LDFLAGS="-m64"
  122. export PREFIX=/opt/carla
  123. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  124. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  125. export CFG_ARCH=x86_64
  126. export QMAKESPEC=macx-clang
  127. # ------------------------------------------------------------------------------------
  128. # qt5-base download (5.2.1 for now)
  129. if [ ! -d qtbase-opensource-src-5.3.1 ]; then
  130. curl -L http://download.qt-project.org/official_releases/qt/5.3/5.3.1/submodules/qtbase-opensource-src-5.3.1.tar.gz -o qtbase-opensource-src-5.3.1.tar.gz
  131. tar -xf qtbase-opensource-src-5.3.1.tar.gz
  132. fi
  133. # ------------------------------------------------------------------------------------
  134. # qt5-base (regular, 64bit, shared, framework)
  135. if [ ! -f qtbase-opensource-src-5.3.1/build-done ]; then
  136. cd qtbase-opensource-src-5.3.1
  137. ./configure -release -shared -opensource -confirm-license -force-pkg-config -platform macx-clang -framework \
  138. -prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
  139. -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl desktop -qpa cocoa \
  140. -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
  141. -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
  142. -no-cups -no-dbus -no-evdev -no-fontconfig -no-harfbuzz -no-iconv -no-icu -no-gif -no-glib -no-nis -no-openssl -no-pch -no-sql-ibase -no-sql-odbc \
  143. -no-audio-backend -no-qml-debug -no-separate-debug-info \
  144. -no-compile-examples -nomake examples -nomake tests -make libs -make tools
  145. make -j 2
  146. sudo make install
  147. sudo ln -s /opt/carla/lib/QtCore.framework/Headers /opt/carla/include/qt5/QtCore
  148. sudo ln -s /opt/carla/lib/QtGui.framework/Headers /opt/carla/include/qt5/QtGui
  149. sudo ln -s /opt/carla/lib/QtWidgets.framework/Headers /opt/carla/include/qt5/QtWidgets
  150. touch build-done
  151. cd ..
  152. fi
  153. # ------------------------------------------------------------------------------------
  154. # qt5-mac-extras
  155. if [ ! -d qtmacextras-opensource-src-5.3.1 ]; then
  156. curl -L http://download.qt-project.org/official_releases/qt/5.3/5.3.1/submodules/qtmacextras-opensource-src-5.3.1.tar.gz -o qtmacextras-opensource-src-5.3.1.tar.gz
  157. tar -xf qtmacextras-opensource-src-5.3.1.tar.gz
  158. fi
  159. if [ ! -f qtmacextras-opensource-src-5.3.1/build-done ]; then
  160. cd qtmacextras-opensource-src-5.3.1
  161. qmake
  162. make -j 2
  163. sudo make install
  164. touch build-done
  165. cd ..
  166. fi
  167. # ------------------------------------------------------------------------------------
  168. # qt5-svg
  169. if [ ! -d qtsvg-opensource-src-5.3.1 ]; then
  170. curl -L http://download.qt-project.org/official_releases/qt/5.3/5.3.1/submodules/qtsvg-opensource-src-5.3.1.tar.gz -o qtsvg-opensource-src-5.3.1.tar.gz
  171. tar -xf qtsvg-opensource-src-5.3.1.tar.gz
  172. fi
  173. if [ ! -f qtsvg-opensource-src-5.3.1/build-done ]; then
  174. cd qtsvg-opensource-src-5.3.1
  175. qmake
  176. make -j 2
  177. sudo make install
  178. touch build-done
  179. cd ..
  180. fi
  181. # ------------------------------------------------------------------------------------
  182. # python
  183. if [ ! -d Python-3.4.1 ]; then
  184. curl -O https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz
  185. tar -xf Python-3.4.1.tgz
  186. fi
  187. if [ ! -f Python-3.4.1/build-done ]; then
  188. cd Python-3.4.1
  189. ./configure --prefix=$PREFIX
  190. make
  191. sudo make install
  192. touch build-done
  193. cd ..
  194. fi
  195. # ------------------------------------------------------------------------------------
  196. # sip
  197. if [ ! -d sip-4.16.2 ]; then
  198. curl -L http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.2/sip-4.16.2.tar.gz -o sip-4.16.2.tar.gz
  199. tar -xf sip-4.16.2.tar.gz
  200. fi
  201. if [ ! -f sip-4.16.2/build-done ]; then
  202. cd sip-4.16.2
  203. python3 configure.py
  204. make
  205. sudo make install
  206. touch build-done
  207. cd ..
  208. fi
  209. # ------------------------------------------------------------------------------------
  210. # pyqt5
  211. if [ ! -d PyQt-gpl-5.3.1 ]; then
  212. curl -L http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.3.1/PyQt-gpl-5.3.1.tar.gz -o PyQt-gpl-5.3.1.tar.gz
  213. tar -xf PyQt-gpl-5.3.1.tar.gz
  214. fi
  215. if [ ! -f PyQt-gpl-5.3.1/build-done ]; then
  216. cd PyQt-gpl-5.3.1
  217. python3 configure.py --confirm-license
  218. make
  219. sudo make install
  220. touch build-done
  221. cd ..
  222. fi
  223. # ------------------------------------------------------------------------------------
  224. # cxfreeze
  225. if [ ! -d cx_Freeze-4.3.3 ]; then
  226. curl -L http://download.sourceforge.net/cx-freeze/cx_Freeze-4.3.3.tar.gz -o cx_Freeze-4.3.3.tar.gz
  227. tar -xf cx_Freeze-4.3.3.tar.gz
  228. fi
  229. if [ ! -f cx_Freeze-4.3.3/build-done ]; then
  230. cd cx_Freeze-4.3.3
  231. sed -i -e 's/"python%s.%s"/"python%s.%sm"/' setup.py
  232. python3 setup.py build
  233. sudo python3 setup.py install --prefix=$PREFIX
  234. touch build-done
  235. cd ..
  236. fi
  237. # ------------------------------------------------------------------------------------