forked from PipeWire/wireplumber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-uninstalled.sh
executable file
·55 lines (46 loc) · 1.24 KB
/
wp-uninstalled.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
set -e
# This is unset by meson
# shellcheck disable=SC2157
if [ -z "@MESON@" ]; then
SOURCEDIR="@MESON_SOURCE_ROOT@"
BUILDDIR="@MESON_BUILD_ROOT@"
else
SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BUILDDIR=$(find "${SOURCEDIR}" -maxdepth 2 -name build.ninja -printf "%h\n" -quit 2>/dev/null || echo "${SOURCEDIR}/build")
fi
CONFIGDIR=config
while getopts ":b:c:" opt; do
case ${opt} in
b)
BUILDDIR=${OPTARG}
;;
c)
CONFIGDIR=${OPTARG}
;;
\?)
echo "Invalid option: -${OPTARG}"
exit 1
;;
:)
echo "Option -${OPTARG} requires an argument"
exit 1
;;
esac
done
shift $((OPTIND-1))
if [ $# -eq 0 ]; then
echo "Usage: $(basename "${BASH_SOURCE[0]}") [options] <wireplumber|wpctl|wpexec|...>"
exit 1
fi
if [ ! -d "${BUILDDIR}" ]; then
echo "Invalid build directory: ${BUILDDIR}"
exit 1
fi
echo "Using build directory: ${BUILDDIR}"
export WIREPLUMBER_MODULE_DIR="${BUILDDIR}/modules"
export WIREPLUMBER_CONFIG_DIR="${SOURCEDIR}/src/${CONFIGDIR}"
export WIREPLUMBER_DATA_DIR="${SOURCEDIR}/src"
export PATH="${BUILDDIR}/src:${BUILDDIR}/src/tools:$PATH"
export LD_LIBRARY_PATH="${BUILDDIR}/lib/wp:$LD_LIBRARY_PATH"
exec "$@"