YAMLs for snaps built using PPAs

I recently tried to rebuild the evince 3.28 snap from the provided snapcraft.yaml. However, “snapcraft cleanbuild” failed since the build happens in a xenial container and the source uses a newer version of gtk than in the xenial archives. According to the build logs at https://launchpad.net/~ubuntu-desktop/+snap/evince, the snap I downloaded was built using the gnome-3-26 backports ppa. Thus the yaml doesn’t include all the information needed to recreate the snap.

If the standard repositories don’t supply the required build-packages, can the yaml specify which additional repositories (such as gnome-3-26 backports) are needed? And is it possible to automatically install such additional dependencies in container builds?

it’s not possible to do this declaratively. The only way to achieve this purely with snapcraft.yaml changes is to add imperative code using the override-* blocks:


        after: [desktop-gnome-platform]
        plugin: nil
        override-build: |
            echo "deb http://ppa.launchpad.net/ubuntu-desktop/gnome-3-26/ubuntu xenial main" | tee /etc/apt/sources.list.d/gnome-3-26.list
            apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 399B698EEA9EF163B6F9A0F62CC98497A1231595
            apt update
            apt upgrade -yy
       prime: [-*]

        after: [gnome-3-26]

        interface: content
        target: $SNAP/gnome-platform
        default-provider: gnome-3-26-1604:gnome-3-26-1604

        command: desktop-launch $SNAP/usr/bin/your-app
1 Like

also, see: Proposal: additional package sources