Repository Setup
Use this script below to build PulseAudio to run directly from the git source tree without installation:
#
# build.sh
#
# Steps for configuring and compiling PulseAudio to run
# directly from the git source tree. This is useful for
# day-to-day PA developers not to mess with the
# distribution-installed PulseAudio instance and configs.
#
# Detailed steps taken from Colin Guthrie's blog article:
#
# Compiling and running PulseAudio from git
# http://colin.guthr.ie/2010/09/compiling-and-running-pulseaudio-from-git/
#
LOG_DIR=build/logs
build() {
NOCONFIGURE=true ./bootstrap.sh -V
cd build
../configure --prefix=$(pwd)
#
# "Due to an intltool upstream bug, the translations for
# .desktop files are not written if the destination folder
# does not exist" --coling
#
mkdir -p src/daemon
make -j 30
# Mixer profile definitions
mkdir -p share/pulseaudio
ln -s ../../../src/modules/alsa/mixer share/pulseaudio/alsa-mixer
ln -s pacat src/paplay
ln -s pacat src/parec
}
rm -fr build
mkdir -p build
mkdir -p $LOG_DIR
build 2>&1 | tee $LOG_DIR/BUILD_LOG.txt
And this one to actually run it:
#
# Steps for running PulseAudio from within the git source tree
#
# Read and run the contents of `build.sh' script first!
#
LOG_DIR=build/logs
HOME_CONFIG_CLIENT_CONF=$HOME/.pulse/client.conf
AUTOSPAWN_NO=' *autospawn *= *no *'
#
# Even while PA modules actually exist under `build/src/.libs'
# instead of just `build/src', specificy the latter as the DL
# search path.
#
# Per the libtool documentation, libtool already adds the
# .libs/ suffix for us if we're running pulseAudio from within
# the source repository.
#
# It does this by applying some Unix trickery and by making
# `build/src/pulseaudio' actually a shell script wrapper
# around the real PA existing at `build/src/.libs/pulseaudio'!
#
PA=build/src/pulseaudio
PA_FLAGS="-n -F build/src/default.pa -p $(pwd)/build/src/.libs/ -vvvv"
run() {
#
# pulse-client.conf(5)
# autospawn= Autospawn a PulseAudio daemon when needed.
#
touch $HOME_CONFIG_CLIENT_CONF
grep "$AUTOSPAWN_NO" $HOME_CONFIG_CLIENT_CONF
if [ "$?" != "0" ]; then
echo "autospawn=no" >> $HOME_CONFIG_CLIENT_CONF
fi
# Assuming only user instances
PULSE_PID=$(ps ux | grep pulseaudio | grep -v grep | awk '{ print $2 }')
if [ x"$PULSE_PID" != x ]; then
kill $PULSE_PID
fi
$PA $PA_FLAGS
}
#
# Did we forget to execute `build.sh'?
#
if [ ! -x $PA ]; then
echo "In-place PA configuration and build not done"
echo "Please run \`build.sh' first!"
echo "Exiting ..."
exit -1
fi
run 2>&1 | tee $LOG_DIR/RUN_LOG.txt