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.

634 lines
22KB

  1. #!/bin/bash
  2. # NOTE: You need the following packages installed via MacPorts:
  3. # automake, autoconf, cmake, libtool, p7zip, pkgconfig, aria2
  4. # ---------------------------------------------------------------------------------------------------------------------
  5. # stop on error
  6. set -e
  7. # ---------------------------------------------------------------------------------------------------------------------
  8. # cd to correct path
  9. if [ -f Makefile ]; then
  10. cd data/macos
  11. fi
  12. # ---------------------------------------------------------------------------------------------------------------------
  13. # set variables
  14. export DEPS_NEW=1
  15. source common.env
  16. # ---------------------------------------------------------------------------------------------------------------------
  17. # function to remove old stuff
  18. cleanup()
  19. {
  20. rm -rf $TARGETDIR/carla/ $TARGETDIR/carla32/ $TARGETDIR/carla64/
  21. rm -rf cx_Freeze-*
  22. rm -rf Python-*
  23. rm -rf PyQt-*
  24. rm -rf PyQt5_*
  25. rm -rf file-*
  26. rm -rf flac-*
  27. rm -rf fltk-*
  28. rm -rf fluidsynth-*
  29. rm -rf fftw-*
  30. rm -rf gettext-*
  31. rm -rf glib-*
  32. rm -rf libffi-*
  33. rm -rf liblo-*
  34. rm -rf libogg-*
  35. rm -rf libsndfile-*
  36. rm -rf libvorbis-*
  37. rm -rf mxml-*
  38. rm -rf pkg-config-*
  39. rm -rf pyliblo-*
  40. rm -rf qtbase-*
  41. rm -rf qtmacextras-*
  42. rm -rf qtsvg-*
  43. rm -rf sip-*
  44. rm -rf zlib-*
  45. rm -rf PaxHeaders.*
  46. }
  47. # ---------------------------------------------------------------------------------------------------------------------
  48. # function to build base libs
  49. build_base()
  50. {
  51. export CC=clang
  52. export CXX=clang++
  53. export PREFIX=${TARGETDIR}/carla${ARCH}
  54. export PATH=${PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  55. export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
  56. export CFLAGS="-O3 -mtune=generic -msse -msse2 -fvisibility=hidden -fdata-sections -ffunction-sections"
  57. export CFLAGS="${CFLAGS} -fPIC -DPIC -DNDEBUG -I${PREFIX}/include -mmacosx-version-min=10.12"
  58. export LDFLAGS="-fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs"
  59. export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib -stdlib=libc++"
  60. if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  61. export CFLAGS="${CFLAGS} -arch x86_64 -arch arm64 -Wno-unused-command-line-argument"
  62. export LDFLAGS="${LDFLAGS} -arch x86_64 -arch arm64"
  63. else
  64. export CFLAGS="${CFLAGS} -mfpmath=sse -m${ARCH}"
  65. export LDFLAGS="${LDFLAGS} -m${ARCH}"
  66. fi
  67. export CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden -std=gnu++11 -stdlib=libc++"
  68. # ---------------------------------------------------------------------------------------------------------------------
  69. # pkgconfig
  70. if [ ! -d pkg-config-${PKG_CONFIG_VERSION} ]; then
  71. curl -O https://pkg-config.freedesktop.org/releases/pkg-config-${PKG_CONFIG_VERSION}.tar.gz
  72. tar -xf pkg-config-${PKG_CONFIG_VERSION}.tar.gz
  73. fi
  74. if [ ! -f pkg-config-${PKG_CONFIG_VERSION}_$ARCH/build-done ]; then
  75. cp -r pkg-config-${PKG_CONFIG_VERSION} pkg-config-${PKG_CONFIG_VERSION}_$ARCH
  76. cd pkg-config-${PKG_CONFIG_VERSION}_$ARCH
  77. ./configure --enable-indirect-deps --with-internal-glib --with-pc-path=$PKG_CONFIG_PATH --prefix=${PREFIX}
  78. make ${MAKE_ARGS}
  79. make install
  80. touch build-done
  81. cd ..
  82. fi
  83. # ---------------------------------------------------------------------------------------------------------------------
  84. # liblo
  85. if [ ! -d liblo-${LIBLO_VERSION} ]; then
  86. curl -L http://download.sourceforge.net/liblo/liblo-${LIBLO_VERSION}.tar.gz -o liblo-${LIBLO_VERSION}.tar.gz
  87. tar -xf liblo-${LIBLO_VERSION}.tar.gz
  88. fi
  89. if [ ! -f liblo-${LIBLO_VERSION}_$ARCH/build-done ]; then
  90. cp -r liblo-${LIBLO_VERSION} liblo-${LIBLO_VERSION}_$ARCH
  91. cd liblo-${LIBLO_VERSION}_$ARCH
  92. ./configure --enable-static --disable-shared --prefix=${PREFIX} \
  93. --enable-threads \
  94. --disable-examples --disable-tools
  95. make ${MAKE_ARGS}
  96. make install
  97. touch build-done
  98. cd ..
  99. fi
  100. # ---------------------------------------------------------------------------------------------------------------------
  101. if [ x"${ARCH}" = x"32" ]; then
  102. return
  103. fi
  104. # ---------------------------------------------------------------------------------------------------------------------
  105. # zlib
  106. if [ ! -d zlib-${ZLIB_VERSION} ]; then
  107. /opt/local/bin/aria2c https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz
  108. tar -xf zlib-${ZLIB_VERSION}.tar.gz
  109. fi
  110. if [ ! -f zlib-${ZLIB_VERSION}/build-done ]; then
  111. cd zlib-${ZLIB_VERSION}
  112. ./configure --static --prefix=${PREFIX}
  113. make
  114. make install
  115. touch build-done
  116. cd ..
  117. fi
  118. # ---------------------------------------------------------------------------------------------------------------------
  119. # file/magic
  120. if [ ! -d file-${FILE_VERSION} ]; then
  121. curl -O ftp://ftp.astron.com/pub/file/file-${FILE_VERSION}.tar.gz
  122. tar -xf file-${FILE_VERSION}.tar.gz
  123. fi
  124. if [ ! -f file-${FILE_VERSION}/build-done ]; then
  125. cd file-${FILE_VERSION}
  126. ./configure --enable-static --disable-shared --prefix=${PREFIX}
  127. make ${MAKE_ARGS}
  128. make install
  129. touch build-done
  130. cd ..
  131. fi
  132. # ---------------------------------------------------------------------------------------------------------------------
  133. # libogg
  134. if [ ! -d libogg-${LIBOGG_VERSION} ]; then
  135. curl -O https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz
  136. tar -xf libogg-${LIBOGG_VERSION}.tar.gz
  137. fi
  138. if [ ! -f libogg-${LIBOGG_VERSION}/build-done ]; then
  139. cd libogg-${LIBOGG_VERSION}
  140. sed -i -e 's/__MACH__/__MACH_SKIP__/' include/ogg/os_types.h
  141. ./configure --enable-static --disable-shared --prefix=${PREFIX}
  142. make ${MAKE_ARGS}
  143. make install
  144. touch build-done
  145. cd ..
  146. fi
  147. # ---------------------------------------------------------------------------------------------------------------------
  148. # libvorbis
  149. if [ ! -d libvorbis-${LIBVORBIS_VERSION} ]; then
  150. curl -O https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-${LIBVORBIS_VERSION}.tar.gz
  151. tar -xf libvorbis-${LIBVORBIS_VERSION}.tar.gz
  152. fi
  153. if [ ! -f libvorbis-${LIBVORBIS_VERSION}/build-done ]; then
  154. cd libvorbis-${LIBVORBIS_VERSION}
  155. ./configure --enable-static --disable-shared --prefix=${PREFIX}
  156. make ${MAKE_ARGS}
  157. make install
  158. touch build-done
  159. cd ..
  160. fi
  161. # ---------------------------------------------------------------------------------------------------------------------
  162. # flac
  163. if [ ! -d flac-${FLAC_VERSION} ]; then
  164. curl -O https://ftp.osuosl.org/pub/xiph/releases/flac/flac-${FLAC_VERSION}.tar.xz
  165. /opt/local/bin/7z x flac-${FLAC_VERSION}.tar.xz
  166. /opt/local/bin/7z x flac-${FLAC_VERSION}.tar
  167. fi
  168. if [ ! -f flac-${FLAC_VERSION}/build-done ]; then
  169. cd flac-${FLAC_VERSION}
  170. chmod +x configure install-sh
  171. ./configure --enable-static --disable-shared --prefix=${PREFIX} \
  172. --disable-cpplibs
  173. make ${MAKE_ARGS}
  174. make install
  175. touch build-done
  176. cd ..
  177. fi
  178. # ---------------------------------------------------------------------------------------------------------------------
  179. # libsndfile
  180. if [ ! -d libsndfile-${LIBSNDFILE_VERSION} ]; then
  181. curl -O http://www.mega-nerd.com/libsndfile/files/libsndfile-${LIBSNDFILE_VERSION}.tar.gz
  182. tar -xf libsndfile-${LIBSNDFILE_VERSION}.tar.gz
  183. fi
  184. if [ ! -f libsndfile-${LIBSNDFILE_VERSION}/build-done ]; then
  185. cd libsndfile-${LIBSNDFILE_VERSION}
  186. ./configure --enable-static --disable-shared --prefix=${PREFIX} \
  187. --disable-full-suite --disable-alsa --disable-sqlite
  188. make ${MAKE_ARGS}
  189. make install
  190. touch build-done
  191. cd ..
  192. fi
  193. # ---------------------------------------------------------------------------------------------------------------------
  194. # glib
  195. if [ ! -d glib-${GLIB_VERSION} ]; then
  196. /opt/local/bin/aria2c http://caesar.ftp.acc.umu.se/pub/GNOME/sources/glib/${GLIB_MVERSION}/glib-${GLIB_VERSION}.tar.xz
  197. /opt/local/bin/7z x glib-${GLIB_VERSION}.tar.xz
  198. /opt/local/bin/7z x glib-${GLIB_VERSION}.tar
  199. fi
  200. if [ ! -f glib-${GLIB_VERSION}/build-done ]; then
  201. cd glib-${GLIB_VERSION}
  202. if [ ! -f patched ]; then
  203. patch -p1 -i ../../patches/glib_skip-gettext.patch
  204. rm m4macros/glib-gettext.m4
  205. touch patched
  206. fi
  207. chmod +x autogen.sh configure install-sh
  208. env PATH=/opt/local/bin:$PATH ./autogen.sh
  209. env PATH=/opt/local/bin:$PATH LDFLAGS="-L${PREFIX}/lib -m${ARCH}" \
  210. ./configure --enable-static --disable-shared --prefix=${PREFIX}
  211. env PATH=/opt/local/bin:$PATH make ${MAKE_ARGS} -k || true
  212. touch gio/gio-querymodules gio/glib-compile-resources gio/gsettings gio/gdbus gio/gresource gio/gapplication
  213. touch gobject/gobject-query tests/gobject/performance tests/gobject/performance-threaded
  214. env PATH=/opt/local/bin:$PATH make
  215. touch ${PREFIX}/bin/gtester-report
  216. env PATH=/opt/local/bin:$PATH make install
  217. touch build-done
  218. cd ..
  219. fi
  220. # ---------------------------------------------------------------------------------------------------------------------
  221. # fluidsynth
  222. if [ ! -d fluidsynth-${FLUIDSYNTH_VERSION} ]; then
  223. /opt/local/bin/aria2c https://github.com/FluidSynth/fluidsynth/archive/v${FLUIDSYNTH_VERSION}.tar.gz
  224. tar -xf fluidsynth-${FLUIDSYNTH_VERSION}.tar.gz
  225. fi
  226. if [ ! -f fluidsynth-${FLUIDSYNTH_VERSION}/build-done ]; then
  227. cd fluidsynth-${FLUIDSYNTH_VERSION}
  228. if [ ! -f patched ]; then
  229. patch -p1 -i ../../patches/fluidsynth-skip-drivers-build.patch
  230. touch patched
  231. fi
  232. sed -i -e 's/_init_lib_suffix "64"/_init_lib_suffix ""/' CMakeLists.txt
  233. /opt/local/bin/cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DBUILD_SHARED_LIBS=OFF \
  234. -Denable-debug=OFF -Denable-profiling=OFF -Denable-ladspa=OFF -Denable-fpe-check=OFF -Denable-portaudio=OFF \
  235. -Denable-trap-on-fpe=OFF -Denable-aufile=OFF -Denable-dbus=OFF -Denable-ipv6=OFF -Denable-jack=OFF \
  236. -Denable-midishare=OFF -Denable-oss=OFF -Denable-pulseaudio=OFF -Denable-readline=OFF -Denable-ladcca=OFF \
  237. -Denable-lash=OFF -Denable-alsa=OFF -Denable-coreaudio=OFF -Denable-coremidi=OFF -Denable-framework=OFF \
  238. -Denable-floats=ON
  239. make ${MAKE_ARGS} -k || true
  240. touch src/fluidsynth
  241. make
  242. make install
  243. sed -i -e "s|-lfluidsynth|-lfluidsynth -lglib-2.0 -lgthread-2.0 -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lpthread -lm -liconv|" ${PREFIX}/lib/pkgconfig/fluidsynth.pc
  244. touch build-done
  245. cd ..
  246. fi
  247. # ---------------------------------------------------------------------------------------------------------------------
  248. # mxml
  249. if [ ! -d mxml-${MXML_VERSION} ]; then
  250. /opt/local/bin/aria2c https://github.com/michaelrsweet/mxml/releases/download/v${MXML_VERSION}/mxml-${MXML_VERSION}.tar.gz
  251. tar -xf mxml-${MXML_VERSION}.tar.gz
  252. fi
  253. if [ ! -f mxml-${MXML_VERSION}/build-done ]; then
  254. cd mxml-${MXML_VERSION}
  255. ./configure --disable-shared --prefix=${PREFIX}
  256. make libmxml.a
  257. cp *.a ${PREFIX}/lib/
  258. cp *.pc ${PREFIX}/lib/pkgconfig/
  259. cp mxml.h ${PREFIX}/include/
  260. touch build-done
  261. cd ..
  262. fi
  263. # ---------------------------------------------------------------------------------------------------------------------
  264. # fftw3 (needs to be last as it modifies C[XX]FLAGS)
  265. if [ ! -d fftw-${FFTW3_VERSION} ]; then
  266. curl -O http://www.fftw.org/fftw-${FFTW3_VERSION}.tar.gz
  267. tar -xf fftw-${FFTW3_VERSION}.tar.gz
  268. fi
  269. if [ ! -f fftw-${FFTW3_VERSION}/build-done ]; then
  270. export CFLAGS="${CFLAGS} -ffast-math"
  271. export CXXFLAGS="${CXXFLAGS} -ffast-math"
  272. cd fftw-${FFTW3_VERSION}
  273. if [ "${MACOS_UNIVERSAL}" -eq 0 ]; then
  274. FFTW_EXTRAFLAGS="--enable-sse2"
  275. fi
  276. ./configure --enable-static ${FFTW_EXTRAFLAGS} --disable-shared --disable-debug --prefix=${PREFIX}
  277. make
  278. make install
  279. make clean
  280. if [ "${MACOS_UNIVERSAL}" -eq 0 ]; then
  281. FFTW_EXTRAFLAGS="${FFTW_EXTRAFLAGS} --enable-sse"
  282. fi
  283. ./configure --enable-static ${FFTW_EXTRAFLAGS} --enable-single --disable-shared --disable-debug --prefix=${PREFIX}
  284. make
  285. make install
  286. make clean
  287. touch build-done
  288. cd ..
  289. fi
  290. }
  291. # ---------------------------------------------------------------------------------------------------------------------
  292. # build base libs
  293. # cleanup
  294. if [ $(clang -v 2>&1 | grep version | cut -d' ' -f4 | cut -d'.' -f1) -lt 11 ]; then
  295. export ARCH=32
  296. build_base
  297. fi
  298. export ARCH=64
  299. build_base
  300. # ---------------------------------------------------------------------------------------------------------------------
  301. # set flags for qt stuff
  302. export PREFIX=${TARGETDIR}/carla
  303. export PATH=${PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  304. export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
  305. export PKG_CONFIG=${TARGETDIR}/carla64/bin/pkg-config
  306. export CFLAGS="-O3 -mtune=generic -msse -msse2 -fPIC -DPIC -DNDEBUG -I${PREFIX}/include -mmacosx-version-min=10.12"
  307. export LDFLAGS="-L${PREFIX}/lib -stdlib=libc++"
  308. if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  309. export CFLAGS="${CFLAGS} -arch x86_64 -arch arm64 -Wno-unused-command-line-argument"
  310. export LDFLAGS="${LDFLAGS} -arch x86_64 -arch arm64"
  311. else
  312. export CFLAGS="${CFLAGS} -mfpmath=sse -m${ARCH}"
  313. export LDFLAGS="${LDFLAGS} -m${ARCH}"
  314. fi
  315. export CXXFLAGS="${CFLAGS} -std=gnu++11 -stdlib=libc++"
  316. export MAKE=/usr/bin/make
  317. # ---------------------------------------------------------------------------------------------------------------------
  318. # qt5-base download
  319. if [ ! -d qtbase-everywhere-src-${QT5_VERSION} ]; then
  320. curl -L http://download.qt.io/archive/qt/${QT5_MVERSION}/${QT5_VERSION}/submodules/qtbase-everywhere-src-${QT5_VERSION}.tar.xz -o qtbase-everywhere-src-${QT5_VERSION}.tar.xz
  321. /opt/local/bin/7z x qtbase-everywhere-src-${QT5_VERSION}.tar.xz
  322. /opt/local/bin/7z x qtbase-everywhere-src-${QT5_VERSION}.tar
  323. fi
  324. # ---------------------------------------------------------------------------------------------------------------------
  325. # qt5-base (64bit, shared, framework)
  326. if [ ! -f qtbase-everywhere-src-${QT5_VERSION}/build-done ]; then
  327. cd qtbase-everywhere-src-${QT5_VERSION}
  328. if [ ! -f configured ]; then
  329. sed -i -e "s/QT_MAC_SDK_VERSION_MIN = 10.13/QT_MAC_SDK_VERSION_MIN = 10.12/" mkspecs/common/macx.conf
  330. if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  331. sed -i -e "s/QMAKE_APPLE_DEVICE_ARCHS = x86_64/QMAKE_APPLE_DEVICE_ARCHS = arm64 x86_64/" mkspecs/common/macx.conf
  332. QT5_EXTRAFLAGS="-no-sse2"
  333. else
  334. QT5_EXTRAFLAGS="-sse2"
  335. fi
  336. chmod +x configure
  337. ./configure -release -shared -opensource -confirm-license -platform macx-clang -framework \
  338. -prefix ${PREFIX} -plugindir ${PREFIX}/lib/qt5/plugins -headerdir ${PREFIX}/include/qt5 \
  339. -pkg-config -force-pkg-config -strip \
  340. ${QT5_EXTRAFLAGS} -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-avx512 \
  341. -no-mips_dsp -no-mips_dspr2 \
  342. -no-pch -pkg-config \
  343. -make libs -make tools \
  344. -nomake examples -nomake tests \
  345. -no-compile-examples \
  346. -gui -widgets \
  347. -no-dbus \
  348. -no-glib -qt-pcre \
  349. -no-journald -no-syslog -no-slog2 \
  350. -no-openssl -no-securetransport -no-sctp -no-libproxy \
  351. -no-cups -no-fontconfig -qt-freetype -no-harfbuzz -no-gtk -opengl desktop -qpa cocoa \
  352. -no-directfb -no-eglfs -no-xcb -no-xcb-xlib \
  353. -no-evdev -no-libinput -no-mtdev \
  354. -no-gif -no-ico -qt-libpng -qt-libjpeg \
  355. -qt-sqlite
  356. touch configured
  357. fi
  358. make ${MAKE_ARGS}
  359. make install
  360. ln -s ${PREFIX}/lib/QtCore.framework/Headers ${PREFIX}/include/qt5/QtCore
  361. ln -s ${PREFIX}/lib/QtGui.framework/Headers ${PREFIX}/include/qt5/QtGui
  362. ln -s ${PREFIX}/lib/QtWidgets.framework/Headers ${PREFIX}/include/qt5/QtWidgets
  363. touch build-done
  364. cd ..
  365. fi
  366. # ---------------------------------------------------------------------------------------------------------------------
  367. # qt5-mac-extras
  368. if [ ! -d qtmacextras-everywhere-src-${QT5_VERSION} ]; then
  369. curl -L http://download.qt.io/archive/qt/${QT5_MVERSION}/${QT5_VERSION}/submodules/qtmacextras-everywhere-src-${QT5_VERSION}.tar.xz -o qtmacextras-everywhere-src-${QT5_VERSION}.tar.xz
  370. /opt/local/bin/7z x qtmacextras-everywhere-src-${QT5_VERSION}.tar.xz
  371. /opt/local/bin/7z x qtmacextras-everywhere-src-${QT5_VERSION}.tar
  372. fi
  373. if [ ! -f qtmacextras-everywhere-src-${QT5_VERSION}/build-done ]; then
  374. cd qtmacextras-everywhere-src-${QT5_VERSION}
  375. qmake
  376. make ${MAKE_ARGS}
  377. make install
  378. touch build-done
  379. cd ..
  380. fi
  381. # ---------------------------------------------------------------------------------------------------------------------
  382. # qt5-svg
  383. if [ ! -d qtsvg-everywhere-src-${QT5_VERSION} ]; then
  384. curl -L http://download.qt.io/archive/qt/${QT5_MVERSION}/${QT5_VERSION}/submodules/qtsvg-everywhere-src-${QT5_VERSION}.tar.xz -o qtsvg-everywhere-src-${QT5_VERSION}.tar.xz
  385. /opt/local/bin/7z x qtsvg-everywhere-src-${QT5_VERSION}.tar.xz
  386. /opt/local/bin/7z x qtsvg-everywhere-src-${QT5_VERSION}.tar
  387. fi
  388. if [ ! -f qtsvg-everywhere-src-${QT5_VERSION}/build-done ]; then
  389. cd qtsvg-everywhere-src-${QT5_VERSION}
  390. qmake
  391. make ${MAKE_ARGS}
  392. make install
  393. touch build-done
  394. cd ..
  395. fi
  396. # ---------------------------------------------------------------------------------------------------------------------
  397. # python
  398. if [ ! -d Python-${PYTHON_VERSION} ]; then
  399. /opt/local/bin/aria2c https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
  400. tar -xf Python-${PYTHON_VERSION}.tgz
  401. fi
  402. if [ ! -f Python-${PYTHON_VERSION}/build-done ]; then
  403. cd Python-${PYTHON_VERSION}
  404. if [ "${MACOS_UNIVERSAL}" -ne 1 ]; then
  405. sed -i -e "s/#zlib zlibmodule.c/zlib zlibmodule.c/" Modules/Setup.dist
  406. fi
  407. ./configure --prefix=${PREFIX} ${PYTHON_EXTRAFLAGS} --enable-optimizations --enable-shared
  408. make
  409. make install
  410. touch build-done
  411. cd ..
  412. fi
  413. # ---------------------------------------------------------------------------------------------------------------------
  414. # sip
  415. if [ ! -d sip-${SIP_VERSION} ]; then
  416. /opt/local/bin/aria2c https://files.kde.org/krita/build/dependencies/sip-${SIP_VERSION}.tar.gz
  417. tar -xf sip-${SIP_VERSION}.tar.gz
  418. fi
  419. if [ ! -f sip-${SIP_VERSION}/build-done ]; then
  420. cd sip-${SIP_VERSION}
  421. python3 configure.py --sip-module PyQt5.sip
  422. make ${MAKE_ARGS} CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LIBS="${LDFLAGS}"
  423. make install
  424. touch build-done
  425. cd ..
  426. fi
  427. # ---------------------------------------------------------------------------------------------------------------------
  428. # pyqt5
  429. if [ ! -d PyQt5_gpl-${PYQT5_VERSION} ]; then
  430. /opt/local/bin/aria2c https://files.kde.org/krita/build/dependencies/PyQt5_gpl-${PYQT5_VERSION}.tar.gz
  431. tar -xf PyQt5_gpl-${PYQT5_VERSION}.tar.gz
  432. fi
  433. if [ ! -f PyQt5_gpl-${PYQT5_VERSION}/build-done ]; then
  434. cd PyQt5_gpl-${PYQT5_VERSION}
  435. python3 configure.py --concatenate --confirm-license -c
  436. make ${MAKE_ARGS}
  437. make install
  438. touch build-done
  439. cd ..
  440. fi
  441. # ---------------------------------------------------------------------------------------------------------------------
  442. # pyliblo
  443. if [ ! -d pyliblo-${PYLIBLO_VERSION} ]; then
  444. /opt/local/bin/aria2c http://das.nasophon.de/download/pyliblo-${PYLIBLO_VERSION}.tar.gz
  445. tar -xf pyliblo-${PYLIBLO_VERSION}.tar.gz
  446. fi
  447. if [ ! -f pyliblo-${PYLIBLO_VERSION}/build-done ]; then
  448. cd pyliblo-${PYLIBLO_VERSION}
  449. if [ ! -f patched ]; then
  450. patch -p1 -i ../../patches/pyliblo-python3.7.patch
  451. touch patched
  452. fi
  453. env CFLAGS="${CFLAGS} -I${TARGETDIR}/carla64/include" LDFLAGS="${LDFLAGS} -L${TARGETDIR}/carla64/lib" \
  454. python3 setup.py build
  455. python3 setup.py install --prefix=${PREFIX}
  456. touch build-done
  457. cd ..
  458. fi
  459. # ---------------------------------------------------------------------------------------------------------------------
  460. # setuptools-scm
  461. if [ ! -d setuptools_scm-${SETUPTOOLS_SCM_VERSION} ]; then
  462. /opt/local/bin/aria2c https://files.pythonhosted.org/packages/ed/b6/979bfa7b81878b2b4475dde092aac517e7f25dd33661796ec35664907b31/setuptools_scm-${SETUPTOOLS_SCM_VERSION}.tar.gz
  463. tar -xf setuptools_scm-${SETUPTOOLS_SCM_VERSION}.tar.gz
  464. fi
  465. if [ ! -f setuptools_scm-${SETUPTOOLS_SCM_VERSION}/build-done ]; then
  466. cd setuptools_scm-${SETUPTOOLS_SCM_VERSION}
  467. python3 setup.py build
  468. python3 setup.py install --prefix=${PREFIX}
  469. touch build-done
  470. cd ..
  471. fi
  472. # ---------------------------------------------------------------------------------------------------------------------
  473. # toml
  474. if [ ! -d toml-${TOML_VERSION} ]; then
  475. /opt/local/bin/aria2c https://files.pythonhosted.org/packages/be/ba/1f744cdc819428fc6b5084ec34d9b30660f6f9daaf70eead706e3203ec3c/toml-${TOML_VERSION}.tar.gz
  476. tar -xf toml-${TOML_VERSION}.tar.gz
  477. fi
  478. if [ ! -f toml-${TOML_VERSION}/build-done ]; then
  479. cd toml-${TOML_VERSION}
  480. python3 setup.py build
  481. python3 setup.py install --prefix=${PREFIX}
  482. touch build-done
  483. cd ..
  484. fi
  485. # ---------------------------------------------------------------------------------------------------------------------
  486. # zipp
  487. if [ ! -d zipp-${ZIPP_VERSION} ]; then
  488. /opt/local/bin/aria2c https://files.pythonhosted.org/packages/ce/b0/757db659e8b91cb3ea47d90350d7735817fe1df36086afc77c1c4610d559/zipp-${ZIPP_VERSION}.tar.gz
  489. tar -xf zipp-${ZIPP_VERSION}.tar.gz
  490. fi
  491. if [ ! -f zipp-${ZIPP_VERSION}/build-done ]; then
  492. cd zipp-${ZIPP_VERSION}
  493. python3 setup.py build
  494. python3 setup.py install --prefix=${PREFIX}
  495. touch build-done
  496. cd ..
  497. fi
  498. # ---------------------------------------------------------------------------------------------------------------------
  499. # importlib_metadata
  500. if [ ! -d importlib_metadata-${IMPORTLIB_METADATA_VERSION} ]; then
  501. /opt/local/bin/aria2c https://files.pythonhosted.org/packages/3f/a8/16dc098b0addd1c20719c18a86e985be851b3ec1e103e703297169bb22cc/importlib_metadata-${IMPORTLIB_METADATA_VERSION}.tar.gz
  502. tar -xf importlib_metadata-${IMPORTLIB_METADATA_VERSION}.tar.gz
  503. fi
  504. if [ ! -f importlib_metadata-${IMPORTLIB_METADATA_VERSION}/build-done ]; then
  505. cd importlib_metadata-${IMPORTLIB_METADATA_VERSION}
  506. python3 setup.py build
  507. python3 setup.py install --prefix=${PREFIX}
  508. touch build-done
  509. cd ..
  510. fi
  511. # ---------------------------------------------------------------------------------------------------------------------
  512. # cxfreeze
  513. if [ ! -d cx_Freeze-${CXFREEZE_VERSION} ]; then
  514. /opt/local/bin/aria2c https://github.com/anthony-tuininga/cx_Freeze/archive/${CXFREEZE_VERSION}.tar.gz
  515. tar -xf cx_Freeze-${CXFREEZE_VERSION}.tar.gz
  516. fi
  517. if [ ! -f cx_Freeze-${CXFREEZE_VERSION}/build-done ]; then
  518. cd cx_Freeze-${CXFREEZE_VERSION}
  519. sed -i -e 's/, use_builtin_types=False//' cx_Freeze/macdist.py
  520. sed -i -e 's/"python%s.%s"/"python%s.%sm"/' setup.py
  521. sed -i -e 's/extra_postargs=extraArgs,/extra_postargs=extraArgs+os.getenv("LDFLAGS").split(),/' setup.py
  522. python3 setup.py build
  523. python3 setup.py install --prefix=${PREFIX}
  524. touch build-done
  525. cd ..
  526. fi
  527. # ---------------------------------------------------------------------------------------------------------------------