Use build-dep in snapcraft

I’m creating a snap that will build some libraries it depends on upon building instead of pulling them as dependencies. I need to pull some deps for the libraries themselves and as long as i could of course add a sizeable flock of build-packages, I know there’s a shorthand utilizing apt-get build-dep which I could use in a “classic” build process. Is there a way to use it inside snapcraft by adding something clever to snapcraft.yaml? This would be a way more elegant solution than just brutally listing every dependency separately…

I don’t think there is anything too clever to do that for you.
To help you populate the build-packages list, these options may be useful:

apt-cache showsrc <package-name> | grep ^Build-Depend
apt-rdepends --build-depends --follow=DEPENDS <package-name>

Thanks! It’s actually a perfect solution!

1 Like