So currently I’m attempting to craft a snap for my project visualboyadvance-m
making use of wxwidgets gtk3 sdk stage snap, but in our code we also make use of polling gtk directly regarding wayland support so we include in our cmake the requirement for libgtk-3-dev.
trying to build what I have, cmake doesn’t seem to quite find gtk and I was wondering if someone could point me in the right direction.
name: visualboyadvance-m
version: 2.1.4
summary: Nintendo Game Boy Advance Emulator
description: |
An open-source Nintendo Game Boy, Super Game Boy, Game Boy Advance Emulators.
confinement: strict
base: core18
plugs:
desktop:
desktop-legacy:
home:
removable-media:
network:
parts:
wxwidgets-sdk:
plugin: nil
stage-snaps:
- wxwidgets-sdk-gtk3
stage-packages:
# Crash dialog support
- binutils
filesets:
crash-dialog-support:
- usr/bin/*addr2line
library-shared:
- '**/lib/**/*.so*'
prime:
- $crash-dialog-support
- $library-shared
vbam:
after:
- wxwidgets-sdk
source: https://github.com/visualboyadvance-m/visualboyadvance-m/archive/v2.1.4.tar.gz
plugin: cmake
build-packages:
- g++
- gcc
- make
- cmake
- pkg-config
- git
- libsdl2-dev
- libsfml-dev
- libgtk-3-dev
- libopenal-dev
configflags:
- -DENABLE_OPENAL=ON
- -DENABLE_SDL=OFF
apps:
visualboyadvance-m:
command: bin/visualboyadvance-m
I know there’s a lot more I need to get before it’s complete, but for now I just want to at least the building stage started.
if you could put a complete build log with the failure on https://paste.ubuntu.com/ and link it here, potential helpers would have some more thing to look at
guessing the error by staring your snapcraft.yaml isnt really possible …
Well personally I’d rather use hastebin As for the error, that will have to wait. Seems I’m having a snapd issue currently and snapcraft is throwing me
cannot change profile for the next exec call: No such file or directory
But the error is still (I’m assuming this is more-or-less the error you see):
CMake Error at src/wx/CMakeLists.txt:449 (message):
Could not find gtk
-- Configuring incomplete, errors occurred!
See also "/root/parts/vbam/build/CMakeFiles/CMakeOutput.log".
See also "/root/parts/vbam/build/CMakeFiles/CMakeError.log".
Failed to run 'cmake /root/parts/vbam/src -DCMAKE_INSTALL_PREFIX= -DENABLE_OPENAL=ON -DENABLE_SDL=OFF' for 'vbam': Exited with code 1.
Verify that the part is using the correct parameters and try again.
Total guess here, but I think the gtk check is not looking in the right place for a snap build. One way to debug this is to log into the lxd container (use snapcraft --use-lxd to use LXD instead of multipass, or you can log into the multipass VM. Same difference, but I find lxd easier to work with) and poke around in the stage directories to see where gtk lives during snap build. The LXD is a kind of beta feature, but I use it all the time.
lxc start snapcraft-visualboyadvance-m
lxc exec snapcraft-visualboyadvance-m bash
# cd /root
# ls stage
As I said, this probably won’t help much, but maybe it’ll help you figure out a good debugging path forward, which is usually: my build can’t find X. Search for where snapcraft puts it in the build container, modify snapcraft.yaml, try again.
@hellsworth crap, forgot hastebin recently changed how it retains content.
@jsseidel pretty much the fact it can’t find gtk, and while I like the idea of snaps, stuff like this makes it kinda frustrating. My platform however doesn’t use LXD, so I’ll have to try and debug with multipass.
Your cmake build tries to compile and run a test to determine if the available wxwidgets is usable. This fails to find the wxwidgets setup.h header and then falls through to the cannot find GTK message due to all the subsequent checks failing for the same reason. To make the build able to find the wxwidgets setup.h header you need to add CFLAGS and CXXFLAGS environment variables to your part in snapcraft.yaml:
You also need to add a build-package for zip and libnotify-dev or the build will fail further along… You’ll likely want to also add libnotify4 as a stage package or reference it with the gnome-3-28 extension.
So I managed to get things going, everything built, and then got my runtime bundled, however
I think I need to dig around with audio stuff. But I do have things working to the point where things load (opengl though is something that’s not exactly working)
But I did manage to get the entirety of the snap built
if anyone has suggestions for opengl support I’m all ears, as for the audio, I think I know what I’m missing, just gonna go through the documentation.
[edit]
Got it, was missing the audio-playback plug
[edit2]
Got my opengl issue finally resolved, missed the opengl plug and needed to add
- libgl1
- libglvnd0
- libglx0
- libopengl0
And things are working, just need to fix icon location and I can begin rollout of a test release.
Much thanks for those that lent a hand in helping with this.