Skip to content

Commit 8c718d4

Browse files
committed
Build - improve and unify build scripts
We now support various build scripts for 4 targets: win, max, linux and pi. For each target there are corresponding clean, pre-build, config and build-all scripts. Tutorials should likely now point to using the build-all scripts to make it easier for developers to get a build.
1 parent cb4a105 commit 8c718d4

17 files changed

+119
-80
lines changed

app/linux-build-all.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e # Quit script on error
3+
4+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
cd ${SCRIPT_DIR}
6+
7+
"${SCRIPT_DIR}/linux-prebuild.sh"
8+
"${SCRIPT_DIR}/linux-config.sh"
9+
10+
cd build
11+
cmake --build . --config Release
12+
13+
cd ${SCRIPT_DIR}

app/linux-clean.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e # Quit script on error
3+
4+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
cd ${SCRIPT_DIR}
6+
7+
echo "Cleaning out build dir...."
8+
rm -rf build
9+
10+
echo "Cleaning out external/build dir...."
11+
rm -rf external/build
12+
13+
echo "Cleaning completed"

app/linux-killprocess.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/linux-prebuild.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/bash
2-
32
set -e # Quit script on error
43
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
54

5+
6+
# Build vcpkg
67
if [ ! -d "vcpkg" ]; then
78
echo "Cloning vcpkg"
89
git clone --single-branch --branch master https://github.com/microsoft/vcpkg.git vcpkg
@@ -21,27 +22,20 @@ cd vcpkg
2122
cd ${SCRIPT_DIR}
2223

2324

24-
25+
# Build external dependencies and copy to build tree
26+
echo "Building external binary dependencies..."
2527
"${SCRIPT_DIR}/external/linux_build_externals.sh"
2628

29+
cp "${SCRIPT_DIR}/external/build/aubio-prefix/src/aubio-build/aubio_onset" "${SCRIPT_DIR}/server/native/"
2730

28-
# Install dependencies to server
29-
echo "Copying external dependencies to the server..."
3031
mkdir -p "${SCRIPT_DIR}/server/erlang/tau/priv/"
3132
cp ${SCRIPT_DIR}/external/build/sp_midi-prefix/src/sp_midi-build/*.so ${SCRIPT_DIR}/server/erlang/tau/priv/
3233
cp ${SCRIPT_DIR}/external/build/sp_link-prefix/src/sp_link-build/*.so ${SCRIPT_DIR}/server/erlang/tau/priv/
3334

34-
cp "${SCRIPT_DIR}/external/build/aubio-prefix/src/aubio-build/aubio_onset" "${SCRIPT_DIR}/server/native/"
35-
36-
#dont remove ruby-aubio-prerelease, as needed in linux build
37-
#it is removed in the windows-prebuild
38-
3935
echo "Compiling native ruby extensions..."
4036
ruby "${SCRIPT_DIR}/server/ruby/bin/compile-extensions.rb"
4137

4238
echo "Translating tutorial..."
43-
#assumes linux uses system ruby
44-
#so dont use prefix /server/native/ruby/bin/ruby, as unnecessary to set this up
4539
ruby "${SCRIPT_DIR}/server/ruby/bin/i18n-tool.rb" -t
4640

4741
echo "Generating docs for the Qt GUI..."
@@ -51,7 +45,7 @@ ruby "${SCRIPT_DIR}/server/ruby/bin/qt-doc.rb" -o "${SCRIPT_DIR}/gui/qt/utils/ru
5145
echo "Updating GUI translation files..."
5246
PATH=`pkg-config --variable bindir Qt5`:$PATH lrelease "${SCRIPT_DIR}"/gui/qt/lang/*.ts
5347

54-
echo "Compiling erlang files..."
48+
echo "Compiling Erlang files..."
5549
cd "${SCRIPT_DIR}/server/erlang/tau"
5650
erl -make
5751
cp src/tau.app.src ebin/tau.app

app/mac-build-all.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e # Quit script on error
3+
4+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
cd ${SCRIPT_DIR}
6+
7+
"${SCRIPT_DIR}/mac-prebuild.sh"
8+
"${SCRIPT_DIR}/mac-config.sh"
9+
10+
cd build
11+
cmake --build . --config Release
12+
13+
cd ${SCRIPT_DIR}

app/mac-clean.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
5+
# Use generic linux clean script
6+
"${SCRIPT_DIR}/linux-clean.sh"

app/mac-prebuild.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
set -e # Quit script on error
33
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44

5-
# Check to see if we have a bundled Ruby and if so, use that
6-
# Otherwise use system ruby
5+
76
# Build vcpkg
87
if [ ! -d "vcpkg" ]; then
98
echo "Cloning vcpkg"
@@ -24,6 +23,9 @@ cd vcpkg
2423

2524
cd ${SCRIPT_DIR}
2625

26+
27+
# Check to see if we have a bundled Ruby and if so, use that
28+
# Otherwise use system ruby
2729
BUNDLED_RUBY="${SCRIPT_DIR}/server/native/ruby/bin/ruby"
2830
if [ -f "$BUNDLED_RUBY" ]; then
2931
echo "Found bundled Ruby: ${BUNDLED_RUBY}"
@@ -33,15 +35,18 @@ else
3335
RUBY=ruby
3436
fi
3537

38+
echo "echo Cleaning out native dir...."
39+
rm -rf ${SCRIPT_DIR}/server/native/supercollider
40+
rm -rf ${SCRIPT_DIR}/server/native/erlang
41+
rm -rf ${SCRIPT_DIR}/server/native/scsynth
42+
3643

37-
# Build external dependencies
44+
# Build external dependencies and copy to build tree
45+
echo "Building external binary dependencies..."
3846
"${SCRIPT_DIR}/external/mac_build_externals.sh"
39-
# mkdir -p "${SCRIPT_DIR}/server/native/lib"
40-
cp "${SCRIPT_DIR}/external/build/aubio-prefix/src/aubio-build/aubio_onset" "${SCRIPT_DIR}/server/native/"
4147

48+
cp "${SCRIPT_DIR}/external/build/aubio-prefix/src/aubio-build/aubio_onset" "${SCRIPT_DIR}/server/native/"
4249

43-
# Install dependencies to server
44-
echo "Copying external dependencies to the server..."
4550
mkdir -p "${SCRIPT_DIR}/server/erlang/tau/priv/"
4651
for f in ${SCRIPT_DIR}/external/build/sp_midi-prefix/src/sp_midi-build/*.dylib; do
4752
cp $f ${SCRIPT_DIR}/server/erlang/tau/priv/$(basename $f .dylib).so
@@ -55,10 +60,9 @@ done
5560
# Copy prebuilt native files to server
5661
echo "Copying prebuilt binaries to the server..."
5762
mkdir -p ${SCRIPT_DIR}/server/native/
58-
rm -rf ${SCRIPT_DIR}/server/native/supercollider
59-
rm -rf ${SCRIPT_DIR}/server/native/erlang
60-
rm -rf ${SCRIPT_DIR}/server/native/scsynth
63+
6164
cp -R ${SCRIPT_DIR}/../prebuilt/macos/x64/* ${SCRIPT_DIR}/server/native/
65+
6266
cd ${SCRIPT_DIR}/server/native/
6367
ln -s supercollider/scsynth scsynth
6468
mv supercollider/extra-plugins/* supercollider/plugins/
@@ -68,7 +72,6 @@ echo "Compiling native ruby extensions..."
6872
$RUBY "${SCRIPT_DIR}/server/ruby/bin/compile-extensions.rb"
6973

7074
echo "Translating tutorial..."
71-
7275
$RUBY "${SCRIPT_DIR}/server/ruby/bin/i18n-tool.rb" -t
7376

7477
echo "Generating docs for the Qt GUI..."
@@ -79,7 +82,7 @@ echo "Updating GUI translation files..."
7982
# Use lrelease on PATH if available otherwise assume Qt was installed via homebrew
8083
PATH=$PATH:/usr/local/opt/qt@5/bin lrelease "${SCRIPT_DIR}"/gui/qt/lang/*.ts
8184

82-
echo "Compiling erlang files..."
85+
echo "Compiling Erlang files..."
8386
cd "${SCRIPT_DIR}/server/erlang/tau"
8487
../../native/erlang/erl -make
8588
cp src/tau.app.src ebin/tau.app

app/pi-build-all.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e # Quit script on error
3+
4+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
cd ${SCRIPT_DIR}
6+
7+
"${SCRIPT_DIR}/pi-prebuild.sh"
8+
"${SCRIPT_DIR}/pi-config.sh"
9+
10+
cd build
11+
cmake --build . --config Release
12+
13+
cd ${SCRIPT_DIR}

app/pi-clean.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
5+
# Use generic linux clean script
6+
"${SCRIPT_DIR}/linux-clean.sh"

app/pi-prebuild.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
5+
# Use generic linux prebuild script
6+
"${SCRIPT_DIR}/linux-prebuild.sh"

0 commit comments

Comments
 (0)