icecat is missing a desktop file

  • Done
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • Leo Famulari
  • Ludovic Courtès
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal

Debbugs page

Danny Milosavljevic wrote 9 years ago
(address . bug-guix@gnu.org)
20160322202004.7e9de603@scratchpost.org
icecat is missing a desktop file and thus it doesn't show up in any application menus. Comparison with hexchat (which does have it) below:

$ find /gnu/store/vwbw8070vy7ikaxbgs6pmi0isw3yzxvm-icecat-38.6.0-gnu1 -name "*.desktop"
$ find /gnu/store/vz1cs171wyj9bq48r4kz8s56hpk6gayy-hexchat-2.10.1 -name "hexchat.desktop"
/gnu/store/vz1cs171wyj9bq48r4kz8s56hpk6gayy-hexchat-2.10.1/share/applications/hexchat.desktop
$ cat /gnu/store/vz1cs171wyj9bq48r4kz8s56hpk6gayy-hexchat-2.10.1/share/applications/hexchat.desktop

[Desktop Entry]
Name=HexChat
Name[de]=HexChat
Name[en_GB]=HexChat
Name[es]=HexChat
Name[fr]=HexChat
Name[it]=HexChat
Name[ja_JP]=HexChat
Name[ko]=헥스채트
Name[pl]=HexChat
Name[sq]=HexChat
Name[zh_CN]=HexChat
GenericName=IRC Client
GenericName[de]=IRC-Client
GenericName[en_GB]=IRC Client
GenericName[es]=Cliente de IRC
GenericName[fi]=IRC Client
GenericName[fr]=Client IRC
GenericName[it]=Client IRC
GenericName[ja_JP]=IRCクライアント
GenericName[ko]=IRC 클라이언트
GenericName[pl]=Klient IRC
GenericName[sq]=Klient IRC
GenericName[zh_CN]=IRC 客户端
Comment=Chat with other people online
Comment[de]=Chatte online mit anderen Leuten
Comment[en_GB]=Chat with other people online
Comment[es]=Chatea con otras personas en línea
Comment[fr]=Parlez avec d'autres personnes en ligne
Comment[it]=Chiacchiera con altri utenti online
Comment[ja_JP]=他の人とオンラインチャットをします
Comment[ko]=온라인에 있는 사람들과 대화합니다
Comment[pl]=Rozmawiaj z innymi ludźmi przez internet
Comment[sq]=Bisedoni në linjë me persona të tjerë
Comment[zh_CN]=与其他人在线聊天
Keywords=IM;Chat;
Keywords[de]=IM;Chat;
Keywords[en_GB]=IM;Chat;
Keywords[es]=IM;Chat;
Keywords[fr]=IM;Chat;
Keywords[it]=IM;Chat;Messaggistica Istantanea;IRC;
Keywords[ko]=IM;인스턴트 메신저;Chat;대화;
Keywords[pl]=IM;Chat;
Keywords[sq]=IM;Fjalosje;
Keywords[zh_CN]=IM;聊天;
Exec=hexchat %U
Icon=hexchat
Terminal=false
Type=Application
Categories=GTK;Network;IRCClient;
StartupNotify=true
X-GNOME-UsesNotifications=true
MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;
Actions=SafeMode;

[Desktop Action SafeMode]
Name=Open Safe Mode
Name[de]=Im sicheren Modus öffnen
Name[en_GB]=Open Safe Mode
Name[es]=Abrir en modo seguro
Name[fr]=Ouvrir le mode sans échec
Name[it]=Apri modalità sicura
Name[ja_JP]=セーフモードで開く
Name[ko]=공개 안전 모드
Name[pl]=Otwórz tryb bezpieczny
Name[sq]=Hap Mënyrën e Sigurt
Name[zh_CN]=打开安全模式
Exec=hexchat --no-auto --no-plugins
Leo Famulari wrote 9 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 23094@debbugs.gnu.org)
20160323173823.GD3893@jasmine
On Tue, Mar 22, 2016 at 08:20:04PM +0100, Danny Milosavljevic wrote:
Toggle quote (2 lines)
> icecat is missing a desktop file and thus it doesn't show up in any application menus. Comparison with hexchat (which does have it) below:

As with transmission-gtk, can you try to fix this and send a patch to
guix-devel@gnu.org?

Toggle quote (77 lines)
>
> $ find /gnu/store/vwbw8070vy7ikaxbgs6pmi0isw3yzxvm-icecat-38.6.0-gnu1 -name "*.desktop"
> $ find /gnu/store/vz1cs171wyj9bq48r4kz8s56hpk6gayy-hexchat-2.10.1 -name "hexchat.desktop"
> /gnu/store/vz1cs171wyj9bq48r4kz8s56hpk6gayy-hexchat-2.10.1/share/applications/hexchat.desktop
> $ cat /gnu/store/vz1cs171wyj9bq48r4kz8s56hpk6gayy-hexchat-2.10.1/share/applications/hexchat.desktop
>
> [Desktop Entry]
> Name=HexChat
> Name[de]=HexChat
> Name[en_GB]=HexChat
> Name[es]=HexChat
> Name[fr]=HexChat
> Name[it]=HexChat
> Name[ja_JP]=HexChat
> Name[ko]=헥스채트
> Name[pl]=HexChat
> Name[sq]=HexChat
> Name[zh_CN]=HexChat
> GenericName=IRC Client
> GenericName[de]=IRC-Client
> GenericName[en_GB]=IRC Client
> GenericName[es]=Cliente de IRC
> GenericName[fi]=IRC Client
> GenericName[fr]=Client IRC
> GenericName[it]=Client IRC
> GenericName[ja_JP]=IRCクライアント
> GenericName[ko]=IRC 클라이언트
> GenericName[pl]=Klient IRC
> GenericName[sq]=Klient IRC
> GenericName[zh_CN]=IRC 客户端
> Comment=Chat with other people online
> Comment[de]=Chatte online mit anderen Leuten
> Comment[en_GB]=Chat with other people online
> Comment[es]=Chatea con otras personas en línea
> Comment[fr]=Parlez avec d'autres personnes en ligne
> Comment[it]=Chiacchiera con altri utenti online
> Comment[ja_JP]=他の人とオンラインチャットをします
> Comment[ko]=온라인에 있는 사람들과 대화합니다
> Comment[pl]=Rozmawiaj z innymi ludźmi przez internet
> Comment[sq]=Bisedoni në linjë me persona të tjerë
> Comment[zh_CN]=与其他人在线聊天
> Keywords=IM;Chat;
> Keywords[de]=IM;Chat;
> Keywords[en_GB]=IM;Chat;
> Keywords[es]=IM;Chat;
> Keywords[fr]=IM;Chat;
> Keywords[it]=IM;Chat;Messaggistica Istantanea;IRC;
> Keywords[ko]=IM;인스턴트 메신저;Chat;대화;
> Keywords[pl]=IM;Chat;
> Keywords[sq]=IM;Fjalosje;
> Keywords[zh_CN]=IM;聊天;
> Exec=hexchat %U
> Icon=hexchat
> Terminal=false
> Type=Application
> Categories=GTK;Network;IRCClient;
> StartupNotify=true
> X-GNOME-UsesNotifications=true
> MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;
> Actions=SafeMode;
>
> [Desktop Action SafeMode]
> Name=Open Safe Mode
> Name[de]=Im sicheren Modus öffnen
> Name[en_GB]=Open Safe Mode
> Name[es]=Abrir en modo seguro
> Name[fr]=Ouvrir le mode sans échec
> Name[it]=Apri modalità sicura
> Name[ja_JP]=セーフモードで開く
> Name[ko]=공개 안전 모드
> Name[pl]=Otwórz tryb bezpieczny
> Name[sq]=Hap Mënyrën e Sigurt
> Name[zh_CN]=打开安全模式
> Exec=hexchat --no-auto --no-plugins
>
>
>
Danny Milosavljevic wrote 9 years ago
(address . 23094@debbugs.gnu.org)
20160410120404.0a37366e@scratchpost.org
Here's a patch which adds a desktop file to icecat:

Note that there's still a maintenance problem with the icon - version "38.6.0" is currently hard-coded, so if icecat updates, it won't be able to find its icon. What is the usual way to fix this?

Toggle diff (46 lines)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index b4892d7..2c38458 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -519,7 +519,40 @@ standards.")
(format #t "configure flags: ~s~%" flags)
(zero? (apply system* bash
(string-append srcdir "/configure")
- flags))))))))
+ flags)))))
+ (add-after
+ 'install
+ 'install-desktop-entry
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((applications (string-append (assoc-ref outputs "out") "/share/applications")))
+ (mkdir-p applications)
+ (call-with-output-file (string-append applications "/icecat.desktop")
+ (lambda (port)
+ (format port "~
+[Desktop Entry]~@
+Version=1.0~@
+Name=GNU IceCat~@
+GenericName=Web Browser~@
+Comment=Browse the World Wide Web~@
+Keywords=Internet;WWW;Browser;Web~@
+Exec=~a/bin/icecat %u~@
+Terminal=false~@
+X-MultipleArgs=false~@
+Type=Application~@
+Icon=~a/lib/icecat-38.6.0/browser/icons/mozicon128.png~@
+Categories=GNOME;GTK;Network;WebBrowser;~@
+MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;~@
+StartupNotify=true~@
+Actions=NewWindow;NewPrivateWindow~@
+~@
+[Desktop Action NewWindow]~@
+Name=Open a New Window~@
+Exec=~a/bin/icecat --new-window~@
+~@
+[Desktop Action NewPrivateWindow]~@
+Name=Open a New Private Window~@
+Exec=~a/bin/icecat -private-window~@
+" (assoc-ref outputs "out") (assoc-ref outputs "out") (assoc-ref outputs "out") (assoc-ref outputs "out")))))))))) ; FIXME version
(home-page "http://www.gnu.org/software/gnuzilla/")
(synopsis "Entirely free browser derived from Mozilla Firefox")
(description
Danny Milosavljevic wrote 9 years ago
[PATCHv2] Re: bug#23094: icecat is missing a desktop file
(address . 23094@debbugs.gnu.org)
20160416201516.7aeb07d7@scratchpost.org
Any news on this? I just got a merge conflict so I was reminded of it again...

The current version of the patch that I'm successfully using is below - although I still can't get the version number into the installation lambda.

Toggle diff (52 lines)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 1ae97b2..96d32a1 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -501,7 +501,46 @@ standards.")
(format #t "configure flags: ~s~%" flags)
(zero? (apply system* bash
(string-append srcdir "/configure")
- flags))))))))
+ flags)))))
+ (add-after
+ 'install
+ 'install-desktop-entry
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (applications (string-append out "/share/applications")))
+ (mkdir-p applications)
+ (call-with-output-file (string-append applications "/icecat.desktop")
+ (lambda (port)
+ (format port "~
+[Desktop Entry]~@
+Version=1.0~@
+Name=GNU IceCat~@
+GenericName=Web Browser~@
+Comment=Browse the World Wide Web~@
+Keywords=Internet;WWW;Browser;Web~@
+Exec=~a/bin/icecat %u~@
+Terminal=false~@
+X-MultipleArgs=false~@
+Type=Application~@
+Icon=~a/lib/icecat-~a/browser/icons/mozicon128.png~@
+Categories=GNOME;GTK;Network;WebBrowser;~@
+MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;~@
+StartupNotify=true~@
+Actions=NewWindow;NewPrivateWindow~@
+~@
+[Desktop Action NewWindow]~@
+Name=Open a New Window~@
+Exec=~a/bin/icecat --new-window~@
+~@
+[Desktop Action NewPrivateWindow]~@
+Name=Open a New Private Window~@
+Exec=~a/bin/icecat -private-window~@
+"
+ out
+ out
+ (string-drop-right "38.7.1-gnu1" (string-length "-gnu1")) ; FIXME do not hardcode
+ out
+ out)))))))))
(home-page "http://www.gnu.org/software/gnuzilla/")
(synopsis "Entirely free browser derived from Mozilla Firefox")
(description
Ludovic Courtès wrote 9 years ago
control message for bug #23094
(address . control@debbugs.gnu.org)
87eg8mky3f.fsf@gnu.org
tags 23094 patch
Ludovic Courtès wrote 9 years ago
Re: bug#23094: [PATCHv2] Re: bug#23094: icecat is missing a desktop file
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 23094@debbugs.gnu.org)
87a8jaky0u.fsf@gnu.org
Hi!

I figured there’s already a desktop entry template in the source, and
it’s more complete (it includes translations), hence this patch:
Toggle diff (29 lines)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 7e52534..2baf4d7 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -509,7 +509,23 @@ standards.")
(format #t "configure flags: ~s~%" flags)
(zero? (apply system* bash
(string-append srcdir "/configure")
- flags))))))))
+ flags)))))
+ (add-after 'install 'install-desktop-entry
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (applications (string-append out "/share/applications")))
+ (mkdir-p applications)
+ (copy-file "debian/icecat.desktop.in"
+ "debian/icecat.desktop")
+ (substitute* "debian/icecat.desktop"
+ (("@MOZ_DISPLAY_NAME@")
+ "GNU IceCat")
+ (("^Exec=@MOZ_APP_NAME@")
+ (string-append "Exec=" out "/bin/icecat"))
+ (("@MOZ_APP_NAME@")
+ "icecat"))
+ (install-file "debian/icecat.desktop" applications)
+ #t))))))
(home-page "http://www.gnu.org/software/gnuzilla/")
(synopsis "Entirely free browser derived from Mozilla Firefox")
(description
I haven’t been able to test it, so your feedback is welcome!

Thanks,
Ludo’.
Danny Milosavljevic wrote 9 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 23094@debbugs.gnu.org)
20160530230219.75f26d31@scratchpost.org
Hi Ludo,

On Sat, 28 May 2016 17:22:41 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

Toggle quote (3 lines)
> I figured there’s already a desktop entry template in the source, and
> it’s more complete (it includes translations), hence this patch:

I tried your patch and I get:

make[1]: Leaving directory '/tmp/guix-build-icecat-38.8.0-gnu1.drv-0/build/browser/installer'
phase `install' succeeded after 51.4 seconds
starting phase `install-desktop-entry'
Backtrace:
In ice-9/boot-9.scm:
157: 13 [catch #t #<catch-closure 8c9580> ...]
In unknown file:
?: 12 [apply-smob/1 #<catch-closure 8c9580>]
In ice-9/boot-9.scm:
63: 11 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
432: 10 [eval # #]
In ice-9/boot-9.scm:
2401: 9 [save-module-excursion #<procedure 8e6880 at ice-9/boot-9.scm:4045:3 ()>]
4050: 8 [#<procedure 8e6880 at ice-9/boot-9.scm:4045:3 ()>]
1724: 7 [%start-stack load-stack #<procedure 8f97c0 at ice-9/boot-9.scm:4041:10 ()>]
1729: 6 [#<procedure 8fcc60 ()>]
In unknown file:
?: 5 [primitive-load "/gnu/store/x6a3mbrpqdjqmw7jaj30hvicind0ysas-icecat-38.8.0-gnu1-guile-builder"]
In ice-9/eval.scm:
387: 4 [eval # ()]
In srfi/srfi-1.scm:
830: 3 [every1 #<procedure fc5920 at /gnu/store/vs75q74qsfr3h45vkbr559p5w6fn4mw2-module-import/guix/build/gnu-build-system.scm:589:9 (expr)> ...]
In /gnu/store/vs75q74qsfr3h45vkbr559p5w6fn4mw2-module-import/guix/build/gnu-build-system.scm:
593: 2 [#<procedure fc5920 at /gnu/store/vs75q74qsfr3h45vkbr559p5w6fn4mw2-module-import/guix/build/gnu-build-system.scm:589:9 (expr)> #]
In ice-9/eval.scm:
432: 1 [eval # #]
In unknown file:
?: 0 [copy-file "debian/icecat.desktop.in" "debian/icecat.desktop"]

ERROR: In procedure copy-file:
ERROR: In procedure copy-file: No such file or directory
builder for `/gnu/store/dkg2y9dn89knaxvn8vd10si4nvdp5glh-icecat-38.8.0-gnu1.drv' failed with exit code 1
Ludovic Courtès wrote 9 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 23094@debbugs.gnu.org)
87twhez6dk.fsf@gnu.org
Danny Milosavljevic <dannym@scratchpost.org> skribis:

Toggle quote (8 lines)
> On Sat, 28 May 2016 17:22:41 +0200
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> I figured there’s already a desktop entry template in the source, and
>> it’s more complete (it includes translations), hence this patch:
>
> I tried your patch and I get:

Oops, my bad.

I tested the attached one. It works as expected, but there remain
“%%ifdef” things in it (see attached file), and I’m guessing GNOME &
co. will barf upon them, though I don’t know how to test.

Thoughts?

Thanks,
Ludo’.
Attachment: icecat.desktop
Toggle diff (30 lines)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 7e52534..264a754 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -509,7 +509,24 @@ standards.")
(format #t "configure flags: ~s~%" flags)
(zero? (apply system* bash
(string-append srcdir "/configure")
- flags))))))))
+ flags)))))
+ (add-before 'configure 'install-desktop-entry
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Install the '.desktop' file.
+ (let* ((out (assoc-ref outputs "out"))
+ (applications (string-append out "/share/applications")))
+ (mkdir-p applications)
+ (copy-file "debian/icecat.desktop.in"
+ "debian/icecat.desktop")
+ (substitute* "debian/icecat.desktop"
+ (("@MOZ_DISPLAY_NAME@")
+ "GNU IceCat")
+ (("^Exec=@MOZ_APP_NAME@")
+ (string-append "Exec=" out "/bin/icecat"))
+ (("@MOZ_APP_NAME@")
+ "icecat"))
+ (install-file "debian/icecat.desktop" applications)
+ #t))))))
(home-page "http://www.gnu.org/software/gnuzilla/")
(synopsis "Entirely free browser derived from Mozilla Firefox")
(description
Danny Milosavljevic wrote 9 years ago
Re: bug#23094: icecat is missing a desktop file
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 23094@debbugs.gnu.org)
20160602004516.56e686a5@scratchpost.org
Hi Ludo,

On Tue, 31 May 2016 15:47:35 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

Toggle quote (4 lines)
> I tested the attached one. It works as expected, but there remain
> “%%ifdef” things in it (see attached file), and I’m guessing GNOME &
> co. will barf upon them, though I don’t know how to test.

I think the easiest way to test (with few dependencies too) is:

$ guix package -i rofi
$ rofi -show drun

Then check whether icecat shows up in the list of applications (it doesn't).

But on the other hand

$ mkdir -p ${HOME}/dd/applications
$ cp ~/.guix-profile/share/applications/icecat.desktop ${HOME}/dd/applications/
$ export XDG_DATA_DIRS="${HOME}/dd:${XDG_DATA_DIRS}"
$ emacs ${HOME}/dd/applications/icecat.desktop
(remove just the %% lines)
$ rofi -show drun

shows icecat.

(Just today I had the same problem (with iceweasel) in Debian in LXDE while I was showing GNU Linux to someone else. Apparently the LXDE desktop environment doesn't let you add applications it doesn't know (i.e. ones without desktop file) to the panel. That... didn't give a good impression)
Ludovic Courtès wrote 9 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 23094-done@debbugs.gnu.org)
8760tr4cax.fsf@gnu.org
Danny Milosavljevic <dannym@scratchpost.org> skribis:

Toggle quote (12 lines)
> On Tue, 31 May 2016 15:47:35 +0200
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> I tested the attached one. It works as expected, but there remain
>> “%%ifdef” things in it (see attached file), and I’m guessing GNOME &
>> co. will barf upon them, though I don’t know how to test.
>
> I think the easiest way to test (with few dependencies too) is:
>
> $ guix package -i rofi
> $ rofi -show drun

Oh, thanks for the trick.

AFAICS commit 6cde5c34a1b7acb953e87055b845629015903888 fixes that.

Let me know if something’s still wrong with the .desktop entry!

Thanks for your patience,
Ludo’.
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 23094
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