How to add custom libs to snap?

Alan Pope alan.pope at canonical.com
Mon Jan 9 10:14:57 UTC 2017


Hi Andrey,

On 9 January 2017 at 08:59, Andrey Rogovsky <a.rogovsky at gmail.com> wrote:
> I need add custom precompiled libs (no sources) to my snap.
> I have directory with libs. Need put it into snap. How I can do it?

I achieved this with one of my snaps by simply using the copy plugin
to put the libs into lib/<triple> and then having a launch script
which ensures the LD_LIBRARY_PATH is set appropriately.

So, (assuming you're only targetting amd64) copy the libs to
lib/x86_64-linux-gnu and in your launcher have something along the
lines.

export LD_LIBRARY_PATH=$SNAP/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

Cheers,
-- 
Alan Pope
Community Manager

Canonical - Ubuntu Engineering and Services
+44 (0) 7973 620 164
alan.pope at canonical.com
http://ubuntu.com/




More information about the Snapcraft mailing list