-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Packaging] Add experimental Flatpak support #72
Conversation
Thanks! I'll take a look at this in the coming days! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So those few days turned into a few months... sorry!
I have a few questions regarding some options, see below. It seems to run file, although it does not have access to ~/.rgb.ini
(it creates its own in ~/.var/app/org.unia.gcolor3/config/gcolor3/config.ini
) and seems to complain about DBus:
(gcolor3:3): GLib-GIO-CRITICAL **: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
I'm also getting this:
(gcolor3:3): Gtk-WARNING **: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
Do you know how to get these resolved? I'd love to have a working Flatpak up on Flathub!
org.unia.gcolor3.json
Outdated
"--socket=x11", | ||
"--socket=wayland", | ||
|
||
"--filesystem=xdg-config/gcolor3/config.ini:ro" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? The colors are written to ~/.rgb.ini
, not ~/.config/gcolor/config.ini
, if that's what this is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flatpak is based off v2.2 which has this in the changelog:
- Follow the XDG directory specification (d91dd06).
This means that the configuration file has moved from ~/.rgb.ini to $XDG_CONFIG_HOME/gcolor3/config.ini
Or at least I think that was the reasoning, it's been a while since I wrote it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, you're 100% right! I forgot that PR.
org.unia.gcolor3.json
Outdated
], | ||
|
||
"build-options": { | ||
"cflags": "-O2 -g" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we distribute a debug build inside the Flatpak?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most, if not all of the flathub builds do:
https://github.com/search?q=org%3Aflathub+-g&type=Code
I'm not 100% sure why they agreed to this since flathub only accepts stable builds so it's not like you would be debugging a broken build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange, but if they all do it, let's do so too.
Thanks, I'll be sure to make those changes (or you can here directly, if you will). Since my GitHub handle changed to Hjdskes, I'm planning |
I would recommended releasing v2.3 before pulling this but after you do the rename. You seem to have a lot of quality of life fixes that wouldn't be included in the new flatpak sent to flathub. Also flathub doesn't accept flatpaks built from Also flathub doesn't seem 100% sure what to do about apps that rename their app-id yet so they ask you don't change them after submitting. They can rename the repo but OSTree is a bit harder, so I would only submit after you |
Re v2.3, definitely on the planning. Time is the # 1 problem for me at the moment.
Does what you did in 66147fe work for you, or do we need to switch to branches for releases? |
You just need to change the url to v2.3 or whichever version you are planning to upgrade to and generate a new sha256 checksum. We could also have the local flatpak file point to the master branch for nightly testing and submit a stable version to flathub. I found developing using flatpak in GNOME Builder to be very nice since the builds are reproducible and independent from the current system. Their might be some issue atm since the app-id passed into GApplicaition is the old one. I was writing another commit to change all the app-ids but ran into a linker issue and had to bolt to classes. I have some before class so I'm going to look into it. |
To follow GNOME standards and to prevent necessary renaming in the Flatpak manifest (see #72).
I did the rename in https://github.com/Hjdskes/gcolor3/tree/rename, which currently is on top of this branch so I can easily test the Flatpak. Compiling and running works locally (i.e. not inside a Flatpak), however when rebuilding the Flatpak (with
I am not sure if this is related to the renaming. Can you test this @julianrichen? |
To follow GNOME standards and to prevent necessary renaming in the Flatpak manifest (see #72).
It's building fine for me but I can't run it, probably because of some permissions with the color.ini ** (gcolor3:2): WARNING **: Error opening file: No such file or directory. Colors likely won't be saved
Failed to register: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown @Hjdskes Try deleting your .flatpak-builder directory, which is located in the directory you built the flatpak. I know OSTree has some issue with app-id renaming which is why flathub deson't want to change them after they are committed. That might be the reason. |
Oh... I set config.ini to :ro (read-only), probably should be :rw (read-write). |
Allow read-write access to xdg-config/gcolor3/config.ini, instead of read-only.
It built fine for me as well, but I got another error, even after rebuilding with the rw permissions:
I'm not sure what's going on here. EDIT: This does not seem to happen on your branch, without the renaming. |
Weird, I still get ** (gcolor3:2): WARNING **: Error opening file: No such file or directory. Colors likely won't be saved
Failed to register: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown Which is only a warning and should not stop the application from running... Question, when you build locally are you changing the manifest to build the local files instead of pulling the v2.2 archive? Example: ...
"modules": [
{
"name": "gcolor3",
"sources": [
{
"type": "git",
"url": "file:///home/jente/Projects/gcolor3"
}
]
}
]
}
|
I built the packages outside of flatpak using the rename branch and it builds fine and runs but I also get the following: ** (gcolor3:15690): WARNING **: Error reading keys: Key file does not have group “Colors” After I built without flatpak and re-ran the Failed to register: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
** (gcolor3:2): WARNING **: Error writing file: Failed to rename file “/home/julian/.var/app/org.hjdskes.gcolor3/config/gcolor3/config.ini.BOMEDZ” to “/home/julian/.var/app/org.hjdskes.gcolor3/config/gcolor3/config.ini”: g_rename() failed: Device or resource busy Which is strange, idk if it's a delay thing & a coincident because only stuff inside the flatpak should effect the flatpak. Still looking into it. |
So changing
to
Fixed the warning, I then tried
and it removed the warning, I think because you have a function that checks that the .config/gcolor3 directory exists. I still can't get the application to launch, the dbus warning makes it seem like their is an application mismatch in GApplication... |
To follow GNOME standards and to prevent necessary renaming in the Flatpak manifest (see #72).
To follow GNOME standards and to prevent necessary renaming in the Flatpak manifest (see #72).
I got everything to work by using |
@Hjdskes Can you push the flatpak file to flathub too? Thanks |
I will do that once I release a new version that I can point the manifest to. According to @julianrichen, Flathub does not accept Flatpaks that build from master, understandably so. |
This pr adds an initial flatpak manifest and should close #71. I would recommend changing the
gcolor3.svg
,gcolor3.desktop
, &gcolor3.appdata.xml
file fromgcolor.*
toorg.unia.gcolor3.*
since flatpak automatically looks for those files based on the application id. It would also be needed since the the shell will look for org.unia.gcolor3.svg but your application will look for gcolor3.svg in the About modal window.Things seem to be working and I added
--socket=wayland
but obviously because of #67 it won't work 100% on wayland. Didn't try x11 since I use wayland.Build
Future
If you plan on following-up on #59 then you will need to add the following to
finish-args
: