guix-patches
[Top][All Lists]
Advanced

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

[bug#60480] [PATCH 1/2] gnu: plover: Wrap so that icons can be found


From: Parnikkapore
Subject: [bug#60480] [PATCH 1/2] gnu: plover: Wrap so that icons can be found
Date: Mon, 2 Jan 2023 08:08:03 +0700

* gnu/packages/stenography.scm (plover): Wrap and add qtsvg to QT_PLUGIN_PATH
  This is needed for the icons in Plover's UI to appear.
---
 gnu/packages/stenography.scm | 81 +++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 38 deletions(-)

diff --git a/gnu/packages/stenography.scm b/gnu/packages/stenography.scm
index 504dfc990f..3249ee4c4f 100644
--- a/gnu/packages/stenography.scm
+++ b/gnu/packages/stenography.scm
@@ -26,6 +26,7 @@ (define-module (gnu packages stenography)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages check)
   #:use-module (gnu packages libusb)
@@ -55,46 +56,50 @@ (define-public plover
   (package
     (name "plover")
     (version "4.0.0.dev12")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/openstenoproject/plover";)
-             (commit (string-append "v" version))))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "0vk6nh2gpn7f7rv2spi2a7n3m0d9kaan6r22mx3vwxprpbvrkbm8"))))
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/openstenoproject/plover";)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0vk6nh2gpn7f7rv2spi2a7n3m0d9kaan6r22mx3vwxprpbvrkbm8"))))
     (build-system python-build-system)
     (arguments
-     (list
-      #:phases
-      #~(modify-phases %standard-phases
-          (replace 'check
-            (lambda* (#:key tests? #:allow-other-keys)
-              (when tests?
-                (invoke "python" "-m" "pytest"
-                        "-p" "pytest-qt"
-                        "-p" "xvfb"
-                        "test"
-                        ;; FIXME: Ignore failing test.
-                        "--ignore"
-                        "test/gui_qt/test_dictionaries_widget.py")))))))
-    (native-inputs
-     (list python-babel
-           python-mock
-           python-pytest
-           python-pytest-qt
-           python-pytest-xvfb))
-    (inputs
-     (list python-appdirs
-           python-dbus
-           python-hidapi
-           python-plover-stroke
-           python-pyqt
-           python-pyserial
-           python-rtf-tokenize
-           python-xlib
-           qtsvg-5))
+     (list #:phases #~(modify-phases %standard-phases
+                        (replace 'check
+                          (lambda* (#:key tests? #:allow-other-keys)
+                            (when tests?
+                              (invoke "python" "-m" "pytest"
+                                      "-p" "pytest-qt"
+                                      "-p" "xvfb"
+                                      "test"
+                                      ;; FIXME: Ignore failing test.
+                                      "--ignore"
+                                      
"test/gui_qt/test_dictionaries_widget.py"))))
+                        ;; Ensure that icons are found at runtime.
+                        (add-after 'install 'wrap-executable
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (let ((out (assoc-ref outputs "out")))
+                              (wrap-program (string-append out "/bin/plover")
+                                            `("QT_PLUGIN_PATH" prefix
+                                              ,(list (string-append (assoc-ref
+                                                                     inputs
+                                                                     "qtsvg")
+                                                      
"/lib/qt5/plugins/"))))))))))
+    (native-inputs (list python-babel python-mock python-pytest
+                         python-pytest-qt python-pytest-xvfb))
+    (inputs (list bash-minimal
+                  python-appdirs
+                  python-dbus
+                  python-hidapi
+                  python-plover-stroke
+                  python-pyqt
+                  python-pyserial
+                  python-rtf-tokenize
+                  python-xlib
+                  qtsvg-5))
     (home-page "https://www.openstenoproject.org/plover/";)
     (synopsis "Stenography engine")
     (description
-- 
2.38.1





reply via email to

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