Skip to content

Commit

Permalink
Build - fork mac* build scripts from linux build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
samaaron committed Jun 15, 2020
1 parent c9cddaf commit 6eb8762
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
30 changes: 30 additions & 0 deletions app/gui/qt/mac-config.sh
Original file line number Diff line number Diff line change
@@ -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 <Release|Debug|RelWithDebInfo|MinSizeRel>]" 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}"
45 changes: 45 additions & 0 deletions app/gui/qt/mac-prebuild.sh
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit 6eb8762

Please sign in to comment.