Add desktop-file-utils to all gtk applications

  • Done
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • 宋文武
  • Marius Bakke
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal

Debbugs page

Danny Milosavljevic wrote 8 years ago
(address . guix-patches@gnu.org)
20170518230111.53a91ffe@scratchpost.org
Hi,

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).

One patch moves desktop-file-utils from (gnu packages gnome) to (gnu packages freedesktop). I suggest we apply this patch to all branches - since they don't change anything in the build.

The other patch adds desktop-file-utils as propagated-input to gtk+-2 (and by inheritance to gtk+ 3, too). That would imply entail all gtk applications. Therefore, it should only go to core-updates.
Danny Milosavljevic wrote 8 years ago
[PATCH] gnu: Move desktop-file-utils to (gnu packages freedesktop).
(address . 26988@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170518210726.6425-1-dannym@scratchpost.org
* gnu/packages/gnome.scm (desktop-file-utils): Move from here ...
* gnu/packages/freedesktop.scm (desktop-file-utils): to here.
---
gnu/packages/freedesktop.scm | 32 ++++++++++++++++++++++++++++++++
gnu/packages/gnome.scm | 32 --------------------------------
2 files changed, 32 insertions(+), 32 deletions(-)

Toggle diff (83 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 85a6c8b26..dfc88986f 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -927,3 +927,35 @@ library to access fingerprint readers, over the D-Bus interprocess
communication bus. This daemon layer above libfprint solves problems related
to applications simultaneously competing for fingerprint readers.")
(license license:gpl2+)))
+
+(define-public desktop-file-utils
+ (package
+ (name "desktop-file-utils")
+ (version "0.23")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://www.freedesktop.org/software/" name
+ "/releases/" name "-" version ".tar.xz"))
+ (sha256
+ (base32
+ "119kj2w0rrxkhg4f9cf5waa55jz1hj8933vh47vcjipcplql02bc"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("glib" ,glib)))
+ (home-page "http://www.freedesktop.org/wiki/Software/desktop-file-utils/")
+ (synopsis "Utilities for working with desktop entries")
+ (description
+ "This package contains a few command line utilities for working with
+desktop entries:
+
+desktop-file-validate: validates a desktop file and prints warnings/errors
+ about desktop entry specification violations.
+
+desktop-file-install: installs a desktop file to the applications directory,
+ optionally munging it a bit in transit.
+
+update-desktop-database: updates the database containing a cache of MIME types
+ handled by desktop files.")
+ (license license:gpl2+)))
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 47dcc91dc..e7b1577f3 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -656,38 +656,6 @@ Specification, the icon naming utility maps the icon names used by the
GNOME and KDE desktops to the icon names proposed in the specification.")
(license license:lgpl2.1+)))
-(define-public desktop-file-utils
- (package
- (name "desktop-file-utils")
- (version "0.23")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://www.freedesktop.org/software/" name
- "/releases/" name "-" version ".tar.xz"))
- (sha256
- (base32
- "119kj2w0rrxkhg4f9cf5waa55jz1hj8933vh47vcjipcplql02bc"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("pkg-config" ,pkg-config)))
- (inputs
- `(("glib" ,glib)))
- (home-page "http://www.freedesktop.org/wiki/Software/desktop-file-utils/")
- (synopsis "Utilities for working with desktop entries")
- (description
- "This package contains a few command line utilities for working with
-desktop entries:
-
-desktop-file-validate: validates a desktop file and prints warnings/errors
- about desktop entry specification violations.
-
-desktop-file-install: installs a desktop file to the applications directory,
- optionally munging it a bit in transit.
-
-update-desktop-database: updates the database containing a cache of MIME types
- handled by desktop files.")
- (license license:gpl2+)))
-
(define-public gnome-icon-theme
(package
(name "gnome-icon-theme")
Danny Milosavljevic wrote 8 years ago
[PATCH] gnu: gtk+-2: Add desktop-file-utils to propagated-inputs.
(address . 26988@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170518211937.27335-1-dannym@scratchpost.org
* gnu/packages/gtk.scm (gtk+-2)[propagated-inputs]: Add desktop-file-utils.
---
gnu/packages/gtk.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (12 lines)
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index dffa2baf3..cf40c59dc 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -604,6 +604,7 @@ is part of the GNOME accessibility project.")
(outputs '("out" "doc"))
(propagated-inputs
`(("atk" ,atk)
+ ("desktop-file-utils" ,desktop-file-utils) ; Used by profile hook.
("gdk-pixbuf" ,gdk-pixbuf+svg)
("pango" ,pango)))
(inputs
Marius Bakke wrote 8 years ago
Re: bug#26988: Add desktop-file-utils to all gtk applications
87inkwa1n1.fsf@fastmail.com
Danny Milosavljevic <dannym@scratchpost.org> writes:

Toggle quote (4 lines)
> 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?

Toggle quote (4 lines)
> One patch moves desktop-file-utils from (gnu packages gnome) to (gnu
> packages freedesktop). I suggest we apply this patch to all branches
> - since they don't change anything in the build.

Adding it to 'master' would be sufficient, no? It will be merged to
'staging' and 'core-updates' in due time.

I don't see a good reason to move it though, but no strong opinion. Make
sure all dependent packages still finds it!

Toggle quote (4 lines)
> The other patch adds desktop-file-utils as propagated-input to gtk+-2
> (and by inheritance to gtk+ 3, too). That would imply entail all gtk
> applications. Therefore, it should only go to core-updates.

Not just all gtk applications, but also anything depending on those. Can
you add a comment about why we propagate 'desktop-file-utils' from gtk?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlkfejIACgkQoqBt8qM6
VPomVggAw13bEkQs51OTVRUlOiA+KfxtkJUKS0fO1dm75PTFocAm2wDYjsHHyHIs
ZUPDtzwN0P1ZXbal8OrhQ+7dQfwBy9oTmjRlX54O5h6RMly9D6euwj4XD5rWnMZQ
dquSH2hj9HSn+4fACRAd9Om1zLKvbL+intlZPh4jgn8evlOIVFa2s4mxmhUF3pXj
mCN3V9P7EvkaN7XLStPfleMi/MmDYiRn2NNnEGdLht4s9qb4PFvb1DkZLJoCm4ZK
n+/qp16f7KnZG+iZ6tquJPJprx4TMCS0vlAxKDcH4A8oIQfBUCp1tiQABXbyxKyh
plEG2pWeOwG/8h7F5yViauFf1amRaQ==
=VnV9
-----END PGP SIGNATURE-----

Danny Milosavljevic wrote 8 years ago
(address . 26988@debbugs.gnu.org)
20170520150411.21c3e0aa@scratchpost.org
Hi Marius,
Hi 宋文武,

On Sat, 20 May 2017 01:05:22 +0200
Marius Bakke <mbakke@fastmail.com> wrote:

Toggle quote (10 lines)
> Danny Milosavljevic <dannym@scratchpost.org> 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.

At least I think that's the idea there. 宋文武 wrote the update-desktop-database part in the profile hook... 宋文武, what do you think?

Toggle quote (9 lines)
> > One patch moves desktop-file-utils from (gnu packages gnome) to (gnu
> > packages freedesktop). I suggest we apply this patch to all branches
> > - since they don't change anything in the build.
>
> Adding it to 'master' would be sufficient, no? It will be merged to
> 'staging' and 'core-updates' in due time.

> I don't see a good reason to move it though, but no strong opinion.

desktop-file-utils is a freedesktop project.

If we don't move it and if KDE used desktop-file-utils (as it should), we'd have KDE depend on Gnome.

Also, it causes module reference cycles if we don't move it. I don't like those - even though they seem to work in this instance.

I think moving it is preferrable to having it sit there, waiting to make the module cycles explode.

Toggle quote (2 lines)
>Make sure all dependent packages still finds it!

Yes, I should add a reference to (gnu packages freedesktop) in (gnu packages xfce), (gnu packages game-development) and (gnu packages engineering) in the next version.

If we did move it in all branches, I mean also in wip-installer etc, I think it would prevent any merging problems - since git uses file hashes as commits - and people would not have to take care whether this branch has already moved it or not.

Moving wouldn't cause any rebuilds and fallout would be minimal - the risk would be very low.

Toggle quote (7 lines)
> > The other patch adds desktop-file-utils as propagated-input to gtk+-2
> > (and by inheritance to gtk+ 3, too). That would [entail rebuilding] all gtk
> > applications. Therefore, it should only go to core-updates.
>
> Not just all gtk applications, but also anything depending on those. Can
> you add a comment about why we propagate 'desktop-file-utils' from gtk?

There's one:

+ ("desktop-file-utils" ,desktop-file-utils) ; Used by profile hook.

Do you mean we should add some more text?
Marius Bakke wrote 8 years ago
(address . 26988@debbugs.gnu.org)
87h90f5e2h.fsf@fastmail.com
Danny Milosavljevic <dannym@scratchpost.org> writes:

Toggle quote (22 lines)
> Hi Marius,
> Hi 宋文武,
>
> On Sat, 20 May 2017 01:05:22 +0200
> Marius Bakke <mbakke@fastmail.com> wrote:
>
>> Danny Milosavljevic <dannym@scratchpost.org> 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".

I wonder if there is a more generic thing we could test for.. Maybe
libx11? Obviously lots of false positives, but the hook is not *that*
expensive. Thoughts?

Toggle quote (13 lines)
>> > One patch moves desktop-file-utils from (gnu packages gnome) to (gnu
>> > packages freedesktop). I suggest we apply this patch to all branches
>> > - since they don't change anything in the build.
>>
>> Adding it to 'master' would be sufficient, no? It will be merged to
>> 'staging' and 'core-updates' in due time.
>
>> I don't see a good reason to move it though, but no strong opinion.
>
> desktop-file-utils is a freedesktop project.
>
> If we don't move it and if KDE used desktop-file-utils (as it should), we'd have KDE depend on Gnome.

Ah, ok. Makes sense.

Toggle quote (2 lines)
> If we did move it in all branches, I mean also in wip-installer etc, I think it would prevent any merging problems - since git uses file hashes as commits - and people would not have to take care whether this branch has already moved it or not.

IME, git usually recognizes cherry-picks as the same change, but not
always. I think the problem is that "cherry-pick" is smart, it can adapt
to some fairly complicated context changes unlike e.g. "patch". So, even
if the cherry-pick succeeds, the file and context can be very different.

For example, I recently tested merging a branch with 600+ cherry-picks
back to 'master'. That went mostly-well, but there were some very
difficult conflicts in all files that had changed in the other branch
(and the duplicate branch history did not help).

In short, I think we should prefer merging to cherry-picks whenever
possible. Merging is equally smart, so if cherry-pick works "out of the
box" merge will too. And they definitely do not prevent merging
problems, quite the opposite!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlkgyoYACgkQoqBt8qM6
VPoIGAf9FJF29v2UKiAvYX29k02Lq1PjToF1itdyzVXFW62HcbSIw6bdD5bG99tm
vAdzenpiULQwhYxo4ISDme1qUnWl7HmUZSKiPvMBWeDqYamIMrhDZEmX2yNm+1dW
JR6yHF9MFHIUL9etyvSJCGZowLSJdGwmulEV47Ihdpk14jF+GAeADW7JaP67Bye2
BtWeNu7zRPuNpB7EpGjbJXSWM0cH2KD55oc3dp1VuwjryJap8a/GtBxnNaUACj/M
beZ8ByTXKA9xjdAi+feyNAp8dZRK2l5x//7S9UDQ+tkgw2fLtit6C/eEqAzUZn0z
ob2v1oIhNVZlILa67f225XElLJyjMw==
=GnQB
-----END PGP SIGNATURE-----

Marius Bakke wrote 8 years ago
(address . 26988@debbugs.gnu.org)
87efvj549b.fsf@fastmail.com
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (29 lines)
> Danny Milosavljevic <dannym@scratchpost.org> writes:
>
>> Hi Marius,
>> Hi 宋文武,
>>
>> On Sat, 20 May 2017 01:05:22 +0200
>> Marius Bakke <mbakke@fastmail.com> wrote:
>>
>>> Danny Milosavljevic <dannym@scratchpost.org> 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.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlkg/DAACgkQoqBt8qM6
VPopugf+NbuZ2Ar1npkkE/DMIwt5gfOC3a5L8dghDbb0TwtlEAl6SOr0fN/jc3az
AcMenvDkxuBvz/mrNj/oxiK6ZlLoU8DwJ1qHYC/3oTVY7PbnjK/WVURnJ00K0gGU
AMb/R1FuZY3Z2WmoS0mJ8/NvSmwvdUgVcI+WLhQWIrR/Bhf+gIReSC0FGw0o8wXy
Me0s7m/VoC7BRXcPCBLx9ojBXQo3KsN4y/zLYtL5729d93O9TRhRHDNB49VHnaLn
EFCpS87g+vtFWoGFUphI+q9gw4ddFDJw/rN4EWK0cuWnB+ZSR5zgSgP0pJQf34RS
1N7KFWithAUZD8R0szwOVjgihBg1cQ==
=FICT
-----END PGP SIGNATURE-----

Danny Milosavljevic wrote 8 years ago
[PATCH v2 0/2] Add desktop-file-utils to all gtk applications.
(address . 26988@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170605192202.18820-1-dannym@scratchpost.org
Danny Milosavljevic (2):
gnu: Move desktop-file-utils to (gnu packages freedesktop).
gnu: gtk+-2: Add desktop-file-utils to propagated-inputs.

gnu/packages/engineering.scm | 1 +
gnu/packages/freedesktop.scm | 32 ++++++++++++++++++++++++++++++++
gnu/packages/game-development.scm | 1 +
gnu/packages/gnome.scm | 32 --------------------------------
gnu/packages/gtk.scm | 1 +
gnu/packages/xfce.scm | 1 +
6 files changed, 36 insertions(+), 32 deletions(-)
Danny Milosavljevic wrote 8 years ago
[PATCH v2 1/2] gnu: Move desktop-file-utils to (gnu packages freedesktop).
(address . 26988@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170605192202.18820-2-dannym@scratchpost.org
* gnu/packages/gnome.scm (desktop-file-utils): Move from here ...
* gnu/packages/freedesktop.scm (desktop-file-utils): ... to here.
* gnu/packages/engineering.scm: Import (gnu packages freedesktop).
* gnu/packages/game-development.scm: Import (gnu packages freedesktop).
* gnu/packages/xfce.scm: Import (gnu packages freedesktop).
---
gnu/packages/engineering.scm | 1 +
gnu/packages/freedesktop.scm | 32 ++++++++++++++++++++++++++++++++
gnu/packages/game-development.scm | 1 +
gnu/packages/gnome.scm | 32 --------------------------------
gnu/packages/xfce.scm | 1 +
5 files changed, 35 insertions(+), 32 deletions(-)

Toggle diff (119 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 7ad93653e..e835a5da9 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -44,6 +44,7 @@
#:use-module (gnu packages curl)
#:use-module (gnu packages flex)
#:use-module (gnu packages fontutils)
+ #:use-module (gnu packages freedesktop)
#:use-module (gnu packages gd)
#:use-module (gnu packages gettext)
#:use-module (gnu packages ghostscript)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 85a6c8b26..dfc88986f 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -927,3 +927,35 @@ library to access fingerprint readers, over the D-Bus interprocess
communication bus. This daemon layer above libfprint solves problems related
to applications simultaneously competing for fingerprint readers.")
(license license:gpl2+)))
+
+(define-public desktop-file-utils
+ (package
+ (name "desktop-file-utils")
+ (version "0.23")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://www.freedesktop.org/software/" name
+ "/releases/" name "-" version ".tar.xz"))
+ (sha256
+ (base32
+ "119kj2w0rrxkhg4f9cf5waa55jz1hj8933vh47vcjipcplql02bc"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("glib" ,glib)))
+ (home-page "http://www.freedesktop.org/wiki/Software/desktop-file-utils/")
+ (synopsis "Utilities for working with desktop entries")
+ (description
+ "This package contains a few command line utilities for working with
+desktop entries:
+
+desktop-file-validate: validates a desktop file and prints warnings/errors
+ about desktop entry specification violations.
+
+desktop-file-install: installs a desktop file to the applications directory,
+ optionally munging it a bit in transit.
+
+update-desktop-database: updates the database containing a cache of MIME types
+ handled by desktop files.")
+ (license license:gpl2+)))
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 6d9e4061d..56dedefd7 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -38,6 +38,7 @@
#:use-module (gnu packages databases)
#:use-module (gnu packages documentation)
#:use-module (gnu packages fontutils)
+ #:use-module (gnu packages freedesktop)
#:use-module (gnu packages fribidi)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnunet)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 84ae1cf2f..f5efb44f8 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -702,38 +702,6 @@ Specification, the icon naming utility maps the icon names used by the
GNOME and KDE desktops to the icon names proposed in the specification.")
(license license:lgpl2.1+)))
-(define-public desktop-file-utils
- (package
- (name "desktop-file-utils")
- (version "0.23")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://www.freedesktop.org/software/" name
- "/releases/" name "-" version ".tar.xz"))
- (sha256
- (base32
- "119kj2w0rrxkhg4f9cf5waa55jz1hj8933vh47vcjipcplql02bc"))))
- (build-system gnu-build-system)
- (native-inputs
- `(("pkg-config" ,pkg-config)))
- (inputs
- `(("glib" ,glib)))
- (home-page "http://www.freedesktop.org/wiki/Software/desktop-file-utils/")
- (synopsis "Utilities for working with desktop entries")
- (description
- "This package contains a few command line utilities for working with
-desktop entries:
-
-desktop-file-validate: validates a desktop file and prints warnings/errors
- about desktop entry specification violations.
-
-desktop-file-install: installs a desktop file to the applications directory,
- optionally munging it a bit in transit.
-
-update-desktop-database: updates the database containing a cache of MIME types
- handled by desktop files.")
- (license license:gpl2+)))
-
(define-public gnome-icon-theme
(package
(name "gnome-icon-theme")
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index c8786dd69..d7d1372dd 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -39,6 +39,7 @@
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages web)
#:use-module (gnu packages fontutils)
+ #:use-module (gnu packages freedesktop)
#:use-module (gnu packages image)
#:use-module (gnu packages gnome)
#:use-module (gnu packages pdf)
Danny Milosavljevic wrote 8 years ago
[PATCH v2 2/2] gnu: gtk+-2: Add desktop-file-utils to propagated-inputs.
(address . 26988@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170605192202.18820-3-dannym@scratchpost.org
* gnu/packages/gtk.scm (gtk+-2)[propagated-inputs]: Add desktop-file-utils.
---
gnu/packages/gtk.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (12 lines)
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 1d9ee1524..67dc3c9a8 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -605,6 +605,7 @@ is part of the GNOME accessibility project.")
(outputs '("out" "doc"))
(propagated-inputs
`(("atk" ,atk)
+ ("desktop-file-utils" ,desktop-file-utils) ; Used by profile hook.
("gdk-pixbuf" ,gdk-pixbuf+svg)
("pango" ,pango)))
(inputs
Danny Milosavljevic wrote 8 years ago
Re: [PATCH v2 1/2] gnu: Move desktop-file-utils to (gnu packages freedesktop).
(address . 26988@debbugs.gnu.org)
20170615102711.7bc7085d@scratchpost.org
Pushed only this patch to master as 324b0040f4ac493ef11f82712db2c9abcc6b92ca.
宋文武 wrote 8 years ago
Re: bug#26988: Add desktop-file-utils to all gtk applications
(name . Marius Bakke)(address . mbakke@fastmail.com)
87eftx1qpw.fsf@member.fsf.org
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (7 lines)
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Danny Milosavljevic <dannym@scratchpost.org> writes:
>>
>>> Hi Marius,
>>> Hi 宋文武,

Hello Marius and Danny,


Toggle quote (12 lines)
>>> Marius Bakke <mbakke@fastmail.com> wrote:
>>>
>>>> Danny Milosavljevic <dannym@scratchpost.org> 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?

Yes, it will work better. It's expensive slightly by adding the
latest version of desktop-file-utils into the profile closure, but
the 'xdg-mime-database' does that already.

Toggle quote (7 lines)
>>> [...]
>>
>> 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".

Yes, but normally one would have other applications that using GTK+ or
GLib, which will make the hook run.

So I end up with modify the profile hook to test for GLib, it should
work in most cases.

Thanks for the patches!
Closed
Danny Milosavljevic wrote 8 years ago
(name . 宋文武)(address . iyzsong@member.fsf.org)
20170703190820.473d59c4@scratchpost.org
Hi 宋文武,

On Mon, 03 Jul 2017 23:32:11 +0800
iyzsong@member.fsf.org (宋文武) wrote:

Toggle quote (3 lines)
> >> GTK+ and Qt, it won't catch some cases where we add the ".desktop" file
> >> manually such as "rxvt-unicode".

How about just adding desktop-file-utils as a native-input to rxvt-unicode (and other few special cases) with a comment saying that's because of the desktop file?

Toggle quote (3 lines)
> So I end up with modify the profile hook to test for GLib, it should
> work in most cases.

Glib is a basic C library that hasn't much to do with GUI. I think that if you check for glib you'll run the hook for system daemons, dbus etc.

Glib is basically the runtime library that makes C sane to use for any purpose.

Also, desktop-file-utils itself requires glib so make sure you don't enter an endless loop :)
Closed
宋文武 wrote 8 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87eftw4eh4.fsf@member.fsf.org
A profile hook checks manifest entries for some condition, then usually
adding a item to the profile's united output.

In case of the current 'xdg-desktop-database', it checks if any entry
has a reference of glib, then adding the 'mimeinfo.cache' to the
profile.

So, ...

Danny Milosavljevic <dannym@scratchpost.org> writes:

Toggle quote (10 lines)
> Hi 宋文武,
>
> On Mon, 03 Jul 2017 23:32:11 +0800
> iyzsong@member.fsf.org (宋文武) wrote:
>
>> >> GTK+ and Qt, it won't catch some cases where we add the ".desktop" file
>> >> manually such as "rxvt-unicode".
>
> How about just adding desktop-file-utils as a native-input to rxvt-unicode (and other few special cases) with a comment saying that's because of the desktop file?

In the sitution where you have rxvt-unicode but not any glib based
applications in your profile, this will ensure the 'mimeinfo.cache' got
built. But since there are no glib based things, I guess it won't be used.

Toggle quote (6 lines)
>
>> So I end up with modify the profile hook to test for GLib, it should
>> work in most cases.
>
> Glib is a basic C library that hasn't much to do with GUI. I think that if you check for glib you'll run the hook for system daemons, dbus etc.

Yeah, the hook only run once for all the packages in the profile.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 26988@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 26988
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help