[vlc-devel] [vlc-commits] snap: provide a wrapper script to launch with needed LD_LIBRARY_PATH.

Konstantin Pavlov thresh at videolan.org
Wed Jan 25 12:49:05 CET 2017


Hello,

I apologize for not looking at the possible comments on my commits.

On Tue, Jan 10, 2017 at 01:20:37PM +0200, Rémi Denis-Courmont wrote:
> Le dimanche 8 janvier 2017, 00:26:19 Konstantin Pavlov a écrit :
> > vlc | branch: master | Konstantin Pavlov <thresh at videolan.org> | Sun Jan  8
> > 00:39:23 2017 +0300| [6605d043c71aea2a2b20384e15dab16ea662a2df] |
> > committer: Konstantin Pavlov
> > 
> > snap: provide a wrapper script to launch with needed LD_LIBRARY_PATH.
> > 
> > +++ b/extras/package/snap/vlc-snap-wrapper.sh
> > @@ -0,0 +1,5 @@
> > +#!/bin/sh
> > +
> > +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib/vlc"
> 
> Doesn't this incorrectly add $CWD to search path if the variable is initially 
> unset?

That's right.

However it's not the only wrapper that will launch VLC :)

konstantin at VirtualBox:~$ sudo mount -t squashfs vlc_20170120-0214_amd64.snap /media/konstantin/

This one will be launched when you do "snap run vlc" or just /snap/bin/vlc (/snap/bin/ is in $PATH):

konstantin at VirtualBox:~$ cat /media/konstantin/command-vlc.wrapper
#!/bin/sh
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu"
export LD_LIBRARY_PATH="$SNAP/usr/lib/x86_64-linux-gnu/mesa-egl:$SNAP/usr/lib/x86_64-linux-gnu/mesa:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$SNAP/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib:$SNAP/usr/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu/mesa:$SNAP/usr/lib/x86_64-linux-gnu/mesa-egl:$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio:$SNAP/usr/lib/x86_64-linux-gnu/samba:$LD_LIBRARY_PATH"

LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH
exec "$SNAP/bin/vlc-snap-wrapper.sh" "$@"
konstantin at VirtualBox:~$ cat /media/konstantin/bin/vlc-snap-wrapper.sh
#!/bin/sh

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib/vlc"

desktop-launch vlc "$@"

So it does not make sense to guard against at that point.

> > +desktop-launch vlc "$@"
> 
> exec ... ?

Yes.

Thank you,

-- 
VideoLAN
Konstantin Pavlov
http://www.videolan.org
Mobile: +7 926 165 45 31
Skype: cryothresh
Twitter: @cryothresh


More information about the vlc-devel mailing list