diff mbox series

[bug#41256] gnu: icedove: Add a desktop file.

Message ID 20200514114953.4457-1-jonathan.brielmaier@web.de
State Accepted
Headers show
Series [bug#41256] gnu: icedove: Add a desktop file. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Jonathan Brielmaier May 14, 2020, 11:49 a.m. UTC
Thunderbird upstream doesn't provide any desktop file. So we have
to create it downstream. I filed an upstream bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1637575

* gnu/packages/gnuzilla.scm (icedove)[phases]: Add install-desktop-file phase.
---
 gnu/packages/gnuzilla.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

--
2.26.2

Comments

Gerd Heber via web May 14, 2020, 12:50 p.m. UTC | #1
This looks good to me!
Jonathan Brielmaier May 15, 2020, 8:56 a.m. UTC | #2
so is this good for push? I cannot do that myself.

On 14.05.20 14:50, Ricardo Wurmus via web wrote:
> This looks good to me!
>
>
>
>
Marius Bakke May 23, 2020, 7:16 p.m. UTC | #3
Jonathan Brielmaier <jonathan.brielmaier@web.de> writes:

> Thunderbird upstream doesn't provide any desktop file. So we have
> to create it downstream. I filed an upstream bug:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
>
> * gnu/packages/gnuzilla.scm (icedove)[phases]: Add install-desktop-file phase.

Applied, thanks!
Nicolas Goaziou May 23, 2020, 7:56 p.m. UTC | #4
Hello,

Marius Bakke <mbakke@fastmail.com> writes:

> Jonathan Brielmaier <jonathan.brielmaier@web.de> writes:
>
>> Thunderbird upstream doesn't provide any desktop file. So we have
>> to create it downstream. I filed an upstream bug:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
>>
>> * gnu/packages/gnuzilla.scm (icedove)[phases]: Add
>> install-desktop-file phase.

I'm a bit late at the party, but would it make sense to use
make-desktop-entry-file instead?

Regards,
Marius Bakke May 23, 2020, 8:18 p.m. UTC | #5
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Jonathan Brielmaier <jonathan.brielmaier@web.de> writes:
>>
>>> Thunderbird upstream doesn't provide any desktop file. So we have
>>> to create it downstream. I filed an upstream bug:
>>> https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
>>>
>>> * gnu/packages/gnuzilla.scm (icedove)[phases]: Add
>>> install-desktop-file phase.
>
> I'm a bit late at the party, but would it make sense to use
> make-desktop-entry-file instead?

Probably, yes.  :-)
Jonathan Brielmaier May 23, 2020, 9:47 p.m. UTC | #6
On 23.05.20 21:56, Nicolas Goaziou wrote:
>>> * gnu/packages/gnuzilla.scm (icedove)[phases]: Add
>>> install-desktop-file phase.
>
> I'm a bit late at the party, but would it make sense to use
> make-desktop-entry-file instead?
Oh Nicolas that is a good catch. I didn't know this nice function :P

But I wonder how to archive the compose action:
```
[Desktop Action ComposeMessage]~@
Name=Write new message~@
Exec=~@*~a/bin/icedove -compose~%"
```

With the field `actions` but how?
diff mbox series

Patch

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 8a926681e0..7bf9850e97 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -1344,6 +1344,32 @@  standards of the IceCat project.")
            (lambda _ (invoke "./mach" "build")))
          (replace 'install
            (lambda _ (invoke "./mach" "install")))
+         ;; Thunderbird doesn't provide any .desktop file.
+         ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1637575
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (apps (string-append out "/share/applications")))
+               (mkdir-p apps)
+               (with-output-to-file (string-append apps "/icedove.desktop")
+                 (lambda _
+                   (format #t
+                           "[Desktop Entry]~@
+                            Name=Icedove~@
+                            Exec=~a/bin/icedove~@
+                            Icon=icedove~@
+                            GenericName=Mail/News Client~@
+                            Categories=Network;Email;~@
+                            Terminal=false~@
+                            StartupNotify=true~@
+                            MimeType=x-scheme-handler/mailto;~@
+                            Type=Application~@
+                            Actions=ComposeMessage;~@
+                            [Desktop Action ComposeMessage]~@
+                            Name=Write new message~@
+                            Exec=~@*~a/bin/icedove -compose~%"
+                           out))))
+             #t))
          (add-after 'install 'wrap-program
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))