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.

359 lines
12KB

  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. # qt5-base download
  119. if [ ! -d qtbase-opensource-src-5.3.0 ]; then
  120. curl -L http://download.qt-project.org/official_releases/qt/5.3/5.3.0/submodules/qtbase-opensource-src-5.3.0.tar.gz -o qtbase-opensource-src-5.3.0.tar.gz
  121. tar -xf qtbase-opensource-src-5.3.0.tar.gz
  122. fi
  123. # ------------------------------------------------------------------------------------
  124. # qt5-base 32bit (minimal, static)
  125. if [ ! -f qtbase-opensource-src-5.3.0_32/build-done ]; then
  126. export CFLAGS="-O2 -mtune=generic -msse -msse2 -m32 -fPIC -DPIC"
  127. export CXXFLAGS=$CFLAGS
  128. export LDFLAGS="-m32"
  129. export PREFIX=/opt/carla32
  130. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  131. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  132. cp -r qtbase-opensource-src-5.3.0 qtbase-opensource-src-5.3.0_32
  133. cd qtbase-opensource-src-5.3.0_32
  134. export CFG_ARCH=i386
  135. export QMAKESPEC=macx-clang-32
  136. ./configure -release -static -opensource -confirm-license -force-pkg-config -platform macx-clang-32 \
  137. -prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
  138. -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl no -qpa cocoa \
  139. -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
  140. -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
  141. -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 \
  142. -no-audio-backend -no-qml-debug -no-separate-debug-info \
  143. -no-compile-examples -no-framework -no-gui -no-widgets -nomake examples -nomake tests -nomake tools -make libs
  144. make -j 2
  145. sudo make install
  146. touch build-done
  147. cd ..
  148. fi
  149. # ------------------------------------------------------------------------------------
  150. # qt5-base 64bit (minimal, static)
  151. if [ ! -f qtbase-opensource-src-5.3.0_64/build-done ]; then
  152. export CFLAGS="-O2 -mtune=generic -msse -msse2 -m64 -fPIC -DPIC"
  153. export CXXFLAGS=$CFLAGS
  154. export LDFLAGS="-m64"
  155. export PREFIX=/opt/carla64
  156. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  157. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  158. cp -r qtbase-opensource-src-5.3.0 qtbase-opensource-src-5.3.0_64
  159. cd qtbase-opensource-src-5.3.0_64
  160. export CFG_ARCH=x86_64
  161. export QMAKESPEC=macx-clang
  162. ./configure -release -static -opensource -confirm-license -force-pkg-config -platform macx-clang \
  163. -prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
  164. -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl no -qpa cocoa \
  165. -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
  166. -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
  167. -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 \
  168. -no-audio-backend -no-qml-debug -no-separate-debug-info \
  169. -no-compile-examples -no-framework -no-gui -no-widgets -nomake examples -nomake tests -nomake tools -make libs
  170. make -j 2
  171. sudo make install
  172. touch build-done
  173. cd ..
  174. fi
  175. # ------------------------------------------------------------------------------------
  176. # set flags for qt stuff
  177. export CFLAGS="-O2 -mtune=generic -msse -msse2 -m64 -fPIC -DPIC"
  178. export CXXFLAGS=$CFLAGS
  179. export LDFLAGS="-m64"
  180. export PREFIX=/opt/carla
  181. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  182. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  183. export CFG_ARCH=x86_64
  184. export QMAKESPEC=macx-clang
  185. # ------------------------------------------------------------------------------------
  186. # qt5-base download (5.2.1 for now)
  187. if [ ! -d qtbase-opensource-src-5.2.1 ]; then
  188. curl -L http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtbase-opensource-src-5.2.1.tar.gz -o qtbase-opensource-src-5.2.1.tar.gz
  189. tar -xf qtbase-opensource-src-5.2.1.tar.gz
  190. fi
  191. # ------------------------------------------------------------------------------------
  192. # qt5-base (regular, 64bit, shared, framework)
  193. if [ ! -f qtbase-opensource-src-5.2.1/build-done ]; then
  194. cd qtbase-opensource-src-5.2.1
  195. ./configure -release -shared -opensource -confirm-license -force-pkg-config -platform macx-clang -framework \
  196. -prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
  197. -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl desktop -qpa cocoa \
  198. -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
  199. -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
  200. -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 \
  201. -no-audio-backend -no-qml-debug -no-separate-debug-info \
  202. -no-compile-examples -nomake examples -nomake tests -make libs -make tools
  203. make -j 2
  204. sudo make install
  205. sudo ln -s /opt/carla/lib/QtCore.framework/Headers /opt/carla/include/qt5/QtCore
  206. sudo ln -s /opt/carla/lib/QtGui.framework/Headers /opt/carla/include/qt5/QtGui
  207. sudo ln -s /opt/carla/lib/QtWidgets.framework/Headers /opt/carla/include/qt5/QtWidgets
  208. touch build-done
  209. cd ..
  210. fi
  211. # ------------------------------------------------------------------------------------
  212. # qt5-mac-extras
  213. if [ ! -d qtmacextras-opensource-src-5.2.1 ]; then
  214. curl -L http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtmacextras-opensource-src-5.2.1.tar.gz -o qtmacextras-opensource-src-5.2.1.tar.gz
  215. tar -xf qtmacextras-opensource-src-5.2.1.tar.gz
  216. fi
  217. if [ ! -f qtmacextras-opensource-src-5.2.1/build-done ]; then
  218. cd qtmacextras-opensource-src-5.2.1
  219. qmake
  220. make -j 2
  221. sudo make install
  222. touch build-done
  223. cd ..
  224. fi
  225. # ------------------------------------------------------------------------------------
  226. # qt5-svg
  227. if [ ! -d qtsvg-opensource-src-5.2.1 ]; then
  228. curl -L http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtsvg-opensource-src-5.2.1.tar.gz -o qtsvg-opensource-src-5.2.1.tar.gz
  229. tar -xf qtsvg-opensource-src-5.2.1.tar.gz
  230. fi
  231. if [ ! -f qtsvg-opensource-src-5.2.1/build-done ]; then
  232. cd qtsvg-opensource-src-5.2.1
  233. qmake
  234. make -j 2
  235. sudo make install
  236. touch build-done
  237. cd ..
  238. fi
  239. # ------------------------------------------------------------------------------------
  240. # python
  241. if [ ! -d Python-3.3.5 ]; then
  242. curl -O https://www.python.org/ftp/python/3.3.5/Python-3.3.5.tgz
  243. tar -xf Python-3.3.5.tgz
  244. fi
  245. if [ ! -f Python-3.3.5/build-done ]; then
  246. cd Python-3.3.5
  247. ./configure --prefix=$PREFIX
  248. make
  249. sudo make install
  250. touch build-done
  251. cd ..
  252. fi
  253. # ------------------------------------------------------------------------------------
  254. # sip
  255. if [ ! -d sip-4.15.5 ]; then
  256. curl -L http://sourceforge.net/projects/pyqt/files/sip/sip-4.15.5/sip-4.15.5.tar.gz -o sip-4.15.5.tar.gz
  257. tar -xf sip-4.15.5.tar.gz
  258. fi
  259. if [ ! -f sip-4.15.5/build-done ]; then
  260. cd sip-4.15.5
  261. python3 configure.py
  262. make
  263. sudo make install
  264. touch build-done
  265. cd ..
  266. fi
  267. # ------------------------------------------------------------------------------------
  268. # pyqt5
  269. if [ ! -d PyQt-gpl-5.2.1 ]; then
  270. curl -L http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.2.1/PyQt-gpl-5.2.1.tar.gz -o PyQt-gpl-5.2.1.tar.gz
  271. tar -xf PyQt-gpl-5.2.1.tar.gz
  272. fi
  273. if [ ! -f PyQt-gpl-5.2.1/build-done ]; then
  274. cd PyQt-gpl-5.2.1
  275. python3 configure.py --confirm-license
  276. make
  277. sudo make install
  278. touch build-done
  279. cd ..
  280. fi
  281. # ------------------------------------------------------------------------------------
  282. # cxfreeze
  283. if [ ! -d cx_Freeze-4.3.3 ]; then
  284. curl -L http://download.sourceforge.net/cx-freeze/cx_Freeze-4.3.3.tar.gz -o cx_Freeze-4.3.3.tar.gz
  285. tar -xf cx_Freeze-4.3.3.tar.gz
  286. fi
  287. if [ ! -f cx_Freeze-4.3.3/build-done ]; then
  288. cd cx_Freeze-4.3.3
  289. sed -i -e 's/"python%s.%s"/"python%s.%sm"/' setup.py
  290. python3 setup.py build
  291. sudo python3 setup.py install --prefix=$PREFIX
  292. touch build-done
  293. cd ..
  294. fi
  295. # ------------------------------------------------------------------------------------