Subject: bug#26988: Add desktop-file-utils to all gtk applications

From: Marius Bakke <[email-masked]>
Date: Sun, 21 May 2017 04:32:16 +0200

Marius Bakke <[email-masked]> writes:

> Danny Milosavljevic <[email-masked]> writes:
>
>> Hi Marius,
>> Hi 宋文武,
>>
>> On Sat, 20 May 2017 01:05:22 +0200
>> Marius Bakke <[email-masked]> wrote:
>>
>>> Danny Milosavljevic <[email-masked]> writes:
>>> 
>>> > these are two patches I propose we add in order to add
>>> > desktop-file-utils to all gtk applications.  This means that the
>>> > profile hook would pick up the desktop files (as soon as possible).  
>>> 
>>> So if I read (guix profiles) correctly, the hook only runs when
>>> 'desktop-file-utils' is referenced. Would checking for a gtk reference
>>> as well not achieve the same effect? Or is that too expensive?
>>
>> That would probably work as well.
>>
>> But the idea is KDE would eventually use the XDG desktop cache, too (maybe it already does - no idea).  Any other desktop environments that don't reinvent the wheel in that regard would use desktop-file-utils as well - and that's the package that actually contains the "update-desktop-database" executable for updating the XDG desktop cache.
>>
>> Right now the "xdg-desktop-database" profile hook doesn't need its own magical packages but it just uses the existing desktop-file-utils reference for actually updating the desktop database.
>
> IIUC, the idea is to run the hook every time a package with a ".desktop"
> file has changed. Even if we propagate "desktop-file-utils" from say,
> GTK+ and Qt, it won't catch some cases where we add the ".desktop" file
> manually such as "rxvt-unicode".

A dirty workaround could be to add a reference to some dummy store item
in the 'patch-dot-desktop-files' phase. Maybe a hidden "mimeinfo-helper"
package and inject a reference to it directly in the '.desktop' files.

And then test for that in the profile hook. Sounds a bit hacky, but
should not cause any compatibility issues, and avoids the artificial
'desktop-file-utils' reference at 122MiB.