From 9168fd8ba3769e06a6236f771188d087d3a25e1f Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 21 May 2013 00:19:56 +0100 Subject: [PATCH] MacOS build script and fixes --- data/macos/build.sh | 53 +++++++++++++++++++ .../backend/engine/rtaudio-4.0.12/RtAudio.cpp | 2 + source/backend/native/lfo.c | 2 +- source/backend/standalone/Makefile | 2 +- source/carla.py | 6 +-- 5 files changed, 60 insertions(+), 5 deletions(-) create mode 100755 data/macos/build.sh diff --git a/data/macos/build.sh b/data/macos/build.sh new file mode 100755 index 000000000..50310bde6 --- /dev/null +++ b/data/macos/build.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +set -e + +JOBS="-j 2" + +if [ ! -f Makefile ]; then + cd ../.. +fi + +export CC="gcc-mp-4.7" +export CXX="g++-mp-4.7" +export LDFLAGS="-L/usr/local/lib/" +export PYUIC="pyuic4-3.3" +export PYRCC="pyrcc4-3.3 -py3" + +# Clean build +make clean + +# Build PyQt4 resources +make $JOBS UI RES WIDGETS + +# Build discovery +make $JOBS -C source/discovery MACOS=true + +# Build backend +make $JOBS -C source/backend/standalone ../libcarla_standalone.dylib EXTRA_LIBS="-ldl" MACOS=true +# DGL_LIBS="-framework OpenGL -framework Cocoa" HAVE_OPENGL=true + +rm -rf ./data/macos/build + +# Build Mac App +# cd data/macos +# python3.3 setup.py build +# cxfreeze-3.3 --target-dir=./data/macos/Carla ./source/carla.py --include-modules=re,sip + +# mkdir build/backend +# mkdir build/bridges +# mkdir build/discovery +# cp ../../source/backend/*.dylib build/backend/ +# cp ../../source/discovery/carla-discovery-* build/discovery/ + +# cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Carla/ +# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/ +# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Carla/ +# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Carla/ +# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Carla/ +# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Carla/ +# cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Carla/ +# cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Carla/ + +# cd ../.. + diff --git a/source/backend/engine/rtaudio-4.0.12/RtAudio.cpp b/source/backend/engine/rtaudio-4.0.12/RtAudio.cpp index 7f343ca5c..ab3e71fa4 100644 --- a/source/backend/engine/rtaudio-4.0.12/RtAudio.cpp +++ b/source/backend/engine/rtaudio-4.0.12/RtAudio.cpp @@ -403,6 +403,8 @@ unsigned int RtApi :: getStreamSampleRate( void ) #if defined(__MACOSX_CORE__) +#include + // The OS X CoreAudio API is designed to use a separate callback // procedure for each of its audio devices. A single RtAudio duplex // stream using two different devices is supported here, though it diff --git a/source/backend/native/lfo.c b/source/backend/native/lfo.c index dd39971b1..e82a9b4e4 100644 --- a/source/backend/native/lfo.c +++ b/source/backend/native/lfo.c @@ -21,7 +21,7 @@ #include #include -#ifdef __MINGW32__ +#ifndef __linux__ # define uint unsigned int #endif diff --git a/source/backend/standalone/Makefile b/source/backend/standalone/Makefile index ec57e4851..589d986fd 100644 --- a/source/backend/standalone/Makefile +++ b/source/backend/standalone/Makefile @@ -135,7 +135,7 @@ debug: $(CXX) $^ -shared $(LINK_FLAGS) $(W32_LIBS) -Wl,--output-def,$@.def -o $@ && $(STRIP) $@ ../libcarla_standalone.dylib: $(OBJS) $(LIBS) - $(CXX) $^ -dynamiclib $(LINK_FLAGS) -o $@ && $(STRIP) $@ + $(CXX) $^ -dynamiclib $(LINK_FLAGS) -framework CoreAudio -framework CoreMidi -framework CoreFoundation -o $@ ../libcarla_standalone.so: $(OBJS) $(LIBS) $(CXX) $^ -shared $(LINK_FLAGS) -o $@ && $(STRIP) $@ diff --git a/source/carla.py b/source/carla.py index 64f82ebba..e97d2879a 100755 --- a/source/carla.py +++ b/source/carla.py @@ -685,9 +685,6 @@ class CarlaMainW(QMainWindow): self.ui = ui_carla.Ui_CarlaMainW() self.ui.setupUi(self) - if MACOS: - self.setUnifiedTitleAndToolBarOnMac(True) - # ------------------------------------------------------------- # Internal stuff @@ -2051,6 +2048,9 @@ class CarlaMainW(QMainWindow): } """ % (col1, col2)) + if MACOS and not settings.value("Main/UseProTheme", True, type=bool): + self.setUnifiedTitleAndToolBarOnMac(True) + useCustomMiniCanvasPaint = bool(settings.value("Main/UseProTheme", True, type=bool) and settings.value("Main/ProThemeColor", "Black", type=str) == "Black")