Looking to share and get feedback on my first successful snap application, https://snapcraft.io/openaudible
I made the snapcraft.yaml project available here: https://github.com/openaudible/oa_snap if anyone wants to follow along or see a real-world example.
But I’m also not sure if I did it correctly. I’m not sure about which plugs/extensions I need to use. Wayland? X11? Unity? I’m not a linux expert but want to provide a linux app for my users. How do I test on all the platforms that snap runs on?
I’m also not sure the best way to run this java based gui application. Currently using a launch.sh that calls:
./jre/bin/java -Duser.home=$SNAP_USER_COMMON -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -jar openaudible_gtk_x86_64.jar > /dev/null 2>&1 &
But I didn’t see any other example apps using the trailing & to run the app in the background and pipe the output to dev/null. But it launches fine using the desktop icon, so perhaps it is fine.
What doesn’t work:
- x11 via a terminal. I develop on windows and run very few linux desktop apps myself, but when I do, they usually come up on my windows box through my MobaXterm. Some snaps work fine, others, including mine, don’t come up at all and report an invalid authorization. Not sure how to fix.
- Revealing a file in the default file manager doesn’t work. My app has a few places (like in the prefs) when you can click on a button and reveal a file path in the system folder. I tried multiple methods-- nautalis --select, xdg-open, dbus-send, gdbus call, etc. xdg-open gives an error message, but dbus-send at least opens the file manager and gives an error that opening the file path is “operation not supported” This is not a deal breaker, but spent many hours trying different approaches.
- When starting the installed snap from terminal, the user sees 6 concerning warning schema messages.
Warning: Schema “org.gnome.system.locale” has path “/system/locale/”. Paths starting with “/apps/”, “/desktop/” or “/system/” are deprecated.
Any suggestions for the above issues would be appreciated!
Here are a few suggestions for making life easier on new snapcraft developers:
Ability to override yaml values from command line OR set environment variables. Using a docker style -e format seems the easiest: snapcraft -e VERS=1.2.3 (and have version: $VERS in the yaml)
A big bug I encountered was that I was trying to build my snapcraft outside of my home directory. This apparently is not allowed, and the error message could use improvement: (Source path “/data/dev/oa_snap” does not exist)
So when I couldn’t build, I spent a day trying to get it working on stable.Dockerfile (getting python3 errors), running on VMWare/Virtualbox (no can do), and trying with LDX (also no luck.)
A few other gripes
- Setting the license to “shareware”,“commercial”, “trialware” did not work. The web site for chosing a license also didn’t have anything like those listed as options. Ended up using Proprietary. But a reasonable error message would be nice or note on snapcraft-top-level-metadata.
- Setting a top level yaml "website: " in the yaml caused the build to fail the snap checks with an error message about an invalid “links” yaml argument.
Sorry for the long post… but thought a little feedback give might be helpful.
Thanks for all the hard work that went into this ambitious project!