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.4KB

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