Skip to content

Commit

Permalink
Build - update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
samaaron committed Oct 4, 2024
1 parent 04af410 commit a61763a
Show file tree
Hide file tree
Showing 28 changed files with 188 additions and 87 deletions.
9 changes: 7 additions & 2 deletions app/linux-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

"${SCRIPT_DIR}"/linux-prebuild.sh "$@"
"${SCRIPT_DIR}"/linux-config.sh "$@"
"${SCRIPT_DIR}"/linux-build-gui.sh "$@"
"${SCRIPT_DIR}"/linux-post-tau-prod-release.sh "$@"

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"

9 changes: 7 additions & 2 deletions app/linux-build-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

cd "${SCRIPT_DIR}"/build
cmake --build .

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"

11 changes: 9 additions & 2 deletions app/linux-clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

cd "${SCRIPT_DIR}"

echo "Cleaning out vcpkg...."
Expand All @@ -26,5 +33,5 @@ fi

echo "Cleaning completed"

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"


11 changes: 6 additions & 5 deletions app/linux-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

args=("$@")
config="Release"
no_imgui=false
Expand Down Expand Up @@ -53,8 +59,3 @@ option() {

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="$config" -DBUILD_IMGUI_INTERFACE="$(option "!$no_imgui")" -DUSE_SYSTEM_LIBS="$(option "$system_libs")" ..

cd "${SCRIPT_DIR}"


# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
10 changes: 8 additions & 2 deletions app/linux-post-tau-prod-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

args=("$@")
offline_build=false

Expand Down Expand Up @@ -38,5 +44,5 @@ else
MIX_ENV=prod mix tau.release
fi

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"


9 changes: 6 additions & 3 deletions app/linux-pre-tau-dev-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

cd "${SCRIPT_DIR}"/server/beam/tau

MIX_ENV=dev mix setup.dev

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
10 changes: 6 additions & 4 deletions app/linux-pre-translations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

echo "Translating tutorial..."
ruby "${SCRIPT_DIR}"/server/ruby/bin/i18n-tool.rb -t

echo "Generating docs for the Qt GUI..."
cp "${SCRIPT_DIR}"/gui/qt/utils/ruby_help.tmpl "${SCRIPT_DIR}"/gui/qt/utils/ruby_help.h
ruby "${SCRIPT_DIR}"/server/ruby/bin/qt-doc.rb


# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
15 changes: 10 additions & 5 deletions app/linux-pre-vcpkg.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -e # Quit script on error

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

args=("$@")
no_imgui=false

Expand All @@ -22,9 +31,6 @@ while [ -n "$1" ]; do
esac
done

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cd "${SCRIPT_DIR}"

# Build vcpkg
Expand All @@ -51,5 +57,4 @@ else
fi


# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"

9 changes: 6 additions & 3 deletions app/linux-prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

args=("$@")
system_libs=false

Expand Down Expand Up @@ -36,6 +42,3 @@ echo "Compiling native ruby extensions..."
ruby "${SCRIPT_DIR}"/server/ruby/bin/compile-extensions.rb

"${SCRIPT_DIR}"/linux-pre-translations.sh "${args[@]}"

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
7 changes: 7 additions & 0 deletions app/linux-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
shopt -s dotglob

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

cd "${SCRIPT_DIR}"

Expand Down
9 changes: 6 additions & 3 deletions app/mac-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

"${SCRIPT_DIR}"/mac-prebuild.sh "$@"
"${SCRIPT_DIR}"/mac-config.sh "$@"
"${SCRIPT_DIR}"/mac-build-gui.sh "$@"
"${SCRIPT_DIR}"/mac-post-tau-prod-release.sh "$@"

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
10 changes: 7 additions & 3 deletions app/mac-build-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

"${SCRIPT_DIR}"/linux-build-gui.sh "$@"
cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT


# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
"${SCRIPT_DIR}"/linux-build-gui.sh "$@"
9 changes: 6 additions & 3 deletions app/mac-clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

cd "${SCRIPT_DIR}"

echo "Cleaning out native dir...."
Expand All @@ -14,6 +20,3 @@ rm -rf "${SCRIPT_DIR}"/server/native/aubio_onset

# Use generic linux clean script for everything else
"${SCRIPT_DIR}"/linux-clean.sh "$@"

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
16 changes: 7 additions & 9 deletions app/mac-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

args=("$@")
config="Release"
no_imgui=false
Expand Down Expand Up @@ -54,12 +60,4 @@ then
cmake -G "Unix Makefiles" -DCMAKE_OSC_ARCHITECTURES="ARM64" -DCMAKE_BUILD_TYPE="$config" -DBUILD_IMGUI_INTERFACE="$(option "!$no_imgui")" ..
else
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="$config" -DBUILD_IMGUI_INTERFACE="$(option "!$no_imgui")" ..
fi






# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
fi
11 changes: 7 additions & 4 deletions app/mac-post-tau-prod-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

# Use generic linux clean script
"${SCRIPT_DIR}"/linux-post-tau-prod-release.sh "$@"
cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
# Use generic linux clean script
"${SCRIPT_DIR}"/linux-post-tau-prod-release.sh "$@"
10 changes: 7 additions & 3 deletions app/mac-pre-tau-dev-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT


# Use generic linux tau dev init script
"${SCRIPT_DIR}"/linux-pre-tau-dev-init.sh "$@"

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
10 changes: 6 additions & 4 deletions app/mac-pre-translations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

# Check to see if we have a bundled Ruby and if so, use that
# Otherwise use system ruby
BUNDLED_RUBY="${SCRIPT_DIR}/server/native/ruby/bin/ruby"
Expand All @@ -21,7 +27,3 @@ echo "Translating tutorial..."
echo "Generating docs for the Qt GUI..."
cp "${SCRIPT_DIR}"/gui/qt/utils/ruby_help.tmpl "${SCRIPT_DIR}"/gui/qt/utils/ruby_help.h
"$RUBY" "${SCRIPT_DIR}"/server/ruby/bin/qt-doc.rb


# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
16 changes: 10 additions & 6 deletions app/mac-pre-vcpkg.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -e # Quit script on error

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

args=("$@")
no_imgui=false

Expand All @@ -22,8 +31,7 @@ while [ -n "$1" ]; do
esac
done

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"


cd "${SCRIPT_DIR}"

Expand Down Expand Up @@ -59,7 +67,3 @@ if [ "$no_imgui" == true ]; then
else
./vcpkg install libsndfile[core,external-libs] kissfft fmt sdl2 gl3w reproc gsl-lite concurrentqueue platform-folders catch2 --triplet ${triplet[0]} --recurse
fi


# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
9 changes: 6 additions & 3 deletions app/mac-prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ set -e # Quit script on error
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR="$(pwd)"

cleanup_function() {
# Restore working directory as it was prior to this script running on exit
cd "${WORKING_DIR}"
}
trap cleanup_function EXIT

# Check to see if we have a bundled Ruby and if so, use that
# Otherwise use system ruby
BUNDLED_RUBY="${SCRIPT_DIR}"/server/native/ruby/bin/ruby
Expand All @@ -23,6 +29,3 @@ echo "Compiling native ruby extensions..."
"$RUBY" "${SCRIPT_DIR}"/server/ruby/bin/compile-extensions.rb

"${SCRIPT_DIR}"/mac-pre-translations.sh

# Restore working directory as it was prior to this script running...
cd "${WORKING_DIR}"
Loading

0 comments on commit a61763a

Please sign in to comment.