From 006ae6bc8c362ac9305f5b3dd69b82393db35e15 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 16 Jan 2018 20:40:38 +0100 Subject: [PATCH] Split build and pack windows scripts --- data/windows/build-win.sh | 75 -------------------- data/windows/pack-win.sh | 140 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+), 75 deletions(-) create mode 100755 data/windows/pack-win.sh diff --git a/data/windows/build-win.sh b/data/windows/build-win.sh index 6f52dae79..86dbbe037 100755 --- a/data/windows/build-win.sh +++ b/data/windows/build-win.sh @@ -72,81 +72,6 @@ if [ x"${ARCH}" != x"32" ]; then make ${MAKE_ARGS} HAVE_LIBLO=false LDFLAGS="-L${TARGETDIR}/carla-w32/lib -L/opt/mingw32/lib -L/opt/mingw32/i686-w64-mingw32/lib" win32 fi -export PYTHONPATH=`pwd`/source - -rm -rf ./data/windows/Carla -mkdir -p ./data/windows/Carla/Debug -cp ./source/carla ./source/Carla.pyw -$PYTHON_EXE ./data/windows/app-console.py build_exe -mv ./data/windows/Carla/carla.exe ./data/windows/Carla/Debug/Carla.exe -$PYTHON_EXE ./data/windows/app-gui.py build_exe -rm -f ./source/Carla.pyw - -cd data/windows/ - -rm -rf dist -$CXFREEZE ../../bin/resources/bigmeter-ui -$CXFREEZE ../../bin/resources/midipattern-ui -$CXFREEZE ../../bin/resources/notes-ui -$CXFREEZE ../../bin/resources/carla-plugin -$CXFREEZE ../../bin/resources/carla-plugin-patchbay - -cp ../../bin/*.dll Carla/ -cp ../../bin/*.exe Carla/ -rm Carla/carla-bridge-lv2-windows.exe -rm Carla/carla-discovery-native.exe -rm Carla/carla-lv2-export.exe - -rm -f Carla/PyQt5.Qsci.pyd Carla/PyQt5.QtNetwork.pyd Carla/PyQt5.QtSql.pyd Carla/PyQt5.QtTest.pyd Carla/PyQt5.QtXml.pyd -rm -f dist/PyQt5.Qsci.pyd dist/PyQt5.QtNetwork.pyd dist/PyQt5.QtSql.pyd dist/PyQt5.QtTest.pyd dist/PyQt5.QtXml.pyd - -cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icu*.dll Carla/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/ - -mv dist Carla/resources -cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/resources/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icu*.dll Carla/resources/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/resources/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/resources/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/resources/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/resources/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/resources/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/resources/ -cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/resources/ - -# Build unzipfx -make -C unzipfx-carla -f Makefile.win32 clean -make -C unzipfx-carla -f Makefile.win32 - -# Create zip of Carla -rm -f Carla.zip CarlaControl.zip -zip -r -9 Carla.zip Carla - -# Create static build -rm -f Carla.exe CarlaControl.exe -cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe -chmod +x Carla.exe - -# Cleanup -rm -f Carla.zip CarlaControl.zip - -# Create release zip -rm -rf Carla-2.0beta5-win${ARCH} -mkdir Carla-2.0beta5-win${ARCH} -mkdir Carla-2.0beta5-win${ARCH}/vcredist -cp Carla.exe README.txt Carla-2.0beta5-win${ARCH} -cp ~/.cache/winetricks/vcrun2010/vcredist_x${ARCH}.exe Carla-2.0beta5-win${ARCH}/vcredist -zip -r -9 Carla-2.0beta5-win${ARCH}.zip Carla-2.0beta5-win${ARCH} - -cd ../.. - # Testing: echo "export WINEPREFIX=~/.winepy3_x${ARCH}" echo "$PYTHON_EXE ./source/carla" diff --git a/data/windows/pack-win.sh b/data/windows/pack-win.sh new file mode 100755 index 000000000..c86ae274e --- /dev/null +++ b/data/windows/pack-win.sh @@ -0,0 +1,140 @@ +#!/bin/bash + +# --------------------------------------------------------------------------------------------------------------------- +# check input + +ARCH="${1}" + +if [ x"${ARCH}" != x"32" ] && [ x"${ARCH}" != x"64" ]; then + echo "usage: $0 32|64" + exit 1 +fi + +# --------------------------------------------------------------------------------------------------------------------- +# stop on error + +set -e + +# --------------------------------------------------------------------------------------------------------------------- +# cd to correct path + +if [ ! -f Makefile ]; then + cd $(dirname $0)/../.. +fi + +# --------------------------------------------------------------------------------------------------------------------- +# set variables + +source data/windows/common.env + +if [ x"${ARCH}" != x"32" ]; then + CPUARCH="x86_64" +else + CPUARCH="i686" +fi + +MINGW_PREFIX="${CPUARCH}-w64-mingw32" + +export PREFIX=${TARGETDIR}/carla-w${ARCH} +export PATH=/opt/mingw${ARCH}/bin:${PREFIX}/bin/usr/sbin:/usr/bin:/sbin:/bin +export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig + +export AR=${MINGW_PREFIX}-ar +export CC=${MINGW_PREFIX}-gcc +export CXX=${MINGW_PREFIX}-g++ +export STRIP=${MINGW_PREFIX}-strip +export WINDRES=${MINGW_PREFIX}-windres + +export CFLAGS="-DBUILDING_CARLA_FOR_WINDOWS -DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL" +export CFLAGS="${CFLAGS} -I${PREFIX}/include -I/opt/mingw${ARCH}/include -I/opt/mingw${ARCH}/${MINGW_PREFIX}/include" +export CXXFLAGS="${CFLAGS}" +export LDFLAGS="-L${PREFIX}/lib -L/opt/mingw${ARCH}/lib -L/opt/mingw${ARCH}/${MINGW_PREFIX}/lib" + +export WIN32=true + +if [ x"${ARCH}" != x"32" ]; then + export WIN64=true +fi + +export WINEARCH=win${ARCH} +export WINEPREFIX=~/.winepy3_x${ARCH} +export PYTHON_EXE="wine C:\\\\Python34\\\\python.exe" + +export CXFREEZE="$PYTHON_EXE C:\\\\Python34\\\\Scripts\\\\cxfreeze" +export PYUIC="$PYTHON_EXE -m PyQt5.uic.pyuic" +export PYRCC="wine C:\\\\Python34\\\\Lib\\\\site-packages\\\\PyQt5\\\\pyrcc5.exe" + +export PYTHONPATH=`pwd`/source + +rm -rf ./data/windows/Carla +mkdir -p ./data/windows/Carla/Debug +cp ./source/carla ./source/Carla.pyw +$PYTHON_EXE ./data/windows/app-console.py build_exe +mv ./data/windows/Carla/carla.exe ./data/windows/Carla/Debug/Carla.exe +$PYTHON_EXE ./data/windows/app-gui.py build_exe +rm -f ./source/Carla.pyw + +cd data/windows/ + +rm -rf dist +$CXFREEZE ../../bin/resources/bigmeter-ui +$CXFREEZE ../../bin/resources/midipattern-ui +$CXFREEZE ../../bin/resources/notes-ui +$CXFREEZE ../../bin/resources/carla-plugin +$CXFREEZE ../../bin/resources/carla-plugin-patchbay + +cp ../../bin/*.dll Carla/ +cp ../../bin/*.exe Carla/ +rm Carla/carla-bridge-lv2-windows.exe +rm Carla/carla-discovery-native.exe +rm Carla/carla-lv2-export.exe + +rm -f Carla/PyQt5.Qsci.pyd Carla/PyQt5.QtNetwork.pyd Carla/PyQt5.QtSql.pyd Carla/PyQt5.QtTest.pyd Carla/PyQt5.QtXml.pyd +rm -f dist/PyQt5.Qsci.pyd dist/PyQt5.QtNetwork.pyd dist/PyQt5.QtSql.pyd dist/PyQt5.QtTest.pyd dist/PyQt5.QtXml.pyd + +cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icu*.dll Carla/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/ + +mv dist Carla/resources +cp $WINEPREFIX/drive_c/Python34/python34.dll Carla/resources/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/icu*.dll Carla/resources/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libEGL.dll Carla/resources/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/libGLESv2.dll Carla/resources/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Core.dll Carla/resources/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Gui.dll Carla/resources/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Widgets.dll Carla/resources/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5OpenGL.dll Carla/resources/ +cp $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt5/Qt5Svg.dll Carla/resources/ + +# Build unzipfx +make -C unzipfx-carla -f Makefile.win32 clean +make -C unzipfx-carla -f Makefile.win32 ${MAKE_ARGS} + +# Create zip of Carla +rm -f Carla.zip CarlaControl.zip +zip -r -9 Carla.zip Carla + +# Create static build +rm -f Carla.exe CarlaControl.exe +cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe +chmod +x Carla.exe + +# Cleanup +rm -f Carla.zip CarlaControl.zip + +# Create release zip +rm -rf Carla-2.0beta5-win${ARCH} +mkdir Carla-2.0beta5-win${ARCH} +mkdir Carla-2.0beta5-win${ARCH}/vcredist +cp Carla.exe README.txt Carla-2.0beta5-win${ARCH} +cp ~/.cache/winetricks/vcrun2010/vcredist_x${ARCH}.exe Carla-2.0beta5-win${ARCH}/vcredist +zip -r -9 Carla-2.0beta5-win${ARCH}.zip Carla-2.0beta5-win${ARCH} + +cd ../..