diff mbox series

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

Message ID 02f456e3dd1951b64ee6216bef6d424ff139667f.1672504941.git.poomklao@yahoo.com
State New
Headers show
Series gnu: plover: Fix missing icons + dbus | expand

Commit Message

Parnikkapore Jan. 2, 2023, 1:08 a.m. UTC
* 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(-)

Comments

Nicolas Goaziou Jan. 3, 2023, 9 p.m. UTC | #1
Hello,

Parnikkapore via Guix-patches via <guix-patches@gnu.org> writes:

> * 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.

Applied both patches. Thank you.

Ialso made use of G-expressions, added a copyright line for you, and
added to the commit message the changes made to inputs.

Regards,
diff mbox series

Patch

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