How do i use "build-snaps"?

Hi,

i’m currently trying to use the “build-snaps”-feature of snapcraft. I’ve managed to include the latest “gnome-3-28-1804-sdk” in my YAML-file but i have no idea how to use it for building my application:

build-snaps:
      - gnome-3-28-1804-sdk/latest/edge

That is specific to the publisher of the snap. In this case

snap info gnome-3-28-1804-sdk|grep publisher
publisher: Ken VanDine

that would be @kenvandine

This is still a work in progress. @marcustomlinson has been working on it and he has been able to get a couple snaps building with it.

Hey @glasen77, really the only difference to understand between build-snaps and build-packages is that they’re installed via ‘snap install’ instead of via the host’s package manager (e.g. ‘apt install’ on Ubuntu). In essence, this means build-snaps are made available under /snap/ during build.

As @sergiusens said, how a particular build-snap is used depends on the build-snap. In the case of the gnome-sdk, our eventual intension is actually for snap developers not to use it directly, but instead have it indirectly pulled in via a new ‘gnome-extension’ (you can read more about extensions on @sergiusens blog post here: http://blog.sergiusens.org/posts/snapcraft-3.0/).

Of course, the build-snap can be used directly (and until the extension is ready, may have to be), it just means more manual work in getting build paths properly set up. As @kenvandine said though, this snap is still a work in progress, so everything I just said could still change :wink:

In the meantime, you can check out my epiphany and gnome-calculator snapcraft yamls for a rough idea on how this works (of particular interest will be the use of the ‘buildenv’ build environment):

https://git.launchpad.net/~marcustomlinson/epiphany/+git/snap/tree/snapcraft.yaml?id=d530a15fd7511c587d3574ef0386883f11f3edbb

https://git.launchpad.net/~marcustomlinson/+git/gnome-calculator/tree/snap/snapcraft.yaml?id=913b5910e6efd088cfb6745f111dcf63f64b16b1

1 Like