[bug#33980] gnu: Add pwsafe

Message ID 72cf6bcd-5ee7-c2af-eb89-2199a47e866f@yahoo.de
State Accepted
Headers show
Series [bug#33980] gnu: Add pwsafe | expand

Checks

Context Check Description
cbaines/package builds pending In Cuirass
cbaines/applying patch fail Apply failed

Commit Message

Tim Gesthuizen Jan. 9, 2019, 9:27 p.m. UTC
Hi Ludo,

>> +    ;; TODO: The help subsystem cannot be initialized
>> +    ;; TODO: pwsafe tries to download GTest which does not work in the daemon
>> +    ;; environment and is not functional. Substitute CMakeLists.txt to use
>> +    ;; native GTest and reenable unit tests.
>> +    (arguments '(#:configure-flags (list "-DNO_GTEST=YES")))
> 
> It would be ideal if you could get the tests running.  :-)

Done. It's a really ugly hack but they are running.
This uncovered the problem of the help system not initializing because
/usr/bin/file was hardcoded. So enabling unit tests was a good idea (as
always) :)


>> +    (native-inputs `(("coreutils" ,coreutils)
> 
> Coreutils is not needed, it’s an implicit input already.

Removed.

>> +    (synopsis "Password safe to store passwords encrypted")
>> +    (description "A password manager originally designed by Bruce Schneier.
>> +It offers a simple UI to manage passwords for different services.  There are
>> +other programs that support the file format on different plattforms.")
>                                                                ^^
> Typo.
> 
> Also please make full sentences.

Hope I got everything corrrect this time.
Patch is attached.

Tim.

Comments

Ludovic Courtès Jan. 10, 2019, 9:22 a.m. UTC | #1
Hi Tim,

Tim Gesthuizen <tim.gesthuizen@yahoo.de> skribis:

> From 5106465e332782896f84b4e3ff3ae03588aeca2a Mon Sep 17 00:00:00 2001
> From: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
> Date: Sat, 29 Dec 2018 23:21:58 +0100
> Subject: [PATCH] gnu: Add pwsafe
>
> * gnu/packages/password-utils.scm (pwsafe): New variable

I made phases return #t and applied, thanks!

While building with --rounds=2, I noticed zip files were produced in a
non-deterministic way:

--8<---------------cut here---------------start------------->8---
$ diff -ru /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0{,-check}
Binary files /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0/share/passwordsafe/help/helpDE.zip and /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0-check/share/passwordsafe/help/helpDE.zip differ
Binary files /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0/share/passwordsafe/help/helpEN.zip and /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0-check/share/passwordsafe/help/helpEN.zip differ
Binary files /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0/share/passwordsafe/help/helpES.zip and /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0-check/share/passwordsafe/help/helpES.zip differ
Binary files /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0/share/passwordsafe/help/helpFR.zip and /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0-check/share/passwordsafe/help/helpFR.zip differ
Binary files /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0/share/passwordsafe/help/helpPL.zip and /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0-check/share/passwordsafe/help/helpPL.zip differ
Binary files /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0/share/passwordsafe/help/helpRU.zip and /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0-check/share/passwordsafe/help/helpRU.zip differ
Binary files /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0/share/passwordsafe/help/helpZH.zip and /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0-check/share/passwordsafe/help/helpZH.zip differ
$ diffoscope /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0{,-check}/share/passwordsafe/help/
--- /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0/share/passwordsafe/help/
+++ /gnu/store/rynl3nnxy1b4l2nclb6s0lsqidzix4q9-pwsafe-3.48.0-check/share/passwordsafe/help/
├── helpDE.zip
│ ├── zipinfo /dev/stdin
│ │ @@ -1,9 +1,9 @@
│ │  Zip file size: 2850677 bytes, number of entries: 216
│ │ -drwxr-xr-x  3.0 unx        0 b- stor 19-Jan-10 08:40 html/
│ │ +drwxr-xr-x  3.0 unx        0 b- stor 19-Jan-10 08:38 html/
│ │  -r--r--r--  3.0 unx     7195 t- defN 80-Jan-01 00:00 html/filters.html
│ │  -r--r--r--  3.0 unx    11035 t- defN 80-Jan-01 00:00 html/run_command.html
│ │  -r--r--r--  3.0 unx    10533 t- defN 80-Jan-01 00:00 html/entering_pwd.html
│ │  -r--r--r--  3.0 unx     7763 t- defN 80-Jan-01 00:00 html/view_menu.html
│ │  -r--r--r--  3.0 unx     3537 t- defN 80-Jan-01 00:00 html/password_history.html
│ │  -r--r--r--  3.0 unx     6363 t- defN 80-Jan-01 00:00 html/file_menu.html
│ │  -r--r--r--  3.0 unx     2910 t- defN 80-Jan-01 00:00 html/about_pws.html
│ │ @@ -30,15 +30,15 @@
│ │  -r--r--r--  3.0 unx    11856 t- defN 80-Jan-01 00:00 html/edit_menu.html
│ │  -r--r--r--  3.0 unx     3745 t- defN 80-Jan-01 00:00 html/password_history_tab.html
│ │  -r--r--r--  3.0 unx     3850 t- defN 80-Jan-01 00:00 html/backup_and_restore.html
│ │  -r--r--r--  3.0 unx     7184 t- defN 80-Jan-01 00:00 html/autotype.html
│ │  -r--r--r--  3.0 unx     2744 t- defN 80-Jan-01 00:00 html/images.html
│ │  -r--r--r--  3.0 unx     5215 t- defN 80-Jan-01 00:00 html/failsafebackups.html
│ │  -r--r--r--  3.0 unx     3155 t- defN 80-Jan-01 00:00 html/wzselectdb.html
│ │ -drwxr-xr-x  3.0 unx        0 b- stor 19-Jan-10 08:40 html/images/
│ │ +drwxr-xr-x  3.0 unx        0 b- stor 19-Jan-10 08:38 html/images/

[...]

│ │  -r--r--r--  3.0 unx     3818 t- defN 80-Jan-01 00:00 html/entering_pwd_date.html
│ │  -r--r--r--  3.0 unx     8113 t- defN 80-Jan-01 00:00 html/manage_menu.html
│ │  -r--r--r--  3.0 unx     1984 t- defN 80-Jan-01 00:00 html/wzfinish.html
│ │ --r--r--r--  3.0 unx     7988 t- defN 19-Jan-10 08:40 pwsafeDE.hhc
│ │ --r--r--r--  3.0 unx      203 t- defN 19-Jan-10 08:40 pwsafeDE.hhk
│ │ --r--r--r--  3.0 unx     1342 t- defN 19-Jan-10 08:40 pwsafe.hhp
│ │ +-r--r--r--  3.0 unx     7988 t- defN 19-Jan-10 08:38 pwsafeDE.hhc
│ │ +-r--r--r--  3.0 unx      203 t- defN 19-Jan-10 08:38 pwsafeDE.hhk
│ │ +-r--r--r--  3.0 unx     1342 t- defN 19-Jan-10 08:38 pwsafe.hhp
--8<---------------cut here---------------end--------------->8---

I suppose this is a case where we should use Gábor’s
‘reset-zip-timestamps’.  It would be great if you could give it a try.

Thanks,
Ludo’.

Patch

From 5106465e332782896f84b4e3ff3ae03588aeca2a Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
Date: Sat, 29 Dec 2018 23:21:58 +0100
Subject: [PATCH] gnu: Add pwsafe

* gnu/packages/password-utils.scm (pwsafe): 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 357ef86d5..8adea891e 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -21,6 +21,7 @@ 
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
+;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -42,6 +43,7 @@ 
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
@@ -51,7 +53,9 @@ 
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages file)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gnuzilla)
@@ -72,6 +76,7 @@ 
   #:use-module (gnu packages tls)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages version-control)
+  #:use-module (gnu packages wxwidgets)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages xml)
@@ -168,6 +173,57 @@  algorithms AES or Twofish.")
     (license license:gpl3)
     (properties `((superseded . ,keepassxc)))))
 
+(define-public pwsafe
+  (package
+    (name "pwsafe")
+    (version "3.48.0")
+    (home-page "https://www.pwsafe.org/" )
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/pwsafe/pwsafe.git")
+             (commit version)))
+       (sha256 (base32 "0hxv23yh76liggxbjn4m132z15sklra8ms341xgzl4n5vjx30ihi"))
+       (file-name (string-append name "-" version "-checkout"))))
+    (build-system cmake-build-system)
+    (native-inputs `(("gettext" ,gettext-minimal)
+                     ("perl" ,perl)
+                     ("zip" ,zip)))
+    (inputs `(("curl" ,curl)
+              ("file" ,file)
+              ("gtest" ,googletest)
+              ("libuuid" ,util-linux)
+              ("libxt" ,libxt)
+              ("libxtst" ,libxtst)
+              ("openssl" ,openssl)
+              ("qrencode" ,qrencode)
+              ("wxwidgets" ,wxwidgets)
+              ("xerces-c" ,xerces-c)))
+    (arguments '(#:configure-flags (list "-DNO_GTEST=YES")
+                 #:phases (modify-phases %standard-phases
+                            (add-after 'unpack 'add-gtest
+                              (lambda* (#:key inputs #:allow-other-keys)
+                                (chmod "CMakeLists.txt" #o644)
+                                (let ((cmake-port (open-file "CMakeLists.txt"
+                                                             "a")))
+                                  (display "find_package(GTest)
+add_subdirectory(src/test)\n" cmake-port)
+                                  (close cmake-port))))
+                            (add-after 'add-gtest 'patch-executables
+                              (lambda* (#:key inputs #:allow-other-keys)
+                                (chmod "src/test/OSTest.cpp" #o644)
+                                (substitute* "src/os/unix/media.cpp"
+                                            (("/usr/bin/file")
+                                             (string-append (assoc-ref inputs "file")
+                                                            "/bin/file"))))))))
+    (synopsis "Password safe with automatic input and key generation")
+    (description "pwsafe is a password manager originally designed by Bruce
+Schneier.  It offers a simple UI to manage passwords for different services.
+There are other programs that support the file format on different
+platforms.")
+    (license license:artistic2.0)))
+
 (define-public shroud
   (package
     (name "shroud")
-- 
2.20.1