unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#37147] [PATCH] gnu: lyx: Wrap binary to let it find qtsvg
@ 2019-08-22 16:16 Xavier Montillet
  2020-03-21 20:09 ` Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: Xavier Montillet @ 2019-08-22 16:16 UTC (permalink / raw)
  To: 37147

From 18929f612dcb3c9210a953c29713ff6cb2a5f222 Mon Sep 17 00:00:00 2001
From: Xavier Montillet <xavierm02@guix.xavierm02.fr>
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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-11  7:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-22 16:16 [bug#37147] [PATCH] gnu: lyx: Wrap binary to let it find qtsvg Xavier Montillet
2020-03-21 20:09 ` Marius Bakke
2020-03-22  7:16   ` Efraim Flashner
2020-05-29  0:42     ` Leo Famulari
2020-06-11  7:00       ` bug#37147: " Efraim Flashner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).