Building native apps
Gábor Paller
gaborpaller at gmail.com
Tue Feb 17 10:49:34 UTC 2015
The launcher you are referring is under $HOME/snappy-bin, right?
I successfully compiled the popular fswebcam application and it works but I
can't get it to work with the launcher.
($HOME/snappy-bin/fswebcam.fswebcam).
All the commands below are issued as root.
If I launch it directly from under the /apps tree, it works nicely (after
having set the LD_LIBRARY_PATH to the lib directory of my snap).
root at localhost:/apps/fswebcam/20140113/bin# ./fswebcam /home/ubuntu/1.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
...
I hacked into the $HOME/snappy-bin/fswebcam.fswebcam file that was created
automatically during package installation and added the LD_LIBRARY_PATH.
...
export SNAPP_LIB="$SNAPP_APP_PATH/lib"
export LD_LIBRARY_PATH=$SNAPP_LIB:$LD_LIBRARY_PATH
...
Then executed the resulting fswebcam.fswebcam.
root at localhost:~/snappy-bin# ./fswebcam.fswebcam
--- Opening /dev/video0...
Trying source module v4l2...
Error opening device: /dev/video0
open: Permission denied
Clearly, somehow I lose access rights to /dev/video0. How can it be?
Regards,
Gabor
On Tue, Feb 10, 2015 at 6:22 PM, Alexander Sack <asac at canonical.com> wrote:
> On Tue, Feb 10, 2015 at 5:53 PM, Gábor Paller <gaborpaller at gmail.com>
> wrote:
> > I have some success. :-)
> > http://mylifewithandroid.blogspot.com/2015/02/bled112-on-beaglebone.html
> >
> > BTW, is there a way for a snap to package a shared object that gets onto
> the
> > LD_LIBRARY_PATH? So far I had success only with executables.
>
> Nothing built in (yet), but the way to go is to make binaries and
> services launch through wrapper where you can set your LD path and
> other stuff relativ to the SNAP_ envs you have available there...
>
> Check out hello-world.env to see what SNAP_ envs are available for you
> in such a launcher.
>
> >
> > Regards,
> > Gabor
> >
> > On Tue, Feb 10, 2015 at 2:57 PM, Alexander Sack <asac at canonical.com>
> wrote:
> >>
> >> On Thu, Feb 5, 2015 at 5:58 PM, Gábor Paller <gaborpaller at gmail.com>
> >> wrote:
> >> > Hi,
> >> >
> >> > I have a very basic question: how to compile native apps for Snappy? I
> >> > went
> >> > through the snappy-examples but none of them had any native element.
> >> > Where
> >> > are the include files and libs that one could link against?
> >>
> >> Documentation and tools to make this neat are pending.
> >>
> >> For now I recommend you could start with a vivid chroot where you can
> >> apt-get install all the dev headers you would want. All you need to do
> >> in the end is to ensure you copy everything that you used from the
> >> system that isn't part of libc into your snap and set the
> >> LD_LIBRARY_PATH accordingly by using a wrapper script.
> >>
> >> >
> >> > Regards,
> >> > Gabor
> >> >
> >> > --
> >> > snappy-app-devel mailing list
> >> > snappy-app-devel at lists.ubuntu.com
> >> > Modify settings or unsubscribe at:
> >> > https://lists.ubuntu.com/mailman/listinfo/snappy-app-devel
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snappy-app-devel/attachments/20150217/d0ff0497/attachment.html>
More information about the snappy-app-devel
mailing list