Command name for prebuild binaries


#1

Hello everybody,

I’m trying to build a snap from prebuild binaries, a mono and gtk-sharp2 application: https://sourceforge.net/p/audiocuesheet/

I use this snapcraft.yaml:

name: audiocuesheeteditor # Name must be lowercase in snap
base: core18 # the base snap is the execution environment for this snap
version: ‘2.4.4’
summary: Write audio cue sheets fast and efficient
description: |
Annoyed of writing your audio cue sheets via text editor? Here comes the solution! Audio Cuesheet Editor helps you editing your audio cuesheet file.

grade: devel # must be ‘stable’ to release into candidate/stable channels
confinement: devmode # use ‘strict’ once you have the right plugs and slots

parts:
audiocuesheeteditor:
plugin: dump
source: http://downloads.sourceforge.net/audiocuesheet/AudioCuesheetEditor-linux-x64-v$SNAPCRAFT_PROJECT_VERSION.zip

apps:
audiocuesheeteditor:
command: $SNAP/usr/bin/AudioCuesheetEditor

How do I find the correct command name? There is a wrapper script inside the linux build, which launches mono, called “AudioCuesheetEditor”. It is on top of the tar if it is unpacked. Also, how do I set the prequisites like “mono” and “gtk-sharp2”?

Thanks for your help.


#2

When you build the snap, use snapcraft --debug which will leave you inside the multipass VM where you can poke about. I just did this. Look in stage/ and you’ll see AudioCuesheetEditor-linux-x64-v2.4.4/ - the unpacked zip. Look in there and you find AudioCuesheetEditor which looks like this…

#!/bin/sh

exec mono "./AudioCuesheetEditor.exe" "$@"

AudioCuesheetEditor.exe is also in that directory, and is the main binary of the application.


#3

Thanks for your answer, I tried a bit around, but got this output:

Failed to generate snap metadata: The specified command ‘./AudioCuesheetEditor’ defined in the app {‘command’: ‘./AudioCuesheetEditor’} does not exist or is not executable.
Ensure that ‘./AudioCuesheetEditor’ is relative to the prime directory.

How can I run a script before stage to make shure the script is executable? (chmod +x)


#4

I’d just replace your command with mono $SNAP/path/to/AudioCuesheetEditor.exe

Rather than call a one line shell script.


#5

Well, nice idea, but its not that easy :):

Failed to generate snap metadata: The specified command ‘mono’ defined in the app ‘audiocuesheeteditor’ does not exist or is not executable.
Ensure that ‘mono’ is relative to the prime directory.

I used this command:

command: mono $SNAP/AudioCuesheetEditor-linux-x64-v$SNAPCRAFT_PROJECT_VERSION/AudioCuesheetEditor.exe


#6

Ah, you’ll need to stage mono somehow (and maybe whatever other libs the application needs) for it to work, sorry.

So add a stage-packages: entry to your part and add mono-runtime (but you may need more than that staged)


#7

Well, do you think, it is a good idea, to package also mono and gtk-sharp? I thought snap is like a package system, so I would love to have some dependencies which I say in my snap are nescessary on the target system. Or is this not possible with snap?