First I have to apologize for posting this question on multiple places (AskUbuntu and in rocket.ubuntu.com).
Since this is my first snap ever I’m struggling to package my tiny Python app (a single .py file) which depends on a Perl tool called exiftool (you can Google it. I can’t add more than 2 links to the topic because I’m a new user).
Exiftool is available in the repos as libimage-exiftool-perl and I’ve tried @popey’s suggestion to add it as stage-packages, but I receive the following error:
tar: ./usr/bin/pstruct: Cannot hard link to ‘./usr/bin/c2ph’: Operation not permitted
tar: ./usr/bin/perlthanks: Cannot hard link to ‘./usr/bin/perlbug’: Operation not permitted
tar: Exiting with failure status due to previous errors
dpkg-deb: error: subprocess tar returned error exit status 2
/home/vagrant/Code/phockup/parts/phockup/ubuntu/download/perl_5.22.1-9_amd64.deb
I saw the source of the exiftool does not require any compilation. It is possible to copy/paste the binary exiftool and lib/ directory to the required place and it will work, but I don’t know how to describe this in the snapcraft.yaml. It’s probably with a wrapper as @elopio suggests, but I don’t know how to organize this or where to place the wrapper file, etc.
I’ll appreciate any help.
I love how easy it is to use snap apps and I’d love to offer my tiny tool as snap.
I am unable to build the .span package and I cannot run snap run ...
Here is my current snapcraft.yaml
I am probably doing some pretty stupid things in there, but basically I’m kinda guessing the required settings.
It turns out the problem is in Vagrant. I ssh-ed to my home computer which is using elementaryOS (16.04 based) and I successfully created the snap.
I have a few questions.
Why so many plugs? Do I need them all? plugs: [x11, home, unity7, gsettings]
project-files and phockupgit looks complicated. Can we combine them together for a more simple flow?
run.sh has quite a lot of code. Can I just leave the
...
exec "$SNAP/usr/bin/python3" "$SNAP/bin/phockup" "$@"``` part?
4) When I am using a wrapper to execute my python script can I skip the part where I copy the `phockup.py` file to `bin` directory and just point the `exec` code to the current location of the `phockup.py` (which I don't know where it is in the snap)?