#!/bin/sh # # xrdp: A Remote Desktop Protocol server. # # Copyright (C) 2021 Matt Burt, all xrdp contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Wrapper to call install_pulseaudio_sources.sh and tidy up afterwards # # The following command line switches are supported, for systems based on # Debian or Ubuntu:- # # 1) --mirror= Specify an alternative mirror for debootstrap # 2) --keyring= Specify an alternative keyring for debootstrap # 3) --suite= Specify an alternative suite for debootstrap # # The first two of these are are needed for systems with their own # mirrors and signing keys (i.e. Raspberry PI OS). # # --suite is useful for systems which report their own codename for # `lsb_release -c`, but are otherwise based on a standard distro. For # example Linux Mint 20.04 reports 'una', but is largely based on # Ubuntu 'focal' # --------------------------------------------------------------------------- # G L O B A L S # --------------------------------------------------------------------------- REPO_ROOT_PATH="$(realpath $(dirname "$0")/..)" # Where the output files are going PULSE_DIRNAME=pulseaudio.src PULSE_DIR=$REPO_ROOT_PATH/$PULSE_DIRNAME # Absolute path to the script we're wrapping. This picks it up from # the same directory this file is in WRAPPED_SCRIPT=$(cd $(dirname $0) && pwd)/install_pulseaudio_sources_apt.sh # The buildroot directory. Choose fast, temporary storage if available BUILDROOT=/var/lib/pa-build/$USER # Extra packages to install in the build root which the wrapped script # may be using. These are packages available by default when using # GitHub actions WRAPPED_SCRIPT_DEPS="sudo lsb-release doxygen" # ----------------------------------------------------------------------------- # S U I T E E X I S T S # # Does the specified debootstrap suite exist? # ----------------------------------------------------------------------------- SuiteExists() { [ -f "/usr/share/debootstrap/scripts/$1" ] } # ----------------------------------------------------------------------------- # I N S T A L L R E Q U I R E D P A C K A G E S # # Installs packages required for the build on the host machine # ----------------------------------------------------------------------------- InstallRequiredPackages() { set -- \ /usr/sbin/debootstrap debootstrap \ /usr/bin/schroot schroot \ /usr/bin/lsb_release lsb-release pkgs= while [ $# -ge 2 ]; do if [ ! -x $1 ]; then pkgs="$pkgs $2" fi shift 2 done if [ -n "$pkgs" ]; then echo "- Need to install packages :$pkgs" echo echo " These can be removed when this script completes with:-" echo " sudo apt-get purge$pkgs && apt-get autoremove" echo sudo apt-get install -y $pkgs fi } # ----------------------------------------------------------------------------- # R U N W R A P P E D S C R I P T # # Runs the wrapped build script using schroot # # This function definition uses () rather than {} to create an extra # sub-process where we can run 'set -e' without affecting the parent # # Parameters :