Closed MadcapJake closed 6 years ago
Seems like howl uses GApplication, which registers its name using dbus. Flatpak denies most dbus accesses by default, however you are allowed to own your flatpak application id on the bus. It seems like in: https://github.com/howl-editor/howl/blob/cdcde209e6ca4bceee56be509b4eaa381b6e29a1/lib/ljglibs/spec/gtk/application_spec.moon#L6 you currently use "my.App" as the id. This needs to be com.github.howl_editor.Howl instead
@alexlarsson thanks for the input! The file you've found is only the spec for the ljglibs GtkApplication
wrapper though - the actual id is io.howl.Editor
as defined in application.moon.
@MadcapJake see if it works with io.howl.Editor
as per Alexander's input. Note that for launching the packaged app you'll want to specify that the --reuse
parameter should be used, otherwise the application id will be changed at start to avoid launching in the same GApplication.
Would be interesting to see if this could work well, I have been following xdg-app from the sides previously. I wasn't aware of the new name though, but I blame @alexlarsson's lack of blog updates for that :)
@nilnor that did the trick! However I am hitting one little snag. At first, I was getting this error:
Failed to find application icon
So I changed all references from howl.svg to io.howl.Editor.svg
. This removed the error but it still shows the default icon for some reason.
There is a "rename-icon" feature you can use.
Ok I've created a bundle if anyone is interesting in giving it a try. https://github.com/MadcapJake/howl/releases/tag/0.4-pak
Nice! And seems to work well from my limited testing (drawbacks I saw: scrollbars end up being uglier, and a Gtk warning in the console). Would be nice to get the build step automated into master and perhaps offer it as a download alternative from the site (as flatpak is not currently at the stage where it's integrated directly in any store AFAIK). The icon renaming could perhaps be handled with rename-icon
feature mentioned by @alexlarsson?
Yeah flatpak forces the use of the Adwaita theme and I'm not sure how to workaround that. The rename-icon
feature requires that you follow their Build API which would require more modifying than I think I'm capable of completing.
Flatpak is available in Arch and Fedora OOTB and others only a step or two away.
Following that build API seems more than what I'm willing to do anyway, but we should be able to wrap up all needed build steps in a simple shell script, and that could handle the icon renaming automatically in that case.
Yeah that's what I did for the .pak
file in my fork. This should cover it (haven't tested but pulled these commands from my shell history and original post)
VER=0.4
flatpak build-init howl-pak-dir io.howl.Editor org.gnome.Sdk org.gnome.Platform 3.20
wget "https://github.com/howl-editor/howl/releases/download/$VER/howl-$VER.tgz"
tar xvf "howl-$VER.tgz"
cd "howl-$VER"
mv share/applications/howl.desktop share/applications/io.howl.Editor.desktop
mv share/icons/hicolor/scalable/apps/howl.svg share/icons/hicolor/scalable/apps/io.howl.Editor.svg
cd src
flatpak build ../../howl-pak-dir make PREFIX=/app
flatpak build ../../howl-pak-dir make PREFIX=/app install
cd ../../
flatpak build-finish howl --socket=x11 --share=network --filesystem=host --command=howl
flatpak build-export howl-repo howl $VER
flatpak build-bundle howl-repo "howl-$VER.x86_64.flatpak" io.howl.Editor $VER
I don't see how that is especially complicated to build with flatpak-builder. All you need is to set "no-autogen": true.
Also, please use .flatpak, thats the extension used in the mime db. .pak is used for other types.
@alexlarsson oh, I had asked on IRC whether I could skip the configure step and didn't receive a reply (and there's no mention of no-autogen
on that Build API page). Without that, it should require no modification of the makefile, iiuc.
Also editing my previous post to reflect .flatpak
First off, this isn't a bug in Howl. Flatpak doesn't allow access to DBus services by default without explicit arguments. And, as Howl uses GApplication to detect unique instances, which in turn uses DBus...you can see where this is headed.
Of course, because I'm a moron, I had forgotten that this was open and basically re-implemented the whole freaking thing. :man_facepalming:
Here's my flatpak-builder script (place in io.howl.Editor.json
):
{
"app-id": "io.howl.Editor",
"runtime": "org.gnome.Platform",
"runtime-version": "3.26",
"sdk": "org.gnome.Sdk",
"command": "howl",
"modules": [
{
"name": "howl",
"buildsystem": "simple",
"build-commands": [
"make -C src install PREFIX=/app"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/howl-editor/howl/releases/download/0.5.3/howl-0.5.3.tgz",
"sha256": "7b0055908f57f27b30f20f7baec6302b0ba368ca3f30ccd655bc2258f246cc3e"
}
],
"cleanup": [
"/share/howl/spec",
"example.*",
"misc",
"*.moon"
]
}
],
"rename-appdata-file": "howl",
"rename-desktop-file": "howl.desktop",
"rename-icon": "howl",
"copy-icon": true,
"finish-args": [
"--share=ipc",
"--share=network",
"--socket=x11",
"--socket=wayland",
"--filesystem=home",
"--filesystem=host",
"--own-name=io.howl.*"
]
}
Unfortunately, Howl 0.5.3 doesn't have the window border fix from #263, which is reproducible when running inside of the Flatpak.
FWIW since this issue has been posted, Flathub has become a thing, where we could probably submit Howl to.
Not a Howl bug.
I tried packaging howl via flatpak and I thought I'd show you how far I got (and ask for some help with an error that I don't know anything about).
This sets up a
howl
directory with some boilerplate.This builds and installs into the proper
howl
directory.This renames two to-be exported files to the format that flatpak expects.
This creates an export directory and adds some details about what howl can access (not sure if the network is really).
This creates a repo and adds howl to it. Then it adds the repo to the user's selection of repos and installs
com.github.howl_editor.Howl
from within it.This runs the application. Everything up to this point works but after attempting to run, I get this message:
I'm not familiar with DBus, MoonScript, or this project but I thought I'd at least share how far I got as I think this might be a plausible build format to support.