summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-08-07 22:51:33 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-08-10 09:26:22 -0400
commitb2c28de020483a52f0a4f118ea40da17c2c9e5a2 (patch)
treed246674bb8336c7d9baf03956614262026813ca3 /gnu
parent6eb465112ce5f86097a11b73cba84c596d9417b7 (diff)
downloadguix-b2c28de020483a52f0a4f118ea40da17c2c9e5a2.tar.gz
gnu: Add yubikey-manager-qt.
* gnu/packages/security-token.scm (yubikey-manager-qt): New variable.

Reviewed-by: Andreas Enge <andreas@enge.fr>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/security-token.scm58
1 files changed, 58 insertions, 0 deletions
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 6d7f5c9ab2..3a0ed245ad 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -51,6 +51,7 @@
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system pyproject)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
@@ -772,6 +773,63 @@ udev rules to your system configuration to be able to configure the YubiKey as
 an unprivileged user.")
     (license license:bsd-2)))
 
+(define-public yubikey-manager-qt
+  (package
+    (name "yubikey-manager-qt")
+    (version "1.2.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://developers.yubico.com/" name
+                                  "/Releases/" name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1qjp9p7i6957lf6ycwwz0178nmjgdyydb2f235bkin0pfm3rxcp9"))))
+    (build-system qt-build-system)
+    (arguments
+     (list
+      #:tests? #f                       ;no test suite
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-paths
+            (lambda _
+              (substitute* "ykman-gui/deployment.pri"
+                (("/usr/bin")
+                 (string-append #$output "/bin")))))
+          (replace 'configure
+            (lambda _
+              (invoke "qmake")))
+          (add-after 'install 'install-desktop-resources
+            (lambda _
+              (let ((datadir (string-append #$output "/share")))
+                (with-directory-excursion "resources"
+                  (install-file "icons/ykman.png"
+                                (string-append datadir "/pixmaps"))
+                  (install-file "com.yubico.yubikey_manager.metainfo.xml"
+                                (string-append datadir "/metainfo"))
+                  (install-file "ykman-gui.desktop"
+                                (string-append datadir "/applications"))))))
+          (add-after 'qt-wrap 'wrap-more
+            (lambda _
+              (wrap-program (string-append #$output "/bin/ykman-gui")
+                ;; Wrap PYTHONPATH so that pyotherside can find the
+                ;; yubikey-manager library.
+                `("GUIX_PYTHONPATH" prefix
+                  (,(getenv "GUIX_PYTHONPATH")))))))))
+    (native-inputs (list python-wrapper))
+    (inputs (list pyotherside-for-qt5
+                  python-yubikey-manager
+                  qtdeclarative-5
+                  qtgraphicaleffects
+                  qtquickcontrols-5
+                  qtquickcontrols2-5
+                  qtsvg-5))
+    (home-page "https://developers.yubico.com/yubikey-manager-qt/")
+    (synopsis "GUI for configuring any YubiKey over all USB interfaces")
+    (description "YubiKey Manager (Qt) is a graphical application for
+configuring any YubiKey over all USB interfaces.  For a CLI alternative, refer
+to the @code{python-yubikey-manager} package.")
+    (license license:bsd-2)))
+
 (define-public libnitrokey
   (package
     (name "libnitrokey")