Improve LD_LIBRARY_PATH handling
-
scripts: Don't add an empty entry to LD_LIBRARY_PATH
LD_LIBRARY_PATH="/path/to/lib:" is interpreted as equivalent to LD_LIBRARY_PATH="/path/to/lib:.", loading libraries from the current working directory, which could lead to malicious libraries being loaded if the current working directory is untrusted. To avoid this, only add the current LD_LIBRARY_PATH to the new LD_LIBRARY_PATH if it is actually set.
This commit also single-quotes the interpolated @VARIABLES@ so that their values can contain shell special characters (other than single quotes).
-
scripts: Use special ${LIB} token for architecture-independence
On GNU/Linux systems, the literal string '${LIB}' in dynamic linker paths expands to "lib", a biarch libQUAL directory such as "lib64", or a Debian-style multiarch directory such as "lib/x86_64-linux-gnu". If we're installing libraries to such a directory, and we have both word-sizes' compatibility libraries available, then pw-pulse can use LD_LIBRARY_PATH='/usr/${LIB}/pipewire-0.3/pulse' to make both i386 and x86_64 programs load the correct version.