[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Xavier Montillet
Subject: [bug#37147] [PATCH] gnu: lyx: Wrap binary to let it find qtsvg
Date: Thu, 22 Aug 2019 16:16:10 +0000
User-agent: Cyrus-JMAP/3.1.6-916-g49fca03-fmstable-20190821v7

>From 18929f612dcb3c9210a953c29713ff6cb2a5f222 Mon Sep 17 00:00:00 2001
From: Xavier Montillet <address@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 
 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 
-                                           "/lyx" ,(version-major+minor 
+                                           (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) #\-)) 
-                     (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 
-                        (string-append out "/bin/lyx" ,(version-major+minor 
+         ;; 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 
+                   (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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]