1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-16 00:27:42 +02:00
audacity/linux/packages/build_packages.sh
Dmitry Vedenko cf328b9d87 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.
2021-08-02 19:52:15 +03:00

36 lines
839 B
Bash
Executable File

#!/usr/bin/env bash
set -euxo pipefail
scriptLocation=$(dirname "$(readlink -f "$0")")
audacityLocation=$(readlink -f "$scriptLocation/../..")
workDir="$scriptLocation/work_dir"
mkdir -p "$workDir"
pushd "$workDir"
tar --exclude '.git' \
--exclude "audacity-sources.tar.gz" \
-C "$audacityLocation/.." \
-czf audacity-sources.tar.gz audacity
for distro in "$@"
do
echo "Building $distro"
imageName="audacity-packaging-$distro"
docker build -t $imageName "$scriptLocation/$distro"
docker run -ti --volume=$workDir:/work_dir --rm $imageName prepare
docker run -ti --volume=$workDir:/work_dir --rm --network none $imageName build
docker run -ti --volume=$workDir:/work_dir --rm --network none $imageName package
done
rm audacity-sources.tar.gz
popd
cp -r $workDir/* ./
rm -R "$workDir"