GNU bug report logs - #37147
[PATCH] gnu: lyx: Wrap binary to let it find qtsvg

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: "Xavier Montillet" <xavierm02@HIDDEN>; Keywords: patch; dated Thu, 22 Aug 2019 16:17:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Aug 2019 16:16:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 22 12:16:48 2019
Received: from localhost ([127.0.0.1]:38257 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i0plU-0000ee-Po
	for submit <at> debbugs.gnu.org; Thu, 22 Aug 2019 12:16:46 -0400
Received: from lists.gnu.org ([209.51.188.17]:32965)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <xavierm02@HIDDEN>) id 1i0plR-0000eU-BE
 for submit <at> debbugs.gnu.org; Thu, 22 Aug 2019 12:16:41 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36563)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <xavierm02@HIDDEN>) id 1i0plP-0003TX-8y
 for guix-patches@HIDDEN; Thu, 22 Aug 2019 12:16:41 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_20,RCVD_IN_DNSWL_LOW,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <xavierm02@HIDDEN>) id 1i0plL-0002zn-RC
 for guix-patches@HIDDEN; Thu, 22 Aug 2019 12:16:38 -0400
Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:43455)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <xavierm02@HIDDEN>)
 id 1i0plL-0002wb-7z
 for guix-patches@HIDDEN; Thu, 22 Aug 2019 12:16:35 -0400
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.west.internal (Postfix) with ESMTP id 05703556
 for <guix-patches@HIDDEN>; Thu, 22 Aug 2019 12:16:31 -0400 (EDT)
Received: from imap4 ([10.202.2.54])
 by compute5.internal (MEProxy); Thu, 22 Aug 2019 12:16:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xavierm02.fr; h=
 mime-version:message-id:date:from:to:subject:content-type; s=
 fm1; bh=c9/NJebQPLALJ8ujtHyjmCx4ySCNRrxVsj0rp1g4cyk=; b=BarmhRa9
 f6YFwCCnDZXSBtzkY5PFfJFaARjBZkGDKRH/ISz7MdnueiyV96NJbpvMbN8OmHOv
 TL+OuaQEHa9ttmqhkM3DfJNawXUuuSBikh1+iMQXuy4jMUGAlfwCSLYcMdvU/LSj
 bM6rjA4dEMDADSRy7fjXCOZJG/9lCcrw9v2uep0Yz8YZKbESu6mgq22qOxoCrDYJ
 PJM9ZaVTtJyNdzl5pC40CW0OadmrjwxWXWKZzuuqr0Cj4sKeJaVTJw8bWIvhbrTN
 R8pBnBHL4mchSLxt+PUt5j6SPU3LuBhUCdTOXDm1WXtWJPegc+tpXCRnP4q+i4E0
 LyydDt3jiu0QiQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:message-id
 :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm3; bh=c9/NJebQPLALJ8ujtHyjmCx4ySCNR
 rxVsj0rp1g4cyk=; b=lZNb0DDaRTzjPTlgJtj10LbYtiWFz7B9yKGfdnJOXwOJb
 63m1G+IRG5KeEfsY+cmy/XD1W2YIKjIPJCDJ2+KG2KXuc6k2CgTaci81mn4bJ8++
 AGJ1CtMyrgdihavHbLnJGF3fa9BMVVRpr6wJKAw5G1U7CL3rIggZdI3fyJhkPS7j
 asz8ITrFvV+on77Bl1RSTmFjfAEh0l1j20gfFPgwAWQtRSyur+2IDZzgTRkFTeDR
 B/SUeSDsZvtqw1zRCjC4GU8YBpzTGVwfITqmxd3ybkbC6OQXbsP9brMjBzgaFQwW
 vPx3iDoy9gcN6/GvRKTux04cHYTV6V64n5T9VwySg==
X-ME-Sender: <xms:379eXfXeVR3x-pTuj1-xvdNt3YkvxDbqwMthXI5PJDyFo0oSwhuGTA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudegiedgheehucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd
 erredtnecuhfhrohhmpedfiggrvhhivghrucfoohhnthhilhhlvghtfdcuoeigrghvihgv
 rhhmtddvsehguhhigidrgigrvhhivghrmhdtvddrfhhrqeenucffohhmrghinheplhihgi
 drohhrghenucfrrghrrghmpehmrghilhhfrhhomhepgigrvhhivghrmhdtvdesghhuihig
 rdigrghvihgvrhhmtddvrdhfrhenucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:379eXX3BXW56G_vaLJk1kQVX6pMGxGFEPYKwqBqU1GK66OzVeMEZaQ>
 <xmx:379eXURjLHkYiY-SfElCJi_IunlmEbStVig7KFI9rxKTXTMDaRaUdQ>
 <xmx:379eXeNAMyYEWJbmXW1CYONAneyeYMqBlcC4gFMxf3c1CLZk2g4NVQ>
 <xmx:379eXW31TcKwoycYme2KcTRHfleweWg4ogFSFx4zMGIj7hMVPblnyg>
Received: by mailuser.nyi.internal (Postfix, from userid 501)
 id 22A703C00A1; Thu, 22 Aug 2019 12:16:31 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.1.6-916-g49fca03-fmstable-20190821v7
Mime-Version: 1.0
Message-Id: <380c5739-01a4-49dc-be05-2a72baf53714@HIDDEN>
Date: Thu, 22 Aug 2019 16:16:10 +0000
From: "Xavier Montillet" <xavierm02@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: lyx: Wrap binary to let it find qtsvg
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 64.147.123.24
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

From 18929f612dcb3c9210a953c29713ff6cb2a5f222 Mon Sep 17 00:00:00 2001
From: Xavier Montillet <xavierm02@HIDDEN>
Date: Thu, 22 Aug 2019 17:48:42 +0200
Subject: [PATCH 1/1] gnu: lyx: Wrap binary to let it find qtsvg

Wrap the lyx binary to set QT_PLUGIN_PATH to let it find qtsvg. Without this, when running lyx in a profile without qtsvg, the menu will contain text instead of icons.
The prefix was changed and the symlink phase was removed because wrapping the lyx binary made it fail to find the lyx system directory. Other solutions were setting the LYX_DIR_23x environment variable and using the -sysdir argument.
Changing the prefix and removing the symlink phase made the LYX_DIR_23x environment variable used earlier in the build redundant, and it was therefore removed.
---
 gnu/packages/tex.scm | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 5be86e7d9e..9111580fce 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -6215,7 +6215,7 @@ and Karl Berry.")
               (method url-fetch)
               (uri (string-append "http://ftp.lyx.org/pub/lyx/stable/"
                                   (version-major+minor version) ".x/"
-                                  name "-" version ".tar.gz"))
+                                  "lyx-" version ".tar.gz"))
               (sha256
                (base32
                 "0vr0qwis6rhind6azfa270hqxci7rj8qb1kk5x6lm80mc34nvrqi"))
@@ -6231,9 +6231,7 @@ and Karl Berry.")
                            "-DLYX_INSTALL=1"
                            "-DLYX_RELEASE=1"
                            ,(string-append "-DLYX_INSTALL_PREFIX="
-                                           (assoc-ref %outputs "out")
-                                           ;; Exact name and level is necessary.
-                                           "/lyx" ,(version-major+minor version)))
+                                           (assoc-ref %outputs "out")))
        #:phases
        (modify-phases %standard-phases
          ;; See ;; https://www.lyx.org/trac/changeset/3a123b90af838b08680471d87170c38e56787df9/lyxgit
@@ -6265,19 +6263,15 @@ and Karl Berry.")
                                                  ,version
                                                  "/src/tests/check_layout.cmake")
                (const #t))
-             (setenv (string-append "LYX_DIR_"
-                                    (string-join
-                                      (string-split
-                                        ,(version-major+minor version) #\-)) "x")
-                     (string-append (getcwd) "/../lyx-" ,version "/lib"))
              #t))
-         (add-after 'install 'install-symlinks
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (mkdir-p (string-append out "/bin"))
-               (symlink (string-append "../lyx" ,(version-major+minor version)
-                                       "/bin/lyx" ,(version-major+minor version))
-                        (string-append out "/bin/lyx" ,(version-major+minor version)))
+         ;; Ensure that qtsvg is found at run time (otherwise the menu has text instead of icons), even if it's not installed in the current profile
+         (add-after 'install 'wrap-executable
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                   (lyx-bin-name (string-append "lyx" ,(version-major+minor version)))
+                   (lyx-bin-path (string-append out "/bin/" lyx-bin-name)))
+               (wrap-program lyx-bin-path
+                 `("QT_PLUGIN_PATH" ":" = (,(string-append (assoc-ref inputs "qtsvg") "/lib/qt5/plugins/"))))
                #t))))))
     (inputs
      `(("boost" ,boost)
-- 
2.23.0




Acknowledgement sent to "Xavier Montillet" <xavierm02@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#37147; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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