From patchwork Wed Feb 20 05:06:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: pkill9 X-Patchwork-Id: 1202 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 70E3916C6E; Wed, 20 Feb 2019 05:22:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 0137316C6C for ; Wed, 20 Feb 2019 05:22:23 +0000 (GMT) Received: from localhost ([127.0.0.1]:34108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwKKs-0000Tc-8E for patchwork@mira.cbaines.net; Wed, 20 Feb 2019 00:22:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwKKh-0000NZ-HK for guix-patches@gnu.org; Wed, 20 Feb 2019 00:22:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwK63-0006FO-ED for guix-patches@gnu.org; Wed, 20 Feb 2019 00:07:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56284) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gwK62-0006F9-U3 for guix-patches@gnu.org; Wed, 20 Feb 2019 00:07:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gwK62-0004Lw-HI for guix-patches@gnu.org; Wed, 20 Feb 2019 00:07:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34576] Calibre: Add icon and desktop file to Calibre References: Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Feb 2019 05:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34576 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: "Ricardo Wurmus" Received: via spool by 34576-submit@debbugs.gnu.org id=B34576.155063919816700 (code B ref 34576); Wed, 20 Feb 2019 05:07:02 +0000 Received: (at 34576) by debbugs.gnu.org; 20 Feb 2019 05:06:38 +0000 Received: from localhost ([127.0.0.1]:57049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gwK5e-0004LH-0k for submit@debbugs.gnu.org; Wed, 20 Feb 2019 00:06:38 -0500 Received: from aibo.runbox.com ([91.220.196.211]:52466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gwK5a-0004L7-CL for 34576@debbugs.gnu.org; Wed, 20 Feb 2019 00:06:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Message-Id:Content-Type:In-Reply-To:Date:Subject:CC:To:From :MIME-Version; bh=HoC7igzQ4DzvQmtRZRcJT6rfYftsR8GAE5fwnixS7Wk=; b=hlWP1h2tyq7 sQm/2dhT4t7DcqZ1ksSuuTxquLYHGqgwoleOsgmkIBC2C4//vb3VMEdqUODfag0OCtw1WU8X1gPli WwQ782Swt2aD2gtxF50UKMLdfJYpm7AuYqqGIqI74addIYS7HrrGR1nAReoMGSGXVO5nLPZfBvKEn +9XibojR2GgziefjYlJXQYAqaT4t0Y7ju4UAFgS1jlrzlVHgISpIT+wPEVCln8AJNWChps5I4el3V ZI4T1bFNa7uR6Bkr13rphYog6UYUe3RbZMqGM50zLP1ggBmkt1BRGaKiPOnvsSQ995ovVp3daO0RV Zf+I+tFij9IWeHxdHJMlFjg==; Received: from [10.9.9.127] (helo=rmmprod05.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1gwK5W-0002GA-GX; Wed, 20 Feb 2019 06:06:31 +0100 Received: from mail by rmmprod05.runbox with local (Exim 4.86_2) (envelope-from ) id 1gwK5W-00056Z-Fk; Wed, 20 Feb 2019 06:06:30 +0100 MIME-Version: 1.0 Received: from [Authenticated user (850733)] by runbox.com with http (RMM6); Wed, 20 Feb 2019 05:06:30 GMT From: Date: Wed, 20 Feb 2019 05:06:30 +0000 (GMT) X-Mailer: RMM6 In-Reply-To: <875ztfv59w.fsf@elephly.net> Message-Id: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 34576 <34576@debbugs.gnu.org> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 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 From 14b7aacec811dd8fbbc7d87846dc4722b13522c9 Mon Sep 17 00:00:00 2001 From: Pkill -9 Date: Wed, 20 Feb 2019 05:01:13 +0000 Subject: [PATCH] gnu: calibre: Add desktop file and icon. * gnu/packages/ebook.scm (calibre): Add desktop file and icon. --- gnu/packages/ebook.scm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm index 99e49bc17..a34664863 100644 --- a/gnu/packages/ebook.scm +++ b/gnu/packages/ebook.scm @@ -185,7 +185,30 @@ (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo")) (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib")) #t))) - (add-after 'install 'install-font-liberation + (add-after 'install 'install-icon + (lambda* (#:key outputs #:allow-other-keys) + (install-file "imgsrc/calibre.svg" + (string-append (assoc-ref outputs "out") + "/share/icons/hicolor/scalable/apps")) + #t)) + (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)) + (add-after 'install-desktop-file 'install-font-liberation (lambda* (#:key inputs outputs #:allow-other-keys) (for-each (lambda (file) (install-file file (string-append -- 2.20.1