M
M
Make Now2020-05-14 18:51:49
linux
Make Now, 2020-05-14 18:51:49

How to properly build for snap (snapcraft.yaml)?

Someone fumbles how to properly build for snap (snapcraft.yaml)?

Bottom line: there is a ready-made binary from https://gitlab.com/go-apps-XnjRcS/password-generator , which needs to be packed into a snap, but I have not yet figured out how to do it correctly. I am getting runtime errors related to gtk. Link to snapcraft.yaml https://gist.github.com/7274b07cb1491b79005e28a6f6...

97997030_2854713881315512_64960457835974

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
klirichek, 2020-09-29
@makenow

I suppose it should be enough to simply write extension there (if the program eventually "communicates" with gtk / qt, and does not hang directly on bare x's). Well, prescribe the appropriate launcher (without it, there are usually various strange special effects, such as the inability to log in). Something like:

apps:
  my-part:
    command: desktop-launch $SNAP/bin/passgen2
    extensions:
      - gnome-3-28
...

Well, it is better to collect such things iteratively; In the process, an understanding will come of what is missing.
Most likely, on the basis of a gnome, nothing more will be needed from a bunch of your libs (i.e. stage-packages may "lose weight" or disappear altogether)
Run `snapcraft try`. It goes through all the stages and prepares the prime folder. Then we connect it using `snap try` - we get a flexible snap, which is both an application and a folder where you can climb and change something (add / configure) on the fly. Then we write the run-in settings into the snapcraft script itself. Confinement, by the way, is initially better to put devmode. Then the application has access everywhere. And then, using snappy-debug in a parallel console, see where it actually climbs, and, accordingly, what plugs it needs to register in order for it to successfully take off in strict.
(for example, with your file, the application will need to be called as 'passgen2.my-part' - I suspect that you did not want to achieve this, and therefore this part will change. And if you run a full rebuild of snapcraft - for every sneeze - it's slow and sad ).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question