Howdy!
I recently had some trouble with sox support flac files, when leveraging sox (and friends) unpacked into a directory and pointing LD_LIBRARY_PATH to the scratch-library directory.
From what I can gather, handler loading is done here: https://sourceforge.net/p/sox/code/ci/master/tree/src/formats.c#l112 with PKGLIBDIR as some static path provided by automake (/usr/local/x86_64-linux-gnu/sox on my machine I believe).
From the documentation looks like lt_dlforeachfile just searches the provided path, and doesn't try to handle the "system library search path".
I don't think the fix is obvious. Perhaps sox could instead switch to loading individual handlers using lt_dlopen ad-hoc instead of scraping a hard-coded search path? Alternative construct the argument to lt_dlforeachfile by appending PACKAGE to the system library search path?
SoX looks for its effect/format dl's in whatever PKGLIBDIR was set to when it was compiled so if you want to install it in a scratch directory you need to recompile it using ./configure --prefix=$HOME or whereever
You could make this happen at runtime by modifying
src/formats.ctohttps://codeberg.org/sox_ng/sox_ng/issues/295
Should
LD_LIBRARY_PATHoverridePKGLIBDIRor vice versa?