Installing a library in a flatpak

Hello! I am trying to figure out how to add a shared object in a flatpak.

For concreteness (and also because it is true), I’m running Kerbal Space Program with the Steam flatpak. I’m adding the Principia mod, which requires some shared object files which I am missing, as shown by

> flatpak run --command=sh com.valvesoftware.Steam
> ldd GameData/Principia/Linux64/principia.so 
ldd: warning: you do not have execution permission for `GameData/Principia/Linux64/principia.so'
	linux-vdso.so.1 (0x00007f65d350f000)
	libpthread.so.0 => /usr/lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f65d34f5000)
	libc++.so.1 => not found
	libc++abi.so.1 => not found
	libunwind.so.1 => not found
	libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007f65d340c000)
	libgcc_s.so.1 => /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f65d33e5000)
	libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007f65d1c13000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f65d3511000)

As an end user, what’s the recommended way to fix/hack around this?

You should try the same suggestions:

If it does not work with the Steam runtime out of the box then you could also ask the mod developer if bundling what’s missing from the Steam runtime is a possibility.