Browse Source

More osx stuff

tags/1.9.4
falkTX 10 years ago
parent
commit
20ab636041
8 changed files with 183 additions and 93 deletions
  1. +139
    -64
      data/macos/build-deps.sh
  2. +28
    -15
      data/macos/build.sh
  3. +1
    -1
      data/macos/env-vars.sh
  4. +3
    -3
      source/Makefile.mk
  5. +2
    -2
      source/carla_settings.py
  6. +1
    -1
      source/modules/juce_audio_processors/AppConfig.h
  7. +2
    -0
      source/modules/theme/Makefile
  8. +7
    -7
      source/patchcanvas.py

+ 139
- 64
data/macos/build-deps.sh View File

@@ -128,8 +128,6 @@ touch build-done
cd ..
fi

# TODO - add qt (for 32bit and 64bit)

}

# ------------------------------------------------------------------------------------
@@ -141,82 +139,105 @@ build_base
export ARCH=64
build_base

# TODO
exit 0

# ------------------------------------------------------------------------------------
# python
# switch to clang for Qt5

if [ ! -d Python-3.3.5 ]; then
curl -O https://www.python.org/ftp/python/3.3.5/Python-3.3.5.tgz
tar -xf Python-3.3.5.tgz
fi

if [ ! -f Python-3.3.5/Makefile ]; then
cd Python-3.3.5
./configure --prefix=/opt/kxstudio
make
sudo make install
cd ..
fi
export CC=clang
export CXX=clang

# ------------------------------------------------------------------------------------
# cxfreeze
# qt5-base download

if [ ! -d cx_Freeze-4.3.3 ]; then
curl -L http://download.sourceforge.net/cx-freeze/cx_Freeze-4.3.3.tar.gz -o cx_Freeze-4.3.3.tar.gz
tar -xf cx_Freeze-4.3.3.tar.gz
if [ ! -d qtbase5-mac10.6 ]; then
/opt/local/bin/git clone git@github.com:falkTX/qtbase5-mac10.6.git --depth 1
fi

if [ ! -d cx_Freeze-4.3.3/build ]; then
cd cx_Freeze-4.3.3
python3 setup.py build
sudo python3 setup.py install --prefix=/opt/kxstudio
# ------------------------------------------------------------------------------------
# qt5-base 32bit (minimal, static)

if [ ! -f qtbase5-mac10.6_32/build-done ]; then
export CFLAGS="-O2 -mtune=generic -msse -msse2 -m32 -fPIC -DPIC"
export CXXFLAGS=$CFLAGS
export LDFLAGS="-m32"
export PREFIX=/opt/kxstudio32
export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
cp -r qtbase5-mac10.6 qtbase5-mac10.6_32
cd qtbase5-mac10.6_32
export CFG_ARCH=i386
export QMAKESPEC=macx-clang-32
./configure -release -static -opensource -confirm-license -force-pkg-config -platform macx-clang-32 \
-prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
-qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl no -qpa cocoa \
-no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
-no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
-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 \
-no-audio-backend -no-qml-debug -no-separate-debug-info \
-no-compile-examples -no-framework -no-gui -no-widgets -nomake examples -nomake tests -nomake tools -make libs
make -j 2
sudo make install
touch build-done
cd ..
fi

# ------------------------------------------------------------------------------------
# sip
# qt5-base 64bit (minimal, static)

if [ ! -d sip-4.15.5 ]; then
curl -L http://download.sourceforge.net/pyqt/sip-4.15.5.tar.gz -o sip-4.15.5.tar.gz
tar -xf sip-4.15.5.tar.gz
fi

if [ ! -f sip-4.15.5/Makefile ]; then
cd sip-4.15.5
python3 configure.py
make
if [ ! -f qtbase5-mac10.6_64/build-done ]; then
export CFLAGS="-O2 -mtune=generic -msse -msse2 -m64 -fPIC -DPIC"
export CXXFLAGS=$CFLAGS
export LDFLAGS="-m64"
export PREFIX=/opt/kxstudio64
export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
cp -r qtbase5-mac10.6 qtbase5-mac10.6_64
cd qtbase5-mac10.6_64
export CFG_ARCH=x86_64
export QMAKESPEC=macx-clang
./configure -release -shared -opensource -confirm-license -force-pkg-config -platform macx-clang \
-prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
-qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl no -qpa cocoa \
-no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
-no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
-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 \
-no-audio-backend -no-qml-debug -no-separate-debug-info \
-no-compile-examples -no-framework -no-gui -no-widgets -nomake examples -nomake tests -nomake tools -make libs
make -j 2
sudo make install
touch build-done
cd ..
fi

# ------------------------------------------------------------------------------------
# switch to clang for Qt

export CC=clang
export CXX=clang
# set flags for qt stuff

# ------------------------------------------------------------------------------------
# qt5-base
export CFLAGS="-O2 -mtune=generic -msse -msse2 -m64 -fPIC -DPIC"
export CXXFLAGS=$CFLAGS
export LDFLAGS="-m64"

if [ ! -d qtbase5-mac10.6 ]; then
/opt/local/bin/git clone git://github.com/falkTX/qtbase5-mac10.6 --depth 1
fi
export PREFIX=/opt/kxstudio
export PATH=$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

if [ ! -f qtbase5-mac10.6/bin/moc ]; then
cd qtbase5-mac10.6
export QMAKESPEC=macx-g++42
./configure -release -shared -opensource -confirm-license -force-pkg-config \
-prefix /opt/kxstudio -plugindir /opt/kxstudio/lib/qt5/plugins -headerdir /opt/kxstudio/include/qt5 \
-qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -no-framework -opengl desktop -qpa cocoa \
# ------------------------------------------------------------------------------------
# qt5-base (regular, 64bit, shared, framework)

if [ ! -f qtbase5-mac10.6_shared/build-done ]; then
cp -r qtbase5-mac10.6 qtbase5-mac10.6_shared
cd qtbase5-mac10.6_shared
export CFG_ARCH=x86_64
export QMAKESPEC=macx-clang
./configure -release -shared -opensource -confirm-license -no-pkg-config -platform macx-clang -framework \
-prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \
-qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -qt-sql-sqlite -qt-zlib -opengl desktop -qpa cocoa \
-no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \
-no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-neon -no-mips_dsp -no-mips_dspr2 \
-no-cups -no-dbus -no-fontconfig -no-harfbuzz -no-iconv -no-icu -no-gif -no-glib -no-nis -no-openssl -no-pch -no-sql-ibase -no-sql-odbc \
-no-audio-backend -no-javascript-jit -no-qml-debug -no-separate-debug-info \
-no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \
-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 \
-no-audio-backend -no-qml-debug -no-separate-debug-info \
-no-compile-examples -nomake examples -nomake tests -make libs -make tools
make -j 2
sudo make install
touch build-done
cd ..
fi

@@ -227,34 +248,88 @@ if [ ! -d qtsvg-opensource-src-5.3.0 ]; then
curl -O http://download.qt-project.org/official_releases/qt/5.3/5.3.0/submodules/qtsvg-opensource-src-5.3.0.tar.gz
fi

if [ ! -f qtsvg-opensource-src-5.3.0/xx ]; then
if [ ! -f qtsvg-opensource-src-5.3.0/build-done ]; then
cd qtsvg-opensource-src-5.3.0
exit 1
qmake
make -j 2
sudo make install
touch build-done
cd ..
fi

# ------------------------------------------------------------------------------------
# switch back to gcc
# python

export CC=gcc-4.2
export CXX=g++-4.2
if [ ! -d Python-3.3.5 ]; then
curl -O https://www.python.org/ftp/python/3.3.5/Python-3.3.5.tgz
tar -xf Python-3.3.5.tgz
fi

if [ ! -f Python-3.3.5/build-done ]; then
cd Python-3.3.5
./configure --prefix=$PREFIX
make
sudo make install
touch build-done
cd ..
fi

# ------------------------------------------------------------------------------------
# sip

if [ ! -d sip-4.16-snapshot-f6acb8ed7b65 ]; then
curl -O http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.16-snapshot-f6acb8ed7b65.tar.gz
tar -xf sip-4.16-snapshot-f6acb8ed7b65.tar.gz
fi

if [ ! -f sip-4.16-snapshot-f6acb8ed7b65/build-done ]; then
cd sip-4.16-snapshot-f6acb8ed7b65
python3 configure.py
make
sudo make install
touch build-done
cd ..
fi

# ------------------------------------------------------------------------------------
# pyqt5

if [ ! -d PyQt-gpl-5.2.1 ]; then
curl -L http://download.sourceforge.net/pyqt/PyQt-gpl-5.2.1.tar.gz -o PyQt-gpl-5.2.1.tar.gz
tar -xf PyQt-gpl-5.2.1.tar.gz
if [ ! -d PyQt-gpl-5.3-snapshot-f6e83c05f2a1 ]; then
curl -O http://www.riverbankcomputing.co.uk/static/Downloads/PyQt5/PyQt-gpl-5.3-snapshot-f6e83c05f2a1.tar.gz
tar -xf PyQt-gpl-5.3-snapshot-f6e83c05f2a1.tar.gz
fi

if [ ! -f PyQt-gpl-5.2.1/Makefile ]; then
cd PyQt-gpl-5.2.1
if [ ! -f PyQt-gpl-5.3-snapshot-f6e83c05f2a1/build-done ]; then
cd PyQt-gpl-5.3-snapshot-f6e83c05f2a1
python3 configure.py --confirm-license
make
sudo make install
touch build-done
cd ..
fi

exit 0

# ------------------------------------------------------------------------------------
# cxfreeze

if [ ! -d cx_Freeze-4.3.3 ]; then
curl -L http://download.sourceforge.net/cx-freeze/cx_Freeze-4.3.3.tar.gz -o cx_Freeze-4.3.3.tar.gz
tar -xf cx_Freeze-4.3.3.tar.gz
fi

if [ ! -d cx_Freeze-4.3.3/build-done ]; then
cd cx_Freeze-4.3.3
python3 setup.py build
sudo python3 setup.py install --prefix=$PREFIX
touch build-done
cd ..
fi

# ------------------------------------------------------------------------------------
# switch back to gcc

export CC=gcc
export CXX=g++

# ------------------------------------------------------------------------------------

+ 28
- 15
data/macos/build.sh View File

@@ -8,22 +8,35 @@ if [ ! -f Makefile ]; then
cd ../..
fi

if [ -d /dev/shm ]; then
# Linux
export CC="i686-apple-darwin10-gcc"
export CXX="i686-apple-darwin10-g++"
export PATH=/usr/i686-apple-darwin10/bin/:$PATH
else
# MacOS
. ./data/macos/env-vars.sh
export CXFREEZE=cxfreeze
fi

# Clean build
# make clean
export MACOS="true"
export CC=clang
export CXX=clang++
export CXFREEZE=/opt/kxstudio/bin/cxfreeze

# Build python stuff
export PATH=/opt/kxstudio/bin:/opt/kxstudio64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export PKG_CONFIG_PATH=/opt/kxstudio64/lib/pkgconfig
# make $JOBS UI RES WIDGETS

# Build theme
rm -rf incs
mkdir incs
ln -s /opt/kxstudio/lib/QtCore.framework/Headers incs/QtCore
ln -s /opt/kxstudio/lib/QtGui.framework/Headers incs/QtGui
ln -s /opt/kxstudio/lib/QtWidgets.framework/Headers incs/QtWidgets
export CXXFLAGS="-I`pwd`/incs"
export LDFLAGS="-F/opt/kxstudio/lib/ -framework QtCore -framework QtGui -framework QtWidgets"
make $JOBS theme
rm -rf incs
exit 0

# Build backend
export PATH=/opt/kxstudio64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export PKG_CONFIG_PATH=/opt/kxstudio64/lib/pkgconfig
make $JOBS backend discovery plugin

# Build
# make $JOBS
cd ../..
exit 0

# Build Mac App
rm -rf ./data/macos/Carla


+ 1
- 1
data/macos/env-vars.sh View File

@@ -4,4 +4,4 @@ export MACOS="true"
export CC=clang
export CXX=clang++
export PATH=/opt/kxstudio64/bin:/opt/kxstudio/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export PKG_CONFIG_PATH=/opt/kxstudio64/lib/pkgconfig:/opt/kxstudio/lib/pkgconfig
export PKG_CONFIG_PATH=/opt/kxstudio64/lib/pkgconfig

+ 3
- 3
source/Makefile.mk View File

@@ -127,8 +127,8 @@ endif
# --------------------------------------------------------------
# Check for qt, set default version (prefer qt4)

HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui QtXml && echo true)
HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Xml Qt5Widgets && echo true)
HAVE_QT4 = $(shell pkg-config --exists QtCore QtXml && echo true)
HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Xml && echo true)

ifeq ($(HAVE_QT5),true)
DEFAULT_QT=5
@@ -355,7 +355,7 @@ JACKBRIDGE_LIBS = -ldl -lpthread
JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
JUCE_AUDIO_DEVICES_LIBS = -framework AppKit -framework AudioToolbox -framework CoreAudio -framework CoreMIDI
JUCE_AUDIO_FORMATS_LIBS = -framework AudioToolbox -framework CoreFoundation
JUCE_AUDIO_PROCESSORS_LIBS = -framework Cocoa -framework Carbon
JUCE_AUDIO_PROCESSORS_LIBS = -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreAudioKit -framework Cocoa -framework Carbon
JUCE_CORE_LIBS = -framework AppKit
JUCE_EVENTS_LIBS = -framework AppKit
JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore


+ 2
- 2
source/carla_settings.py View File

@@ -83,8 +83,8 @@ CARLA_DEFAULT_AUDIO_SAMPLE_RATE = 44100

if WINDOWS:
CARLA_DEFAULT_AUDIO_DRIVER = "DirectSound"
#elif MACOS:
#CARLA_DEFAULT_AUDIO_DRIVER = "CoreAudio"
elif MACOS:
CARLA_DEFAULT_AUDIO_DRIVER = "CoreAudio"
else:
CARLA_DEFAULT_AUDIO_DRIVER = "JACK"



+ 1
- 1
source/modules/juce_audio_processors/AppConfig.h View File

@@ -42,7 +42,7 @@
@see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST
*/
#define JUCE_PLUGINHOST_AU 0 // FIXME - my OSX version is still at 10.5...
#define JUCE_PLUGINHOST_AU 1
#define JUCE_PLUGINHOST_LADSPA 1


+ 2
- 0
source/modules/theme/Makefile View File

@@ -13,6 +13,7 @@ BUILD_CXX_FLAGS += -I. -I../../includes -I../../utils
ifeq ($(HAVE_QT4),true)
QT4_CXX_FLAGS = $(BUILD_CXX_FLAGS)
QT4_CXX_FLAGS += $(shell pkg-config --cflags QtCore QtGui)
QT4_LINK_FLAGS = $(LINK_FLAGS)
QT4_LINK_FLAGS += $(shell pkg-config --libs QtCore QtGui)
QT4_STYLES_DIR = $(shell pkg-config --variable=libdir QtCore)/qt4/plugins/styles
endif
@@ -20,6 +21,7 @@ endif
ifeq ($(HAVE_QT5),true)
QT5_CXX_FLAGS = $(BUILD_CXX_FLAGS)
QT5_CXX_FLAGS += $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)
QT5_LINK_FLAGS = $(LINK_FLAGS)
QT5_LINK_FLAGS += $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets)
QT5_STYLES_DIR = $(shell pkg-config --variable=libdir Qt5Core)/qt5/plugins/styles
endif


+ 7
- 7
source/patchcanvas.py View File

@@ -29,7 +29,7 @@ if config_UseQt5:
from PyQt5.QtCore import QAbstractAnimation, QLineF, QPointF, QRectF, QSizeF, QSettings, QTimer
from PyQt5.QtGui import QColor, QLinearGradient, QPen, QPolygonF, QPainter, QPainterPath
from PyQt5.QtGui import QCursor, QFont, QFontMetrics
#from PyQt5.QtSvg import QGraphicsSvgItem, QSvgRenderer
from PyQt5.QtSvg import QGraphicsSvgItem, QSvgRenderer
from PyQt5.QtWidgets import QGraphicsScene, QGraphicsItem, QGraphicsLineItem, QGraphicsPathItem
from PyQt5.QtWidgets import QGraphicsColorizeEffect, QGraphicsDropShadowEffect
from PyQt5.QtWidgets import QInputDialog, QLineEdit, QMenu
@@ -2187,10 +2187,10 @@ class CanvasBox(QGraphicsItem):
self.m_font_port.setWeight(canvas.theme.port_font_state)

# Icon
#if canvas.theme.box_use_icon:
#self.icon_svg = CanvasIcon(icon, self.m_group_name, self)
#else:
self.icon_svg = None
if canvas.theme.box_use_icon:
self.icon_svg = CanvasIcon(icon, self.m_group_name, self)
else:
self.icon_svg = None

# Shadow
if options.eyecandy:
@@ -2761,9 +2761,9 @@ class CanvasBox(QGraphicsItem):
# ------------------------------------------------------------------------------
# canvasicon.cpp

class CanvasIcon(QGraphicsItem):
class CanvasIcon(QGraphicsSvgItem):
def __init__(self, icon, name, parent):
QGraphicsItem.__init__(self, parent)
QGraphicsSvgItem.__init__(self, parent)

self.m_renderer = None
self.p_size = QRectF(0, 0, 0, 0)


Loading…
Cancel
Save