I am trying to build my first snap from a Github project, jangernert/FeedReader.
Issue 1. I can’t use the cmake plugin in Snapcraft because it breaks down when encountering nested cmake files in the WebExtension submodule of the jangernert/FeedReader project, even though the make files generated work fine.
Issue 2. So I tried using a build script to call cmake, make, and make install and that appears to build. See https://github.com/sirredbeard/FeedReader/blob/master/snap/snapcraft.yaml, But none of the built libraries and binaries come over into staging or prime, even though I specify they should and other parts, specifically the latest valac, built by the autotools plugin do come over.
Can anyone point me in the right direction? Thank you!
UPDATE: Upstream project has switched to Meson. #1 and #2 may still be issues with cmake and build scrips that snap should look into but I am now focused on solving issue #3.
Hey, nice, I created a snap for FeedReader on my side as well, which I haven’t published yet as I need to do some relocations for the GTK webprocess it starts up. I’ll share my snapcraft.yaml if you want.
There are a few issues in your yaml though,
build: |
mkdir build
cd build
cmake ..
make
sudo make install
Is not really needed, I would remove that and let the plugin do its thing. What is most worrisome is the use of sudo make install, what you really want is make install DESTDIR=$SNAPCRAFT_PART_INSTALL, but all in all, you do not need this bit of code.
The reason I did the build script is because the cmake plugin in snapcraft fails, inexplicably, on one of the dependant components, /WebExtension/, see the log in the first post of the GitHub thread.
sudo make install, what you really want is make install DESTDIR=$SNAPCRAFT_PART_INSTALL
Would that explain why none of the binaries and libraries built by sudo make install are brought over into the snap even though they are listed under snap: or prime:?
The upstream project has now switched to Meson, so while issues #1 and #2 might still be issues with snap creation, and your fix may work, I am now focusing on issue #3, getting snap to build with the Meson plugin.