writeas-gtk
writeas-gtk copied to clipboard
Create a Flatpak Package For GTK App
This creates a development flatpak package for the desktop app. Includes a rework of the non-elementary version's app ID and a fix for an issue introduced in #28
The current issues:
- ~~There's no way to authenticate from the UI, which means you can't actually publish from the app~~
- [x] The current way of saving drafts doesn't work with the flatpak sandbox. I'll look into that - either we make a sandbox hole or I figure this out.
- [x] It requires xclip currently. I'll need to see if there's a way around this or if I need to ship xclip within the flatpak.
Once we get the last two worked out can we merge this? It will be much easier for me to work on number 1 after that
In addition: should I look into getting flatpak CI set up, or should I make that a separate task?
- There's no way to authenticate from the UI, which means you can't actually publish from the app
Hm, you should be able to publish -- the writeas-cli doesn't require authentication to publish. Maybe it's related to the flatpak sandbox? Because the CLI does need access to ~/.writeas
In addition: should I look into getting flatpak CI set up, or should I make that a separate task?
I'd say we address this as a separate task. Please feel free to create that in Phabricator
Ah, apologies. The xclip issue is the only one that blocks publishing, then.
Fixed the publishing issue, will look into the draft issue next.
For now I added a sandbox hole to the flatpak. In the future I think we should migrate to using xdg dirs instead of a directory in ~/. Flatpak properly handles that use case by default.
I'd say that this is ready now.
Great, sounds good. How can I test this out?
There are a few ways:
-
GNOME Builder (recommended). This should get you set up in a couple clicks.
-
Commands:
$ flatpak-builder --repo=repo app flatpak/com.abunchtell.WriteAsDesktop.json
Or I can send you a flatpak bundle. Which way would you prefer?
Thanks! I'd like to personally know how everything works, so I'm happy to build everything
I'm having a tough time getting this working, now it's an error when running the built flatpak with flatpak run com.abunchtell.WriteAsDesktop:
Failed to register: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
This was after adding the local repo and installing for my user.
@thebaer needed dependencies with flatpak:
flatpak install org.gnome.Sdk//3.32flatpak install org.gnome.Platform//3.32flatpak install io.elementary.BaseApp//Junoflatpak install org.freedesktop.Sdk.Extension.golang//18.08
@BrainBlasted I couldn't find an easy way to install required dependencies so just kept installing whatever the builder comlained was missing.
@robjloranger do you have xdg-desktop-portal & xdg-desktop-portal-gtk installed?
@BrainBlasted tried again today and found another error building:
[0/1] Installing files.
Installing src/wl-copy to /app/bin
Installing src/wl-paste to /app/bin
Installing /run/build/wl-clipboard/data/wl-copy.1 to /app/share/man/man1
Installing /run/build/wl-clipboard/data/wl-paste.1 to /app/share/man/man1
Installing /run/build/wl-clipboard/data/wl-clipboard.1 to /app/share/man/man1
Installing /run/build/wl-clipboard/completions/bash/wl-copy to /app/share/bash-completion/completions
Installing /run/build/wl-clipboard/completions/bash/wl-paste to /app/share/bash-completion/completions
Installing /run/build/wl-clipboard/completions/zsh/_wl-copy to /app/share/zsh/site-functions
Installing /run/build/wl-clipboard/completions/zsh/_wl-paste to /app/share/zsh/site-functions
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/mesonbuild/mesonmain.py", line 122, in run
return options.run_func(options)
File "/usr/lib/python3.7/site-packages/mesonbuild/minstall.py", line 514, in run
installer.do_install(datafilename)
File "/usr/lib/python3.7/site-packages/mesonbuild/minstall.py", line 346, in do_install
self.install_data(d)
File "/usr/lib/python3.7/site-packages/mesonbuild/minstall.py", line 375, in install_data
d.dirmaker.makedirs(outdir, exist_ok=True)
File "/usr/lib/python3.7/site-packages/mesonbuild/minstall.py", line 55, in makedirs
os.makedirs(path, exist_ok=exist_ok)
File "/usr/lib/python3.7/os.py", line 211, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/lib/python3.7/os.py", line 221, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/usr/share/fish'
FAILED: meson-install
/usr/bin/meson install --no-rebuild
ninja: build stopped: subcommand failed.
Error: module wl-clipboard: Child process exited with code 1
What version of python is required to build?
Also, are there any python modules required to build?
This isn't a python issue by rather an idea where a dependency requires a new cli flag. Working on updating things.