I want to be able to use some shared libraries, that should be fetched before cmake step(plugin) from a custom PPA.
snapcraft.yaml:
name: mraa-blink-example
version: 'Latest'
summary: mraa for snapcraft
description: |
Blink Example from MRAA lib
grade: stable #devel # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
apps:
blinkapp:
command: bin/blink
parts:
blink:
plugin: cmake
build-packages:
- libmraa1
- libmraa-dev
- mraa-tools
- python-mraa
- python3-mraa
I have done this in different ways in order to give a user friendly experience on using mraa/upm libs on Ubuntu Core(eventually for Intel joule board):
First we have made a part that builds from sources the libs, and we don’t have any issues on that, we could also add them as in the wiki/parts when we are ready/decided and well tested.
Second, on the idea of being efficient, we wanted to not build the libs, to have them available fast. So, we came up with a snap/part that gets the libs from a .tar external source and will put them in the appropriate location before entering a cmake step.
SideNode:
Also, on Ubuntu Core, while running snap classic, you don’t have the possibility to do sudo add-apt-repository.
(classic)maneaflavian@localhost:~/PPA/fetch_shared_library_ppa_example$ sudo add-apt-repository ppa:mraa/mraa
sudo: add-apt-repository: command not found
I have done that, but other problem have arrised (problems only on Ubuntu Core in Classic Snap, on a regular distribution is not reproducible - in my case Linux Mint 18.1 64-bit ):
The repository 'http://ppa.launchpad.net/mraa/mraa/ubuntu zesty Release' does not have a Release file., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., E:Failed to fetch http://ppa.launchpad.net/mraa/mraa/ubuntu/dists/zesty/main/binary-amd64/Packages 404 Not Found, E:Some index files failed to download. They have been ignored, or old ones used instead.
Is it that under Ubuntu Core in Classic Snap, when doing apt-get install, it is saw as a ubuntu zesty distribution, and tries to get zesty specific install from this location “http://ppa.launchpad.net/mraa/mraa/ubuntu/dists/”?
I saw now that they aren’t, but I was not sure if for Ubuntu Core all the packages should be build for zesty, or I did something wrong when installing software-properties-common.
After looking in sources.list in .cache/snapcraft/… I saw that it added:
deb http://ppa.launchpad.net/mraa/mraa/ubuntu zesty main
Maybe it was triggered by the add-apt-repository from software-properties-common which were installed inside Snap Classic, maybe some additional arguments should be given when installing software-properties-common (I don’t have knowledge on this aspect)
I have fixed this issue by manually adding “xenial” to this file: ./var/snap/classic/common/classic/etc/apt/sources.list.d/mraa-ubuntu-mraa-zesty.list (but I don’t kow how it got zesty in the first place )