@ras0219-msft I was listening to CppCasts and my understanding about including DLLs in Windows packages is that Vcpkg includes them in the same directory as the executable.
Can the same thing be done for Linux ELF binaries with runpath set to $ORIGIN?
If the package is simply extracted to a directory, the executable will have its dependencies in the same directory and the linker will find them. If it has an installer that puts the binary under a directory like /usr/bin, the same installer will put libraries under a directory like /usr/lib and the linker will still find them.
To demonstrate what I mean, I downloaded SuperTuxKart (https://supertuxkart.net/Download) but I did not install its dependencies:
~ $ cd ~/tmp/
~/tmp $ tar xf ~/Downloads/supertuxkart-0.9.3-linux.tar.xz
~/tmp $ cd supertuxkart-0.9.3-linux
~/tmp/supertuxkart-0.9.3-linux $ ldd bin-64/supertuxkart | fgrep png
libpng12.so.0 => not found
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007fef1b339000)
If I install the dependency, it will become:
~/tmp/supertuxkart-0.9.3-linux $ ldd bin-64/supertuxkart | fgrep png
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00007f9f3b2c1000)
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f9f37f75000)
And If I want to put it in the same directory as the binary:
~/tmp/supertuxkart-0.9.3-linux $ ls bin-64/libpng12.so*
bin-64/libpng12.so bin-64/libpng12.so.0 bin-64/libpng12.so.0.59.0
~/tmp/supertuxkart-0.9.3-linux $ patchelf --set-rpath '$ORIGIN' bin-64/supertuxkart
~/tmp/supertuxkart-0.9.3-linux $ ldd bin-64/supertuxkart | fgrep png
libpng12.so.0 => .../tmp/supertuxkart-0.9.3-linux/bin-64/libpng12.so.0 (0x00007f8fbeefc000)
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f8fbbbb0000)
~/tmp/supertuxkart-0.9.3-linux $
Most interesting. I was listening to the same podcast and wondering if something like this would not be at least a starting solution. In addition, since dependencies are built via CMake - as I understand it, at any rate - is it not just a case of supplying BUILD_SHARED_LIBS somewhere to get them to build as a shared object rather than a static library? [1], [2] Though I'm sure I'm missing something.
Cheers
[1] https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html
[2] https://stackoverflow.com/questions/2152077/is-it-possible-to-get-cmake-to-build-both-a-static-and-shared-version-of-the-sam
There has not been any interest in improving Linux support!
I strongly believe that there is not a big community, or at least it is not widely used on Linux.
Most helpful comment
To demonstrate what I mean, I downloaded SuperTuxKart (https://supertuxkart.net/Download) but I did not install its dependencies:
If I install the dependency, it will become:
And If I want to put it in the same directory as the binary: