I have a Python package which has dependencies: Python, Gtk, PillowPI, and align_image_stack from the Hugin package.
In my Debian package I can just state the dependencies. I wouldn’t expect most of these to be a problem for a Snap, but align_image_stack is complex. Is there a way to just state the dependency in a Snap manifest? I assume that would rely on there being a Snap or Debian package for Hugin - there is no Snap, but there is a Flatpak and a Debian package.
Otherwise I imagine I would have to include build commands for align_image_stack and all its dependencies. That wouldn’t be possible for me as:
- The package was written by someone else (a team), I don’t know the technical details.
- It requires compiling, I use an interpreted language and am not familiar with compilation.
- It is written in C, I don’t know C.
I had a go at this a couple of years ago and gave up after trying 10-20 versions of the yml file over a couple of months effort. I concluded that I didn’t know what I was doing and there didn’t seem any expertise around to help.
Here is an example I have found and modified, is this anywhere near on the right lines? There is no reference to meson.build there.
name: {myapp}
version: '0.1'
summary: My application
description: |
My application for python
base: core18
grade: stable
confinement: strict
apps:
{myapp}:
command: bin/{myapp}
plugs: [home]
extensions: [gnome-3-34]
parts:
{myapp}:
plugin: python
python-version: python3
source: .
stage-packages: [hugin-tools, python3-pillow]
Alternatively, since I have already created a working Debian package of {myapp}. Could I just include that somehow and the align-image-stack dependency would be included?
name: {myapp}
version: '0.1'
summary: My application
description: |
My application for python
base: core18
grade: stable
confinement: strict
icon: {myapp}_logo.png
apps:
{myapp}:
command: bin/{myapp}
plugs: [home]
extensions: [gnome-3-34]
parts:
{myapp}:
plugin: python
python-version: python3
source: .
stage-packages: [hugin-tools, python3-pillow]
archives:
plugin: nil
stage-packages:
- libc6
- python3-pil
deb:
plugin: dump
source: {myapp}_0.0.1_all.deb
if there’s a deb package then you can add that, yes. Is it in the Ubuntu archive? i.e. on normal Ubuntu can you install it with apt
without adding an additional repository? If so then you can add the name of the package to stage-packages
and it’ll be included. If the deb package is in another repository than the Ubuntu archive you can try using the experimental package repositories feature of snapcraft to add the required repository to your yaml and again add the name of the package to the stage-packages
. Finally, you can also try doing it by adding the deb package as an extra part
like below:
parts:
deb-package:
source: https://example.com/deb-package.deb
source-type: deb
plugin: dump
The dependency hugin-tools is already an official Debian package installable with apt install…
{myapp} isn’t an official Debian package (I’m working on that), it is installable with apt install -f…
Ideally I’d install both from debs, something like this perhaps?
name: {myapp}
version: '0.1'
summary: My application
description: |
My application for python
base: core18
grade: stable
confinement: strict
icon: {myapp}_logo.png
apps:
{myapp}:
command: bin/{myapp}
plugs: [home]
plugin: python
python-version: python3
extensions: [gnome-3-34]
parts:
archives:
plugin: nil
stage-packages:
- libc6
- python3-pillow
- hugin-tools
- {myapp}
deb-package:
source: https://example.com/deb-package.deb
source-type: deb
plugin: dump
deb-package:
source: /home/chris/{myapp}_0.0.1_all.deb
source-type: deb
plugin: dump