Snapcraft Build in Subdirectory
Sergio Schvezov
sergio.schvezov at canonical.com
Wed Nov 4 23:06:46 UTC 2015
On Wed, Nov 4, 2015 at 7:51 PM, <robert_joslyn at selinc.com> wrote:
> Is it possible to configure Snapcraft to conduct an autotools build in a
> subdirectory of a cloned repository? The repository I'm cloning has the
> source in a src subdirectory, which is where the autogen/configure/make
> process needs to happen. If I manually repackage the source as a tarball
> without a subdirectory, everything works great. I looked at the Snapcraft
> code, and I didn't see anything that looked like this is an option. Seems
> like there could be a "source-directory" or similar option to go alongside
> source, source-type, source-branch, and source-tag.
>
It is not there today, but the RFC about sources I sent to this list
earlier today was also meant to solve this particular issue and avoid
introducing another toplevel (to the part), source-[key] and have it live
in its own yaml object.
> I can work around this by writing a build script to manipulate the sources
> and call snappy build directly, but I'd rather have snapcraft do this for
> me than maintain another build script :-)
>
This is certainly not possible today, but I planned on working on this
tomorrow.
For now I suggest (just for now) doing
mkdir parts/plugins
cp /usr/lib/python3/dist-packages/snapcraft/plugins/autotools.py
parts/plugins/x-autotools.py
[edit cwd in the build parts]
snapcraft away
This should get you by until we either introduce
source-subdirectory|source-directory|source-subdir (not sure on the name
yet)
Or the source object
source:
type: <type>
repo: <repo>
subdir: <dir> # also not settled on this name
0.5 will have this and it is not far away. We are aiming at releasing
regularly, especially when there's an unblocking feature on the way.
Cheers
Sergio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snappy-app-devel/attachments/20151104/87adcf79/attachment.html>
More information about the snappy-app-devel
mailing list