When trying to snap my project with snapcraft 3.9.7 on Ubuntu 19.10, I get an error with the command:
caleb@whistling-duck:~/projects/gladupe$ snapcraft --debug
Launching a VM.
snap "snapd" has no updates available
Skipping pull gladupe (already ran)
Skipping build gladupe (already ran)
Skipping stage gladupe (already ran)
Skipping prime gladupe (already ran)
Failed to generate snap metadata: Specified command 'bin/gladupe' was not found.
Verify the command is correct and for a more deterministic outcome, specify the relative path to the command from the prime directory.
snapcraft-gladupe # ls prime
etc include lib meta usr
snapcraft-gladupe # ls -l parts/gladupe/build/bin/
total 92
-rwxr-xr-x 1 root root 93288 Jan 18 16:24 gladupe
snapcraft-gladupe #
How do I get parts/gladupe/build/bin
into prime
? Or is that not what I want? If not, how do I get the command to find my executable?
I tried to set the command to be ../parts/gladupe/build/bin/gladupe
, but it wasn’t too happy about that either.
Here’s the last half of my snap/snapcraft.yaml
file:
parts:
gladupe:
plugin: cmake
configflags:
- -DSNAPCRAFT=True
- -DCOMPILE_INK=True
- -DCOMPILE_LIB2D=True
- -DUIINK_BUILD_RUNNER=False
- -DUIINK_BUILD_TESTS=False
- -DUIINK_DX11=False
- -DUIINK_HARFBUZZ=True
- -DUIINK_USE_LUA=False
source: .
build-packages:
- g++
- cmake
- make
- libsdl2-dev
- libsdl2-image-dev
apps:
gladupe:
command: bin/gladupe
When I run the example project for the cmake plugin, it spits out a bin/executable into the prime
directory and it works fine. And there aren’t any parts I don’t have in my snapcraft.yaml
Two more questions.
My program has two dependencies that aren’t on apt and must be built from source. Since both are use cmake, it works just to include the source files and add add_subdirectory()
and include_directories()
to my CMakeLists.txt, but is there a better way?
My program also uses .png images, a variety of files for the gui, and binary files for maps and settings. How do I get these in the installable result?
Thanks.