From 47349670e39441e6c0d5dd5bad938efaa7d31109 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 26 Jun 2013 03:32:57 +0100 Subject: [PATCH] Update windows build scripts; Set plugin GUI window-icons --- data/windows/build-win32.sh | 124 ++++++++++++----------- data/windows/build-win64.sh | 49 +++++---- doc/Carla-TODO | 2 + source/backend/plugin/CarlaPluginGui.cpp | 2 + source/bridges/CarlaBridgeToolkitQt.cpp | 1 + source/bridges/Makefile | 27 +++-- 6 files changed, 117 insertions(+), 88 deletions(-) diff --git a/data/windows/build-win32.sh b/data/windows/build-win32.sh index 06f140874..07ce968b4 100755 --- a/data/windows/build-win32.sh +++ b/data/windows/build-win32.sh @@ -5,7 +5,7 @@ set -e MINGW=i686-w64-mingw32 MINGW_PATH=/opt/mingw32 -JOBS="-j 4" +JOBS="-j 2" if [ ! -f Makefile ]; then cd ../.. @@ -28,80 +28,82 @@ export CXXFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL -I$MINGW_PATH/include export EXTRA_LIBS1="-lglib-2.0 -lgthread-2.0 -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg" export EXTRA_LIBS2="$MINGW_PATH/lib/qt4/plugins/imageformats/libqsvg.a" +export WINEPREFIX=~/.winepy3 +export PYTHON_EXE="C:\\\\Python33\\\\python.exe" + +export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze" +export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py" +export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3" + # Clean build -# make clean +make clean # Build PyQt4 resources -# make $JOBS UI RES WIDGETS +make $JOBS UI RES WIDGETS # Build discovery make $JOBS discovery EXTRA_LIBS="$EXTRA_LIBS1" -cp source/discovery/carla-discovery-native.exe source/discovery/carla-discovery-win32.exe +mv source/discovery/carla-discovery-native.exe source/discovery/carla-discovery-win32.exe # Build backend -# make $JOBS -C source/backend/standalone ../libcarla_standalone.dll WIN32=true EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2" - -# export WINEPREFIX=~/.winepy3 -# -# export PYTHON_EXE="C:\\\\Python33\\\\python.exe" -# -# export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze" -# export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py" -# export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3" - -# rm -rf ./data/windows/Carla -# cp ./source/carla.py ./source/carla.pyw -# $CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.pyw" -# rm -f ./source/carla.pyw -# -# rm -rf ./data/windows/CarlaControl -# cp ./source/carla_control.py ./source/carla_control.pyw -# $CXFREEZE --target-dir=".\\data\\windows\\CarlaControl" ".\\source\\carla_control.pyw" -# rm -f ./source/carla_control.pyw - -# cd data/windows -# mkdir Carla/backend -# mkdir Carla/bridges -# mkdir Carla/discovery -# cp ../../source/backend/*.dll Carla/backend/ -# cp ../../source/discovery/*.exe Carla/discovery/ -# mv CarlaControl/carla_control.exe CarlaControl/CarlaControl.exe -# -# 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/ -# -# cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll CarlaControl/ -# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll CarlaControl/ -# cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll CarlaControl/ -# cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ CarlaControl/ -# cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ CarlaControl/ +make $JOBS backend EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2" + +# Build bridges +# make $JOBS bridges EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2" + +rm -rf ./data/windows/Carla +cp ./source/carla.py ./source/carla.pyw +$CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.pyw" +rm -f ./source/carla.pyw + +rm -rf ./data/windows/CarlaControl +cp ./source/carla_control.py ./source/carla_control.pyw +$CXFREEZE --target-dir=".\\data\\windows\\CarlaControl" ".\\source\\carla_control.pyw" +rm -f ./source/carla_control.pyw + +cd data/windows +mkdir Carla/backend +mkdir Carla/bridges +mkdir Carla/discovery +cp ../../source/backend/*.dll Carla/backend/ +cp ../../source/discovery/*.exe Carla/discovery/ +mv CarlaControl/carla_control.exe CarlaControl/CarlaControl.exe + +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/ + +cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll CarlaControl/ +cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll CarlaControl/ +cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll CarlaControl/ +cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ CarlaControl/ +cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ CarlaControl/ # Build unzipfx -# make -C unzipfx-carla -f Makefile.win32 -# make -C unzipfx-carla-control -f Makefile.win32 +make -C unzipfx-carla -f Makefile.win32 +make -C unzipfx-carla-control -f Makefile.win32 # Create static build -# rm -f Carla.zip CarlaControl.zip -# zip -r -9 Carla.zip Carla -# zip -r -9 CarlaControl.zip CarlaControl -# -# rm -f Carla.exe CarlaControl.exe -# cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe -# cat unzipfx-carla-control/unzipfx2cat.exe CarlaControl.zip > CarlaControl.exe -# chmod +x Carla.exe -# chmod +x CarlaControl.exe +rm -f Carla.zip CarlaControl.zip +zip -r -9 Carla.zip Carla +zip -r -9 CarlaControl.zip CarlaControl + +rm -f Carla.exe CarlaControl.exe +cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe +cat unzipfx-carla-control/unzipfx2cat.exe CarlaControl.zip > CarlaControl.exe +chmod +x Carla.exe +chmod +x CarlaControl.exe # Cleanup -# make -C unzipfx-carla -f Makefile.win32 clean -# make -C unzipfx-carla-control -f Makefile.win32 clean -# rm -f Carla.zip CarlaControl.zip -# rm -f unzipfx-*/*.exe +make -C unzipfx-carla -f Makefile.win32 clean +make -C unzipfx-carla-control -f Makefile.win32 clean +rm -f Carla.zip CarlaControl.zip +rm -f unzipfx-*/*.exe # Testing: echo "export WINEPREFIX=~/.winepy3" diff --git a/data/windows/build-win64.sh b/data/windows/build-win64.sh index f44180c1b..78aa453c2 100755 --- a/data/windows/build-win64.sh +++ b/data/windows/build-win64.sh @@ -5,15 +5,15 @@ set -e MINGW=x86_64-w64-mingw32 MINGW_PATH=/opt/mingw64 -JOBS="-j 4" +JOBS="-j 2" if [ ! -f Makefile ]; then cd ../.. fi -ln -s -f $MINGW_PATH/bin/$MINGW-pkg-config ./data/windows/pkg-config +export WIN32=true -export PATH=`pwd`/data/windows:$MINGW_PATH/bin:$MINGW_PATH/$MINGW/bin:$PATH +export PATH=$MINGW_PATH/bin:$MINGW_PATH/$MINGW/bin:$PATH export AR=$MINGW-ar export CC=$MINGW-gcc export CXX=$MINGW-g++ @@ -23,21 +23,18 @@ export UIC=$MINGW-uic export STRIP=$MINGW-strip export WINDRES=$MINGW-windres -export PKG_CONFIG_PATH=$MINGW_PATH/lib/pkgconfig +export CFLAGS="-DPTW32_STATIC_LIB -I$MINGW_PATH/include" +export CXXFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL -I$MINGW_PATH/include" +export EXTRA_LIBS1="-lglib-2.0 -lgthread-2.0 -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg" +export EXTRA_LIBS2="$MINGW_PATH/lib/qt4/plugins/imageformats/libqsvg.a" export WINEPREFIX=~/.winepy3_x64 - export PYTHON_EXE="C:\\\\Python33\\\\python.exe" export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze" export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py" export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3" -export CFLAGS="-DPTW32_STATIC_LIB -I$MINGW_PATH/include" -export CXXFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL -I$MINGW_PATH/include" -export EXTRA_LIBS1="-lglib-2.0 -lgthread-2.0 -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg" -export EXTRA_LIBS2="$MINGW_PATH/lib/qt4/plugins/imageformats/libqsvg.a $MINGW_PATH/lib/qt4/plugins/iconengines/libqsvgicon.a" - # Clean build make clean @@ -45,23 +42,32 @@ make clean make $JOBS UI RES WIDGETS # Build discovery -make $JOBS -C source/discovery WIN32=true EXTRA_LIBS="$EXTRA_LIBS1" -mv source/discovery/carla-discovery-native source/discovery/carla-discovery-win32.exe +make $JOBS discovery EXTRA_LIBS="$EXTRA_LIBS1" +mv source/discovery/carla-discovery-native.exe source/discovery/carla-discovery-win32.exe # Build backend -make $JOBS -C source/backend/standalone ../libcarla_standalone.dll WIN32=true EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2" +make $JOBS backend EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2" + +# Build bridges +# make $JOBS bridges EXTRA_LIBS="$EXTRA_LIBS1 $EXTRA_LIBS2" rm -rf ./data/windows/Carla cp ./source/carla.py ./source/carla.pyw $CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.pyw" rm -f ./source/carla.pyw +rm -rf ./data/windows/CarlaControl +cp ./source/carla_control.py ./source/carla_control.pyw +$CXFREEZE --target-dir=".\\data\\windows\\CarlaControl" ".\\source\\carla_control.pyw" +rm -f ./source/carla_control.pyw + cd data/windows mkdir Carla/backend mkdir Carla/bridges mkdir Carla/discovery cp ../../source/backend/*.dll Carla/backend/ cp ../../source/discovery/*.exe Carla/discovery/ +mv CarlaControl/carla_control.exe CarlaControl/CarlaControl.exe cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Carla/ cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/ @@ -72,22 +78,31 @@ 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/ -rm -f pkg-config +cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll CarlaControl/ +cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll CarlaControl/ +cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll CarlaControl/ +cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ CarlaControl/ +cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ CarlaControl/ # Build unzipfx make -C unzipfx-carla -f Makefile.win32 +make -C unzipfx-carla-control -f Makefile.win32 # Create static build -rm -f Carla.zip +rm -f Carla.zip CarlaControl.zip zip -r -9 Carla.zip Carla +zip -r -9 CarlaControl.zip CarlaControl -rm -f Carla.exe +rm -f Carla.exe CarlaControl.exe cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe +cat unzipfx-carla-control/unzipfx2cat.exe CarlaControl.zip > CarlaControl.exe chmod +x Carla.exe +chmod +x CarlaControl.exe # Cleanup make -C unzipfx-carla -f Makefile.win32 clean -rm -f Carla.zip +make -C unzipfx-carla-control -f Makefile.win32 clean +rm -f Carla.zip CarlaControl.zip rm -f unzipfx-*/*.exe # Testing: diff --git a/doc/Carla-TODO b/doc/Carla-TODO index 8448fab9d..4cc90d930 100644 --- a/doc/Carla-TODO +++ b/doc/Carla-TODO @@ -32,7 +32,9 @@ VST: FluidSynth: - per-channel volume control + - proper buffer-size/sample-rate change LinuxSampler: - multi-program - 16outs (depends on multi-program) + - proper buffer-size/sample-rate change diff --git a/source/backend/plugin/CarlaPluginGui.cpp b/source/backend/plugin/CarlaPluginGui.cpp index 5b9441752..e98c74497 100644 --- a/source/backend/plugin/CarlaPluginGui.cpp +++ b/source/backend/plugin/CarlaPluginGui.cpp @@ -39,6 +39,8 @@ CarlaPluginGui::CarlaPluginGui(CarlaEngine* const engine, Callback* const callba CARLA_ASSERT(callback != nullptr); carla_debug("CarlaPluginGui::CarlaPluginGui(%p, %p)", engine, callback); + setWindowIcon(QIcon::fromTheme("carla", QIcon(":/scalable/carla.svg"))); + if (options.parented) { #ifdef Q_WS_X11 diff --git a/source/bridges/CarlaBridgeToolkitQt.cpp b/source/bridges/CarlaBridgeToolkitQt.cpp index fcc6c72b9..c914edac8 100644 --- a/source/bridges/CarlaBridgeToolkitQt.cpp +++ b/source/bridges/CarlaBridgeToolkitQt.cpp @@ -160,6 +160,7 @@ public: #endif } + fWindow->setWindowIcon(QIcon::fromTheme("carla", QIcon(":/scalable/carla.svg"))); fWindow->setWindowTitle(kUiTitle); { diff --git a/source/bridges/Makefile b/source/bridges/Makefile index 24d2f2728..9dff4f47a 100644 --- a/source/bridges/Makefile +++ b/source/bridges/Makefile @@ -153,8 +153,8 @@ LINK_UI_LV2_QT5_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs Qt5Gui Qt5 BUILD_UI_LV2_COCOA_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_COCOA -DBRIDGE_LV2_COCOA $(QT_UI_FLAGS) LINK_UI_LV2_COCOA_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS) -BUILD_UI_LV2_HWND_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_HWND -DBRIDGE_LV2_HWND $(QT_UI_FLAGS) -LINK_UI_LV2_HWND_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static +BUILD_UI_LV2_WIN32_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_HWND -DBRIDGE_LV2_WIN32 $(QT_UI_FLAGS) +LINK_UI_LV2_WIN32_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static BUILD_UI_LV2_X11_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_X11 -DBRIDGE_LV2_X11 $(QT_UI_FLAGS) LINK_UI_LV2_X11_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS) @@ -190,6 +190,13 @@ TARGETS += ui_lv2-x11 TARGETS += ui_vst-x11 endif +ifeq ($(WIN32),true) +TARGETS = carla-bridge-win32.exe +TARGETS += carla-bridge-win64.exe +TARGETS += carla-bridge-lv2-windows.exe +TARGETS += carla-bridge-vst-hwnd.exe +endif + # -------------------------------------------------------------- all: $(TARGETS) @@ -200,7 +207,7 @@ ui_lv2-qt4: carla-bridge-lv2-qt4 ui_lv2-qt5: carla-bridge-lv2-qt5 ui_lv2-cocoa: carla-bridge-lv2-cocoa -ui_lv2-hwnd: carla-bridge-lv2-hwnd.exe +ui_lv2-win32: carla-bridge-lv2-windows.exe ui_lv2-x11: carla-bridge-lv2-x11 ui_vst-cocoa: carla-bridge-vst-cocoa @@ -296,17 +303,17 @@ carla-bridge-lv2-cocoa: $(OBJS_UI_LV2_COCOA) $(OBJS_UI_LV2_LIBS) ../libs/theme.a $(CXX) $< $(BUILD_UI_LV2_COCOA_FLAGS) -c -o $@ # -------------------------------------------------------------- -# ui_lv2-hwnd +# ui_lv2-windows -OBJS_UI_LV2_HWND = CarlaBridgeUI-LV2__lv2-hwnd.o \ +OBJS_UI_LV2_WIN32 = CarlaBridgeUI-LV2__lv2-windows.o \ CarlaBridgeClient__lv2.o CarlaBridgeOsc__lv2.o \ - CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-hwnd.o + CarlaBridgeToolkit__lv2.o CarlaBridgeToolkitQt__lv2-windows.o -carla-bridge-lv2-hwnd.exe: $(OBJS_UI_LV2_HWND) $(OBJS_UI_LV2_LIBS) ../libs/theme.a - $(CXX) $^ $(LINK_UI_LV2_HWND_FLAGS) -o $@ $(CMD_STRIP) $@ +carla-bridge-lv2-windows.exe: $(OBJS_UI_LV2_WINDOWS) $(OBJS_UI_LV2_LIBS) ../libs/theme.a + $(CXX) $^ $(LINK_UI_LV2_WIN32_FLAGS) -o $@ $(CMD_STRIP) $@ -%__lv2-hwnd.o: %.cpp CarlaBridgeToolkitQt.moc - $(CXX) $< $(BUILD_UI_LV2_HWND_FLAGS) -c -o $@ +%__lv2-windows.o: %.cpp CarlaBridgeToolkitQt.moc + $(CXX) $< $(BUILD_UI_LV2_WIN32_FLAGS) -c -o $@ # -------------------------------------------------------------- # ui_lv2-x11