Creating a snap for a python app that uses a C++ library using ffi

I have a python application that uses a C++ library and its ffi interface to call methods implemented on it.

Here are details of how I normally get this working on a desktop:

  1. Building the c++ library into the system $ wget https://example.tar.xz $ tar -xvzf example.tar.xz $ cd example $ python configure $ make $ make install

This adds libexampe.so to /usr/share/bin and I reference this from my python application using the ctypes python package.

I am very new to this. I am assuming that I have to add the c++ library as a part in my application. However, I am not sure how I would build and install the package since the installation is not according to the autotools-way.

If anyone could give me an overview on how to approach this would be great.

More context, I would be installing the snap on ubuntu core running on an rpi.

Many thanks :slight_smile:

a part like this might work:

parts:
    example:
        source: https://example.com/example.tar.xz
        plugin: make
        override-build: |
            python configure
            snapcraftctl build
        build-packages:
            - python

You will probably find you need to add further build-packages entries, and potentially a stage-packages list for library dependencies that your example depends on that are supplied by the APT repositories.