GNU bug report logs - #34576
Calibre: Add icon and desktop file to Calibre

Previous Next

Package: guix-patches;

Reported by: <pkill9 <at> runbox.com>

Date: Tue, 19 Feb 2019 18:27:02 UTC

Severity: normal

Done: Michael Rohleder <mike <at> rohleder.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34576 in the body.
You can then email your comments to 34576 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#34576; Package guix-patches. (Tue, 19 Feb 2019 18:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to <pkill9 <at> runbox.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 19 Feb 2019 18:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <pkill9 <at> runbox.com>
To: "guix-patches" <guix-patches <at> gnu.org>
Subject: Calibre: Add icon and desktop file to Calibre
Date: Tue, 19 Feb 2019 18:26:27 +0000 (GMT)
[Message part 1 (text/plain, inline)]
This patch adds two phases to the package definition for Calibre that install an icon and install a desktop file.
[0001-gnu-calibre-Add-icon-and-desktop-file.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#34576; Package guix-patches. (Tue, 19 Feb 2019 21:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 34576 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: pkill9 <at> runbox.com
Cc: 34576 <at> debbugs.gnu.org
Subject: Re: [bug#34576] Calibre: Add icon and desktop file to Calibre
Date: Tue, 19 Feb 2019 22:26:35 +0100
Hi pkill9,

> +         (add-after 'install 'install-icon
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out")))
> +               (install-file "imgsrc/calibre.svg"
> +                             (string-append out
> +                                            "/share/icons/hicolor/scalable/apps")))
> +             #t))

You can do without “let*” here.

> +         (add-after 'install-icon 'install-desktop-file
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let ((out (assoc-ref outputs "out")))
> +               (mkdir-p (string-append out "/share/applications"))
> +               (with-output-to-file
> +                   (string-append out "/share/applications/calibre.desktop")
> +                 (lambda _
> +                   (format #t
> +                           "[Desktop Entry]~@
> +                Name=Calibre~@
> +                Comment=E-book organiser and reader~@
> +                Exec=~a/bin/calibre~@
> +                TryExec=~@*~a/bin/calibre~@
> +                Icon=calibre~@
> +                Categories=Office~@
> +                Type=Application~%"
> +                           out)))
> +               #t)))

Does upstream not provide a desktop file?  I’d rather see this submitted
to upstream.  Have you contacted the developers about this?

Secondly, the indentation is odd.  I’d write it like this:

     (format #t "\
[Desktop Entry]~@
Name=…
Comment=…
…
Type=Application~%" out)


--
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#34576; Package guix-patches. (Wed, 20 Feb 2019 04:31:01 GMT) Full text and rfc822 format available.

Message #11 received at 34576 <at> debbugs.gnu.org (full text, mbox):

From: <pkill9 <at> runbox.com>
To: "Ricardo Wurmus" <rekado <at> elephly.net>
Cc: 34576 <34576 <at> debbugs.gnu.org>
Subject: Re: [bug#34576] Calibre: Add icon and desktop file to Calibre
Date: Wed, 20 Feb 2019 04:30:03 +0000 (GMT)
Hi Ricardo,

> Does upstream not provide a desktop file?  I’d rather see this submitted
> to upstream.  Have you contacted the developers about this?

It looks like it does provide a desktop file looking at this pull request: https://github.com/kovidgoyal/calibre/pull/739, which modifies this file (link to line showing desktop file): https://github.com/kovidgoyal/calibre/blob/master/src/calibre/linux.py#L1031

It's created using a Python script though, perhaps it doesn't get run during building?

I thought the developer wouldn't add it upstream because I remember investigating a long time ago and finding the developer writing somewhere that they wouldn't add a desktop file upstream and that it was the linux packager's job to do that, maybe I am mis-remembering or it was in some other context.

On Tue, 19 Feb 2019 22:26:35 +0100, Ricardo Wurmus <rekado <at> elephly.net> wrote:

> 
> Hi pkill9,
> 
> > +         (add-after 'install 'install-icon
> > +           (lambda* (#:key outputs #:allow-other-keys)
> > +             (let* ((out (assoc-ref outputs "out")))
> > +               (install-file "imgsrc/calibre.svg"
> > +                             (string-append out
> > +                                            "/share/icons/hicolor/scalable/apps")))
> > +             #t))
> 
> You can do without “let*” here.
> 
> > +         (add-after 'install-icon 'install-desktop-file
> > +           (lambda* (#:key outputs #:allow-other-keys)
> > +             (let ((out (assoc-ref outputs "out")))
> > +               (mkdir-p (string-append out "/share/applications"))
> > +               (with-output-to-file
> > +                   (string-append out "/share/applications/calibre.desktop")
> > +                 (lambda _
> > +                   (format #t
> > +                           "[Desktop Entry]~@
> > +                Name=Calibre~@
> > +                Comment=E-book organiser and reader~@
> > +                Exec=~a/bin/calibre~@
> > +                TryExec=~@*~a/bin/calibre~@
> > +                Icon=calibre~@
> > +                Categories=Office~@
> > +                Type=Application~%"
> > +                           out)))
> > +               #t)))
> 
> Does upstream not provide a desktop file?  I’d rather see this submitted
> to upstream.  Have you contacted the developers about this?
> 
> Secondly, the indentation is odd.  I’d write it like this:
> 
>      (format #t "\
> [Desktop Entry]~@
> Name=…
> Comment=…
> …
> Type=Application~%" out)
> 
> 
> --
> Ricardo






Information forwarded to guix-patches <at> gnu.org:
bug#34576; Package guix-patches. (Wed, 20 Feb 2019 05:01:01 GMT) Full text and rfc822 format available.

Message #14 received at 34576 <at> debbugs.gnu.org (full text, mbox):

From: Brett Gilio <brettg <at> posteo.net>
To: pkill9 <at> runbox.com
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 34576 <34576 <at> debbugs.gnu.org>
Subject: Re: [bug#34576] Calibre: Add icon and desktop file to Calibre
Date: Tue, 19 Feb 2019 23:00:30 -0600
pkill9 <at> runbox.com writes:
> I thought the developer wouldn't add it upstream because I remember investigating a long time ago and finding the developer writing somewhere that they wouldn't add a desktop file upstream and that it was the linux packager's job to do that, maybe I am mis-remembering or it was in some other context.


While we are on that topic, the Calibre maintainer can be (said
lovingly) stubborn about some things. On a related topic, Calibre (to my
knowledge) is going to remain on python2 forever at his choice because
of a political disagreement with python3.

Correctness aside, that might have some impact on our upcoming "Great
Python 2 Purge".

Brett Gilio




Information forwarded to guix-patches <at> gnu.org:
bug#34576; Package guix-patches. (Wed, 20 Feb 2019 05:07:02 GMT) Full text and rfc822 format available.

Message #17 received at 34576 <at> debbugs.gnu.org (full text, mbox):

From: <pkill9 <at> runbox.com>
To: "Ricardo Wurmus" <rekado <at> elephly.net>
Cc: 34576 <34576 <at> debbugs.gnu.org>
Subject: Re: [bug#34576] Calibre: Add icon and desktop file to Calibre
Date: Wed, 20 Feb 2019 05:06:30 +0000 (GMT)
[Message part 1 (text/plain, inline)]
I've attached a patch with the 'let' removed from the icon install phase, but I haven't changed the indentation of the desktop file because when I did that it added a blank line at the beginning of the desktop file and created a large indentation before '[Desktop Entry]'. I moved 'out' to be next to the last line of the desktop file output.

> Secondly, the indentation is odd.  I’d write it like this:
> 
>      (format #t "\
> [Desktop Entry]~@
> Name=…
> Comment=…
> …
> Type=Application~%" out)
> 
> 
> --

I used the xonotic package definition as a reference for thi part, and emacs' `indent-region` indents it like this. I don't know how it should look. I've attached a patch for now.

On Tue, 19 Feb 2019 22:26:35 +0100, Ricardo Wurmus <rekado <at> elephly.net> wrote:

> 
> Hi pkill9,
> 
> > +         (add-after 'install 'install-icon
> > +           (lambda* (#:key outputs #:allow-other-keys)
> > +             (let* ((out (assoc-ref outputs "out")))
> > +               (install-file "imgsrc/calibre.svg"
> > +                             (string-append out
> > +                                            "/share/icons/hicolor/scalable/apps")))
> > +             #t))
> 
> You can do without “let*” here.
> 
> > +         (add-after 'install-icon 'install-desktop-file
> > +           (lambda* (#:key outputs #:allow-other-keys)
> > +             (let ((out (assoc-ref outputs "out")))
> > +               (mkdir-p (string-append out "/share/applications"))
> > +               (with-output-to-file
> > +                   (string-append out "/share/applications/calibre.desktop")
> > +                 (lambda _
> > +                   (format #t
> > +                           "[Desktop Entry]~@
> > +                Name=Calibre~@
> > +                Comment=E-book organiser and reader~@
> > +                Exec=~a/bin/calibre~@
> > +                TryExec=~@*~a/bin/calibre~@
> > +                Icon=calibre~@
> > +                Categories=Office~@
> > +                Type=Application~%"
> > +                           out)))
> > +               #t)))
> 
> Does upstream not provide a desktop file?  I’d rather see this submitted
> to upstream.  Have you contacted the developers about this?
> 
> Secondly, the indentation is odd.  I’d write it like this:
> 
>      (format #t "\
> [Desktop Entry]~@
> Name=…
> Comment=…
> …
> Type=Application~%" out)
> 
> 
> --
> Ricardo


[0001-gnu-calibre-Add-desktop-file-and-icon.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#34576; Package guix-patches. (Wed, 20 Feb 2019 14:10:02 GMT) Full text and rfc822 format available.

Message #20 received at 34576 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: pkill9 <at> runbox.com
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 34576 <34576 <at> debbugs.gnu.org>
Subject: Re: [bug#34576] Calibre: Add icon and desktop file to Calibre
Date: Wed, 20 Feb 2019 15:08:37 +0100
Pkill -9,

pkill9 wrote:
> I've attached a patch with the 'let' removed from the icon 
> install phase, but I haven't changed the indentation of the 
> desktop file because when I did that it added a blank line at 
> the beginning of the desktop file and created a large 
> indentation before '[Desktop Entry]'.

Zut alors!  You had a typo.

Use Ricardo's snippet from the quoted message and make sure that 
there's no trailing whitespace, particularly after "\ (as was 
probably the case above).  Emacs won't touch the indentation 
inside the format string.

Thanks!

T G-R




Information forwarded to guix-patches <at> gnu.org:
bug#34576; Package guix-patches. (Wed, 20 Feb 2019 14:26:02 GMT) Full text and rfc822 format available.

Message #23 received at 34576 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <somebody <at> not-sent-or-endorsed-by.tobias.gr>
To: pkill9 <at> runbox.com
Cc: 34576 <34576 <at> debbugs.gnu.org>
Subject: Re: [bug#34576] Calibre: Add icon and desktop file to Calibre
Date: Wed, 20 Feb 2019 15:25:21 +0100
[I sent my previous message to this bug from the wrong address. 
Oops!  And sorry.]

Pkill -9,

pkill9 wrote:
> -         (add-after 'install 'install-font-liberation
> +         (add-after 'install 'install-icon
> +         (add-after 'install-icon 'install-desktop-file
> +         (add-after 'install-desktop-file 
> 'install-font-liberation

This is utterly correct and right and good, but…

In practice, one tends to just (ADD-AFTER 'INSTALL …) everywhere 
instead of building up such nice (but brittle) orderings — unless 
the phases actually depend on each other.  It makes removing them 
later slightly quicker.

(If you're thinking ‘Wait, doesn't that run them in the reverse 
order?’ you're 1. paying attention and b. right.  It hardly ever 
matters.)

Kind regards,

T G-R




Reply sent to Michael Rohleder <mike <at> rohleder.de>:
You have taken responsibility. (Thu, 01 Oct 2020 03:19:02 GMT) Full text and rfc822 format available.

Notification sent to <pkill9 <at> runbox.com>:
bug acknowledged by developer. (Thu, 01 Oct 2020 03:19:03 GMT) Full text and rfc822 format available.

Message #28 received at 34576-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Rohleder <mike <at> rohleder.de>
To: <pkill9 <at> runbox.com>
Cc: 34576-done <at> debbugs.gnu.org
Subject: Re: [bug#34576] Calibre: Add icon and desktop file to Calibre
Date: Thu, 01 Oct 2020 05:18:52 +0200
[Message part 1 (text/plain, inline)]
<pkill9 <at> runbox.com> writes:
> This patch adds two phases to the package definition for Calibre that install an icon and install a desktop file.

I believe, this is done with 6e1ab5fadbc8fbe5d8d71864c68dd52ddbc732c9

-- 
Linux - Better for your uptime than Viagra
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 29 Oct 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.