From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:36703) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0plo-0003Uf-Nw for guix-patches@gnu.org; Thu, 22 Aug 2019 12:17:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0plm-0003NT-P5 for guix-patches@gnu.org; Thu, 22 Aug 2019 12:17:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57669) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0plm-0003NE-In for guix-patches@gnu.org; Thu, 22 Aug 2019 12:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0plm-0000fD-Aq for guix-patches@gnu.org; Thu, 22 Aug 2019 12:17:02 -0400 Subject: [bug#37147] [PATCH] gnu: lyx: Wrap binary to let it find qtsvg Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:36563) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0plP-0003TX-8y for guix-patches@gnu.org; Thu, 22 Aug 2019 12:16:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0plL-0002zn-RC for guix-patches@gnu.org; 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 ) id 1i0plL-0002wb-7z for guix-patches@gnu.org; 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 ; Thu, 22 Aug 2019 12:16:31 -0400 (EDT) Mime-Version: 1.0 Message-Id: <380c5739-01a4-49dc-be05-2a72baf53714@www.fastmail.com> Date: Thu, 22 Aug 2019 16:16:10 +0000 From: "Xavier Montillet" Content-Type: text/plain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37147@debbugs.gnu.org >From 18929f612dcb3c9210a953c29713ff6cb2a5f222 Mon Sep 17 00:00:00 2001 From: Xavier Montillet 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