From 6eb87627548a17b808cda71308c3bfd89e5d4c25 Mon Sep 17 00:00:00 2001 From: Sam Aaron Date: Mon, 15 Jun 2020 20:46:10 +0100 Subject: [PATCH] Build - fork mac* build scripts from linux build scripts --- app/gui/qt/mac-config.sh | 30 +++++++++++++++++++++++++ app/gui/qt/mac-prebuild.sh | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 app/gui/qt/mac-config.sh create mode 100644 app/gui/qt/mac-prebuild.sh diff --git a/app/gui/qt/mac-config.sh b/app/gui/qt/mac-config.sh new file mode 100644 index 0000000000..d110b185b1 --- /dev/null +++ b/app/gui/qt/mac-config.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e # Quit script on error +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +config="" + +if [ "$1" = "--config" ]; then + case $2 in + Release|Debug|RelWithDebInfo|MinSizeRel) + config="$2" + ;; + *) + echo "`basename $0`: Error: invalid configuration: '${2}'" 1>&2 + echo "Valid configurations: Release, Debug, RelWithDebInfo, MinSizeRel" 1>&2 + exit 1 + ;; + esac +elif [ ! -z $1 ]; then + echo "`basename $0`: Error: invalid parameter: '${1}'" 1>&2 + echo "Usage: `basename $0` [--config ]" 1>&2 + exit 1 +fi + +echo "Creating build directory..." +mkdir -p "${SCRIPT_DIR}/build" + +echo "Generating makefiles..." +cd "${SCRIPT_DIR}/build" +cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=\"$config\" .. + +cd "${SCRIPT_DIR}" diff --git a/app/gui/qt/mac-prebuild.sh b/app/gui/qt/mac-prebuild.sh new file mode 100644 index 0000000000..ad8803861e --- /dev/null +++ b/app/gui/qt/mac-prebuild.sh @@ -0,0 +1,45 @@ +#!/bin/bash +set -e # Quit script on error +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +echo "Warning: Unix build scripts are still a work in progress!" + +# Build external dependencies +if [ "$1" = "--build-aubio" ]; then + "${SCRIPT_DIR}/external/linux_build_externals.sh" --build-aubio +else + "${SCRIPT_DIR}/external/linux_build_externals.sh" +fi + +# Install dependencies to server +echo "Copying external dependencies to the server..." +mkdir -p "${SCRIPT_DIR}/../../server/erlang/sonic_pi_server/priv/" +cp ${SCRIPT_DIR}/external/build/sp_midi-prefix/src/sp_midi-build/*.so ${SCRIPT_DIR}/../../server/erlang/sonic_pi_server/priv/ + +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 + +echo "Compiling native ruby extensions..." +ruby "${SCRIPT_DIR}/../../server/ruby/bin/compile-extensions.rb" + +echo "Translating tutorial..." +#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/i18n-tool.rb" -t + +echo "Generating docs for the Qt GUI..." +cp "${SCRIPT_DIR}/utils/ruby_help.tmpl" "${SCRIPT_DIR}/utils/ruby_help.h" +ruby "${SCRIPT_DIR}/../../server/ruby/bin/qt-doc.rb" -o "${SCRIPT_DIR}/utils/ruby_help.h" + +echo "Updating GUI translation files..." +lrelease "${SCRIPT_DIR}"/lang/*.ts + +echo "Compiling erlang files..." +cd "${SCRIPT_DIR}/../../server/erlang/sonic_pi_server" +erl -make +cp src/sonic_pi_server.app.src ebin/sonic_pi_server.app +cd "${SCRIPT_DIR}"