pipewire-jack: Disable LD_LIBRARY_PATH when libjack is in libdir

This avoids prepending /usr/lib to the LD_LIBRARY_PATH, which supersedes
DT_RUNPATH and can cause library confusion.
This commit is contained in:
Jan Alexander Steffens (heftig) 2023-08-03 20:53:49 +02:00 committed by Wim Taymans
parent 43db03909b
commit fa7cd96b6e
2 changed files with 9 additions and 2 deletions

View file

@ -21,12 +21,19 @@ libjack_path = get_option('libjack-path')
if libjack_path == '' if libjack_path == ''
libjack_path = modules_install_dir / 'jack' libjack_path = modules_install_dir / 'jack'
libjack_path_dlopen = modules_install_dir_dlopen / 'jack' libjack_path_dlopen = modules_install_dir_dlopen / 'jack'
libjack_path_enable = ''
elif libjack_path == get_option('libdir') or libjack_path == pipewire_libdir
libjack_path = pipewire_libdir
libjack_path_dlopen = libjack_path
libjack_path_enable = '#'
else else
libjack_path_dlopen = libjack_path libjack_path_dlopen = libjack_path
libjack_path_enable = ''
endif endif
tools_config = configuration_data() tools_config = configuration_data()
tools_config.set('LIBJACK_PATH', libjack_path_dlopen) tools_config.set('LIBJACK_PATH', libjack_path_dlopen)
tools_config.set('LIBJACK_PATH_ENABLE', libjack_path_enable)
configure_file(input : 'pw-jack.in', configure_file(input : 'pw-jack.in',
output : 'pw-jack', output : 'pw-jack',

View file

@ -54,7 +54,7 @@ if [ -n "$PERIOD" ]; then
fi fi
# shellcheck disable=SC2016 # ${LIB} is interpreted by ld.so, not the shell # shellcheck disable=SC2016 # ${LIB} is interpreted by ld.so, not the shell
LD_LIBRARY_PATH='@LIBJACK_PATH@'"${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}" @LIBJACK_PATH_ENABLE@LD_LIBRARY_PATH='@LIBJACK_PATH@'"${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}"
export LD_LIBRARY_PATH @LIBJACK_PATH_ENABLE@export LD_LIBRARY_PATH
exec "$@" exec "$@"