@xiota That could definitely work. Adversely, I just tested adding 'libshaderc_shared.so.1' to pcsx2-qt's DT_NEEDED section using patchelf and with the rpath set during build I get this output from ldd:
ldd /opt/pcsx2/pcsx2-qt
linux-vdso.so.1 (0x000073386eb26000)
libshaderc_shared.so.1 => /opt/pcsx2/libshaderc_shared.so.1 (0x0000733860400000)
...
It needs more testing but it seems to be working (I was able to load into burnout 3 and compile new shaders). I don't know if ̶t̶h̶a̶t̶ ̶w̶o̶u̶l̶d̶ ̶l̶o̶a̶d̶ ̶a̶ ̶s̶e̶c̶o̶n̶d̶ ̶i̶n̶s̶t̶a̶n̶c̶e̶ ̶o̶f̶ ̶t̶h̶e̶ ̶l̶i̶b̶ ̶i̶n̶t̶o̶ ̶m̶e̶m̶o̶r̶y̶ ̶o̶r̶ ̶i̶f̶ that would cause problems though (Note: The posix spec states Only a single copy of an object file is brought into the address space, even if dlopen() is invoked multiple times in reference to the file
so it should be okay to do this). Really I don't see any way around this that isn't either hacky or patchy, so both methods could work. Your method probably has the cleanest result and I'm kind of leaning that way.
Perhaps the name could even be 'libshaderc_pcsx2' and the lib could be installed to /usr/lib, removing the need to mess with rpath and ld cache even. That way duckstation could depend on a differing patchset and not find the wrong lib.
Pinned Comments
weirdbeard commented on 2024-08-17 03:40 (UTC)
https://github.com/PCSX2/pcsx2/pull/11632
This package now enables Cmake Package mode proper. PCSX2 will here on, be installed in the package standard folders /usr/bin, /usr/share, /usr/lib. Following the XDG standard pcsx2's config files remain in .config/PCSX2
In order to ensure a proper and clean upgrade. Uninstall this package COMPLETELY and clear cache before reinstalling.