From 3b5e040659743546caf46766118e1a9812bfd1cd Mon Sep 17 00:00:00 2001 From: Be Date: Fri, 12 Feb 2021 15:05:34 -0600 Subject: [PATCH] pw-uninstalled.sh: use directory of script instead of current dir This allows running the script from outside the PipeWire source tree, which is convenient for developing other applications for use with PipeWire. Fixes #720 --- pw-uninstalled.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pw-uninstalled.sh b/pw-uninstalled.sh index 1236cdc52..4779b3564 100755 --- a/pw-uninstalled.sh +++ b/pw-uninstalled.sh @@ -2,6 +2,8 @@ set -e +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + while getopts ":b:v:" opt; do case ${opt} in b) @@ -22,7 +24,7 @@ while getopts ":b:v:" opt; do done if [ -z "${BUILDDIR}" ]; then - BUILDDIR=${PWD}/build + BUILDDIR=${SCRIPT_DIR}/build echo "Using default build directory: ${BUILDDIR}" fi @@ -41,8 +43,8 @@ export PATH="${BUILDDIR}/src/daemon:${BUILDDIR}/src/tools:${BUILDDIR}/src/exampl export LD_LIBRARY_PATH="${BUILDDIR}/pipewire-pulseaudio/src/:${BUILDDIR}/src/pipewire/:${BUILDDIR}/pipewire-jack/src/${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}" export GST_PLUGIN_PATH="${BUILDDIR}/src/gst/${GST_PLUGIN_PATH+":${GST_PLUGIN_PATH}"}" # the directory with card profiles and paths -export ACP_PATHS_DIR=${PWD}"/spa/plugins/alsa/mixer/paths" -export ACP_PROFILES_DIR=${PWD}"/spa/plugins/alsa/mixer/profile-sets" +export ACP_PATHS_DIR="${SCRIPT_DIR}/spa/plugins/alsa/mixer/paths" +export ACP_PROFILES_DIR="${SCRIPT_DIR}/spa/plugins/alsa/mixer/profile-sets" # FIXME: find a nice, shell-neutral way to specify a prompt ${SHELL}