From patchwork Sat Apr 27 09:36:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Tildesley X-Patchwork-Id: 13786 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 50D2416F51; Sat, 27 Apr 2019 14:13:51 +0100 (BST) 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,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham 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 9C63516F4F for ; Sat, 27 Apr 2019 14:13:50 +0100 (BST) Received: from localhost ([127.0.0.1]:60239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKN9K-0000kP-4M for patchwork@mira.cbaines.net; Sat, 27 Apr 2019 09:13:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKJnf-0007KM-JP for guix-patches@gnu.org; Sat, 27 Apr 2019 05:39:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKJnd-0005aE-PK for guix-patches@gnu.org; Sat, 27 Apr 2019 05:39:15 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hKJna-0005Ux-5B for guix-patches@gnu.org; Sat, 27 Apr 2019 05:39:11 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hKJna-0001BK-12 for guix-patches@gnu.org; Sat, 27 Apr 2019 05:39:10 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35446] [PATCH 19/26] gnu: calibre: Use linux.py to install desktop files. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 27 Apr 2019 09:39:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35446 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35446@debbugs.gnu.org Received: via spool by 35446-submit@debbugs.gnu.org id=B35446.15563579084385 (code B ref 35446); Sat, 27 Apr 2019 09:39:09 +0000 Received: (at 35446) by debbugs.gnu.org; 27 Apr 2019 09:38:28 +0000 Received: from localhost ([127.0.0.1]:34430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKJmt-00018Z-O7 for submit@debbugs.gnu.org; Sat, 27 Apr 2019 05:38:28 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:39150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKJme-000168-AN for 35446@debbugs.gnu.org; Sat, 27 Apr 2019 05:38:13 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id DE05E40F0C for <35446@debbugs.gnu.org>; Sat, 27 Apr 2019 11:38:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1556357880; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ppyKnbVd8prOY84gDTVKbxnpeX751NDYCzsun/PLsK0=; b=j4N9SaTvg8i8ItnvRUs3qElDYtOlKwNmqnGYAa1pDyIM6kgsCM+mSyCEv7GnXeR/PGtUD6 MJrbtANqBTkzJPthfyM4BzAd7Q5dMV39zg2M7aK8LIbnTbOPu992tDZgczxufdJdVWbZkl EmDYJqn1+2DeJ8kAA8D2AezYenefttB5Xpp0A+NZmrTQNptUBxCECdnc2fCYR1YAOutHJX nA4r5jaCllCmaqTbv0Y1V+1LJ6W/sSj6RnIP+c/CRzZCUlyO5nBcA9IjoZBnjPCMQqrdr+ hp8tco5426u6qxl6FkrCAmajUWt1gsHqtkQiWEzCfmNFIVcvbK44rBZ+QryzPA== Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id BoBkHdFtiYjc for <35446@debbugs.gnu.org>; Sat, 27 Apr 2019 11:37:49 +0200 (CEST) From: Brendan Tildesley Date: Sat, 27 Apr 2019 19:36:52 +1000 Message-Id: <20190427093659.21851-19-mail@brendan.scot> In-Reply-To: <20190427093659.21851-1-mail@brendan.scot> References: <20190427093659.21851-1-mail@brendan.scot> MIME-Version: 1.0 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-Mailman-Approved-At: Sat, 27 Apr 2019 09:12:44 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/ebook.scm (calibre):[arguments]: linux.py is for installing various freedestkop files in one's home directory. Here we hack it to install into the /share folder in the output. This also installs the mimetypes.xml, so we no longer require that explicit phase. Note that the patch looks a little confusing as the diff thinks I've remove a #t)) line and left the other #t)))) line below it, but it all adds up. --- gnu/packages/ebook.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm index 72d07ea370..2900b492bf 100644 --- a/gnu/packages/ebook.scm +++ b/gnu/packages/ebook.scm @@ -102,9 +102,6 @@ (native-inputs `(("pkg-config" ,pkg-config) ("qtbase" ,qtbase) ; for qmake - ;; xdg-utils is supposed to be used for desktop integration, but it - ;; also creates lots of messages - ;; mkdir: cannot create directory '/homeless-shelter': Permission denied ("python2-flake8" ,python2-flake8) ("xdg-utils" ,xdg-utils))) ;; Beautifulsoup3 is bundled but obsolete and not packaged, so just leave it bundled. @@ -172,15 +169,24 @@ "href=\"favicon.ico\"")) #t)) (add-before 'build 'configure - (lambda* (#:key inputs #:allow-other-keys) + (lambda* (#:key inputs outputs #:allow-other-keys) (let ((podofo (assoc-ref inputs "podofo")) - (pyqt (assoc-ref inputs "python2-pyqt"))) + (pyqt (assoc-ref inputs "python2-pyqt")) + (out (assoc-ref outputs "out"))) (substitute* "setup/build_environment.py" (("sys.prefix") (string-append "'" pyqt "'"))) (substitute* "src/calibre/ebooks/pdf/pdftohtml.py" (("PDFTOHTML = 'pdftohtml'") (string-append "PDFTOHTML = \"" (assoc-ref inputs "poppler") - "/bin/pdftohtml\""))) + "/bin/pdftohtml\""))) + + ;; Calibre thinks we are installing desktop files into a home + ;; directory, but here we butcher the script in to installing + ;; to calibres /share directory. + (setenv "XDG_DATA_HOME" (string-append (assoc-ref outputs "out") "/share")) + (substitute* "src/calibre/linux.py" + (("'~/.local/share'") "''")) + (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo")) (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib")) ;; This informs the tests we are a continuous integration @@ -202,12 +208,6 @@ "/share/fonts/truetype"))) (delete-file-recursively font-dest) (symlink font-src font-dest)) - #t)) - (add-after 'unbundle-font-liberation 'install-mimetypes - (lambda* (#:key outputs #:allow-other-keys) - (install-file "resources/calibre-mimetypes.xml" - (string-append (assoc-ref outputs "out") - "/share/mime/packages")) #t))))) (home-page "http://calibre-ebook.com/") (synopsis "E-book library management software")