<div dir="auto"><div class="gmail_extra" dir="auto"><div class="gmail_quote">On Feb 20, 2017 6:23 AM, "Olivier Tilloy" <<a href="mailto:olivier.tilloy@canonical.com">olivier.tilloy@canonical.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On Fri, Feb 17, 2017 at 12:11 AM, Leo Arias <<a href="mailto:leo.arias@canonical.com">leo.arias@canonical.com</a>> wrote:<br>
> Hello!<br>
><br>
> This week I've been cleaning a few of my old snaps, using some of the<br>
> new features in more recent versions of snapcraft. At first I wasn't<br>
> convinced about scriptlets, but now I think they are great. Take a<br>
> look at this diff:<br>
><br>
> 5 additions and 144 deletions<br>
><br>
> <a href="https://github.com/elopio/ipfs-snap/commit/06f32696c1b461b1068e803e71e22bad50fe52eb" rel="noreferrer" target="_blank">https://github.com/elopio/<wbr>ipfs-snap/commit/<wbr>06f32696c1b461b1068e803e71e22b<wbr>ad50fe52eb</a><br>
><br>
> Here is more info:<br>
> <a href="https://insights.ubuntu.com/2017/02/02/run-scripts-during-snapcraft-builds-with-scriptlets/" rel="noreferrer" target="_blank">https://insights.ubuntu.com/<wbr>2017/02/02/run-scripts-during-<wbr>snapcraft-builds-with-<wbr>scriptlets/</a><br>
<br>
</div>Very useful, thanks for highlighting it Leo!<br>
I've been able to replace the custom plugin for the 0AD snap with<br>
scriptlets, and that simplifies the packaging quite a bit.<br>
<br>
One thing that bit me is that I was expecting the 'install' scriptlet<br>
to replace the `make install` step when using the make plugin, but it<br>
doesn't. It runs `make`, `make install`, and then the install<br>
scriptlet. Note that the documentation is reasonably clear about it,<br>
but it looks a bit counterintuitive to me.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Note that the lifecycle doesn't have an 'install' step. The install actually happens in the 'build' step, which you can replace via the 'build' scriptlet. The three scriptlet surround the 'build' step:</div><div dir="auto"><br></div><div dir="auto">- 'prepare' runs before build</div><div dir="auto">- 'build' replaces plugin build (including install)</div><div dir="auto">- 'install' runs after build. This is useful e.g. for a Makefile with no installation targets, or copying over some config files after the plugin does its thing.</div><div dir="auto"><br></div><div class="gmail_extra" dir="auto"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
One thing I haven't been able to figure out: is the<br>
parallel_build_count property exposed to scriptlets as a variable?<br>
That would be useful for custom build scripts that call make.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">I don't believe so, but I agree it would be useful.</div></div>