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>

Received: (at submit) by; 22 Aug 2019 16:16:48 +0000
From debbugs-submit-bounces <at> Thu Aug 22 12:16:48 2019
Received: from localhost ([]:38257
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1i0plU-0000ee-Po
	for submit <at>; Thu, 22 Aug 2019 12:16:46 -0400
Received: from ([]:32965)
 by with esmtp (Exim 4.84_2)
 (envelope-from <xavierm02@HIDDEN>) id 1i0plR-0000eU-BE
 for submit <at>; Thu, 22 Aug 2019 12:16:41 -0400
Received: from ([2001:470:142:3::10]:36563)
 by 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
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 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 ([]:43455)
 by 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 [])
 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 ([])
 by compute5.internal (MEProxy); Thu, 22 Aug 2019 12:16:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; h=
 mime-version:message-id:date:from:to:subject:content-type; s=
 fm1; bh=c9/NJebQPLALJ8ujtHyjmCx4ySCNRrxVsj0rp1g4cyk=; b=BarmhRa9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=; h=content-type:date:from:message-id
 :x-me-sender:x-sasl-enc; s=fm3; bh=c9/NJebQPLALJ8ujtHyjmCx4ySCNR
 rxVsj0rp1g4cyk=; b=lZNb0DDaRTzjPTlgJtj10LbYtiWFz7B9yKGfdnJOXwOJb
X-ME-Sender: <xms:379eXfXeVR3x-pTuj1-xvdNt3YkvxDbqwMthXI5PJDyFo0oSwhuGTA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudegiedgheehucetufdoteggodetrfdotf
X-ME-Proxy: <xmx:379eXX3BXW56G_vaLJk1kQVX6pMGxGFEPYKwqBqU1GK66OzVeMEZaQ>
Received: by mailuser.nyi.internal (Postfix, from userid 501)
 id 22A703C00A1; Thu, 22 Aug 2019 12:16:31 -0400 (EDT)
X-Mailer: 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 GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
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 ""
                                   (version-major+minor version) ".x/"
-                                  name "-" version ".tar.gz"))
+                                  "lyx-" version ".tar.gz"))
@@ -6231,9 +6231,7 @@ and Karl Berry.")
                            ,(string-append "-DLYX_INSTALL_PREFIX="
-                                           (assoc-ref %outputs "out")
-                                           ;; Exact name and level is necessary.
-                                           "/lyx" ,(version-major+minor version)))
+                                           (assoc-ref %outputs "out")))
        (modify-phases %standard-phases
          ;; See ;;
@@ -6265,19 +6263,15 @@ and Karl Berry.")
                (const #t))
-             (setenv (string-append "LYX_DIR_"
-                                    (string-join
-                                      (string-split
-                                        ,(version-major+minor version) #\-)) "x")
-                     (string-append (getcwd) "/../lyx-" ,version "/lib"))
-         (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/"))))
      `(("boost" ,boost)

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.