How to stage a package from repository(ppa) in snap package using snapcraft build system?


#1

Hi,
One of app i built using Qt framework named (OLIVIA) requires latest version of mpv media player in it as backend for playback.
I set up my app to build and delivered using snapcraft build service, the problem is build system is choosing an older version of mpv as package, so i tried to add launchpad ppa of mpv so build system will pick it and stage it for my part.

I was expecting it to choose latest version from repository(Like what happens on our local ubuntu system) but it wont pick the new version and keep staging older version everytime.

my snapcraft.yaml look like this

snap package builts with above snapcraft.yaml as can be seen in log
it installs latest version of mpv in build env but not stage it ,(can be seen on line number 5089) :frowning:

MY SECOND ATTEMPT:
i used this snapcraft file added line 64 and 65 and got this log
(see line number 5527 and 5529)

Please guide me :frowning:


#2

You should add an “apt-get update” in there as well, to refresh the apt cache.


#3

am already having that from manual of add-apt-repository it says:

-y, --yes Assume yes to all queries
-u, --update Update package cache after adding

Problem is not with update as you can see mpv_0.29.xxxx is getting installed but not getting staged in $SNAP root.
In log at line 5089 it clearly says that mpv was installed to latest version on build machine.


#4

Problem solved :slight_smile:
current snapcraft file fixes the issue.

So here is what i did:
This is diff of old craft file and new craft file, if anyone face this issue feel free to continue here.

Also link to new snacraft.yaml is here.

Thanks


#5

Note that the fetching of the stage-packages happens at the part’s pull step is likely the cause of that problem.

If you put the software source modification in the part’s override-pull scriptlet before the snapcraftctl pull call it should work.