Skip to content

Commit

Permalink
Add --build-aubio option to unix scripts; add Ubuntu and macOS builds…
Browse files Browse the repository at this point in the history
… to AppVeyor; rename windows build_externals scripts
  • Loading branch information
SunderB authored and samaaron committed Mar 17, 2020
1 parent 5a7bb8d commit cb6787d
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 50 deletions.
4 changes: 2 additions & 2 deletions app/gui/qt/external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
10 changes: 9 additions & 1 deletion app/gui/qt/external/unix_build_externals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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%
16 changes: 10 additions & 6 deletions app/gui/qt/unix-prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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..."
Expand Down
4 changes: 2 additions & 2 deletions app/gui/qt/win-prebuild.bat
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/gui/qt/win-prebuild32.bat
Original file line number Diff line number Diff line change
@@ -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
Expand Down
142 changes: 108 additions & 34 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit cb6787d

Please sign in to comment.