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.

339 lines
11KB

  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/linux
  9. fi
  10. # ------------------------------------------------------------------------------------
  11. # Use gcc 4.8
  12. export CC=gcc-4.8
  13. export CXX=g++-4.8
  14. # ------------------------------------------------------------------------------------
  15. # function to build base libs
  16. build_base()
  17. {
  18. export CFLAGS="-O2 -mtune=generic -msse -msse2 -m$ARCH -fPIC -DPIC"
  19. export CXXFLAGS=$CFLAGS
  20. export LDFLAGS="-m$ARCH"
  21. export PREFIX=/opt/carla$ARCH
  22. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin
  23. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  24. # ------------------------------------------------------------------------------------
  25. # pkgconfig
  26. if [ ! -d pkg-config-0.28 ]; then
  27. aria2c http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
  28. tar -xf pkg-config-0.28.tar.gz
  29. fi
  30. if [ ! -f pkg-config-0.28_$ARCH/build-done ]; then
  31. cp -r pkg-config-0.28 pkg-config-0.28_$ARCH
  32. cd pkg-config-0.28_$ARCH
  33. ./configure --enable-indirect-deps --with-internal-glib --with-pc-path=$PKG_CONFIG_PATH --prefix=$PREFIX
  34. make
  35. sudo make install
  36. touch build-done
  37. cd ..
  38. fi
  39. # ------------------------------------------------------------------------------------
  40. # zlib
  41. if [ ! -d zlib-1.2.8 ]; then
  42. aria2c http://zlib.net/zlib-1.2.8.tar.gz
  43. tar -xf zlib-1.2.8.tar.gz
  44. fi
  45. if [ ! -f zlib-1.2.8_$ARCH/build-done ]; then
  46. cp -r zlib-1.2.8 zlib-1.2.8_$ARCH
  47. cd zlib-1.2.8_$ARCH
  48. ./configure --static --prefix=$PREFIX
  49. make
  50. sudo make install
  51. touch build-done
  52. cd ..
  53. fi
  54. # ------------------------------------------------------------------------------------
  55. # liblo
  56. if [ ! -d liblo-0.28 ]; then
  57. aria2c http://download.sourceforge.net/liblo/liblo-0.28.tar.gz
  58. tar -xf liblo-0.28.tar.gz
  59. fi
  60. if [ ! -f liblo-0.28_$ARCH/build-done ]; then
  61. cp -r liblo-0.28 liblo-0.28_$ARCH
  62. cd liblo-0.28_$ARCH
  63. ./configure --enable-static --disable-shared --prefix=$PREFIX
  64. make
  65. sudo make install
  66. touch build-done
  67. cd ..
  68. fi
  69. # ------------------------------------------------------------------------------------
  70. # mxml
  71. if [ ! -d mxml-2.8 ]; then
  72. aria2c http://www.msweet.org/files/project3/mxml-2.8.tar.gz
  73. tar -xf mxml-2.8.tar.gz
  74. fi
  75. if [ ! -f mxml-2.8_$ARCH/build-done ]; then
  76. cp -r mxml-2.8 mxml-2.8_$ARCH
  77. cd mxml-2.8_$ARCH
  78. ./configure --enable-static --disable-shared --prefix=$PREFIX
  79. make
  80. sudo cp *.a $PREFIX/lib/
  81. sudo cp *.pc $PREFIX/lib/pkgconfig/
  82. sudo cp mxml.h $PREFIX/include/
  83. touch build-done
  84. cd ..
  85. fi
  86. # ------------------------------------------------------------------------------------
  87. # fftw3
  88. if [ ! -d fftw-3.3.4 ]; then
  89. aria2c http://www.fftw.org/fftw-3.3.4.tar.gz
  90. tar -xf fftw-3.3.4.tar.gz
  91. fi
  92. if [ ! -f fftw-3.3.4_$ARCH/build-done ]; then
  93. export CFLAGS="-O2 -mtune=generic -msse -msse2 -ffast-math -mfpmath=sse -m$ARCH -fPIC -DPIC"
  94. export CXXFLAGS=$CFLAGS
  95. cp -r fftw-3.3.4 fftw-3.3.4_$ARCH
  96. cd fftw-3.3.4_$ARCH
  97. ./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=$PREFIX
  98. make
  99. sudo make install
  100. make clean
  101. ./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=$PREFIX
  102. make
  103. sudo make install
  104. make clean
  105. touch build-done
  106. cd ..
  107. fi
  108. }
  109. # ------------------------------------------------------------------------------------
  110. # build base libs
  111. export ARCH=32
  112. build_base
  113. export ARCH=64
  114. build_base
  115. # ------------------------------------------------------------------------------------
  116. # qt5-base download
  117. if [ ! -d qtbase-opensource-src-5.3.0 ]; then
  118. aria2c http://download.qt-project.org/official_releases/qt/5.3/5.3.0/submodules/qtbase-opensource-src-5.3.0.tar.xz
  119. tar -xf qtbase-opensource-src-5.3.0.tar.xz
  120. fi
  121. # ------------------------------------------------------------------------------------
  122. # qt5-base 32bit (minimal, static)
  123. if [ ! -f qtbase-opensource-src-5.3.0_32/build-done ]; then
  124. export CFLAGS="-O2 -mtune=generic -msse -msse2 -m32 -fPIC -DPIC"
  125. export CXXFLAGS=$CFLAGS
  126. export LDFLAGS="-m32"
  127. export PREFIX=/opt/carla32
  128. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin
  129. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  130. cp -r qtbase-opensource-src-5.3.0 qtbase-opensource-src-5.3.0_32
  131. cd qtbase-opensource-src-5.3.0_32
  132. export CFG_ARCH=i386
  133. export QMAKESPEC=linux-g++-32
  134. ./configure -release -static -opensource -confirm-license -force-pkg-config -platform linux-g++-32 \
  135. -prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
  136. -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl no \
  137. -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
  138. -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
  139. -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 \
  140. -no-audio-backend -no-qml-debug -no-separate-debug-info \
  141. -no-compile-examples -no-gui -no-widgets -nomake examples -nomake tests -nomake tools -make libs
  142. make -j 8
  143. sudo make install
  144. touch build-done
  145. cd ..
  146. fi
  147. # ------------------------------------------------------------------------------------
  148. # qt5-base 64bit (minimal, static)
  149. if [ ! -f qtbase-opensource-src-5.3.0_64/build-done ]; then
  150. export CFLAGS="-O2 -mtune=generic -msse -msse2 -m64 -fPIC -DPIC"
  151. export CXXFLAGS=$CFLAGS
  152. export LDFLAGS="-m64"
  153. export PREFIX=/opt/carla64
  154. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin
  155. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  156. cp -r qtbase-opensource-src-5.3.0 qtbase-opensource-src-5.3.0_64
  157. cd qtbase-opensource-src-5.3.0_64
  158. export CFG_ARCH=x86_64
  159. export QMAKESPEC=linux-g++-64
  160. ./configure -release -static -opensource -confirm-license -force-pkg-config -platform linux-g++-64 \
  161. -prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
  162. -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl no \
  163. -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
  164. -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
  165. -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 \
  166. -no-audio-backend -no-qml-debug -no-separate-debug-info \
  167. -no-compile-examples -no-gui -no-widgets -nomake examples -nomake tests -nomake tools -make libs
  168. make -j 8
  169. sudo make install
  170. touch build-done
  171. cd ..
  172. fi
  173. # ------------------------------------------------------------------------------------
  174. # set flags for qt stuff
  175. export CFLAGS="-O2 -mtune=generic -msse -msse2 -fPIC -DPIC"
  176. export CXXFLAGS=$CFLAGS
  177. export LDFLAGS=""
  178. export PREFIX=/opt/carla
  179. export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin
  180. export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
  181. export CFG_ARCH=x86_64
  182. export QMAKESPEC=linux-g++
  183. # ------------------------------------------------------------------------------------
  184. # qt5-base download (5.2.1 for now)
  185. if [ ! -d qtbase-opensource-src-5.2.1 ]; then
  186. aria2c http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtbase-opensource-src-5.2.1.tar.xz
  187. tar -xf qtbase-opensource-src-5.2.1.tar.xz
  188. fi
  189. # ------------------------------------------------------------------------------------
  190. # qt5-base (regular, shared)
  191. if [ ! -f qtbase-opensource-src-5.2.1/build-done ]; then
  192. cd qtbase-opensource-src-5.2.1
  193. ./configure -release -shared -opensource -confirm-license -force-pkg-config -platform linux-g++ \
  194. -prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
  195. -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-xcb -qt-xkbcommon -qt-zlib -opengl desktop -qpa xcb \
  196. -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev \
  197. -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-neon -no-mips_dsp -no-mips_dspr2 \
  198. -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 \
  199. -no-audio-backend -no-javascript-jit -no-qml-debug -no-rpath -no-separate-debug-info \
  200. -no-compile-examples -nomake examples -nomake tests -make libs -make tools
  201. make -j 8
  202. sudo make install
  203. # sudo cp src/plugins/platforms/xcb/xcb-static/libxcb-static.a $PREFIX/lib/qt5/plugins/platforms/
  204. # sudo sed "s?`pwd`/src/plugins/platforms/xcb/xcb-static?$PREFIX/lib/qt5/plugins/platforms?" -i $PREFIX/lib/qt5/plugins/platforms/libqxcb.prl
  205. touch build-done
  206. cd ..
  207. fi
  208. # ------------------------------------------------------------------------------------
  209. # qt5-svg
  210. if [ ! -d qtsvg-opensource-src-5.2.1 ]; then
  211. aria2c http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtsvg-opensource-src-5.2.1.tar.gz
  212. tar -xf qtsvg-opensource-src-5.2.1.tar.gz
  213. fi
  214. if [ ! -f qtsvg-opensource-src-5.2.1/build-done ]; then
  215. cd qtsvg-opensource-src-5.2.1
  216. qmake
  217. make -j 8
  218. sudo make install
  219. touch build-done
  220. cd ..
  221. fi
  222. # ------------------------------------------------------------------------------------
  223. # python
  224. if [ ! -d Python-3.3.5 ]; then
  225. aria2c https://www.python.org/ftp/python/3.3.5/Python-3.3.5.tgz
  226. tar -xf Python-3.3.5.tgz
  227. fi
  228. if [ ! -f Python-3.3.5/build-done ]; then
  229. cd Python-3.3.5
  230. ./configure --prefix=$PREFIX
  231. make
  232. sudo make install
  233. touch build-done
  234. cd ..
  235. fi
  236. # ------------------------------------------------------------------------------------
  237. # sip
  238. if [ ! -d sip-4.15.5 ]; then
  239. aria2c http://sourceforge.net/projects/pyqt/files/sip/sip-4.15.5/sip-4.15.5.tar.gz
  240. tar -xf sip-4.15.5.tar.gz
  241. fi
  242. if [ ! -f sip-4.15.5/build-done ]; then
  243. cd sip-4.15.5
  244. python3 configure.py
  245. make
  246. sudo make install
  247. touch build-done
  248. cd ..
  249. fi
  250. # ------------------------------------------------------------------------------------
  251. # pyqt5
  252. if [ ! -d PyQt-gpl-5.2.1 ]; then
  253. aria2c http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.2.1/PyQt-gpl-5.2.1.tar.gz
  254. tar -xf PyQt-gpl-5.2.1.tar.gz
  255. fi
  256. if [ ! -f PyQt-gpl-5.2.1/build-done ]; then
  257. cd PyQt-gpl-5.2.1
  258. python3 configure.py --confirm-license
  259. make
  260. sudo make install
  261. touch build-done
  262. cd ..
  263. fi
  264. # ------------------------------------------------------------------------------------
  265. # cxfreeze
  266. if [ ! -d cx_Freeze-4.3.3 ]; then
  267. aria2c http://download.sourceforge.net/cx-freeze/cx_Freeze-4.3.3.tar.gz
  268. tar -xf cx_Freeze-4.3.3.tar.gz
  269. fi
  270. if [ ! -f cx_Freeze-4.3.3/build-done ]; then
  271. cd cx_Freeze-4.3.3
  272. sed -i -e 's/"python%s.%s"/"python%s.%sm"/' setup.py
  273. sed -i -e 's/not vars.get("Py_ENABLE_SHARED", 0)/True/' setup.py
  274. python3 setup.py build
  275. sudo python3 setup.py install --prefix=$PREFIX
  276. touch build-done
  277. cd ..
  278. fi
  279. # ------------------------------------------------------------------------------------