diff mbox series

[bug#36303] gnu: Add qtpass.

Message ID 87d0j81yls.fsf@zete.tk
State Accepted
Headers show
Series [bug#36303] gnu: Add qtpass. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

Jens Mølgaard June 20, 2019, 7:53 a.m. UTC
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

Comments

Ludovic Courtès July 2, 2019, 10:23 p.m. UTC | #1
Hi Jens,

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

> 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?

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

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

OK.

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

[...]

> +    (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’.
diff mbox series

Patch

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(+)

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