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
xdg module for common freedesktop tasks #837
Comments
one note, that users should be able to disable all such hooks (as it slows down and can even break packaging process). |
This is how Gnome-Twitch does the post install updates. The problem here is that, AFAICT, you should only call those updater functions when hard-installing to The real solution would be to have a daemon that watches the install dirs with inotify and does the magic when things are updated, but I'm guessing that will be a hard thing to get to the distros. |
Really that should cover every packaging situation I know of.
Any decent package manager already triggers these on installing a package automatically, but this is for when you go outside of the package manager. |
@TingPing, yeah we got filetriggers in RPM recently ;) |
about |
So to make progress on this what needs to happen from a module:
I think the latter should be doable similiar to how |
Also don't forget that if an user installs a program in its home folder, the .desktop files must be installed at $XDG_CONFIG_HOME/autostart. In case $XDG_CONFIG_HOME is not defined, the path is $HOME/.config/autostart. |
What is the correct way of determining when to install to |
In AUTOVALA I use the rule: if( ${CMAKE_INSTALL_PREFIX} MATCHES "^/home/" ) This is: if PREFIX starts with "/home/". DESTDIR should not come into play because this would never be used in packages, only when the user manually builds the program in its system and manually installs it in its user folder (useful when (s)he does not have root access). |
In fact, installing something to /opt/whatever... should not install .desktop files at $HOME/.config... |
Autostart is an unrelated directory for... autostarting applications. |
Yes, but you install there specific .desktop files, which have the "X-GNOME-Autostart-enabled=True" key. |
No extra key is needed: https://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html Anyway it is a different location for a different purpose. Sure a function could be added for that too though. |
We might also want to provide access to the https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html Sort of the equivalent of |
I'd request this be called |
I've pushed an initial version here: https://github.com/mesonbuild/meson/tree/tingping/xdg-module |
This would get us most of the way to eliminating post_install.py scripts in GNOME, right? (The only other missing part would be glib-compile-schemas, which belongs in the GNOME module.) |
I would like to work on this, as the meson_post_install script is imo shouldn't be needed at all for that basic stuff :) I would like to know which are the steps to do that? And is this the list mentioned on the issue is all that should be implemented or something else should be added? |
@bil-elmoussaoui Well the work isn't the hard part I just still am not happy with the API.
Yes that could be valuable but raises more API questions. #1757 might be relevant to that one. |
For translations, a preset would fit nicely. The API could be that |
@sardemff7 We not only need to extract translations, which your idea sounds like it handles, but we need to merge files at build time too. |
Sorry, missing |
I am sort of leaning in that direction, the only thing lost by that though is the detail of where things are installed. |
|
So another approach discussed at GUADEC for this is to just automatically do the right thing: https://github.com/mesonbuild/meson/tree/wip/tingping/xdg-auto-post-install Two remaining problems:
|
@TingPing how's this going? I'd love to use this. Let me know if you need testers. |
Depends upon #1601 getting fixed. |
@TingPing seems like support now exists for #1601, at least the i18n module uses it according to @eli-schwartz |
It's not really that "support now exists". It's a matter of architectural design. It used to be quite common for modules to make everything into custom meson.add_install_script() dispatched functionality instead of returning a On the other hand, we've since added https://mesonbuild.com/Gnome-module.html#gnomepost_install for running things like gtk_update_icon_cache. I guess in theory we could move it to a new module... personally I've never seen the point of a special module function that just does install_data but specialized for a specific type of file and a pre-set install_dir. |
So I started on a
freedesktop
module that encompasses various tasks one might do and wanted some feedback on the idea and how it might be implemented.Desktop files
install_desktop()
Calls
desktop-file-install
which validates the file and rebuilds the desktop mime cache. Alternatively we could just callupdate-desktop-database
and install ourselves. Validation makes more sense below IMO.validate_desktop()
Calls
desktop-file-validate
duringtest
, this does not seem easily doable from a module?Appstream files
install_appstream()
Just installs into the correct directory for you, not useful?
validate_appstream()
Calls
appstream-util validate
, see above.Mime files
install_mime()
Installs mime file and calls
update-mime-database
for you.Icons
install_icons()
Calls
gtk-update-icon-cache
on install.Related to #295. As mentioned there we should probably only run these when
DESTDIR
is unset, is this doable from a module too?The text was updated successfully, but these errors were encountered: