[PATCH] gnu: Add qtpass.

  • Done
  • quality assurance status badge
Details
2 participants
  • Jens Mølgaard
  • Ludovic Courtès
Owner
unassigned
Submitted by
Jens Mølgaard
Severity
normal
J
J
Jens Mølgaard wrote on 20 Jun 2019 09:53
(address . guix-patches@gnu.org)
87d0j81yls.fsf@zete.tk
Hello guix!

This patch adds qtpass, one of the GUIs available for password-store. It
should build reproducibly now, and 'guix lint' reports no issues, so
should be ready to go.

Some notes:

- Tests are currently disabled as they seem to need display set. Appears
to be the case for a few qt packages.

- qmake looks for lrelease-qt5/lupdate-qt5 instead of lrelease/lupdate,
and only seems to like the env vars given directly when invoked.
lrelease/lupdate in turn need a variable to find qmake. There's possibly
a more elegant way of doing this.

- Desktop file isn't currently set up; I'll need to look into that.

Comments and advice are very welcome (I'm quite 'green')!

Happy hacking,
Jens M
From cf95cf3b851c09afe7904e512c4a2e6b373db4de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jens=20M=C3=B8lgaard?= <jens@zete.tk>
Date: Thu, 20 Jun 2019 19:24:47 +1200
Subject: [PATCH] gnu: Add qtpass.

* gnu/packages/password-utils.scm (qtpass): New variable.
---
gnu/packages/password-utils.scm | 56 +++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)

Toggle diff (76 lines)
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index ed890f73c3..a3db8fbcdc 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -22,6 +22,7 @@
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
+;;; Copyright © 2019 Jens Mølgaard <jens@zete.tk>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -562,6 +563,61 @@ one-time-password (OTP) secrets, generating OTP codes, and displaying secret
key URIs using the standard otpauth:// scheme.")
(license license:gpl3+)))
+(define-public qtpass
+ (package
+ (name "qtpass")
+ (version "1.2.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/IJHack/QtPass.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1vfhfyccrxq9snyvayqfzm5rqik8ny2gysyv7nipc91kvhq3bhky"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; Tests require display.
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; lupdate/lrelease need to find qmake.
+ (setenv "QMAKE" "qmake")
+ ;; qmake needs to find lrelease/lupdate.
+ (invoke "qmake"
+ "QMAKE_LRELEASE=lrelease"
+ "QMAKE_LUPDATE=lupdate"
+ (string-append "PREFIX=" out)))))
+ (add-after 'configure 'reset-resource-timestamps
+ ;; Reset timestamps on localization files for a reproducible build.
+ (lambda _
+ (with-directory-excursion "localization"
+ (for-each (lambda (file)
+ (let* ((base (basename file ".qm"))
+ (src (string-append base ".ts"))
+ (st (stat src)))
+ (set-file-time file st)))
+ (find-files "." ".*\\.qm")))
+ #t)))))
+ (native-inputs
+ `(("qttools" ,qttools)))
+ (inputs
+ `(("qtbase" ,qtbase)
+ ("qtsvg" ,qtsvg)))
+ (home-page "https://qtpass.org")
+ (synopsis "GUI for password manager password-store")
+ (description
+ "Qt-based graphical user interface for the password manager
+password-store also known as pass. Can use either pass or gpg to interact
+with password-store files. Features configurable password generation,
+templates, clipboard handling, and per folder settings for multi-recipient
+encryption.")
+ (license license:gpl3)))
+
(define-public argon2
(package
(name "argon2")
--
2.22.0
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE/VzWzPUn4Rzyui0RiZ866GcCScAFAl0LO48ACgkQiZ866GcC
ScBMVBAAhspRykDWUUqIlZQs0E5ALWPsAgpAgR8A1umZx8HzFHNJ756Gv2prAwPS
fJJgrypKIOjZ94dl11o0LgtvJgYRIQvgxOpuFvdmyISZr2ilm49skuiE7PoYCX++
/rpIMqSHdbFyYnlVNjHV/uOQGXq5gjwrMt0tvZXgbnh12kgS5mb6m3CtCIH69TDD
5gbkjNwQH77ZtTwh8yJomHHhD2h+dN/sVzw31/5l0dEin83kMudNiOcZZJ1MBQKg
agUwuBrKabMU0WdYUzYqpMtzZuTXXhWmg3EFM17IcclxStyW4hMWfwty4xNTltwz
DXFujvrrv5+CefDOIILT5MKR+1OJB9VWXpQFJbjLJmplKxqByF9T1NKmjs9ouIuH
Inc7PKCal0ywlxZHm50uHL/W8+VLTbkQwYrllx2NNMR31MzQtRncqv8Y362C0ob4
vKM8mM1kP1k+t00f1YUfUDQ2fG146fFP5jnaVKQ3vN5QFVc3lK+zQUEcU/YuHbqU
yVmgZgyBBYTty2+W0S9IC8CrPPdAwdFPzg1XDPrUsUt+bQPVv2j+VOvhtSSLw3Uc
LcLg0Ar17XjwVTiy0cP0xnFlnP3a8kpCnHe5b6clBlyAmWYQoLanh1DpAPqcjPj+
nc9W+pwrIsV28iKuzIDS1IvGJ7XdjPFlu+PGFH0r+K3OZGGIl0g=
=x9DY
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 3 Jul 2019 00:23
(name . Jens Mølgaard)(address . jens@zete.tk)(address . 36303@debbugs.gnu.org)
871rz85b5h.fsf@gnu.org
Hi Jens,

Jens Mølgaard <jens@zete.tk> skribis:

Toggle quote (5 lines)
> Some notes:
>
> - Tests are currently disabled as they seem to need display set. Appears
> to be the case for a few qt packages.

Some packages have a pre-check phase that spawns Xvfb; others do:

(setenv "QT_QPA_PLATFORM" "offscreen")

Would one of these method allow us to run the tests?

Toggle quote (5 lines)
> - qmake looks for lrelease-qt5/lupdate-qt5 instead of lrelease/lupdate,
> and only seems to like the env vars given directly when invoked.
> lrelease/lupdate in turn need a variable to find qmake. There's possibly
> a more elegant way of doing this.

Sounds good.

Toggle quote (2 lines)
> - Desktop file isn't currently set up; I'll need to look into that.

OK.

Toggle quote (7 lines)
> From cf95cf3b851c09afe7904e512c4a2e6b373db4de Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Jens=20M=C3=B8lgaard?= <jens@zete.tk>
> Date: Thu, 20 Jun 2019 19:24:47 +1200
> Subject: [PATCH] gnu: Add qtpass.
>
> * gnu/packages/password-utils.scm (qtpass): New variable.

[...]

Toggle quote (2 lines)
> + (license license:gpl3)))

Source file headers don’t specify any version of the GPL, so it should
be ‘gpl3+’ (meaning “or any later version”).

Apart from these minor issues, it LGTM!

Could you send an updated patch that runs tests, if that works?
Otherwise we’re ready to go.

Thank you, and apologies for the delay!

Ludo’.
J
J
Jens Mølgaard wrote on 3 Jul 2019 11:29
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 36303@debbugs.gnu.org)
87o92bbh58.fsf@zete.tk
Hello Ludo,

Toggle quote (4 lines)
> Some packages have a pre-check phase that spawns Xvfb; others do:
> (setenv "QT_QPA_PLATFORM" "offscreen")
> Would one of these method allow us to run the tests?

Yep, tests work fine with this!

Toggle quote (3 lines)
> Source file headers don’t specify any version of the GPL, so it should
> be ‘gpl3+’ (meaning “or any later version”).

Ah, I thought only compatible later versions could be used, unless it
was specified explicitly. I'll trust your advice and specify 'gpl3+'.

I've also added a bit to install the desktop file, man-page and icon.

So, patch should be good to go!

Thanks,
Jens M
From 9aa91d33b280197dbd590e8347260e213df623c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jens=20M=C3=B8lgaard?= <jens@zete.tk>
Date: Thu, 20 Jun 2019 19:24:47 +1200
Subject: [PATCH] gnu: Add qtpass.

* gnu/packages/password-utils.scm (qtpass): New variable.
---
gnu/packages/password-utils.scm | 73 +++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)

Toggle diff (93 lines)
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index ed890f73c3..e1c8a10242 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -22,6 +22,7 @@
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
+;;; Copyright © 2019 Jens Mølgaard <jens@zete.tk>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -562,6 +563,78 @@ one-time-password (OTP) secrets, generating OTP codes, and displaying secret
key URIs using the standard otpauth:// scheme.")
(license license:gpl3+)))
+(define-public qtpass
+ (package
+ (name "qtpass")
+ (version "1.2.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/IJHack/QtPass.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1vfhfyccrxq9snyvayqfzm5rqik8ny2gysyv7nipc91kvhq3bhky"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; lupdate/lrelease need to find qmake.
+ (setenv "QMAKE" "qmake")
+ ;; qmake needs to find lrelease/lupdate.
+ (invoke "qmake"
+ "QMAKE_LRELEASE=lrelease"
+ "QMAKE_LUPDATE=lupdate"
+ (string-append "PREFIX=" out)))))
+ (add-after 'configure 'reset-resource-timestamps
+ ;; Reset timestamps on localization files for a reproducible build.
+ (lambda _
+ (with-directory-excursion "localization"
+ (for-each (lambda (file)
+ (let* ((base (basename file ".qm"))
+ (src (string-append base ".ts"))
+ (st (stat src)))
+ (set-file-time file st)))
+ (find-files "." ".*\\.qm")))
+ #t))
+ (add-after 'install 'install-auxilliary
+ ;; Install man-page, icon and .desktop file.
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (applications (string-append out "/share/applications"))
+ (icons (string-append out "/share/icons/hicolor/scalable/apps"))
+ (man (string-append out "/share/man/man1")))
+ (install-file "qtpass.desktop" applications)
+ (install-file "artwork/icon.svg" icons)
+ (rename-file (string-append icons "/icon.svg")
+ (string-append icons "/qtpass-icon.svg"))
+ (install-file "qtpass.1" man)
+ #t)))
+ (add-before 'check 'check-setup
+ ;; Make Qt render "offscreen", required for tests.
+ (lambda _
+ (setenv "QT_QPA_PLATFORM" "offscreen")
+ #t)))))
+ (native-inputs
+ `(("qttools" ,qttools)))
+ (inputs
+ `(("qtbase" ,qtbase)
+ ("qtsvg" ,qtsvg)))
+ (home-page "https://qtpass.org")
+ (synopsis "GUI for password manager password-store")
+ (description
+ "Qt-based graphical user interface for the password manager
+password-store also known as pass. Can use either pass or gpg to interact
+with password-store files. Features configurable password generation,
+templates, clipboard handling, and per folder settings for multi-recipient
+encryption.")
+ (license license:gpl3+)))
+
(define-public argon2
(package
(name "argon2")
--
2.22.0
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE/VzWzPUn4Rzyui0RiZ866GcCScAFAl0cdXMACgkQiZ866GcC
ScA90Q//QOmSkbKTZMOloJZX2Cyzbk2l+2q8hegGUsTIOTjw7+06wXpSTX08vOEb
RcGxzMeD5yNGwtKVqJFLBYKdCFZXE4DNtd0gxl14Im3jqNa4lbEqpL6AB9RQqwQc
9GOQuLLowPpad0XosNtfPFTzskZGdM3+Pflf9l+MufDoi996NZ1ZUP+sWPbYnb70
ZoXYJHww5OM+JORcnh0yFUngLhBLsFW/pEw1y2C+6ENsY313+15tZYXsi65xQdm6
ON8oCuuEL8LllBbrQdwe9DigUqfEZ0ORr8bn+/GB9iFsxMl9D0qtCTfsg1tzUX4I
21/hjIF0XHKCYpR07XOg9LRRnaFgefMLoo/7guIxJ3LrLSLdv4dc+2nCN6y0kbGv
q/s+2FNOmZfIferst30TB2WrpkmvmFvN4nkBuic+vmfF05JWhnHYw36iXgR1Euya
hCfejOHLNxVChPUwkLLhPvJePQNP4sW8e/26Mr/8RikCN5l/FMnINTRycXT+7DzV
oSL1jB51WNhuMZmTuRWd96LMYJRx1PJR2r6+IF9GlSFjLrhVUxmVvr4E/8LHwakZ
kqvuiVjOY9czR4Vn3TwMUoDzz+aWIIsLtKhTkG9eqoBjpsIi9KHTaScDin+k3pdo
o02HaWCYFqVPtNku4Mqqg7doc+juXX3JHwLU23R1WozhN6yYEsE=
=sk+r
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 4 Jul 2019 11:48
(name . Jens Mølgaard)(address . jens@zete.tk)(address . 36303-done@debbugs.gnu.org)
87zhlu6sgh.fsf@gnu.org
Hi,

Jens Mølgaard <jens@zete.tk> skribis:

Toggle quote (6 lines)
>> Some packages have a pre-check phase that spawns Xvfb; others do:
>> (setenv "QT_QPA_PLATFORM" "offscreen")
>> Would one of these method allow us to run the tests?
>
> Yep, tests work fine with this!

Awesome.

Toggle quote (6 lines)
>> Source file headers don’t specify any version of the GPL, so it should
>> be ‘gpl3+’ (meaning “or any later version”).
>
> Ah, I thought only compatible later versions could be used, unless it
> was specified explicitly. I'll trust your advice and specify 'gpl3+'.

Section 14 of GPLv3 reads (GPLv2 has similar wording):

If the Program does not specify a version number of the GNU General
Public License, you may choose any version ever published by the Free
Software Foundation.

In Guix, we encode it as “version X or later”.

Toggle quote (7 lines)
> From 9aa91d33b280197dbd590e8347260e213df623c7 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Jens=20M=C3=B8lgaard?= <jens@zete.tk>
> Date: Thu, 20 Jun 2019 19:24:47 +1200
> Subject: [PATCH] gnu: Add qtpass.
>
> * gnu/packages/password-utils.scm (qtpass): New variable.

Applied, thanks!

Ludo’.
Closed
?