gnu: pinentry-qt: Build with qtbase.
[jackhill/guix/guix.git] / gnu / packages / gnupg.scm
index 3b52351..c5055b6 100644 (file)
@@ -1,8 +1,11 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
+;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages gnupg)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages adns)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages openldap)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pth)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
-  #:use-module ((gnu packages compression) #:prefix guix:)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages tls)
   #:use-module (guix packages)
   #:use-module (guix download)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python))
 
 (define-public libgpg-error
   (package
     (name "libgpg-error")
-    (version "1.17")
+    (version "1.21")
     (source
      (origin
       (method url-fetch)
@@ -47,7 +57,7 @@
                           version ".tar.bz2"))
       (sha256
        (base32
-        "1dapxzxl1naghf342fwfc2w2f2c5hb9gr1a1s4n8dsqn26kybx1z"))))
+        "0kdq2cbnk84fr4jqcv689rlxpbyl6bda2cn6y3ll19v3mlydpnxp"))))
     (build-system gnu-build-system)
     (home-page "http://gnupg.org")
     (synopsis "Library of error values for GnuPG components")
 for all GnuPG components.  Among these are GPG, GPGSM, GPGME,
 GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard
 Daemon and possibly more in the future.")
-    (license lgpl2.0+)))
+    (license license:lgpl2.0+)
+    (properties '((ftp-server . "ftp.gnupg.org")
+                  (ftp-directory . "/gcrypt/libgpg-error")))))
 
 (define-public libgcrypt
   (package
     (name "libgcrypt")
-    (version "1.6.2")
+    (version "1.6.5")
     (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
                                  version ".tar.bz2"))
              (sha256
               (base32
-               "0k2wi34qhp5hq71w1ab3kw1gfsx7xff79bvynqkxp35kls94826y"))))
+               "0959mwfzsxhallxdqlw359xg180ll2skxwyy35qawmfl89cbr7pl"))))
     (build-system gnu-build-system)
     (propagated-inputs
      `(("libgpg-error-host" ,libgpg-error)))
@@ -90,7 +102,9 @@ Daemon and possibly more in the future.")
 standard cryptographic building blocks such as symmetric ciphers, hash
 algorithms, public key algorithms, large integer functions and random number
 generation.")
-    (license lgpl2.0+)))
+    (license license:lgpl2.0+)
+    (properties '((ftp-server . "ftp.gnupg.org")
+                  (ftp-directory . "/gcrypt/libgcrypt")))))
 
 (define-public libgcrypt-1.5
   (package (inherit libgcrypt)
@@ -107,7 +121,7 @@ generation.")
 (define-public libassuan
   (package
     (name "libassuan")
-    (version "2.2.0")
+    (version "2.4.2")
     (source
      (origin
       (method url-fetch)
@@ -115,7 +129,7 @@ generation.")
                           version ".tar.bz2"))
       (sha256
        (base32
-        "1ikf9whfi7rg71qa610ynyv12qrw20zkn7zxgvvr9dp41gbqxxbx"))))
+        "086bbcdnvs48qq5g4iac7dpk76j0q3jrp16mchdvyx0b720xq1mv"))))
     (build-system gnu-build-system)
     (propagated-inputs
      `(("libgpg-error" ,libgpg-error) ("pth" ,pth)))
@@ -127,12 +141,14 @@ generation.")
 protocol.  This protocol is used for IPC between most newer
 GnuPG components.  Both, server and client side functions are
 provided.")
-    (license lgpl2.0+)))
+    (license license:lgpl2.0+)
+    (properties '((ftp-server . "ftp.gnupg.org")
+                  (ftp-directory . "/gcrypt/libassuan")))))
 
 (define-public libksba
   (package
     (name "libksba")
-    (version "1.3.2")
+    (version "1.3.4")
     (source
      (origin
       (method url-fetch)
@@ -141,7 +157,7 @@ provided.")
             version ".tar.bz2"))
       (sha256
        (base32
-        "01l4hvcknk9nb4bvyb6aqaid19jg0wv3ik54j1b89hnzamwm75gb"))))
+        "0kxdb02z41cwm1xbwfwj9nbc0dzjhwyq8c475mlhhmpcxcy8ihpn"))))
     (build-system gnu-build-system)
     (propagated-inputs
      `(("libgpg-error" ,libgpg-error)))
@@ -160,38 +176,70 @@ provided.")
      "KSBA (pronounced Kasbah) is a library to make X.509 certificates
 as well as the CMS easily accessible by other applications.  Both
 specifications are building blocks of S/MIME and TLS.")
-    (license gpl3+)))
+    (license license:gpl3+)
+    (properties '((ftp-server . "ftp.gnupg.org")
+                  (ftp-directory . "/gcrypt/libksba")))))
+
+(define-public npth
+  (package
+    (name "npth")
+    (version "1.2")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append
+            "mirror://gnupg/npth/npth-"
+            version ".tar.bz2"))
+      (sha256
+       (base32
+        "12n0nvhw4fzwp0k7gjv3rc6pdml0qiinbbfiz4ilg6pl5kdxvnvd"))))
+    (build-system gnu-build-system)
+    (home-page "http://www.gnupg.org")
+    (synopsis "Non-preemptive thread library")
+    (description
+     "Npth is a library to provide the GNU Pth API and thus a non-preemptive
+threads implementation.
+
+In contrast to GNU Pth is is based on the system's standard threads
+implementation.  This allows the use of libraries which are not
+compatible to GNU Pth.")
+    (license (list license:lgpl3+ license:gpl2+)))) ; dual license
 
 (define-public gnupg
   (package
     (name "gnupg")
-    (version "2.0.27")
+    (version "2.1.12")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
                                   ".tar.bz2"))
               (sha256
                (base32
-                "1wihx7dphacg9fy5wfj93h236lr1w5gwzh7ir3js37wi9cz6sr2p"))))
+                "01n5py45x0r97l4dzmd803jpbpbcxr1591k3k4s8m9804jfr4d5c"))))
     (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
     (inputs
-     `(("bzip2" ,guix:bzip2)
+     `(("adns" ,adns)
+       ("bzip2" ,bzip2)
        ("curl" ,curl)
+       ("gnutls" ,gnutls)
        ("libassuan" ,libassuan)
        ("libgcrypt" ,libgcrypt)
        ("libgpg-error" ,libgpg-error)
        ("libksba" ,libksba)
-       ("pth" ,pth)
+       ("npth" ,npth)
        ("openldap" ,openldap)
-       ("zlib" ,guix:zlib)
-       ("readline" ,readline)))
+       ("readline" ,readline)
+       ("sqlite" ,sqlite)
+       ("zlib" ,zlib)))
    (arguments
     `(#:phases
        (alist-cons-before
         'configure 'patch-config-files
         (lambda _
-          (substitute* "tests/openpgp/Makefile.in"
-            (("/bin/sh") (which "bash"))))
+          (substitute* "tests/openpgp/defs.inc"
+            (("/bin/pwd") (which "pwd"))))
        %standard-phases)))
     (home-page "http://gnupg.org/")
     (synopsis "GNU Privacy Guard")
@@ -202,21 +250,56 @@ features powerful key management and the ability to access public key
 servers.  It includes several libraries: libassuan (IPC between GnuPG
 components), libgpg-error (centralized GnuPG error values), and
 libskba (working with X.509 certificates and CMS data).")
-    (license gpl3+)))
+    (license license:gpl3+)
+    (properties '((ftp-server . "ftp.gnupg.org")
+                  (ftp-directory . "/gcrypt/gnupg")))))
+
+(define-public gnupg-2.0
+  (package (inherit gnupg)
+    (version "2.0.30")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
+                                  ".tar.bz2"))
+              (sha256
+               (base32
+                "0wax4cy14hh0h7kg9hj0hjn9424b71z8lrrc5kbsasrn9xd7hag3"))))
+    (native-inputs '())
+    (inputs
+     `(("adns" ,adns)
+       ("bzip2" ,bzip2)
+       ("curl" ,curl)
+       ("libassuan" ,libassuan)
+       ("libgcrypt" ,libgcrypt)
+       ("libgpg-error" ,libgpg-error)
+       ("libksba" ,libksba)
+       ("pth" ,pth)
+       ("openldap" ,openldap)
+       ("zlib" ,zlib)
+       ("readline" ,readline)))
+   (arguments
+    `(#:phases
+       (alist-cons-before
+        'configure 'patch-config-files
+        (lambda _
+          (substitute* "tests/openpgp/Makefile.in"
+            (("/bin/sh") (which "bash"))))
+       %standard-phases)))))
 
 (define-public gnupg-1
   (package (inherit gnupg)
-    (version "1.4.19")
+    (version "1.4.20")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
                                   ".tar.bz2"))
               (sha256
                (base32
-                "11pxx26sfilh0vswylh9mhiifw5yffw7nn733zknw3sb0jfk22bz"))))
+                "1k7d6zi0zznqsmcjic0yrgfhqklqz3qgd3yac7wxsa7s6088p604"))))
+    (native-inputs '())
     (inputs
-     `(("zlib" ,guix:zlib)
-       ("bzip2" ,guix:bzip2)
+     `(("zlib" ,zlib)
+       ("bzip2" ,bzip2)
        ("curl" ,curl)
        ("readline" ,readline)
        ("libgpg-error" ,libgpg-error)))
@@ -231,7 +314,7 @@ libskba (working with X.509 certificates and CMS data).")
 (define-public gpgme
   (package
     (name "gpgme")
-    (version "1.5.1")
+    (version "1.6.0")
     (source
      (origin
       (method url-fetch)
@@ -239,13 +322,13 @@ libskba (working with X.509 certificates and CMS data).")
                           ".tar.bz2"))
       (sha256
        (base32
-        "1qqi9bxwxxsc4r15j7drclgp0w8jk9nj3h2fsivk4c7brvw3lbvc"))))
+        "17892sclz3yg45wbyqqrzzpq3l0icbnfl28f101b3062g8cy97dh"))))
     (build-system gnu-build-system)
     (propagated-inputs
      ;; Needs to be propagated because gpgme.h includes gpg-error.h.
      `(("libgpg-error" ,libgpg-error)))
     (inputs
-     `(("gnupg" ,gnupg)
+     `(("gnupg" ,gnupg-2.0)
        ("libassuan" ,libassuan)))
     (arguments '(#:make-flags '("GPG=gpg2")))
     (home-page "http://www.gnupg.org/related_software/gpgme/")
@@ -260,44 +343,117 @@ Because the direct use of GnuPG from an application can be a complicated
 programming task, it is suggested that all software should try to use GPGME
 instead.  This way bug fixes or improvements can be done at a central place
 and every application benefits from this.")
-    (license lgpl2.1+)))
+    (license license:lgpl2.1+)))
+
+(define-public python-pygpgme
+  (package
+    (name "python-pygpgme")
+    (version "0.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pygpgme" version))
+       (sha256
+        (base32
+         "1q82p3gs6lwq8j8dxk4pvrwk3jpww1zqcjrzznl9clh10z28gn2z"))
+       ;; Unfortunately, we have to disable some tests due to some gpg-agent
+       ;; goofiness... see:
+       ;;   https://bugs.launchpad.net/pygpgme/+bug/999949
+       (patches (search-patches "pygpgme-disable-problematic-tests.patch"))))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'make-build
+           (lambda _
+             (zero? (system* "make" "build"))))
+         (replace 'check
+           (lambda _
+             (zero? (system* "make" "check")))))))
+    (build-system python-build-system)
+    (inputs
+     `(;; setuptools required for python-2 variant
+       ("python-setuptools" ,python-setuptools)
+       ("gnupg" ,gnupg-2.0)
+       ("gpgme" ,gpgme)))
+    (home-page "https://launchpad.net/pygpgme")
+    (synopsis "Python module for working with OpenPGP messages")
+    (description
+     "PyGPGME is a Python module that lets you sign, verify, encrypt and
+decrypt messages using the OpenPGP format by making use of GPGME.")
+    (license license:lgpl2.1+)))
+
+(define-public python2-pygpgme
+  (package-with-python2 python-pygpgme))
+
+(define-public python-gnupg
+  (package
+    (name "python-gnupg")
+    (version "0.3.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-gnupg" version))
+       (sha256
+        (base32
+         "0nkbs9c8f30lra7ca39kg91x8cyxn0jb61vih4qky839gpbwwwiq"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+                  (lambda* (#:key inputs #:allow-other-keys)
+                    (substitute* "test_gnupg.py"
+                      ;; Test keyrings are missing, so this test fails.
+                      (("'test_scan_keys'") "True")
+                      (("def test_scan_keys") "def disabled__scan_keys")
+                      ;; Unsure why this test fails.
+                      (("'test_search_keys'") "True")
+                      (("def test_search_keys") "def disabled__search_keys"))
+                    (setenv "GPGBINARY" "gpg")
+                    (setenv "USERNAME" "guixbuilder")
+                    ;; The doctests are extremely slow and sometimes time out,
+                    ;; so we disable them.
+                    (zero? (system* "python"
+                                    "test_gnupg.py" "--no-doctests")))))))
+    (native-inputs
+     `(("gnupg" ,gnupg-1)))
+    (home-page "http://packages.python.org/python-gnupg/index.html")
+    (synopsis "Wrapper for the GNU Privacy Guard")
+    (description
+      "This module allows easy access to GnuPG’s key management, encryption
+and signature functionality from Python programs.")
+    (license license:bsd-3)))
+
+(define-public python2-gnupg
+  (package-with-python2 python-gnupg))
 
 (define-public pius
   (package
    (name "pius")
-   (version "2.0.9")
+   (version "2.2.2")
    (source (origin
             (method url-fetch)
-            (uri (string-append "mirror://sourceforge/pgpius/pius/"
-                                version "/pius-"
-                                version ".tar.bz2"))
-            (sha256 (base32
-                     "1g1jly3wl4ks6h8ydkygyl2c4i7v3z91rg42005m6vm70y1d8b3d"))))
-   (build-system gnu-build-system)
-   (inputs `(("perl" ,perl)
-             ("python" ,python-2)           ; uses the Python 2 'print' syntax
-             ("gpg" ,gnupg)))
+            (uri (string-append
+                  "https://github.com/jaymzh/pius/releases/download/v"
+                  version "/pius-" version ".tar.bz2"))
+            (sha256
+             (base32
+              "0k94mlr7l12mplph7pdgjbampqha47d8mfjq69n4xm80qwbn1rq1"))))
+   (build-system python-build-system)
+   (inputs `(("perl" ,perl)                ;for 'pius-party-worksheet'
+             ("gpg" ,gnupg-2.0)))          ;2.1 fails to talk to gpg-agent 2.0
    (arguments
     `(#:tests? #f
+      #:python ,python-2                     ;uses the Python 2 'print' syntax
       #:phases
-       (alist-delete
-        'configure
-       (alist-delete
-        'build
-       (alist-replace
-        'install
-        (lambda* (#:key inputs outputs #:allow-other-keys)
-          (let* ((out (assoc-ref outputs "out"))
-                 (gpg (string-append (assoc-ref inputs "gpg")
-                                     "/bin/gpg2")))
-            (mkdir out)
-            (mkdir (string-append out "/bin"))
-            (for-each (lambda (file)
-                        (substitute* file
-                          (("/usr/bin/gpg") gpg))
-                        (copy-file file (string-append out "/bin/" file)))
-                      '("pius" "pius-keyring-mgr" "pius-party-worksheet"))))
-       %standard-phases)))))
+      (modify-phases %standard-phases
+        (add-before
+         'build 'set-gpg-file-name
+         (lambda* (#:key inputs outputs #:allow-other-keys)
+           (let* ((gpg (string-append (assoc-ref inputs "gpg")
+                                      "/bin/gpg2")))
+             (substitute* "libpius/constants.py"
+               (("/usr/bin/gpg2") gpg))))))))
    (synopsis "Programs to simplify GnuPG key signing")
    (description
     "Pius (PGP Individual UID Signer) helps attendees of PGP keysigning
@@ -308,7 +464,7 @@ to the process.
 
 pius-keyring-mgr and pius-party-worksheet help organisers of
 PGP keysigning parties.")
-   (license gpl2)
+   (license license:gpl2)
    (home-page "http://www.phildev.net/pius/index.shtml")))
 
 (define-public signing-party
@@ -379,7 +535,7 @@ PGP keysigning parties.")
 including tools for signing keys, keyring analysis, and party preparation.
 
  * caff: CA - Fire and Forget signs and mails a key
+
  * pgp-clean: removes all non-self signatures from key
 
  * pgp-fixkey: removes broken packets from keys
@@ -408,33 +564,62 @@ including tools for signing keys, keyring analysis, and party preparation.
    ;; gpl2+ for almost all programs, except for keyanalyze: gpl2
    ;; and caff and gpgsigs: bsd-3, see
    ;; http://packages.debian.org/changelogs/pool/main/s/signing-party/current/copyright
-   (license gpl2)
+   (license license:gpl2)
    (home-page "http://pgp-tools.alioth.debian.org/")))
 
-(define-public pinentry
+(define-public pinentry-tty
   (package
-    (name "pinentry")
-    (version "0.8.3")
+    (name "pinentry-tty")
+    (version "0.9.7")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnupg/pinentry/pinentry-"
                                   version ".tar.bz2"))
               (sha256
                (base32
-                "1bd047crf7xb8g61mval8v6qww98rddlsw2dz6j8h8qbnl4hp2sn"))))
+                "1cp7wjqr6nx31mdclr61s2h84ijqjl0ph99kgj4vyawpjj1j1633"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags '("--enable-pinentry-tty")))
     (inputs
      `(("ncurses" ,ncurses)
-       ("gtk+" ,gtk+-2)
-       ("glib" ,glib)))
+       ("libassuan" ,libassuan)
+       ("libsecret" ,libsecret "out")))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
-    (home-page "http://gnupg.org/aegypten2/")
+    (home-page "https://gnupg.org/aegypten2/")
     (synopsis "GnuPG's interface to passphrase input")
     (description
-     "Pinentry provides a console and a GTK+ GUI that allows users to
-enter a passphrase when `gpg' or `gpg2' is run and needs it.")
-    (license gpl2+)))
+     "Pinentry provides a console that allows users to enter a passphrase when
+@code{gpg} or @code{gpg2} is run and needs it.")
+    (license license:gpl2+)))
+
+(define-public pinentry-gtk2
+  (package
+    (inherit pinentry-tty)
+    (name "pinentry-gtk2")
+    (inputs
+     `(("gtk+" ,gtk+-2)
+       ("glib" ,glib)
+       ,@(package-inputs pinentry-tty)))
+    (description
+     "Pinentry provides a console and a GTK+ GUI that allows users to enter a
+passphrase when @code{gpg} or @code{gpg2} is run and needs it.")))
+
+(define-public pinentry-qt
+  (package
+    (inherit pinentry-tty)
+    (name "pinentry-qt")
+    (inputs
+     `(("qtbase" ,qtbase)
+       ,@(package-inputs pinentry-tty)))
+  (description
+   "Pinentry provides a console and a Qt GUI that allows users to enter a
+passphrase when @code{gpg} or @code{gpg2} is run and needs it.")))
+
+(define-public pinentry
+  (package (inherit pinentry-gtk2)
+    (name "pinentry")))
 
 (define-public paperkey
   (package
@@ -466,4 +651,4 @@ for printing with paper and ink, which have amazingly long retention
 qualities.  To reconstruct a secret key, you re-enter those
 bytes (whether by hand, OCR, QR code, or the like) and paperkey can use
 them to transform your existing public key into a secret key.")
-    (license gpl2+)))
+    (license license:gpl2+)))