Page 1 of 1

building snaps

Posted: Thu Nov 09, 2017 8:27 am
by cheesyking
For a bit of fun I decided to have a play around with building snaps with an eye on ubuntu core. However since I've never had anything to do with packaging software for distribution I'm a bit lost. TBH all the programming I do is the occasional webapp in flask and the odd script here and there so I'm in at the deep end.

Anyway, I worked through the super simple gnu hello "build your first snap" example and then thought I'd try something harder and picked google assistant. Since it's all available through pip I figured all I should have to do was create a .yaml that installed google assistant stuff straight from there at which point I thought I'd be able to add an "apps" section that allowed me to call some of the samples like "googlesamples-assistant-pushtotalk".

Calling the google-oathlib[tool] does indeed work just as expected however googlesamples-assistant-pushtotalk does produces this error:
  File "/snap/ga-matt-test/x2/lib/python3.5/site-packages/", line 2634, in _initialize
    _check(_lib.Pa_Initialize(), 'Error initializing PortAudio')
ffi.error: symbol 'Pa_Initialize' not found in library '<None>': /snap/ga-matt-test/x2/usr/bin/python3: undefined symbol: Pa_Initialize

I assume this is because the snap I've built needs a bunch of extra libraries to support sound but that's the limit of my knowledge. Can someone explain what's going on or point me at some reading material?

Re: building snaps

Posted: Thu Nov 09, 2017 8:38 am
by just brew it!
That definitely looks like a missing library (PortAudio, in this case). Never having built snaps myself I have no idea how you would go about adding it to the package, but at least you know what you need to add now.

Re: building snaps

Posted: Thu Nov 09, 2017 9:33 am
by cheesyking

I've been looking at these two revisions of a yaml for Telegram which uses portaudio:

The first one is building portaudio from scratch while the second uses the repo package but I'm not sure how I'd tell the python packages for GA how to use them. That telegram example looks like it's building telegram with compiler options to include openal which includes portaudio.

I've always tried to avoid stuff that involves working with sound as it seems like a labyrinth libraries and different systems.