[PATCH 0/3] Add yubikey-manager-qt.

  • Done
  • quality assurance status badge
Details
2 participants
  • Andreas Enge
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 8 Aug 2023 06:11
cover.1691467894.git.maxim.cournoyer@gmail.com
This series adds the graphical Yubikey Manager tool and a missing dependency,
'pyotherside', which is a Qt plugin to use Python.


Maxim Cournoyer (3):
gnu: Add pyotherside.
gnu: Add pyotherside-for-qt5.
gnu: Add yubikey-manager-qt.

gnu/packages/qt.scm | 72 +++++++++++++++++++++++++++++++++
gnu/packages/security-token.scm | 58 ++++++++++++++++++++++++++
2 files changed, 130 insertions(+)


base-commit: 98c17c14829349d4838186400541a7cd650b64d0
--
2.41.0
M
M
Maxim Cournoyer wrote on 8 Aug 2023 06:14
[PATCH 1/3] gnu: Add pyotherside.
(address . 65139@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
8b46df8977bee667a041d4b94e565d5ae76b02ab.1691468046.git.maxim.cournoyer@gmail.com
* gnu/packages/qt.scm (pyotherside): New variable.
---

gnu/packages/qt.scm | 49 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 5d7af0d0c8..581df38eaa 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3215,6 +3215,55 @@ (define-public single-application-qt5
instances.")
(license license:expat))))
+(define-public pyotherside
+ (package
+ (name "pyotherside")
+ (version "1.6.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/thp/pyotherside")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0vwl088p8zjkh2rwmzwpz5mkjs2rfyb80018dq4r571c9vpwp2r0"))))
+ (build-system qt-build-system)
+ (arguments
+ (list
+ #:qtbase qtbase
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-installation-prefix
+ (lambda _
+ ;; The QT_INSTALL_QML property points to the qtbase
+ ;; installation prefix.
+ (substitute* "src/src.pro"
+ (("\\$\\$\\[QT_INSTALL_QML]")
+ (string-append #$output "/lib/qt"
+ #$(version-major (package-version qtbase))
+ "/qml")))))
+ (replace 'configure
+ (lambda _
+ (invoke "qmake")))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "./tests/tests"))))
+ (replace 'install
+ ;; Specify a specific install target, otherwise the build fails
+ ;; attempting to install the qtquicktests target to the qtbase
+ ;; installation prefix.
+ (lambda _
+ (invoke "make" "sub-src-install_subtargets"))))))
+ (inputs (list python qtdeclarative qtquickcontrols2 qtsvg))
+ (home-page "https://thp.io/2011/pyotherside/")
+ (synopsis "Qt plugin providing access to a Python 3 interpreter from QML")
+ (description "Pyotherside is a Qt plugin providing access to a Python 3
+interpreter from QML for creating asynchronous mobile and desktop UIs with
+Python.")
+ (license license:isc)))
+
(define-public python-sip
(package
(name "python-sip")
--
2.41.0
M
M
Maxim Cournoyer wrote on 8 Aug 2023 06:14
[PATCH 2/3] gnu: Add pyotherside-for-qt5.
(address . 65139@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
4db489d46ef60fcbf9bfe1ae580a99789e5f9c4d.1691468046.git.maxim.cournoyer@gmail.com
* gnu/packages/qt.scm (pyotherside-for-qt5): New variable.
---

gnu/packages/qt.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 581df38eaa..1184a85938 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3264,6 +3264,29 @@ (define-public pyotherside
Python.")
(license license:isc)))
+(define-public pyotherside-for-qt5
+ (package/inherit pyotherside
+ (name "pyotherside-for-qt5")
+ (arguments
+ (substitute-keyword-arguments (package-arguments pyotherside)
+ ((#:qtbase _ #f)
+ qtbase-5)
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ (replace 'fix-installation-prefix
+ (lambda _
+ ;; The QT_INSTALL_QML property points to the qtbase
+ ;; installation prefix.
+ (substitute* "src/src.pro"
+ (("\\$\\$\\[QT_INSTALL_QML]")
+ (string-append #$output "/lib/qt"
+ #$(version-major (package-version qtbase-5))
+ "/qml")))))))))
+ (inputs (modify-inputs (package-inputs pyotherside)
+ (replace "qtdeclarative" qtdeclarative-5)
+ (replace "qtquickcontrols2" qtquickcontrols-5)
+ (replace "qtsvg" qtsvg-5)))))
+
(define-public python-sip
(package
(name "python-sip")
--
2.41.0
M
M
Maxim Cournoyer wrote on 8 Aug 2023 06:14
[PATCH 3/3] gnu: Add yubikey-manager-qt.
(address . 65139@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
4a7768c184069c62d884904e2cc42ba31088d429.1691468046.git.maxim.cournoyer@gmail.com
* gnu/packages/security-token.scm (yubikey-manager-qt): New variable.

---

gnu/packages/security-token.scm | 58 +++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)

Toggle diff (78 lines)
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 @@ (define-module (gnu packages security-token)
#: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 @@ (define-public python-yubikey-manager
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")
--
2.41.0
A
A
Andreas Enge wrote on 9 Aug 2023 09:51
Re: [bug#65139] [PATCH 1/3] gnu: Add pyotherside.
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
ZNNFkENBHOdDDDAe@jurong
Hello,

the packages look good, although it is unfortunate to add a dependency
on Qt5.

Andreas
M
M
Maxim Cournoyer wrote on 10 Aug 2023 15:36
(name . Andreas Enge)(address . andreas@enge.fr)
875y5nggu0.fsf@gmail.com
Hi Andreas,

Andreas Enge <andreas@enge.fr> writes:

Toggle quote (5 lines)
> Hello,
>
> the packages look good, although it is unfortunate to add a dependency
> on Qt5.

I'd like to move more things to Qt6 as well, but at the pace of things,
it seems this will take years.

I've installed the series and added you as reviewer to the last commit
message; I hope that's fine.

--
Thanks,
Maxim
Closed
?