projects/guix·blob javascript-team · refs

179 lines · 6.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020, 2022 Nicolas Goaziou <[email protected]>
3;;; Copyright © 2021 Christopher Baines <[email protected]>
4;;; Copyright © 2022 Arun Isaac <[email protected]>
5;;; Copyright © 2023 Parnikkapore <[email protected]>
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages stenography)
23 #:use-module (guix build-system pyproject)
24 #:use-module (guix download)
25 #:use-module (guix gexp)
26 #:use-module (guix git-download)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages bash)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages libusb)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages python-build)
37 #:use-module (gnu packages python-check)
38 #:use-module (gnu packages python-web)
39 #:use-module (gnu packages python-xyz)
40 #:use-module (gnu packages qt)
41 #:use-module (gnu packages wxwidgets)
42 #:use-module (gnu packages xorg))
43
44(define-public python-plover-stroke
45 (package
46 (name "python-plover-stroke")
47 (version "1.1.0")
48 (source
49 (origin
50 (method git-fetch)
51 (uri (git-reference
52 (url "https://github.com/benoit-pierre/plover_stroke")
53 (commit version)))
54 (file-name (git-file-name name version))
55 (sha256
56 (base32 "104ab1lr2xr8nbq98n7h3jvskfzzg8m41rhb1ik4b7w474rlxgh3"))))
57 (build-system pyproject-build-system)
58 (native-inputs (list python-pytest python-setuptools))
59 (home-page "https://github.com/benoit-pierre/plover_stroke")
60 (synopsis "Stroke handling helper library for Plover")
61 (description
62 "This package provides a helper class for working with steno strokes.")
63 (license license:gpl2+)))
64
65(define-public plover
66 (package
67 (name "plover")
68 (version "5.4.0")
69 (source
70 (origin
71 (method git-fetch)
72 (uri (git-reference
73 (url "https://github.com/openstenoproject/plover")
74 (commit (string-append "v" version))))
75 (file-name (git-file-name name version))
76 (sha256
77 (base32 "0k7a7q6nq218kya7rx5i6cdry6v9aibz3yxfmavyg1vayp62x8d9"))))
78 (build-system pyproject-build-system)
79 (arguments
80 (list
81 #:test-flags
82 #~(list "-p" "pytest-qt"
83 "-p" "xvfb"
84 ;; FIXME: Ignore failing test.
85 "--ignore" "test/gui_qt/test_dictionaries_widget.py"
86 "test")
87 #:phases
88 #~(modify-phases %standard-phases
89 ;; FIXME: adjust after packaging pyside-6-tools.
90 (add-after 'unpack 'set-paths
91 (lambda* (#:key inputs #:allow-other-keys)
92 (substitute* "plover_build_utils/setup.py"
93 (("\"pyside6-(rcc|uic)\"" all prog)
94 (simple-format #f "~s, \"-g\", \"python\""
95 (search-input-file
96 inputs (string-append "/lib/qt6/libexec/" prog)))))))
97 ;; FIXME: test_i18n_files_up_to_date would not pass
98 ;; if the phase is run after build.
99 (add-after 'build 'update-i18n-catalog-for-tests
100 (lambda _
101 (invoke "python" "setup.py" "extract_messages" "update_catalog")))
102 ;; Ensure that icons are found at runtime.
103 (add-after 'wrap 'wrap-executable
104 (lambda* (#:key inputs #:allow-other-keys)
105 (wrap-program (string-append #$output "/bin/plover")
106 `("QT_PLUGIN_PATH" prefix
107 (,(string-append #$(this-package-input "qtwayland")
108 "/lib/qt6/plugins/")
109 ,(string-append #$(this-package-input "qtsvg")
110 "/lib/qt6/plugins/")
111 ,(string-append #$(this-package-input "python-pyside-6")
112 "/lib/qt6/plugins/")))
113 `("LD_LIBRARY_PATH" prefix
114 (,(string-append #$(this-package-input "dbus") "/lib"))))))
115 (add-after 'install 'install-desktop
116 (lambda _
117 (install-file "plover/assets/plover.png"
118 (string-append
119 #$output "/share/icons/hicolor/128x128/apps"))
120 (let ((desktop
121 (string-append
122 #$output "/share/applications/plover.desktop")))
123 (install-file "linux/plover.desktop" (dirname desktop))
124 (substitute* desktop
125 (("Exec=plover")
126 (string-append "Exec=" #$output "/bin/plover"))))))
127 (add-after 'install 'install-udev-rules
128 (lambda _
129 (let* ((dir (string-append #$output "/lib/udev/rules.d"))
130 (file (string-append dir "/99-plover-uinput.rules")))
131 (mkdir-p dir)
132 (call-with-output-file file
133 (lambda (port)
134 (display
135 (string-append
136 "KERNEL==\"uinput\", MODE=\"0660\", "
137 "GROUP=\"input\", OPTIONS+=\"static_node=uinput\"\n")
138 port)))))))))
139 (native-inputs
140 (list python-babel
141 python-mock
142 python-pytest
143 python-pytest-qt
144 python-pytest-xvfb
145 python-setuptools))
146 (inputs
147 (list bash-minimal
148 dbus
149 qtbase
150 qtsvg
151 qtwayland
152 xhost))
153 (propagated-inputs
154 (list python-appdirs
155 python-comrak
156 python-dbus
157 python-evdev
158 python-hidapi
159 python-packaging
160 python-pkginfo
161 python-plover-stroke
162 python-psutil
163 python-pygments
164 python-pyserial
165 python-pyside-6
166 python-readme-renderer
167 python-requests-cache
168 python-requests-futures
169 python-rtf-tokenize
170 python-wcwidth
171 python-xkbcommon
172 python-xlib))
173 (home-page "https://www.openstenoproject.org/plover/")
174 (synopsis "Stenography engine")
175 (description
176 "Plover (rhymes with @emph{lover}) is a desktop application that
177allows anyone to use stenography to write on their computer, up to
178speeds of 200WPM and beyond.")
179 (license license:gpl2+)))