Persepolis snap

Hi all!
After trying to snap a godot app with success (thank you guys!) I’m trying something more difficult and make the snap of persepolis, a python download manager.
Here my snapcraft.yaml file made following this great how-to plus some requested dependencies:
name: persepolis
version: git
summary: Persepolis
description: |
Persepolis is a download manager & a GUI for Aria2.
base: core18
confinement: devmode

parts:
  persepolis:
    plugin: python
    python-version: python3
    source: .
    stage-packages:
      - python-six
      - python3
      - python3-pyqt5
      - python3-requests
      - python3-setproctitle
      - python3-psutil
 
apps:
  persepolis:
    command: man/persepolis.1
    plugs:
      - opengl
      - network
      - network-bind
      - x11
      - desktop
      - home

if you try yourself th yaml you will find there is only a missing dependency: youtube-dl
I tried to put that strings in the parts/persepolis/stage-packages but it doesn’t work
Also, existing a youtube-dl snap, I tried to add a stage-snaps (following this doc) by adding in the same location a

stage-snaps:
- youtube-dl

resulting in this error:

Failed to load plugin: properties failed to load for persepolis: Additional properties are not allowed ('stage-snaps' was unexpected)

Any idea how to solve this?

The stage-snap should be within the part. Like this. https://github.com/popey/sosumi-snap/blob/master/snap/snapcraft.yaml#L46

with

parts:
  persepolis:
    stage-snaps:
      - youtube-dl/latest/stable
    plugin: python
    python-version: python3
    source: .
    stage-packages:
      - python-six
      - python3
      - python3-pyqt5
      - python3-requests
      - python3-setproctitle
      - python3-psutil

I’ve the same error:

/snap/persepolis$ snapcraft
Failed to load plugin: properties failed to load for persepolis: Additional properties are not allowed ('stage-snaps' was unexpected)

What version of snapcraft are you using?

snapcraft version

1 Like

I found that I had 2 snapcraft versions, one from repository (version 2.43.1) and one from snap ( version 3.10.1); I don’t know why but probably the repository version was the one used by default. anyway I removed the older version and after correcting a multipass error snapcraft was able to complete the dependencies process…now I only need to find the right launch command location :sweat_smile:

thank you Popey!

1 Like

so now my snapcraft.yaml is this:

name: persepolis
version: 3.2.0
summary: Persepolis
description: |
  Persepolis is a download manager & a GUI for Aria2.
base: core18

icon: resources/persepolis.svg
grade: stable
confinement: strict

apps:
  persepolis:
    command: python3 $SNAP/persepolis/__main__.py
    plugs:
      - opengl
      - network
      - network-bind
      - x11
      - desktop
      - home
      - pulseaudio

parts:
  persepolis:
    stage-snaps:
      - youtube-dl/latest/stable
    plugin: python
    python-version: python3
    source: .
    stage-packages:
      - python-six
      - python3
      - python3-pyqt5
      - python3-requests
      - python3-setproctitle
      - python3-psutil

I’m having problem related to the apps: command: section; my snap compile and install successfully, but when i try to launch the app I receive this error:

:~/snap/persepolis$ persepolis
/snap/persepolis/x2/usr/bin/python3: can't open file '/snap/persepolis/x2/persepolis/__main__.py': [Errno 2] No such file or directory

this is all I have in the snap file:
/snap/persepolis/x2$ tree -d -L 2
.
β”œβ”€β”€ bin
β”œβ”€β”€ etc
β”‚ β”œβ”€β”€ bash_completion.d
β”‚ β”œβ”€β”€ ca-certificates
β”‚ β”œβ”€β”€ fish
β”‚ β”œβ”€β”€ fonts
β”‚ β”œβ”€β”€ glvnd
β”‚ β”œβ”€β”€ gss
β”‚ β”œβ”€β”€ init.d
β”‚ β”œβ”€β”€ openal
β”‚ β”œβ”€β”€ pulse
β”‚ β”œβ”€β”€ python2.7
β”‚ β”œβ”€β”€ python3.6
β”‚ β”œβ”€β”€ sensors.d
β”‚ β”œβ”€β”€ ssl
β”‚ └── X11
β”œβ”€β”€ lib
β”‚ β”œβ”€β”€ python3.6
β”‚ β”œβ”€β”€ udev
β”‚ └── x86_64-linux-gnu
β”œβ”€β”€ meta
β”‚ └── gui
β”œβ”€β”€ meta.youtube-dl
β”œβ”€β”€ share
β”‚ β”œβ”€β”€ doc
β”‚ └── man
β”œβ”€β”€ snap
β”‚ └── command-chain
β”œβ”€β”€ snap.youtube-dl
β”‚ └── command-chain
β”œβ”€β”€ usr
β”‚ β”œβ”€β”€ bin
β”‚ β”œβ”€β”€ include
β”‚ β”œβ”€β”€ lib
β”‚ β”œβ”€β”€ sbin
β”‚ └── share
└── var
└── lib

so there is not any of the source files where my snapcraft.yaml is located…

the snapcraft.yaml is located in the root directory of a git cloned of https://github.com/persepolisdm/persepolis like in the doc instructions.

also I tried adding a bin directory containing an executable file like the one in the Doc:

#!/usr/bin/env python
# Startup from system-wide installation
# Copyright (C) 2002 - 2009 John Goerzen
# <jgoerzen@complete
#
#    This program is free software;.....

    import sys
    import os
    from persepolis import persepolis

    oi = persepolis.main()
    oi.run()

but changing the command part in the snapcraft.yaml like this:

apps:
  persepolis:
    command: bin/persepolis
    plugs:
      - opengl
      - network
      - network-bind
      - x11
      - desktop
      - home
      - pulseaudio

I obtain this error:

The command 'bin/persepolis' was not found in the prime directory, it has been changed to 'bin/persepolis'.
Failed to generate snap metadata: The specified command 'bin/persepolis' defined in the app 'persepolis' is not executable.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.

but the file has executable authorization:

~/snap/persepolis/bin$ ls -l
totale 12
-rwxrwxr-x 1 aurelio aurelio 953 mar 21 08:57 persepolis

Hi guys.
I’m totally stuck and from two weeks there were not any progress.
I fear this is over my skills and understanding.

if someone want to help me or point me to other projects that solved similar situations or take the project I would be very grateful.

Here the issue on the github page

I’ve worked-up a Minimum Viable Product Snap package for you, based on your work. I’ve filed it as a pull-request against your fork of Persepolis at:

1 Like