1

I am trying to pack my first python app as a snap app. I've checked a lot of Github repos and couldn't manage to understand the part where you set the binary to be executed when the snap app is executed (apps: part). I've tried a lot of things, but couldn't build the snap properly.
Once the build says the phockup binary is not found or other times when I build it successfully when executing phockup I get the Python console which hints for a wrong path to phockup.py

Here is my snapcraft.yaml file

  • 1
    I tried running snapcraft against your yaml, and it doesn't appear to copy the phockup.py executable from parts/phockup/build to parts/phockup/install which will be why it never ends up in stage/ or prime/, and thus why it's not in the snap. I don't know why that is though. – popey Jun 2 '17 at 11:35
3

The project you're snapping doesn't contain a setup.py or any sort of build system, so Snapcraft doesn't know what you want installed. You can either use setuptools and add a setup.py to your project, or keep it the way it is and tell Snapcraft exactly what you want to install, like so (note the use of the the install keyword):

name: phockup
version: '1.2.0'
summary: Photo and video sorting tool
description: |
  Media sorting and backup tool to organize photos and videos from your camera in folders by year, month and day.
  The software will collect all files from the input directory and transfer them to the output directory without
  changing the files content. It will only rename the files and place them in the proper directory for the year, month and day.
grade: devel
confinement: devmode

apps:
  phockup:
    command: phockup

parts:
  phockup:
    plugin: python
    source: https://github.com/ivandokov/phockup.git
    source-tag: v1.2.0
    install: |
      mkdir -p $SNAPCRAFT_PART_INSTALL/bin
      cp phockup.py $SNAPCRAFT_PART_INSTALL/bin/phockup
| improve this answer | |
  • I've used the install way and it works just great! Thank you. Now I gotta figure out how to add exiftool as dependency and I'm ready – Ivan Dokov Jun 2 '17 at 12:13
  • It seems I'll have to create another topic, because I'm unable to figure it out myself. – Ivan Dokov Jun 2 '17 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.