mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-29 15:19:44 +02:00
Use vcpkg for dependencies and cleanup GH Actions workflow
Signed-off-by: Be <be@mixxx.org>
This commit is contained in:
parent
7f95afcc89
commit
0acf00d8b9
185
.github/workflows/cmake_build.yml
vendored
185
.github/workflows/cmake_build.yml
vendored
@ -14,37 +14,32 @@ jobs:
|
||||
build:
|
||||
name: ${{ matrix.config.name }}
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
env:
|
||||
AUDACITY_CMAKE_GENERATOR: ${{ matrix.config.generator }}
|
||||
AUDACITY_ARCH_LABEL: ${{ matrix.config.arch }}
|
||||
# Windows codesigning
|
||||
# This variables will be used by all the steps
|
||||
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
|
||||
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
||||
# Conan home location to be used for cache action
|
||||
CONAN_USER_HOME: "${{ github.workspace }}/conan-home/"
|
||||
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-home/short"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
|
||||
- name: Ubuntu_18.04
|
||||
os: ubuntu-18.04
|
||||
- name: Ubuntu_20.04
|
||||
os: ubuntu-20.04
|
||||
arch: x86_64 # as reported by `arch` or `uname -m`
|
||||
generator: Unix Makefiles
|
||||
compiler_cache: ccache
|
||||
compiler_cache_path: ~/.ccache
|
||||
vcpkg_binary_cache: ~/.cache/vcpkg
|
||||
vcpkg_triplet: x64-linux
|
||||
wxwidgets_git_url: https://github.com/wxWidgets/wxWidgets.git
|
||||
wxwidgets_git_ref: v3.1.5
|
||||
WX_CONFIG: /home/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config
|
||||
|
||||
- name: macOS_Intel
|
||||
os: macos-latest
|
||||
arch: Intel # as reported by Apple menu > About This Mac
|
||||
generator: Unix Makefiles
|
||||
# LAME only builds in Conan when not using the Xcode generator if explicitly setting GCC
|
||||
cc: gcc
|
||||
cxx: g++
|
||||
compiler_cache: ccache
|
||||
compiler_cache_path: ~/Library/Caches/ccache
|
||||
vcpkg_binary_cache: ~/.cache/vcpkg
|
||||
vcpkg_triplet: x64-osx-10.12min
|
||||
wxwidgets_git_url: https://github.com/wxWidgets/wxWidgets.git
|
||||
wxwidgets_git_ref: v3.1.5
|
||||
WX_CONFIG: /Users/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config
|
||||
|
||||
- name: Windows_32bit
|
||||
os: windows-latest
|
||||
@ -52,9 +47,11 @@ jobs:
|
||||
# required so CMake uses MSVC rather than MinGW
|
||||
cc: cl
|
||||
cxx: cl
|
||||
generator: Ninja
|
||||
compiler_cache: sccache
|
||||
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
|
||||
vcpkg_binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg
|
||||
vcpkg_triplet: x86-windows
|
||||
exe_suffix: .exe
|
||||
|
||||
- name: Windows_64bit
|
||||
os: windows-latest
|
||||
@ -62,28 +59,39 @@ jobs:
|
||||
# required so CMake uses MSVC rather than MinGW
|
||||
cc: cl
|
||||
cxx: cl
|
||||
generator: Ninja
|
||||
compiler_cache: sccache
|
||||
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
|
||||
vcpkg_binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg
|
||||
vcpkg_triplet: x64-windows
|
||||
exe_suffix: .exe
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: RelWithDebInfo
|
||||
CMAKE_C_COMPILER_LAUNCHER: ${{ matrix.config.os.compiler_cache }}
|
||||
CMAKE_CXX_COMPILER_LAUNCHER: ${{ matrix.config.os.compiler_cache }}
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.12
|
||||
|
||||
VCPKG_DISABLE_METRICS: true
|
||||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vcpkg_triplet }}
|
||||
|
||||
# Windows codesigning
|
||||
# This variables will be used by all the steps
|
||||
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
|
||||
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
||||
|
||||
AUDACITY_ARCH_LABEL: ${{ matrix.config.arch }}
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
- name: Checkout Git repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Add conan to path
|
||||
if: runner.os == 'Windows'
|
||||
run: echo "C:\Program Files\Conan\conan\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
shell: pwsh
|
||||
|
||||
- name: Dependencies
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
exec bash "scripts/ci/dependencies.sh"
|
||||
|
||||
- name: Environment
|
||||
run: |
|
||||
source "scripts/ci/environment.sh"
|
||||
|
||||
- name: Install Apple codesigning certificates
|
||||
uses: apple-actions/import-codesign-certs@v1
|
||||
if: startswith( matrix.config.os, 'macos' ) && github.event_name == 'push' && github.repository_owner == 'audacity'
|
||||
@ -98,10 +106,52 @@ jobs:
|
||||
with:
|
||||
arch: ${{ matrix.config.arch }}
|
||||
|
||||
# Having this in PATH breaks building LAME in Conan when not using Visual Studio CMake generator
|
||||
- name: "[Windows] Remove MinGW link"
|
||||
- name: Get Git commit of vcpkg submodule
|
||||
run: echo VCPKG_COMMIT=$(git ls-tree HEAD vcpkg | awk '{print $3}') >> ${GITHUB_ENV}
|
||||
|
||||
- name: Setup vcpkg cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
# cache the vcpkg executable to avoid having to bootstrap vcpkg every time
|
||||
path: |
|
||||
${{ github.workspace }}/vcpkg/vcpkg${{ matrix.config.exe_suffix }}
|
||||
${{ matrix.config.vcpkg_binary_cache }}
|
||||
key: ${{ matrix.config.name }}-${{ hashFiles('**/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}-${{ github.run_number }}
|
||||
restore-keys: |
|
||||
${{ matrix.config.name }}-${{ hashFiles(' **/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}-
|
||||
${{ matrix.config.name }}-${{ hashFiles(' **/vcpkg.json') }}-
|
||||
${{ matrix.config.name }}-
|
||||
|
||||
# FIXME: hack around bad SSL certificate, needed to build ffmpeg
|
||||
# https://github.com/microsoft/vcpkg/issues/19121
|
||||
- name: "[Windows] Install yasm"
|
||||
if: runner.os == 'Windows'
|
||||
run: rm "C:/Program Files/Git/usr/bin/link.EXE"
|
||||
run: |
|
||||
mkdir -p "vcpkg/downloads/tools/yasm/1.3.0.6"
|
||||
curl -k -o "vcpkg/downloads/tools/yasm/1.3.0.6/yasm.exe" \
|
||||
"http://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe"
|
||||
|
||||
- name: "Set up wxwidgets cache"
|
||||
uses: actions/cache@v2
|
||||
id: wxwidgets-cache
|
||||
if: runner.os != 'Windows'
|
||||
with:
|
||||
path: ${{ github.workspace }}/wxwidgets-install
|
||||
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.wxwidgets_git_url }}-${{ matrix.config.wxwidgets_git_ref }}
|
||||
|
||||
# FIXME: use wxWidgets from vcpkg for all OSes when bugs are fixed for Linux and macOS
|
||||
# https://github.com/microsoft/vcpkg/pull/17111
|
||||
- name: Build and install wxWidgets
|
||||
if: steps.wxwidgets-cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
|
||||
run: |
|
||||
# wxWidgets' build system does not find dependencies from vcpkg, so use its vendored Git submodules
|
||||
git clone --recurse-submodules ${{ matrix.config.wxwidgets_git_url }}
|
||||
cd wxWidgets
|
||||
git checkout ${{ matrix.config.wxwidgets_git_ref }}
|
||||
cmake -G Ninja -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/wxwidgets-install \
|
||||
-S . -B cmake_build
|
||||
cmake --build cmake_build
|
||||
cmake --install cmake_build
|
||||
|
||||
- name: "Set up compiler cache"
|
||||
uses: actions/cache@v2
|
||||
@ -112,25 +162,15 @@ jobs:
|
||||
${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-
|
||||
${{ matrix.config.os }}-${{ matrix.config.arch }}-
|
||||
|
||||
- name: Cache for .conan
|
||||
id: cache-conan
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-conan-modules
|
||||
with:
|
||||
path: ${{ env.CONAN_USER_HOME }}
|
||||
key: host-${{ matrix.config.name }}-${{ hashFiles('cmake-proxies/CMakeLists.txt') }}
|
||||
restore-keys: |
|
||||
host-${{ matrix.config.name }}-
|
||||
|
||||
# Install scdoc with conan TODO: Move conan pkg to own repo
|
||||
- name: "[Linux] Install scdoc"
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
conan remote add -f rigs-of-rods-deps https://conan.cloudsmith.io/rigs-of-rods/deps/
|
||||
conan install scdoc/1.11.1@anotherfoxguy/stable -g=virtualenv --build=missing
|
||||
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake
|
||||
-G Ninja
|
||||
-D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
|
||||
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install
|
||||
-D VCPKG=ON
|
||||
-S .
|
||||
-B build
|
||||
env:
|
||||
# Apple code signing
|
||||
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
|
||||
@ -138,29 +178,46 @@ jobs:
|
||||
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
|
||||
CC: ${{ matrix.config.cc }}
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
run: |
|
||||
exec bash "scripts/ci/configure.sh"
|
||||
# hack to get CMake to find wxWidgets until vcpkg wxWidgets port is fixed
|
||||
# https://github.com/microsoft/vcpkg/pull/17111
|
||||
WX_CONFIG: ${{ matrix.config.WX_CONFIG }}
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
exec bash "scripts/ci/build.sh"
|
||||
run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
|
||||
|
||||
- name: "Print compiler cache stats"
|
||||
run: ${{ matrix.config.compiler_cache }} -s
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
exec bash "scripts/ci/install.sh"
|
||||
run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
exec bash "scripts/ci/package.sh"
|
||||
- name: "[Windows] Package"
|
||||
if: runner.os == 'Windows'
|
||||
run: cmake --build build --target innosetup --config ${{ env.CMAKE_BUILD_TYPE }}
|
||||
|
||||
- name: Upload artifact
|
||||
- name: "[Ubuntu/macOS] Package"
|
||||
if: runner.os != 'Windows'
|
||||
working-directory: build
|
||||
run: >-
|
||||
cpack
|
||||
-C ${{ env.CMAKE_BUILD_TYPE }}
|
||||
-D CPACK_COMMAND_HDIUTIL=${{ github.workspace }}/scripts/ci/macos/repeat_hdiutil.sh
|
||||
--verbose
|
||||
&& rm -r package/_CPack_Packages
|
||||
env:
|
||||
# Required for linuxdeploy to find wxWidgets libraries installed without a package manager
|
||||
WXWIDGETS_LD_LIBRARY_PATH: ${{ github.workspace }}/wxwidgets-install/lib
|
||||
|
||||
- name: Upload package artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Tenacity_${{ matrix.config.name }}_${{ github.run_id }}_${{ env.GIT_HASH_SHORT }}
|
||||
path: |
|
||||
build/package/*
|
||||
!build/package/_CPack_Packages
|
||||
path: build/package/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifact of vcpkg build logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: vcpkg-logs-${{ runner.os }}
|
||||
path: ${{ github.workspace }}/vcpkg/buildtrees/**/*.log
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -214,3 +214,5 @@ win/xaudacity.ico
|
||||
|
||||
# VSCode
|
||||
.vscode/
|
||||
|
||||
vcpkg_installed
|
||||
|
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
[submodule "vcpkg"]
|
||||
path = vcpkg
|
||||
url = https://github.com/tenacityteam/vcpkg.git
|
||||
branch = tenacity
|
@ -14,6 +14,54 @@
|
||||
# generator expressions.
|
||||
cmake_minimum_required( VERSION 3.15 )
|
||||
|
||||
find_package(Git)
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
option(VCPKG "Use vcpkg for dependencies" ON)
|
||||
else()
|
||||
option(VCPKG "Use vcpkg for dependencies" OFF)
|
||||
endif()
|
||||
|
||||
if(VCPKG)
|
||||
set(ENV{VCPKG_DISABLE_METRICS} true)
|
||||
|
||||
if(VCPKG_ROOT)
|
||||
message(STATUS "Using dependencies from vcpkg repository at ${VCPKG_ROOT}")
|
||||
if(NOT EXISTS "${VCPKG_ROOT}/bootstrap-vcpkg.sh")
|
||||
message(FATAL_ERROR "${VCPKG_ROOT} is not a vcpkg Git repository.")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using dependencies from vcpkg Git submodule")
|
||||
set(VCPKG_ROOT "${CMAKE_SOURCE_DIR}/vcpkg")
|
||||
|
||||
if(NOT EXISTS "${VCPKG_ROOT}/bootstrap-vcpkg.sh")
|
||||
message(STATUS "Initializing vcpkg Git submodule")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED VCPKG_OVERLAY_PORTS)
|
||||
set(VCPKG_OVERLAY_PORTS "${VCPKG_ROOT}/overlay/ports")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED VCPKG_OVERLAY_TRIPLETS)
|
||||
set(VCPKG_OVERLAY_TRIPLETS "${VCPKG_ROOT}/overlay/triplets")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
|
||||
if(APPLE)
|
||||
set(VCPKG_TARGET_TRIPLET "x64-osx-10.12min")
|
||||
endif()
|
||||
elseif(DEFINED ENV{VCPKG_DEFAULT_TRIPLET})
|
||||
set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
|
||||
else()
|
||||
message(STATUS "Searching for dependencies from system, not using vcpkg.")
|
||||
endif()
|
||||
|
||||
# If building with GNU compiler, then must be 4.9 or later.
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
|
||||
CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
|
||||
@ -108,6 +156,10 @@ set( CMAKE_PREFIX_PATH
|
||||
set( CMAKE_CXX_STANDARD 17 )
|
||||
set( CMAKE_CXX_STANDARD_REQUIRED ON )
|
||||
|
||||
include( CMakeDependentOption )
|
||||
|
||||
project( Tenacity )
|
||||
|
||||
# Use ccache if available
|
||||
find_program( CCACHE_PROGRAM ccache )
|
||||
mark_as_advanced( FORCE CCACHE_PROGRAM )
|
||||
@ -127,11 +179,6 @@ else()
|
||||
message( STATUS "Could NOT find ccache nor sccache, no compiler caching enabled" )
|
||||
endif()
|
||||
|
||||
include( CMakeDependentOption )
|
||||
|
||||
# Our very own project
|
||||
project( Tenacity )
|
||||
|
||||
# Load our functions/macros
|
||||
include( AudacityFunctions )
|
||||
|
||||
@ -213,7 +260,6 @@ set( AUDACITY_VERSION 0 )
|
||||
set( AUDACITY_RELEASE 0 )
|
||||
set( AUDACITY_REVISION 0 )
|
||||
set( GIT_DESCRIBE "unknown" )
|
||||
find_package( Git QUIET )
|
||||
if( GIT_FOUND )
|
||||
execute_process(
|
||||
COMMAND
|
||||
@ -633,19 +679,31 @@ endif()
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
|
||||
find_package(GLIB REQUIRED)
|
||||
find_package(GTK 3.0 REQUIRED)
|
||||
|
||||
endif()
|
||||
|
||||
set(wxWidgets_CONFIG_OPTIONS --version=3.1)
|
||||
find_package(wxWidgets 3.1 REQUIRED COMPONENTS adv base core html qa xml net)
|
||||
include(${wxWidgets_USE_FILE})
|
||||
# The FindwxWidgets.cmake module does not create an IMPORT target, so hack one together.
|
||||
# This makes it easy to add the compile definitions to the lib-strings and lib-strings-utils targets.
|
||||
if(NOT TARGET wxWidgets::wxWidgets)
|
||||
add_library(wxWidgets::wxWidgets INTERFACE IMPORTED)
|
||||
target_link_libraries(wxWidgets::wxWidgets INTERFACE ${wxWidgets_LIBRARIES})
|
||||
target_compile_definitions(wxWidgets::wxWidgets INTERFACE ${wxWidgets_DEFINITIONS} ${wxWidgets_DEFINITIONS_DEBUG})
|
||||
if(WIN32)
|
||||
target_compile_definitions(wxWidgets::wxWidgets INTERFACE WXUSINGDLL)
|
||||
if(NOT WIN32)
|
||||
set(wxWidgets_CONFIG_OPTIONS --version=3.1)
|
||||
find_package(wxWidgets 3.1 COMPONENTS adv base core html qa xml net)
|
||||
include(${wxWidgets_USE_FILE})
|
||||
# The FindwxWidgets.cmake module does not create an IMPORT target, so hack one together.
|
||||
# This makes it easy to add the compile definitions to the lib-strings and lib-strings-utils targets.
|
||||
if(NOT TARGET wxWidgets::wxWidgets)
|
||||
add_library(wxWidgets::wxWidgets INTERFACE IMPORTED)
|
||||
target_link_libraries(wxWidgets::wxWidgets INTERFACE ${wxWidgets_LIBRARIES})
|
||||
target_compile_definitions(wxWidgets::wxWidgets INTERFACE ${wxWidgets_DEFINITIONS} ${wxWidgets_DEFINITIONS_DEBUG})
|
||||
endif()
|
||||
else()
|
||||
# On Windows we are using wxWidgets from an unmerged vcpkg branch in our vcpkg overlay
|
||||
# https://github.com/microsoft/vcpkg/pull/17111
|
||||
# This requires using 'unofficial-wxWidgets' rather than simply 'wxWidgets'.
|
||||
# This is required for CMAKE_BUILD_TYPE=Debug to work. Refer to
|
||||
# https://github.com/microsoft/vcpkg/issues/18066
|
||||
# for background about the bug.
|
||||
find_package(unofficial-wxWidgets COMPONENTS adv base core html qa xml net)
|
||||
if(NOT TARGET wxWidgets::wxWidgets)
|
||||
add_library(wxWidgets::wxWidgets INTERFACE IMPORTED)
|
||||
target_link_libraries(wxWidgets::wxWidgets INTERFACE wx::wxadv wx::wxbase wx::wxcore wx::wxhtml wx::wxqa wx::wxxml wx::wxnet)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -89,7 +89,7 @@ ln -sf share/icons/hicolor/scalable/apps/tenacity.svg "${appdir}/.DirIcon"
|
||||
|
||||
# HACK: Some wxWidget libraries depend on themselves. Add
|
||||
# them to LD_LIBRARY_PATH so that linuxdeploy can find them.
|
||||
export LD_LIBRARY_PATH="${appdir}/usr/lib/tenacity:${LD_LIBRARY_PATH-}"
|
||||
export LD_LIBRARY_PATH="${appdir}/usr/lib/tenacity:${WXWIDGETS_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH-}"
|
||||
|
||||
linuxdeploy --appdir "${appdir}" # add all shared library dependencies
|
||||
|
||||
|
@ -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
|
@ -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
|
@ -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
|
||||
|
@ -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)
|
@ -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
0
scripts/ci/macos/repeat_hdiutil.sh
Normal file → Executable 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
|
1
vcpkg
Submodule
1
vcpkg
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 173356335adb0ba33c6e496e6e6bf226aa244d76
|
32
vcpkg.json
Normal file
32
vcpkg.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "tenacity",
|
||||
"version": "0.10",
|
||||
"description": "Tenacity is an easy-to-use, cross-platform multi-track audio editor/recorder for Windows, MacOS, GNU/Linux and other operating systems.",
|
||||
"homepage": "https://tenacityaudio.org/",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"libsndfile",
|
||||
"lilv",
|
||||
"libid3tag",
|
||||
"libmad",
|
||||
"twolame",
|
||||
"soxr",
|
||||
"soundtouch",
|
||||
"libsbsms",
|
||||
"portaudio",
|
||||
"portmidi",
|
||||
"portsmf",
|
||||
"mp3lame",
|
||||
"libmad",
|
||||
"zlib",
|
||||
"vamp-sdk",
|
||||
"expat",
|
||||
"sqlite3",
|
||||
"ffmpeg",
|
||||
{
|
||||
"name": "wxwidgets",
|
||||
"platform": "windows"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user