From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:36812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwJXF-00083F-9A for guix-patches@gnu.org; Tue, 19 Feb 2019 23:31:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwJXC-000810-9P for guix-patches@gnu.org; Tue, 19 Feb 2019 23:31:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56268) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gwJXB-00080Y-R3 for guix-patches@gnu.org; Tue, 19 Feb 2019 23:31:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gwJXB-0003UY-JY for guix-patches@gnu.org; Tue, 19 Feb 2019 23:31:01 -0500 Subject: [bug#34576] Calibre: Add icon and desktop file to Calibre References: Resent-Message-ID: Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: Date: Wed, 20 Feb 2019 04:30:03 +0000 (GMT) In-Reply-To: <875ztfv59w.fsf@elephly.net> Message-Id: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ricardo Wurmus Cc: 34576 <34576@debbugs.gnu.org> Hi Ricardo, > Does upstream not provide a desktop file? I=E2=80=99d rather see this su= bmitted > 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 (l= ink to line showing desktop file): https://github.com/kovidgoyal/calibre/bl= ob/master/src/calibre/linux.py#L1031 It's created using a Python script though, perhaps it doesn't get run durin= g building? I thought the developer wouldn't add it upstream because I remember investi= gating a long time ago and finding the developer writing somewhere that the= y 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 wro= te: >=20 > Hi pkill9, >=20 > > + (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/scal= able/apps"))) > > + #t)) >=20 > You can do without =E2=80=9Clet*=E2=80=9D here. >=20 > > + (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.des= ktop") > > + (lambda _ > > + (format #t > > + "[Desktop Entry]~@ > > + Name=3DCalibre~@ > > + Comment=3DE-book organiser and reader~@ > > + Exec=3D~a/bin/calibre~@ > > + TryExec=3D~@*~a/bin/calibre~@ > > + Icon=3Dcalibre~@ > > + Categories=3DOffice~@ > > + Type=3DApplication~%" > > + out))) > > + #t))) >=20 > Does upstream not provide a desktop file? I=E2=80=99d rather see this su= bmitted > to upstream. Have you contacted the developers about this? >=20 > Secondly, the indentation is odd. I=E2=80=99d write it like this: >=20 > (format #t "\ > [Desktop Entry]~@ > Name=3D=E2=80=A6 > Comment=3D=E2=80=A6 > =E2=80=A6 > Type=3DApplication~%" out) >=20 >=20 > -- > Ricardo