diff --git a/app/gui/qt/external/CMakeLists.txt b/app/gui/qt/external/CMakeLists.txt index fe4572658e..a356e5ba9d 100644 --- a/app/gui/qt/external/CMakeLists.txt +++ b/app/gui/qt/external/CMakeLists.txt @@ -99,7 +99,7 @@ ExternalProject_Add(libsndfile CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/libsndfile-package ) -ExternalProject_Add(Aubio +ExternalProject_Add(aubio PREFIX aubio-prefix SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/aubio DEPENDS libsndfile @@ -122,4 +122,4 @@ ExternalProject_Add(Aubio add_library(AubioBuilder STATIC externals.cpp) # Dependency ensures the externals are built -add_dependencies(AubioBuilder Aubio) +add_dependencies(AubioBuilder aubio) diff --git a/app/gui/qt/external/unix_build_externals.sh b/app/gui/qt/external/unix_build_externals.sh index dbc6ad9fd6..59fed90ca2 100644 --- a/app/gui/qt/external/unix_build_externals.sh +++ b/app/gui/qt/external/unix_build_externals.sh @@ -6,5 +6,13 @@ echo "Building server external dependencies..." mkdir -p "${SCRIPT_DIR}/build" cd "${SCRIPT_DIR}/build" cmake -G "Unix Makefiles" .. -cmake --build . + +echo "Building osmid..." +cmake --build . --target osmid + +if [ "$1" = "--build-aubio" ]; then + echo "Building aubio..." + cmake --build . --target aubio +fi + cd "${SCRIPT_DIR}" diff --git a/app/gui/qt/external/build_externals.bat b/app/gui/qt/external/win_x64_build_externals.bat similarity index 100% rename from app/gui/qt/external/build_externals.bat rename to app/gui/qt/external/win_x64_build_externals.bat diff --git a/app/gui/qt/external/build_externals32.bat b/app/gui/qt/external/win_x86_build_externals.bat similarity index 75% rename from app/gui/qt/external/build_externals32.bat rename to app/gui/qt/external/win_x86_build_externals.bat index 0b0a426fe9..0c76e89b42 100644 --- a/app/gui/qt/external/build_externals32.bat +++ b/app/gui/qt/external/win_x86_build_externals.bat @@ -1,6 +1,6 @@ cd %~dp0 -mkdir build32 > nul -cd build32 +mkdir build_x86 > nul +cd build_x86 cmake -G "Visual Studio 16 2019" -A Win32 ..\ cmake --build . --config Release cd %CURRENT_DIR% diff --git a/app/gui/qt/unix-prebuild.sh b/app/gui/qt/unix-prebuild.sh index 15744041f6..45a8f77eb4 100755 --- a/app/gui/qt/unix-prebuild.sh +++ b/app/gui/qt/unix-prebuild.sh @@ -4,17 +4,23 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo "Warning: Unix build scripts are still a work in progress!" # Build external dependencies -"${SCRIPT_DIR}/external/unix_build_externals.sh" +if [ "$1" = "--build-aubio" ]; then + "${SCRIPT_DIR}/external/unix_build_externals.sh" --build-aubio +else + "${SCRIPT_DIR}/external/unix_build_externals.sh" +fi # Install dependencies to server echo "Copying external dependencies to the server..." -mkdir -p "${SCRIPT_DIR}/../../server/native/lib" -cp "${SCRIPT_DIR}/external/build/aubio-prefix/src/Aubio-build/libaubio-5.so" "${SCRIPT_DIR}/../../server/native/lib/" - mkdir -p "${SCRIPT_DIR}/../../server/native/osmid" cp "${SCRIPT_DIR}/external/build/osmid-prefix/src/osmid-build/o2m" "${SCRIPT_DIR}/../../server/native/osmid/" cp "${SCRIPT_DIR}/external/build/osmid-prefix/src/osmid-build/m2o" "${SCRIPT_DIR}/../../server/native/osmid/" +if [ "$1" = "--build-aubio" ]; then + mkdir -p "${SCRIPT_DIR}/../../server/native/lib" + cp "${SCRIPT_DIR}/external/build/aubio-prefix/src/aubio-build/libaubio-5.so" "${SCRIPT_DIR}/../../server/native/lib/" +fi + #dont remove ruby-aubio-prerelease, as needed in linux build #it is removed in the windows-prebuild @@ -25,8 +31,6 @@ ruby "${SCRIPT_DIR}/../../server/ruby/bin/i18n-tool.rb" -t echo "Generating docs for the Qt GUI..." cp "${SCRIPT_DIR}/utils/ruby_help.tmpl" "${SCRIPT_DIR}/utils/ruby_help.h" -#assumes linux uses system ruby -#so dont use prefix ../../server/native/ruby/bin/ruby, as unnecessary to set this up ruby "${SCRIPT_DIR}/../../server/ruby/bin/qt-doc.rb" -o "${SCRIPT_DIR}/utils/ruby_help.h" echo "Updating GUI translation files..." diff --git a/app/gui/qt/win-prebuild.bat b/app/gui/qt/win-prebuild.bat index 87718a7796..1c3ad0da65 100644 --- a/app/gui/qt/win-prebuild.bat +++ b/app/gui/qt/win-prebuild.bat @@ -1,9 +1,9 @@ cd %~dp0 -call external/build_externals.bat +call external/win_x64_build_externals.bat cd %~dp0 @echo Copying aubio to the server... -copy external\build\aubio-prefix\src\Aubio-build\Release\libaubio-5.dll ..\..\server\native\ruby\bin +copy external\build\aubio-prefix\src\aubio-build\Release\libaubio-5.dll ..\..\server\native\ruby\bin rmdir /S /Q ..\..\server\ruby\vendor\ruby-aubio-prerelease rmdir /S /Q ..\..\server\ruby\vendor\fast_osc-1.2.1 diff --git a/app/gui/qt/win-prebuild32.bat b/app/gui/qt/win-prebuild32.bat index 56abf49720..3dc8728b38 100644 --- a/app/gui/qt/win-prebuild32.bat +++ b/app/gui/qt/win-prebuild32.bat @@ -1,14 +1,14 @@ cd %~dp0 -call external/build_externals32.bat +call external/win_x86_build_externals.bat cd %~dp0 @echo Copying aubio to the server... -copy external\build32\aubio-prefix\src\Aubio-build\Release\libaubio-5.dll ..\..\server\native\ruby\bin +copy external\build_x86\aubio-prefix\src\aubio-build\Release\libaubio-5.dll ..\..\server\native\ruby\bin rmdir /S /Q ..\..\server\ruby\vendor\ruby-aubio-prerelease @echo Copying osmid to the server -xcopy /Y /I /R /E external\build32\osmid-prefix\src\osmid-build\Release\*.exe ..\..\server\native\osmid +xcopy /Y /I /R /E external\build_x86\osmid-prefix\src\osmid-build\Release\*.exe ..\..\server\native\osmid @echo Copying scsynth to server... copy /Y ..\..\..\prebuilt\windows\x86\*.* ..\..\server\native diff --git a/appveyor.yml b/appveyor.yml index 1c40397410..36fc4bd202 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,12 +1,19 @@ # Build worker image (VM template) -image: Visual Studio 2019 +image: + - Visual Studio 2019 + - macos + - Ubuntu # scripts that are called at very beginning, before repo cloning init: - - date /T & time /T - - git config --global core.autocrlf input - - cmake --version + - cmd: | + date /T & time /T + git config --global core.autocrlf input + cmake --version + - sh: | + date + cmake --version branches: only: - master @@ -18,37 +25,104 @@ configuration: - Release - Debug -environment: - MSBUILD_FLAGS: /verbosity:minimal /maxcpucount +# Windows build +for: +- matrix: - - generator: "Visual Studio 16 2019" + only: + - image: Visual Studio 2019 + + environment: + MSBUILD_FLAGS: /verbosity:minimal /maxcpucount + matrix: + - generator: "Visual Studio 16 2019" + + install: + - cmd: | + cd %APPVEYOR_BUILD_FOLDER% + dir + cd app\server\native + mklink /d ruby c:\Ruby26-x64 + set PATH=c:\Ruby26-x64\bin;C:\Program Files (x86)\WiX Toolset v3.11\bin;%PATH% + gem install win32-process + gem install rugged --version 0.27.1 + gem install aubio + gem install fast_osc + set QT_INSTALL_LOCATION=C:\Qt\5.14.0\msvc2017_64 + build_script: + # generate build script + - cmd: | + cd %APPVEYOR_BUILD_FOLDER% + cd app\gui\qt + win-prebuild.bat + win-config.bat + cd build + cmake --build . --target ALL_BUILD --config %configuration% -- /nologo /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + after_build: + - cmd: | + cd %APPVEYOR_BUILD_FOLDER% + cd install\windows + IF "%configuration%"=="Release" install.bat + #- IF "%configuration%"=="Release" appveyor PushArtifact wix\sonic-pi.msi + +# Ubuntu Linux build +for: +- + matrix: + only: + - image: Ubuntu + + install: + - sh: | + cd "$APPVEYOR_BUILD_FOLDER" + ls -lA + # Install prerequisites + sudo apt-get install -y git build-essential\ + ruby ruby-dev erlang-base\ # Ruby & Erlang stuff + qt5-default libqt5svg5-dev\ # Qt5 stuff + qttools5-dev qttools5-dev-tools qtdeclarative5-dev libqt5webkit5-dev\ + qtpositioning5-dev libqt5sensors5-dev libqt5opengl5-dev qtmultimedia5-dev\ + libjack-jackd2-dev libasound2-dev libavahi-client-dev\ # Other libraries + libicu-dev libreadline6-dev libfftw3-dev libxt-dev libudev-dev cmake\ + libboost-dev libffi-dev + gem install bundler + build_script: + # generate build script + - sh: | + cd "$APPVEYOR_BUILD_FOLDER" + cd app/server/ruby/bin + ./compile-extensions.rb + cd ../../../gui/qt + ./unix-prebuild.sh --build-aubio + ./unix-config.sh + cd build + cmake --build . --target ALL_BUILD + +# macOS build +for: +- + matrix: + only: + - image: macos + + install: + - sh: | + cd "$APPVEYOR_BUILD_FOLDER" + ls -lA + # Install prerequisites + brew install cmake erlang qt + gem install bundler + build_script: + # generate build script + - sh: | + cd "$APPVEYOR_BUILD_FOLDER" + cd app/server/ruby/bin + ./compile-extensions.rb + cd ../../../gui/qt + ./unix-prebuild.sh --build-aubio + ./unix-config.sh + cd build + cmake --build . --target ALL_BUILD matrix: fast_finish: true - -install: - - cd %APPVEYOR_BUILD_FOLDER% - - dir - - cd app\server\native - - mklink /d ruby c:\Ruby26-x64 - - set PATH=c:\Ruby26-x64\bin;C:\Program Files (x86)\WiX Toolset v3.11\bin;%PATH% - - gem install win32-process - - gem install rugged --version 0.27.1 - - gem install aubio - - gem install fast_osc - - set QT_INSTALL_LOCATION=C:\Qt\5.14.0\msvc2017_64 - -build_script: - # generate build script - - cd %APPVEYOR_BUILD_FOLDER% - - cd app\gui\qt - - win-prebuild.bat - - win-config.bat - - cd build - - cmake --build . --target ALL_BUILD --config %configuration% -- /nologo /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - -after_build: - - cd %APPVEYOR_BUILD_FOLDER% - - cd install\windows - - IF "%configuration%"=="Release" install.bat - #- IF "%configuration%"=="Release" appveyor PushArtifact wix\sonic-pi.msi