swupd-client icon indicating copy to clipboard operation
swupd-client copied to clipboard

3rd-party: allow exporting the lib folder of a bundle

Open gregor160300 opened this issue 4 years ago • 5 comments

I have been experimenting with building my own 3rd-party bundles and while most of the bundles work fine without having their lib folder in the LD_LIBRARY_PATH it can be useful to export the libraries to the LD_LIBRARY_PATH. A good example for this need is having a build of ffmpeg installed as a 3rd-party bundle when the lib folder of this ffmpeg build is not available in the LD_LIBRARY_PATH applications like vlc (and likely others as well) can't make proper use of the added codecs.

gregor160300 avatar Apr 02 '20 11:04 gregor160300

Thank you for the feedback. So far, as you noticed, we only support exporting binaries, but exporting libraries and .desktop files is going to be supported in the future.

otaviobp avatar Apr 02 '20 15:04 otaviobp

@gregor160300 A work around for this is to have whatever applications are requiring the 3rd-party libraries in the same mix repo.

bryteise avatar Apr 02 '20 16:04 bryteise

Great to hear that you are planning on supporting more export options. I did consider building vlc within the same mix however I found that it was easier to just run LD_LIBRARY_PATH=/opt/3rd-party/bundles//usr/lib vlc from the terminal, as for firefox it has it's own quirks. I do think there might be some issues with ldconfig due to the stateless design, for some reason programs like firefox and vlc seem unable to pick up on the libraries loaded by ldconfig see also here

gregor160300 avatar Apr 02 '20 17:04 gregor160300

@gregor160300 Do you mean that:

sudo sh -c 'echo /usr/local/lib >>/etc/ld.so.conf'
sudo ldconfig

isn't enough for firefox (and apparently vlc) to use the library path correctly? I think this was a firefox bug looking at this.

bryteise avatar Apr 02 '20 18:04 bryteise

@gregor160300 Do you mean that:

sudo sh -c 'echo /usr/local/lib >>/etc/ld.so.conf'
sudo ldconfig

isn't enough for firefox (and apparently vlc) to use the library path correctly? I think this was a firefox bug looking at this.

Indeed this isn't enough for both vlc and firefox I will read through the bugreport on bugzilla to find a proper workaround as it seems firefox didn't fix it yet. Meanwhile, I am setting up a VM to check whether or not adding the export of LD_LIBRARY_PATH in /etc/environment fixes the codec loading in at least vlc

EDIT: Adding

if [[ $UID -ge 1000 && -d /opt/3rd-party/bundles/<my-3rd-party-repo>/usr/lib && -z $(echo $LD_LIBRARY_PATH | grep -o /opt/3rd-party/bundles/<my-3rd-party-repo>/usr/lib) ]]
then
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/3rd-party/bundles/<my-3rd-party-repo>/usr/lib"
fi

to /etc/environment also seems to do the trick (at least when bash is the default shell, haven't gotten it to work yet by setting the same in /etc/zsh/zprofile for zsh

gregor160300 avatar Apr 02 '20 19:04 gregor160300