1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-10 00:23:32 +02:00

Use vcpkg for dependencies and cleanup GH Actions workflow

Signed-off-by: Be <be@mixxx.org>
This commit is contained in:
Be
2021-08-09 16:04:57 -05:00
parent 7f95afcc89
commit 0acf00d8b9
14 changed files with 253 additions and 242 deletions

View File

@@ -1,44 +0,0 @@
#!/usr/bin/env bash
((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "$0: Error: Please upgrade Bash."; exit 1; }
set -euxo pipefail
if [[ "${OSTYPE}" == msys* ]]; then # Windows
cpus="${NUMBER_OF_PROCESSORS}"
elif [[ "${OSTYPE}" == darwin* ]]; then # macOS
cpus="$(sysctl -n hw.ncpu)"
else # Linux & others
cpus="$(nproc)"
fi
export CMAKE_BUILD_PARALLEL_LEVEL=$(( ${cpus} > 2 ? $((${cpus} - 2)) : ${cpus} ))
echo "Using ${CMAKE_BUILD_PARALLEL_LEVEL} processors for cmake build"
# Build Audacity
cmake --build build --config "${AUDACITY_BUILD_TYPE}"
BIN_OUTPUT_DIR=build/bin/${AUDACITY_BUILD_TYPE}
SYMBOLS_OUTPUT_DIR=debug
mkdir ${SYMBOLS_OUTPUT_DIR}
if [[ "${OSTYPE}" == msys* ]]; then # Windows
# copy PDBs to debug folder...
find ${BIN_OUTPUT_DIR} -name '*.pdb' | xargs -I % cp % ${SYMBOLS_OUTPUT_DIR}
# and remove debug symbol files from the file tree before archiving
find ${BIN_OUTPUT_DIR} -name '*.iobj' -o -name '*.ipdb' -o -name '*.pdb' -o -name '*.ilk' | xargs rm -f
elif [[ "${OSTYPE}" == darwin* ]]; then # macOS
find ${BIN_OUTPUT_DIR} -name '*.dSYM' | xargs -J % mv % ${SYMBOLS_OUTPUT_DIR}
else # Linux & others
chmod +x scripts/ci/linux/split_debug_symbols.sh
find ${BIN_OUTPUT_DIR} -type f -executable -o -name '*.so' | xargs -n 1 scripts/ci/linux/split_debug_symbols.sh
find ${BIN_OUTPUT_DIR} -name '*.debug' | xargs -I % mv % ${SYMBOLS_OUTPUT_DIR}
fi

View File

@@ -1,53 +0,0 @@
#!/usr/bin/env bash
((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "$0: Error: Please upgrade Bash."; exit 1; }
if [ -f "activate.sh" ]; then
echo "Setting up conan venv"
source activate.sh
fi
set -euxo pipefail
conan --version # check it works
cmake_args=(
-S .
-B build
-G "${AUDACITY_CMAKE_GENERATOR}"
-D use_pch=no
-D CMAKE_BUILD_TYPE="${AUDACITY_BUILD_TYPE}"
-D CMAKE_INSTALL_PREFIX="${AUDACITY_INSTALL_PREFIX}"
)
if [[ -n "${APPLE_CODESIGN_IDENTITY}" && "${OSTYPE}" == darwin* ]]; then
cmake_args+=(
-D APPLE_CODESIGN_IDENTITY="${APPLE_CODESIGN_IDENTITY}"
-D perform_codesign=yes
)
if [[ ${GIT_BRANCH} == release* ]]; then
cmake_args+=(
-D APPLE_NOTARIZATION_USER_NAME="${APPLE_NOTARIZATION_USER_NAME}"
-D APPLE_NOTARIZATION_PASSWORD="${APPLE_NOTARIZATION_PASSWORD}"
-D perform_notarization=yes
)
fi
elif [[ -n "${WINDOWS_CERTIFICATE}" && "${OSTYPE}" == msys* ]]; then
# Windows certificate will be used from the environment
cmake_args+=(
-D perform_codesign=yes
)
fi
if [[ ${GIT_BRANCH} == release* ]]; then
cmake_args+=(
-D package_manual=yes
)
fi
# Configure Audacity
cmake "${cmake_args[@]}"
# Remove build directories and sources to reduce the cache size.
conan remove "*" --src --builds --force

View File

@@ -11,7 +11,6 @@ if [[ "${OSTYPE}" == msys* ]]; then # Windows
# Chocolatey packages
choco_packages=(
sccache
conan
)
choco install "${choco_packages[@]}" -y
@@ -25,8 +24,11 @@ elif [[ "${OSTYPE}" == darwin* ]]; then # macOS
# Homebrew packages
brew_packages=(
bash # macOS ships with Bash v3 for licensing reasons so upgrade it now
conan
ccache
ninja
# needed to build ffmpeg
nasm
)
brew install "${brew_packages[@]}"
@@ -39,28 +41,31 @@ else # Linux & others
# Distribution packages
if which apt-get; then
apt_packages=(
# Docker image
# Build tools
file
g++
ninja-build
nasm
git
wget
bash
scdoc
ccache
# Dependencies
debhelper-compat
gettext
libasound2-dev
libgtk-3-dev
libsuil-dev
# GitHub Actions
libasound2-dev
libgtk2.0-dev
gettext
ccache
)
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends "${apt_packages[@]}"
# Download Conan from github
wget "https://github.com/conan-io/conan/releases/latest/download/conan-ubuntu-64.deb" -nv -O /tmp/conan.deb
sudo dpkg -i /tmp/conan.deb
else
echo >&2 "$0: Error: You don't have a recognized package manager installed."
exit 1
fi
fi

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env bash
if [[ "$0" == "${BASH_SOURCE}" ]]; then
echo >&2 "$0: Please source this script instead of running it."
exit 1
fi
((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "${BASH_SOURCE}: Error: Please upgrade Bash."; return 1; }
function gh_export()
{
[[ "${GITHUB_ENV-}" ]] || local -r GITHUB_ENV="/dev/null"
export -- "$@" && printf "%s\n" "$@" >> "${GITHUB_ENV}"
}
repository_root="$(cd "$(dirname "${BASH_SOURCE}")/.."; echo "${PWD}/${GITHUB_ACTOR}")"
gh_export GIT_HASH="$(git show -s --format='%H')"
gh_export GIT_HASH_SHORT="$(git show -s --format='%h')"
gh_export AUDACITY_BUILD_TYPE="RelWithDebInfo"
gh_export AUDACITY_INSTALL_PREFIX="${repository_root}/build/install"
gh_export GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env bash
((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "$0: Error: Please upgrade Bash."; exit 1; }
set -euxo pipefail
# Install Audacity
cmake --install build --config "${AUDACITY_BUILD_TYPE}" --verbose

0
scripts/ci/macos/repeat_hdiutil.sh Normal file → Executable file
View File

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env bash
((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "$0: Error: Please upgrade Bash."; exit 1; }
set -euxo pipefail
cd build
if [[ "${OSTYPE}" == msys* && ${GIT_BRANCH} == release* ]]; then # Windows
cmake --build . --target innosetup --config "${AUDACITY_BUILD_TYPE}"
else
# GITHUB_WORKSPACE is set by the checkout action in the action workflow configuration
export CPACK_COMMAND_HDIUTIL="${GITHUB_WORKSPACE}/scripts/ci/macos/repeat_hdiutil.sh"
chmod +x $CPACK_COMMAND_HDIUTIL
cpack -C "${AUDACITY_BUILD_TYPE}" -D CPACK_COMMAND_HDIUTIL="${CPACK_COMMAND_HDIUTIL}" --verbose
fi
# Remove the temporary directory
rm -Rf package/_CPack_Packages