From patchwork Fri May 3 16:42:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Tildesley X-Patchwork-Id: 13876 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 114AA16F93; Fri, 3 May 2019 17:45:35 +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 37DDD16F91 for ; Fri, 3 May 2019 17:45:34 +0100 (BST) Received: from localhost ([127.0.0.1]:44470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMbJV-00062M-P1 for patchwork@mira.cbaines.net; Fri, 03 May 2019 12:45:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMbJ6-0005WF-24 for guix-patches@gnu.org; Fri, 03 May 2019 12:45:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMbJ4-0004xZ-DW for guix-patches@gnu.org; Fri, 03 May 2019 12:45:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMbJ4-0004xE-3z for guix-patches@gnu.org; Fri, 03 May 2019 12:45:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMbJ3-0007NB-Vh for guix-patches@gnu.org; Fri, 03 May 2019 12:45:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35446] [PATCH v2 12/24] 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: Fri, 03 May 2019 16:45:05 +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.155690186228166 (code B ref 35446); Fri, 03 May 2019 16:45:05 +0000 Received: (at 35446) by debbugs.gnu.org; 3 May 2019 16:44:22 +0000 Received: from localhost ([127.0.0.1]:49537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMbII-0007K8-RC for submit@debbugs.gnu.org; Fri, 03 May 2019 12:44:22 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:38430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMbIG-0007Id-Od for 35446@debbugs.gnu.org; Fri, 03 May 2019 12:44:17 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 522A74DB84 for <35446@debbugs.gnu.org>; Fri, 3 May 2019 18:44:11 +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=1556901842; 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=7GZy+jZM947QnsWMSPboHmIylT+8KbZE9jCg4fsu8RU=; b=hO6Bbgm120c95ERCfaYUha9YFEIiHOFNqPS3YkhsQMmI1q/CXL71wiRgObbeXjHORgP8z2 6goSrOKhvO8Xo3ko4F/tSzK8cklvSO34vwWGJhRbNuCiMOaL8z7k1ZS3mqI5M5HvBkTe/5 IV1pBYzbGAn3r7/OCu85SRFeZgrQrxszs/5LYdN1kUdSYdvnL1D/z56b9+pzfzGwfwyOqX rrxBNV8+4vMoAbYDYRDoV4iPNwTfC2Loonps1Lxmwj3qV9VWDSsd+O5bhvgo/FN/LoEyaK 9f8xh+H/Sn8Zm5oqiC0ER+FHNYqfReBZ0RFD0/QAj4o3S96KpWfVzszsaEfSUw== 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 Ie0u26N3Mxxi for <35446@debbugs.gnu.org>; Fri, 3 May 2019 18:43:50 +0200 (CEST) From: Brendan Tildesley Date: Sat, 4 May 2019 02:42:20 +1000 Message-Id: <20190503164232.1799-12-mail@brendan.scot> In-Reply-To: <20190503164232.1799-1-mail@brendan.scot> References: <20190503164232.1799-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-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 2b557ab08d..964fdd7b75 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. @@ -174,15 +171,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 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 @@ -204,12 +210,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")