mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-29 16:50:12 +01:00
Add a framework to generate offline dependencies
`prepare_offline_dependencies.sh` will generate a tarball containing: * Files required for PIP to install Conan * Conan download cache The resulting tarball content depends on CMake flags passed down to the script. `build_package.sh` demonstrates how to use the offline dependecies to build Audacity. The script requires the exact CMake options that were provided to `prepare_offline_dependencies.sh` `build_packages.sh` allows validating the build process for different Linux distros. It uses Docker to: * Generate the dependencies tarball. * Execute an offline build using `build_package.sh`. * Generate distro specific packages, offline as well.
This commit is contained in:
committed by
Dmitry Vedenko
parent
b25e3b767f
commit
cf328b9d87
62
linux/packages/prepare_offline_dependencies.sh
Executable file
62
linux/packages/prepare_offline_dependencies.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage prepare_offline_environment.sh cmake-options...
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
packageName="audacity-offline-dependencies"
|
||||
scriptLocation=$(dirname "$(readlink -f "$0")")
|
||||
audacityLocation=$(readlink -f "$scriptLocation/../..")
|
||||
resultsLocation=$(pwd)
|
||||
packageLocation="$resultsLocation/$packageName"
|
||||
|
||||
echo "Audacity location: $audacityLocation"
|
||||
echo "Result location: $resultsLocation"
|
||||
|
||||
mkdir -p $packageLocation
|
||||
|
||||
cd $packageLocation
|
||||
|
||||
# Create pip download cache containing all the
|
||||
# packages requiredf to istall Conan
|
||||
|
||||
mkdir -p pip_cache
|
||||
|
||||
pushd pip_cache
|
||||
|
||||
pip3 download conan
|
||||
|
||||
popd
|
||||
|
||||
# Cache all Conan dependencies
|
||||
|
||||
mkdir -p temp
|
||||
|
||||
pushd temp
|
||||
python3 -m venv conan_env
|
||||
|
||||
source conan_env/bin/activate
|
||||
pip3 install --no-index --find-links "$packageLocation/pip_cache" conan
|
||||
|
||||
export CONAN_USER_HOME="$packageLocation/conan_home"
|
||||
mkdir -p $CONAN_USER_HOME
|
||||
|
||||
conan config home
|
||||
conan config init
|
||||
conan config set storage.download_cache="$CONAN_USER_HOME/download_cache"
|
||||
|
||||
# Configure Audacity so we can collect the required
|
||||
# packages.
|
||||
|
||||
cmake ${@} $audacityLocation
|
||||
|
||||
conan remove "*" --src --builds --packages --force
|
||||
popd
|
||||
|
||||
rm -R temp
|
||||
|
||||
cd $resultsLocation
|
||||
|
||||
tar -czf "$packageName.tar.gz" $packageName
|
||||
|
||||
rm -R $packageLocation
|
||||
Reference in New Issue
Block a user