gnu: python-gnupg: Update to 0.4.3.
[jackhill/guix/guix.git] / gnu / packages / gnupg.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
464f5447 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
a92d9726 3;;; Copyright © 2013, 2015, 2018 Andreas Enge <andreas@enge.fr>
4380a7b4 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
3a7261bf 5;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5dabdb75 6;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
607d280e 7;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
5aeb6611 8;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
a05d1d82 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
4a78fd46 10;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
41edb23f 11;;; Copyright © 2016 Christopher Baines <mail@cbaines.net>
cd9ed6c1 12;;; Copyright © 2016 Mike Gerwitz <mtg@gnu.org>
0f391063 13;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
e3dd1f0c 14;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
5aeb6611 15;;; Copyright © 2017 Petter <petter@mykolab.ch>
f7147e27 16;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
df9f6289 17;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
8d1939e4 18;;;
233e7676 19;;; This file is part of GNU Guix.
8d1939e4 20;;;
233e7676 21;;; GNU Guix is free software; you can redistribute it and/or modify it
8d1939e4
LC
22;;; under the terms of the GNU General Public License as published by
23;;; the Free Software Foundation; either version 3 of the License, or (at
24;;; your option) any later version.
25;;;
233e7676 26;;; GNU Guix is distributed in the hope that it will be useful, but
8d1939e4
LC
27;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29;;; GNU General Public License for more details.
30;;;
31;;; You should have received a copy of the GNU General Public License
233e7676 32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
8d1939e4 33
1ffa7090 34(define-module (gnu packages gnupg)
07157e8a 35 #:use-module ((guix licenses) #:prefix license:)
a05d1d82 36 #:use-module (gnu packages)
7b40296f 37 #:use-module (gnu packages adns)
c9ce8e17 38 #:use-module (gnu packages autotools)
34ef5755 39 #:use-module (gnu packages base)
01e11826 40 #:use-module (gnu packages curl)
c9ce8e17 41 #:use-module (gnu packages crypto)
abc4a332 42 #:use-module (gnu packages emacs)
01e11826 43 #:use-module (gnu packages openldap)
ea4d96c6 44 #:use-module (gnu packages perl)
5ccde207 45 #:use-module (gnu packages perl-check)
1ffa7090 46 #:use-module (gnu packages pth)
ea4d96c6 47 #:use-module (gnu packages python)
54df7558 48 #:use-module (gnu packages qt)
1ffa7090 49 #:use-module (gnu packages readline)
07157e8a 50 #:use-module (gnu packages compression)
2d12284d 51 #:use-module (gnu packages databases)
40d806af
LC
52 #:use-module (gnu packages gtk)
53 #:use-module (gnu packages glib)
d1d75c6a 54 #:use-module (gnu packages gnome)
40d806af
LC
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages ncurses)
cd9ed6c1 57 #:use-module (gnu packages security-token)
e3dd1f0c 58 #:use-module (gnu packages swig)
a7fd7b68 59 #:use-module (gnu packages tls)
15b08442
P
60 #:use-module (gnu packages tor)
61 #:use-module (gnu packages web)
62 #:use-module (gnu packages xml)
8d1939e4 63 #:use-module (guix packages)
87f5d366 64 #:use-module (guix download)
0f391063 65 #:use-module (guix git-download)
14e2e44d 66 #:use-module (guix build-system gnu)
34ef5755 67 #:use-module (guix build-system perl)
14e2e44d 68 #:use-module (guix build-system python))
8d1939e4
LC
69
70(define-public libgpg-error
71 (package
72 (name "libgpg-error")
1abc295b 73 (version "1.28")
8d1939e4
LC
74 (source
75 (origin
87f5d366 76 (method url-fetch)
0db342a5 77 (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
8d1939e4
LC
78 version ".tar.bz2"))
79 (sha256
80 (base32
1bf7ef85
EF
81 "0jfsfnh9bxlxiwxws60yah4ybjw2hshmvqp31pri4m4h8ivrbnry"))
82 (patches (search-patches "libgpg-error-aarch64-logging-fix.patch"))))
8d1939e4 83 (build-system gnu-build-system)
72fb1b24 84 (home-page "https://gnupg.org")
35b9e423 85 (synopsis "Library of error values for GnuPG components")
8d1939e4
LC
86 (description
87 "Libgpg-error is a small library that defines common error values
88for all GnuPG components. Among these are GPG, GPGSM, GPGME,
89GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard
90Daemon and possibly more in the future.")
63e8bb12
LC
91 (license license:lgpl2.0+)
92 (properties '((ftp-server . "ftp.gnupg.org")
93 (ftp-directory . "/gcrypt/libgpg-error")))))
8d1939e4 94
df9f6289
MB
95;; Some packages (e.g. GPGME) require a newer libgpg-error to deal with
96;; error codes from recent GnuPG. Remove this in the next rebuild cycle.
97(define-public libgpg-error-1.31
98 (package
99 (inherit libgpg-error)
100 (version "1.31")
101 (source (origin
102 (method url-fetch)
103 (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
104 version ".tar.bz2"))
105 (sha256
106 (base32
107 "1vx4nw6rxh2biy3h8n96fyr86q29h8gjl6837437i51jr4isil20"))))))
108
8d1939e4
LC
109(define-public libgcrypt
110 (package
111 (name "libgcrypt")
36d37ca9 112 (version "1.8.2")
84a3e3b7
LC
113 (source (origin
114 (method url-fetch)
115 (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
116 version ".tar.bz2"))
117 (sha256
118 (base32
36d37ca9 119 "01sca9m8hm6b5v8hmqsfdjhyz013869p1f0fxw9ln52qfnp4q1n8"))))
8d1939e4
LC
120 (build-system gnu-build-system)
121 (propagated-inputs
e0932742 122 `(("libgpg-error-host" ,libgpg-error)))
e766f699
JD
123 (native-inputs
124 ;; Needed here for the 'gpg-error' program.
e0932742 125 `(("libgpg-error-native" ,libgpg-error)))
e766f699
JD
126 (arguments
127 ;; The '--with-gpg-error-prefix' argument is needed because otherwise
128 ;; 'configure' uses 'gpg-error-config' to determine the '-L' flag, and
129 ;; the 'gpg-error-config' it runs is the native one---i.e., the wrong one.
130 `(#:configure-flags
131 (list (string-append "--with-gpg-error-prefix="
e0932742 132 (assoc-ref %build-inputs "libgpg-error-host")))))
40fed2d8 133 (outputs '("out" "debug"))
72fb1b24 134 (home-page "https://gnupg.org/")
f50d2669 135 (synopsis "Cryptographic function library")
8d1939e4 136 (description
a22dc0c4
LC
137 "Libgcrypt is a general-purpose cryptographic library. It provides the
138standard cryptographic building blocks such as symmetric ciphers, hash
139algorithms, public key algorithms, large integer functions and random number
140generation.")
63e8bb12
LC
141 (license license:lgpl2.0+)
142 (properties '((ftp-server . "ftp.gnupg.org")
143 (ftp-directory . "/gcrypt/libgcrypt")))))
8d1939e4
LC
144
145(define-public libassuan
146 (package
147 (name "libassuan")
5965b083 148 (version "2.5.1")
8d1939e4
LC
149 (source
150 (origin
87f5d366 151 (method url-fetch)
0db342a5 152 (uri (string-append "mirror://gnupg/libassuan/libassuan-"
8d1939e4
LC
153 version ".tar.bz2"))
154 (sha256
155 (base32
5965b083 156 "0jb4nb4nrjr949gd3lw8lh4v5d6qigxaq6xwy24w5apjnhvnrya7"))))
8d1939e4
LC
157 (build-system gnu-build-system)
158 (propagated-inputs
5965b083
LF
159 `(("libgpg-error" ,libgpg-error)
160 ("pth" ,pth)))
72fb1b24 161 (home-page "https://gnupg.org")
8d1939e4 162 (synopsis
35b9e423 163 "IPC library used by GnuPG and related software")
8d1939e4
LC
164 (description
165 "Libassuan is a small library implementing the so-called Assuan
166protocol. This protocol is used for IPC between most newer
167GnuPG components. Both, server and client side functions are
168provided.")
63e8bb12
LC
169 (license license:lgpl2.0+)
170 (properties '((ftp-server . "ftp.gnupg.org")
171 (ftp-directory . "/gcrypt/libassuan")))))
8d1939e4
LC
172
173(define-public libksba
174 (package
175 (name "libksba")
c95f7160 176 (version "1.3.5")
8d1939e4
LC
177 (source
178 (origin
87f5d366 179 (method url-fetch)
8d1939e4 180 (uri (string-append
0db342a5 181 "mirror://gnupg/libksba/libksba-"
8d1939e4
LC
182 version ".tar.bz2"))
183 (sha256
184 (base32
c95f7160 185 "0h53q4sns1jz1pkmhcz5wp9qrfn9f5g9i3vjv6dafwzzlvblyi21"))))
8d1939e4
LC
186 (build-system gnu-build-system)
187 (propagated-inputs
188 `(("libgpg-error" ,libgpg-error)))
e766f699
JD
189 (native-inputs
190 `(("libgpg-error" ,libgpg-error)))
191 (arguments
192 `(#:configure-flags
193 (list ,@(if (%current-target-system)
194 '("CC_FOR_BUILD=gcc")
195 '())
196 (string-append "--with-gpg-error-prefix="
197 (assoc-ref %build-inputs "libgpg-error")))))
72fb1b24 198 (home-page "https://www.gnupg.org")
35b9e423 199 (synopsis "CMS and X.509 access library")
8d1939e4
LC
200 (description
201 "KSBA (pronounced Kasbah) is a library to make X.509 certificates
202as well as the CMS easily accessible by other applications. Both
203specifications are building blocks of S/MIME and TLS.")
63e8bb12
LC
204 (license license:gpl3+)
205 (properties '((ftp-server . "ftp.gnupg.org")
206 (ftp-directory . "/gcrypt/libksba")))))
8d1939e4 207
c18ea90f
AE
208(define-public npth
209 (package
210 (name "npth")
f48a9d4a 211 (version "1.5")
c18ea90f
AE
212 (source
213 (origin
214 (method url-fetch)
89c83e8c 215 (uri (string-append "mirror://gnupg/npth/npth-" version ".tar.bz2"))
c18ea90f
AE
216 (sha256
217 (base32
f48a9d4a 218 "1hmkkp6vzyrh8v01c2ynzf9vwikyagp7p1lxhbnr4ysk3w66jji9"))))
c18ea90f 219 (build-system gnu-build-system)
72fb1b24 220 (home-page "https://www.gnupg.org")
c18ea90f
AE
221 (synopsis "Non-preemptive thread library")
222 (description
223 "Npth is a library to provide the GNU Pth API and thus a non-preemptive
224threads implementation.
225
226In contrast to GNU Pth is is based on the system's standard threads
227implementation. This allows the use of libraries which are not
228compatible to GNU Pth.")
07157e8a 229 (license (list license:lgpl3+ license:gpl2+)))) ; dual license
c18ea90f 230
8d1939e4
LC
231(define-public gnupg
232 (package
233 (name "gnupg")
216c7266 234 (version "2.2.8")
58970d6a
LC
235 (source (origin
236 (method url-fetch)
237 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
238 ".tar.bz2"))
239 (sha256
240 (base32
216c7266 241 "1k8dnnfs9888yp713l7kg2jg110lw47s4krx0njna6fjrsw4qyvp"))))
8d1939e4 242 (build-system gnu-build-system)
08fa45b1
MW
243 (native-inputs
244 `(("pkg-config" ,pkg-config)))
8d1939e4 245 (inputs
f02d254a 246 `(("gnutls" ,gnutls)
8d1939e4
LC
247 ("libassuan" ,libassuan)
248 ("libgcrypt" ,libgcrypt)
01e11826 249 ("libgpg-error" ,libgpg-error)
8d1939e4 250 ("libksba" ,libksba)
cd064df7 251 ("npth" ,npth)
01e11826 252 ("openldap" ,openldap)
cd9ed6c1 253 ("pcsc-lite" ,pcsc-lite)
2d12284d
EF
254 ("readline" ,readline)
255 ("sqlite" ,sqlite)
256 ("zlib" ,zlib)))
30e9cbb4 257 (arguments
10756b9e 258 `(#:configure-flags '(;; Otherwise, the test suite looks for the `gpg`
f11275c9
LF
259 ;; executable in its installation directory in
260 ;; /gnu/store before it has been installed.
e184de57
EF
261 "--enable-gnupg-builddir-envvar"
262 "--enable-all-tests")
163708a6 263 #:phases
45477c6a 264 (modify-phases %standard-phases
cd9ed6c1
MG
265 (add-before 'configure 'patch-paths
266 (lambda* (#:key inputs #:allow-other-keys)
cd9ed6c1
MG
267 (substitute* "scd/scdaemon.c"
268 (("\"(libpcsclite\\.so[^\"]*)\"" _ name)
269 (string-append "\"" (assoc-ref inputs "pcsc-lite")
270 "/lib/" name "\"")))
7deb5ee8
LF
271 #t))
272 (add-after 'build 'patch-scheme-tests
273 (lambda _
274 (substitute* (find-files "tests" ".\\.scm$")
275 (("/usr/bin/env gpgscm")
764c5662
LF
276 (string-append (getcwd) "/tests/gpgscm/gpgscm")))
277 #t))
f11275c9 278 (add-before 'build 'patch-test-paths
92cc6a58
EF
279 (lambda _
280 (substitute* '("tests/inittests"
281 "tests/pkits/inittests"
282 "tests/Makefile"
283 "tests/pkits/common.sh"
284 "tests/pkits/Makefile")
285 (("/bin/pwd") (which "pwd")))
286 (substitute* "common/t-exectool.c"
287 (("/bin/cat") (which "cat"))
288 (("/bin/true") (which "true"))
289 (("/bin/false") (which "false")))
290 #t)))))
72fb1b24 291 (home-page "https://gnupg.org/")
f50d2669 292 (synopsis "GNU Privacy Guard")
8d1939e4 293 (description
a22dc0c4
LC
294 "The GNU Privacy Guard is a complete implementation of the OpenPGP
295standard. It is used to encrypt and sign data and communication. It
296features powerful key management and the ability to access public key
79c311b8 297servers. It includes several libraries: libassuan (IPC between GnuPG
58970d6a
LC
298components), libgpg-error (centralized GnuPG error values), and
299libskba (working with X.509 certificates and CMS data).")
63e8bb12
LC
300 (license license:gpl3+)
301 (properties '((ftp-server . "ftp.gnupg.org")
302 (ftp-directory . "/gcrypt/gnupg")))))
ea4d96c6 303
cd064df7
AE
304(define-public gnupg-2.0
305 (package (inherit gnupg)
b5afe6f0 306 (version "2.0.30")
cd064df7
AE
307 (source (origin
308 (method url-fetch)
309 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
310 ".tar.bz2"))
311 (sha256
312 (base32
b5afe6f0 313 "0wax4cy14hh0h7kg9hj0hjn9424b71z8lrrc5kbsasrn9xd7hag3"))))
08fa45b1 314 (native-inputs '())
cd064df7 315 (inputs
7b40296f
EF
316 `(("adns" ,adns)
317 ("bzip2" ,bzip2)
cd064df7
AE
318 ("curl" ,curl)
319 ("libassuan" ,libassuan)
320 ("libgcrypt" ,libgcrypt)
321 ("libgpg-error" ,libgpg-error)
322 ("libksba" ,libksba)
323 ("pth" ,pth)
324 ("openldap" ,openldap)
07157e8a 325 ("zlib" ,zlib)
cd064df7
AE
326 ("readline" ,readline)))
327 (arguments
328 `(#:phases
80c47cf8 329 (modify-phases %standard-phases
6b547d22
LC
330 (add-before 'configure 'patch-config-files
331 (lambda _
332 (substitute* "tests/openpgp/Makefile.in"
3a534f42 333 (("/bin/sh") (which "sh")))
bc85b127
LC
334 #t))
335 (add-after 'install 'rename-v2-commands
336 (lambda* (#:key outputs #:allow-other-keys)
337 ;; Upstream suggests removing the trailing '2' from command names:
338 ;; <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22883#58>.
339 (let ((out (assoc-ref outputs "out")))
340 (with-directory-excursion (string-append out "/bin")
341 (rename-file "gpgv2" "gpgv")
342 (rename-file "gpg2" "gpg")
343
344 ;; Keep the old name around to ease transition.
345 (symlink "gpgv" "gpgv2")
346 (symlink "gpg" "gpg2")
806e891e
LF
347 #t)))))))
348 (properties `((superseded . ,gnupg)))))
cd064df7 349
5249045c
MW
350(define-public gnupg-1
351 (package (inherit gnupg)
81ca29a6 352 (version "1.4.22")
58970d6a
LC
353 (source (origin
354 (method url-fetch)
355 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
356 ".tar.bz2"))
65956ad3 357 (patches (search-patches "gnupg-1.4-CVE-2018-12020.patch"))
58970d6a
LC
358 (sha256
359 (base32
81ca29a6 360 "1d1hz4szh1kvwhsw7w2zxa6q5ndrk3qy6hj289l1b8k3xi5s554m"))))
08fa45b1 361 (native-inputs '())
5249045c 362 (inputs
07157e8a
LC
363 `(("zlib" ,zlib)
364 ("bzip2" ,bzip2)
5249045c
MW
365 ("curl" ,curl)
366 ("readline" ,readline)
367 ("libgpg-error" ,libgpg-error)))
368 (arguments
29d90757
LF
369 `(#:phases
370 (modify-phases %standard-phases
371 (add-after 'unpack 'patch-check-sh
372 (lambda _
373 (substitute* "checks/Makefile.in"
b17f7238
MW
374 (("/bin/sh") (which "sh")))
375 #t)))))))
5249045c 376
09d5c166
AE
377(define-public gpgme
378 (package
379 (name "gpgme")
df9f6289 380 (version "1.11.1")
09d5c166
AE
381 (source
382 (origin
383 (method url-fetch)
384 (uri (string-append "mirror://gnupg/gpgme/gpgme-" version
385 ".tar.bz2"))
386 (sha256
387 (base32
df9f6289 388 "0vxx5xaag3rhp4g2arp5qm77gvz4kj0m3hnpvhkdvqyjfhbi26rd"))))
09d5c166 389 (build-system gnu-build-system)
b3ecb3fe
LF
390 (native-inputs
391 `(("gnupg" ,gnupg)))
68640c3c
MW
392 (propagated-inputs
393 ;; Needs to be propagated because gpgme.h includes gpg-error.h.
df9f6289 394 `(("libgpg-error" ,libgpg-error-1.31)))
09d5c166 395 (inputs
b3ecb3fe 396 `(("libassuan" ,libassuan)))
72fb1b24 397 (home-page "https://www.gnupg.org/related_software/gpgme/")
35b9e423 398 (synopsis "Library providing simplified access to GnuPG functionality")
09d5c166
AE
399 (description
400 "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
401easier for applications. It provides a High-Level Crypto API for encryption,
402decryption, signing, signature verification and key management. Currently
403it uses GnuPG as its backend but the API isn't restricted to this engine.
404
405Because the direct use of GnuPG from an application can be a complicated
406programming task, it is suggested that all software should try to use GPGME
407instead. This way bug fixes or improvements can be done at a central place
408and every application benefits from this.")
07157e8a 409 (license license:lgpl2.1+)))
09d5c166 410
6b982a78
HG
411(define-public qgpgme
412 (package
413 (inherit gpgme)
414 (name "qgpgme")
415 (arguments
416 `(#:phases
417 (modify-phases %standard-phases
418 (add-before 'build 'chdir-and-symlink
419 (lambda* (#:key inputs #:allow-other-keys)
420 (let ((gpgme (assoc-ref inputs "gpgme")))
421 (symlink (string-append gpgme "/lib/libgpgmepp.la")
422 "lang/cpp/src/libgpgmepp.la")
423 (symlink (string-append gpgme "/lib/libgpgme.la")
424 "src/libgpgme.la"))
425 (chdir "lang/qt")
426 #t)))))
427 (native-inputs
0684f1d6
LF
428 `(("pkg-config" ,pkg-config)
429 ,@(package-native-inputs gpgme)))
6b982a78
HG
430 (inputs
431 `(("gpgme" ,gpgme)
432 ("qtbase" ,qtbase)
433 ,@(package-inputs gpgme)))
434 (synopsis "Qt API bindings for gpgme")
435 (description "QGpgme provides a very high level Qt API around GpgMEpp.
436
437QGpgME was originally developed as part of libkleo and incorporated into
438gpgpme starting with version 1.7.")
439 (license license:gpl2+))) ;; Note: this differs from gpgme
440
e3dd1f0c
LF
441(define-public python-gpg
442 (package
443 (name "python-gpg")
99c63f3f 444 (version "1.8.0")
e3dd1f0c
LF
445 (source (origin
446 (method url-fetch)
447 (uri (pypi-uri "gpg" version))
448 (sha256
449 (base32
450 "1x74i6q713c0bckls7rdm8kgsmllf9qvy9x62jghszlhgjkyh9nd"))))
451 (build-system python-build-system)
452 (arguments
453 '(#:tests? #f)) ; No test suite.
454 (inputs
455 `(("gpgme" ,gpgme)))
456 (native-inputs
457 `(("swig" ,swig)))
458 (home-page (package-home-page gpgme))
459 (synopsis "Python bindings for GPGME GnuPG cryptography library")
460 (description "This package provides Python bindings to the GPGME GnuPG
461cryptographic library. It is developed in the GPGME source code, and then
462distributed separately.")
463 (license license:lgpl2.1+)))
464
465(define-public python2-gpg
466 (package-with-python2 python-gpg))
467
a05d1d82
CAW
468(define-public python-pygpgme
469 (package
470 (name "python-pygpgme")
471 (version "0.3")
472 (source
473 (origin
474 (method url-fetch)
475 (uri (pypi-uri "pygpgme" version))
476 (sha256
477 (base32
478 "1q82p3gs6lwq8j8dxk4pvrwk3jpww1zqcjrzznl9clh10z28gn2z"))
479 ;; Unfortunately, we have to disable some tests due to some gpg-agent
480 ;; goofiness... see:
481 ;; https://bugs.launchpad.net/pygpgme/+bug/999949
1c9cea74
LF
482 (patches (search-patches "pygpgme-disable-problematic-tests.patch"
483 "python-pygpgme-fix-pinentry-tests.patch"))))
a05d1d82
CAW
484 (arguments
485 `(#:phases
486 (modify-phases %standard-phases
487 (add-before 'build 'make-build
488 (lambda _
489 (zero? (system* "make" "build"))))
490 (replace 'check
491 (lambda _
492 (zero? (system* "make" "check")))))))
493 (build-system python-build-system)
e6f63412
LF
494 (native-inputs
495 `(("gnupg" ,gnupg-1)))
a05d1d82 496 (inputs
e6f63412 497 `(("gpgme" ,gpgme)))
a05d1d82
CAW
498 (home-page "https://launchpad.net/pygpgme")
499 (synopsis "Python module for working with OpenPGP messages")
500 (description
501 "PyGPGME is a Python module that lets you sign, verify, encrypt and
502decrypt messages using the OpenPGP format by making use of GPGME.")
503 (license license:lgpl2.1+)))
504
505(define-public python2-pygpgme
5c31f4aa 506 (package-with-python2 python-pygpgme))
a05d1d82 507
22af9029
RW
508(define-public python-gnupg
509 (package
510 (name "python-gnupg")
ff76a1e9 511 (version "0.4.3")
22af9029
RW
512 (source
513 (origin
514 (method url-fetch)
5b669ba1 515 (uri (pypi-uri "python-gnupg" version))
22af9029
RW
516 (sha256
517 (base32
ff76a1e9 518 "03dc8whhvk7ccspbk8vzfhkxli8cd9zfbss5p597g4jldgy8s59d"))))
22af9029
RW
519 (build-system python-build-system)
520 (arguments
521 `(#:phases
522 (modify-phases %standard-phases
523 (replace 'check
ec089763
RW
524 (lambda _
525 (substitute* "test_gnupg.py"
ec089763
RW
526 ;; Unsure why this test fails.
527 (("'test_search_keys'") "True")
528 (("def test_search_keys") "def disabled__search_keys"))
529 (setenv "USERNAME" "guixbuilder")
530 ;; The doctests are extremely slow and sometimes time out,
531 ;; so we disable them.
532 (zero? (system* "python"
533 "test_gnupg.py" "--no-doctests")))))))
22af9029
RW
534 (native-inputs
535 `(("gnupg" ,gnupg-1)))
72fb1b24 536 (home-page "https://packages.python.org/python-gnupg/index.html")
22af9029
RW
537 (synopsis "Wrapper for the GNU Privacy Guard")
538 (description
539 "This module allows easy access to GnuPG’s key management, encryption
540and signature functionality from Python programs.")
541 (license license:bsd-3)))
542
543(define-public python2-gnupg
544 (package-with-python2 python-gnupg))
545
34ef5755
CB
546(define-public perl-gnupg-interface
547 (package
548 (name "perl-gnupg-interface")
549 (version "0.52")
9c2d0a03
RW
550 (source (origin
551 (method url-fetch)
552 (uri (string-append "mirror://cpan/authors/id/A/AL/ALEXMV/"
553 "GnuPG-Interface-" version ".tar.gz"))
554 (sha256
555 (base32
556 "0dgx8yhdsmhkazcrz14n4flrk1afv7azgl003hl4arxvi1d9yyi4"))))
34ef5755
CB
557 (build-system perl-build-system)
558 (arguments
9c2d0a03
RW
559 `(#:phases
560 (modify-phases %standard-phases
561 ;; FIXME: This test fails for unknown reasons
562 (add-after 'unpack 'delete-broken-test
563 (lambda _
564 (delete-file "t/encrypt_symmetrically.t")
565 #t)))))
34ef5755 566 (inputs
9c2d0a03 567 `(("gnupg" ,gnupg-1)))
34ef5755
CB
568 (propagated-inputs
569 `(("perl-moo" ,perl-moo)
9c2d0a03
RW
570 ("perl-moox-handlesvia" ,perl-moox-handlesvia)
571 ("perl-moox-late" ,perl-moox-late)))
572 (native-inputs
573 `(("which" ,which)
574 ("perl-module-install" ,perl-module-install)))
575 (home-page "http://search.cpan.org/dist/GnuPG-Interface/")
34ef5755 576 (synopsis "Perl interface to GnuPG")
9c2d0a03
RW
577 (description "@code{GnuPG::Interface} and its associated modules are
578designed to provide an object-oriented method for interacting with GnuPG,
579being able to perform functions such as but not limited to encrypting,
580signing, decryption, verification, and key-listing parsing.")
34ef5755
CB
581 (license license:perl-license)))
582
ea4d96c6 583(define-public pius
cda0ef04
TS
584 (package
585 (name "pius")
66eb91be 586 (version "2.2.6")
cda0ef04
TS
587 (source (origin
588 (method url-fetch)
589 (uri (string-append
590 "https://github.com/jaymzh/pius/releases/download/v"
591 version "/pius-" version ".tar.bz2"))
592 (sha256
593 (base32
a92d9726
AE
594 "1893hzpx3zv724drqv48csrn0cm98xw4ymb1zmhs2jvjj1778zfj"))
595 (patches (search-patches "pius.patch"))))
cda0ef04
TS
596 (build-system python-build-system)
597 (inputs `(("perl" ,perl) ;for 'pius-party-worksheet'
fcb1dd99
AE
598 ("gpg" ,gnupg)
599 ("python-six" ,python2-six)))
cda0ef04
TS
600 (arguments
601 `(#:tests? #f
602 #:python ,python-2 ;uses the Python 2 'print' syntax
603 #:phases
604 (modify-phases %standard-phases
605 (add-before
606 'build 'set-gpg-file-name
607 (lambda* (#:key inputs outputs #:allow-other-keys)
608 (let* ((gpg (string-append (assoc-ref inputs "gpg")
609 "/bin/gpg")))
610 (substitute* "libpius/constants.py"
611 (("/usr/bin/gpg2") gpg))
612 #t))))))
613 (synopsis "Programs to simplify GnuPG key signing")
614 (description
615 "Pius (PGP Individual UID Signer) helps attendees of PGP keysigning
35b9e423
EB
616parties. It is the main utility and makes it possible to quickly and easily
617sign each UID on a set of PGP keys. It is designed to take the pain out of
ea4d96c6
AE
618the sign-all-the-keys part of PGP Keysigning Party while adding security
619to the process.
620
621pius-keyring-mgr and pius-party-worksheet help organisers of
622PGP keysigning parties.")
cda0ef04
TS
623 (license license:gpl2)
624 (home-page "https://www.phildev.net/pius/index.shtml")))
96be765c
AE
625
626(define-public signing-party
831f07a0
LC
627 ;; Upstream moved from alioth.debian.org to salsa.debian.org but the
628 ;; automatic svn import did not preserve tags apparently, so there's no real
629 ;; version number.
630 (let ((commit "d6f2296325605ee96ddf9f5b156e5e3f667a6df3")
631 (revision "0"))
632 (package
633 (name "signing-party")
634 (version (git-version "2.6" revision commit))
635 (home-page "https://salsa.debian.org/stappers/pgp-tools")
636 (source (origin
637 (method git-fetch)
638 (uri (git-reference
639 (url home-page)
640 (commit commit)))
641 (sha256
642 (base32
643 "00f7zasbwcbjzd92br2j10pyjxv0aw1qb4540qfz2dxzxgmdscrz"))))
644 (build-system gnu-build-system)
645 (native-inputs
646 `(("autoconf" ,autoconf-wrapper)
647 ("automake" ,automake)))
648 (inputs `(("perl" ,perl)
649 ("perl-text-template" ,perl-text-template)
650 ("perl-mime-tools" ,perl-mime-tools)
651 ("perl-gnupg-interface" ,perl-gnupg-interface)
652 ("perl-net-idn-encode" ,perl-net-idn-encode)
653 ("libmd" ,libmd)))
654 (arguments
655 `(#:tests? #f
656 #:phases
657 (modify-phases %standard-phases
658 (replace 'configure
659 (lambda* (#:key outputs #:allow-other-keys)
660 (let ((out (assoc-ref outputs "out")))
661 (substitute* "keyanalyze/Makefile"
662 (("LDLIBS") (string-append "CC=" (which "gcc") "\nLDLIBS")))
663 (substitute* "keyanalyze/Makefile"
664 (("\\./configure") (string-append "./configure --prefix=" out)))
665 (substitute* "gpgwrap/Makefile"
666 (("\\} clean")
667 (string-append "} clean\ninstall:\n\tinstall -D bin/gpgwrap "
668 out "/bin/gpgwrap\n")))
669 (substitute* '("gpgsigs/Makefile" "keyanalyze/Makefile"
670 "keylookup/Makefile" "sig2dot/Makefile"
671 "springgraph/Makefile")
672 (("/usr") out))
673 (setenv "CONFIG_SHELL" (which "sh")))))
674 (replace 'install
675 (lambda* (#:key outputs #:allow-other-keys #:rest args)
676 (let ((out (assoc-ref outputs "out"))
677 (install (assoc-ref %standard-phases 'install)))
678 (apply install args)
679 (for-each
680 (lambda (dir file)
681 (copy-file (string-append dir "/" file)
682 (string-append out "/bin/" file)))
683 '("caff" "caff" "caff" "gpgdir" "gpg-key2ps"
684 "gpglist" "gpg-mailkeys" "gpgparticipants")
685 '("caff" "pgp-clean" "pgp-fixkey" "gpgdir" "gpg-key2ps"
686 "gpglist" "gpg-mailkeys" "gpgparticipants"))
687 (for-each
688 (lambda (dir file)
689 (copy-file (string-append dir "/" file)
690 (string-append out "/share/man/man1/" file)))
691 '("caff" "caff" "caff" "gpgdir"
692 "gpg-key2ps" "gpglist" "gpg-mailkeys"
693 "gpgparticipants" "gpgsigs" "gpgwrap/doc"
694 "keyanalyze" "keyanalyze/pgpring" "keyanalyze")
695 '("caff.1" "pgp-clean.1" "pgp-fixkey.1" "gpgdir.1"
696 "gpg-key2ps.1" "gpglist.1" "gpg-mailkeys.1"
697 "gpgparticipants.1" "gpgsigs.1" "gpgwrap.1"
698 "process_keys.1" "pgpring.1" "keyanalyze.1")))))
699 (add-after 'install 'wrap-programs
700 (lambda* (#:key outputs #:allow-other-keys)
701 (let* ((out (assoc-ref outputs "out")))
702 (wrap-program
703 (string-append out "/bin/caff")
704 `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))))))))
705 (synopsis "Collection of scripts for simplifying gnupg key signing")
706 (description
707 "Signing-party is a collection for all kinds of PGP/GnuPG related things,
96be765c 708including tools for signing keys, keyring analysis, and party preparation.
7ac53403
EF
709@enumerate
710@item caff: CA - Fire and Forget signs and mails a key
711@item pgp-clean: removes all non-self signatures from key
712@item pgp-fixkey: removes broken packets from keys
713@item gpg-mailkeys: simply mail out a signed key to its owner
714@item gpg-key2ps: generate PostScript file with fingerprint paper strips
715@item gpgdir: recursive directory encryption tool
716@item gpglist: show who signed which of your UIDs
717@item gpgsigs: annotates list of GnuPG keys with already done signatures
718@item gpgparticipants: create list of party participants for the organiser
719@item gpgwrap: a passphrase wrapper
720@item keyanalyze: minimum signing distance (MSD) analysis on keyrings
721@item keylookup: ncurses wrapper around gpg --search
722@item sig2dot: converts a list of GnuPG signatures to a .dot file
723@item springgraph: creates a graph from a .dot file
724@end enumerate")
831f07a0
LC
725 ;; gpl2+ for almost all programs, except for keyanalyze: gpl2
726 ;; and caff and gpgsigs: bsd-3, see
727 ;; http://packages.debian.org/changelogs/pool/main/s/signing-party/current/copyright
728 (license license:gpl2))))
40d806af 729
c607b701 730(define-public pinentry-tty
40d806af 731 (package
c607b701 732 (name "pinentry-tty")
4498cbd7 733 (version "1.1.0")
40d806af
LC
734 (source (origin
735 (method url-fetch)
736 (uri (string-append "mirror://gnupg/pinentry/pinentry-"
737 version ".tar.bz2"))
738 (sha256
739 (base32
4498cbd7 740 "0w35ypl960pczg5kp6km3dyr000m1hf0vpwwlh72jjkjza36c1v8"))))
40d806af 741 (build-system gnu-build-system)
c607b701
EF
742 (arguments
743 `(#:configure-flags '("--enable-pinentry-tty")))
40d806af
LC
744 (inputs
745 `(("ncurses" ,ncurses)
18ed97d6 746 ("libassuan" ,libassuan)
c607b701 747 ("libsecret" ,libsecret "out")))
40d806af
LC
748 (native-inputs
749 `(("pkg-config" ,pkg-config)))
547cb17d 750 (home-page "https://gnupg.org/aegypten2/")
40d806af
LC
751 (synopsis "GnuPG's interface to passphrase input")
752 (description
c607b701 753 "Pinentry provides a console that allows users to enter a passphrase when
9614897b 754@code{gpg} is run and needs it.")
f8457932
LC
755 (license license:gpl2+)
756 (properties '((ftp-server . "ftp.gnupg.org")
757 (ftp-directory . "/gcrypt/pinentry")
758 (upstream-name . "pinentry")))))
4380a7b4 759
abc4a332
PN
760(define-public pinentry-emacs
761 (package
762 (inherit pinentry-tty)
763 (name "pinentry-emacs")
764 (arguments
765 `(#:configure-flags '("--enable-pinentry-emacs")))
766 (description
767 "Pinentry provides a console and an Emacs interface that allows users to
768enter a passphrase when required by @code{gpg} or other software.")))
769
c607b701
EF
770(define-public pinentry-gtk2
771 (package
772 (inherit pinentry-tty)
773 (name "pinentry-gtk2")
774 (inputs
775 `(("gtk+" ,gtk+-2)
776 ("glib" ,glib)
777 ,@(package-inputs pinentry-tty)))
778 (description
779 "Pinentry provides a console and a GTK+ GUI that allows users to enter a
9614897b 780passphrase when @code{gpg} is run and needs it.")))
c607b701 781
41edb23f
CB
782(define-public pinentry-gnome3
783 (package
784 (inherit pinentry-tty)
785 (name "pinentry-gnome3")
786 (inputs
787 `(("gtk+" ,gtk+-2)
788 ("gcr" ,gcr)
789 ("glib" ,glib)
790 ,@(package-inputs pinentry-tty)))
791 (arguments
792 `(#:configure-flags '("--enable-pinentry-gnome3")))
793 (description
794 "Pinentry provides a console and a GUI designed for use with GNOME@tie{}3
795that allows users to enter a passphrase when required by @code{gpg} or other
796software.")))
c607b701 797
54df7558
EF
798(define-public pinentry-qt
799 (package
800 (inherit pinentry-tty)
801 (name "pinentry-qt")
802 (inputs
e2788cef 803 `(("qtbase" ,qtbase)
54df7558 804 ,@(package-inputs pinentry-tty)))
984ad832
DC
805 (arguments
806 `(#:configure-flags '("CXXFLAGS=-std=gnu++11")))
54df7558
EF
807 (description
808 "Pinentry provides a console and a Qt GUI that allows users to enter a
9614897b 809passphrase when @code{gpg} is run and needs it.")))
54df7558 810
940f8d39
EF
811(define-public pinentry
812 (package (inherit pinentry-gtk2)
813 (name "pinentry")))
814
4380a7b4
EB
815(define-public paperkey
816 (package
817 (name "paperkey")
ae9877fe 818 (version "1.5")
4380a7b4
EB
819 (source (origin
820 (method url-fetch)
821 (uri (string-append "http://www.jabberwocky.com/"
822 "software/paperkey/paperkey-"
823 version ".tar.gz"))
824 (sha256
825 (base32
ae9877fe 826 "1prd2jaf4zjad3xhv160hmi5n408ssljfg7iz90jxs9w111pjwy4"))))
4380a7b4
EB
827 (build-system gnu-build-system)
828 (arguments
829 `(#:phases
e379d85c
EF
830 (modify-phases %standard-phases
831 (add-before 'check 'patch-check-scripts
832 (lambda _
833 (substitute* '("checks/roundtrip.sh"
834 "checks/roundtrip-raw.sh")
835 (("/bin/echo") "echo"))
836 #t)))))
4380a7b4
EB
837 (home-page "http://www.jabberwocky.com/software/paperkey/")
838 (synopsis "Backup OpenPGP keys to paper")
839 (description
840 "Paperkey extracts the secret bytes from an OpenPGP (GnuPG, PGP, etc) key
841for printing with paper and ink, which have amazingly long retention
842qualities. To reconstruct a secret key, you re-enter those
843bytes (whether by hand, OCR, QR code, or the like) and paperkey can use
844them to transform your existing public key into a secret key.")
07157e8a 845 (license license:gpl2+)))
8384499c 846
847(define-public gpa
848 (package
849 (name "gpa")
850 (version "0.9.10")
851 (source (origin
852 (method url-fetch)
853 (uri (string-append "mirror://gnupg/gpa/"
854 name "-" version ".tar.bz2"))
855 (sha256
856 (base32
857 "09xphbi2456qynwqq5n0yh0zdmdi2ggrj3wk4hsyh5lrzlvcrff3"))))
858 (build-system gnu-build-system)
859 (native-inputs
860 `(("pkg-config" ,pkg-config)))
861 (inputs
862 `(("gnupg" ,gnupg)
863 ("gpgme" ,gpgme)
864 ("libassuan" ,libassuan)
865 ("libgpg-error" ,libgpg-error)
866 ("gtk+-2" ,gtk+-2)))
867 (home-page "https://gnupg.org/software/gpa/")
868 (synopsis "Graphical user interface for GnuPG")
869 (description
870 "GPA, the GNU Privacy Assistant, is a graphical user interface for
871@uref{https://gnupg.org, GnuPG}. It can be used to encrypt, decrypt, and sign
872files, to verify signatures, and to manage the private and public keys.")
873 (license license:gpl3+)))
5aeb6611 874
15b08442
P
875(define-public parcimonie
876 (package
877 (name "parcimonie")
878 (version "0.10.3")
879 (source (origin
880 (method url-fetch)
881 (uri (string-append "https://gaffer.ptitcanardnoir.org/"
882 "intrigeri/files/parcimonie/App-Parcimonie-"
883 version ".tar.gz"))
884 (sha256
885 (base32
886 "1kf891117s1f3k6lxvbjdb21va9gxh29vlp9bd664ssgw266rcyb"))))
887 (build-system perl-build-system)
888 (inputs
889 `(("gnupg" ,gnupg-1) ; This is the version used by perl-gnupg-interface
890 ("perl-config-general" ,perl-config-general)
891 ("perl-clone" ,perl-clone)
892 ("perl-data" ,perl-data)
893 ("perl-exporter-tiny" ,perl-exporter-tiny)
894 ("perl-file-homedir" ,perl-file-homedir)
895 ("perl-file-sharedir" ,perl-file-sharedir)
896 ("perl-file-which" ,perl-file-which)
897 ("perl-getopt-long-descriptive" ,perl-getopt-long-descriptive)
898 ("perl-gnupg-interface" ,perl-gnupg-interface)
899 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
900 ("perl-list-moreutils" ,perl-list-moreutils)
901 ("perl-libintl-perl" ,perl-libintl-perl) ; Locale::TextDomain
902 ("perl-lwp-online" ,perl-lwp-online)
903 ("perl-module-build" ,perl-module-build)
904 ("perl-module-pluggable-object" ,perl-module-pluggable)
905 ("perl-moo" ,perl-moo)
906 ("perl-moox-handlesvia" ,perl-moox-handlesvia)
907 ("perl-moox-late" ,perl-moox-late)
908 ("perl-moox-options" ,perl-moox-options)
909 ("perl-namespace-clean" ,perl-namespace-clean)
910 ("perl-net-dbus" ,perl-net-dbus)
911 ("perl-net-dbus-glib" ,perl-net-dbus-glib)
912 ("perl-path-tiny" ,perl-path-tiny)
913 ("perl-test-most" ,perl-test-most)
914 ("perl-test-trap" ,perl-test-trap)
915 ("perl-time-duration" ,perl-time-duration)
916 ("perl-time-duration-parse" ,perl-time-duration-parse)
917 ("perl-try-tiny" ,perl-try-tiny)
918 ("perl-type-tiny" ,perl-type-tiny)
919 ("perl-types-path-tiny" ,perl-types-path-tiny)
920 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
921 ("perl-xml-parser" ,perl-xml-parser)
922 ("perl-xml-twig" ,perl-xml-twig)
923 ("torsocks" ,torsocks)))
924 (arguments
925 `(#:phases
926 (modify-phases %standard-phases
927 ;; Needed for using gpg-connect-agent during tests.
928 (add-before 'check 'set-HOME
929 (lambda _ (setenv "HOME" "/tmp") #t))
930 (add-before 'install 'fix-references
931 (lambda* (#:key inputs outputs #:allow-other-keys)
932 (substitute* "lib/App/Parcimonie/GnuPG/Interface.pm"
933 (("gpg2") "gpg")
934 ;; Skip check whether dependencies are in the PATH
935 (("defined which.*") "")
936 (("call\\('parcimonie-torified-gpg'\\)")
937 (string-append "call('" (assoc-ref outputs "out")
938 "/bin/parcimonie-torified-gpg')")))
939 (substitute* "bin/parcimonie-torified-gpg"
940 (("torsocks") (string-append (assoc-ref inputs "torsocks")
941 "/bin/torsocks")))
942 #t))
943 (add-after 'install 'wrap-program
944 (lambda* (#:key inputs outputs #:allow-other-keys)
945 (let* ((out (assoc-ref outputs "out"))
946 (perllib (string-append out "/lib/perl5/site_perl/"
947 ,(package-version perl))))
948 (wrap-program (string-append out "/bin/parcimonie")
949 `("PERL5LIB" ":"
950 prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))
951 #t))))))
952 (home-page "https://gaffer.ptitcanardnoir.org/intrigeri/code/parcimonie/")
953 (synopsis "Incrementally refreshes a GnuPG keyring")
954 (description "Parcimonie incrementaly refreshes a GnuPG keyring in a way
955that makes it hard to correlate the keyring content to an individual, and
956makes it hard to locate an individual based on an identifying subset of her
957keyring content. Parcimonie is a daemon that fetches one key at a time using
958the Tor network, waits a bit, changes the Tor circuit being used, and starts
959over.")
960 (license license:gpl1+)))
607d280e
EF
961
962(define-public jetring
963 (package
964 (name "jetring")
835cf37c 965 (version "0.27")
607d280e
EF
966 (source
967 (origin
968 (method url-fetch)
969 (uri (string-append "mirror://debian/pool/main/j/" name "/"
970 name "_" version ".tar.xz"))
971 (sha256
972 (base32
835cf37c 973 "0jy0x5zj7v87xgyldlsx1knzp0mv10wzamblrw1b61i2m1ii4pxz"))))
607d280e
EF
974 (build-system gnu-build-system)
975 (arguments
976 '(#:phases
977 (modify-phases %standard-phases
978 (delete 'configure) ; no configure script
979 (add-before 'install 'hardlink-gnupg
980 (lambda* (#:key inputs #:allow-other-keys)
981 (let ((gpg (string-append (assoc-ref inputs "gnupg")
982 "/bin/gpg")))
983 (substitute* (find-files "." "jetring-[[:alpha:]]+$")
984 (("gpg -") (string-append gpg " -"))
985 (("\\\"gpg\\\"") (string-append "\"" gpg "\"")))
986 #t)))
987 (replace 'install
988 (lambda* (#:key outputs #:allow-other-keys)
989 (let* ((out (assoc-ref outputs "out"))
990 (man (string-append out "/share/man")))
991 (for-each (lambda (file)
992 (install-file file (string-append out "/bin/")))
993 (find-files "." "jetring-[[:alpha:]]+$"))
994 (for-each (lambda (file)
995 (install-file file (string-append man "/man1/")))
996 (find-files "." ".*\\.1$"))
997 (install-file "jetring.7" (string-append man "/man7/"))
998 #t))))
999 #:tests? #f)) ; no test phase
1000 (inputs
1001 `(("gnupg" ,gnupg)
1002 ("perl" ,perl)))
1003 (home-page "https://joeyh.name/code/jetring/")
1004 (synopsis "GnuPG keyring maintenance using changesets")
1005 (description
1006 "Jetring is a collection of tools that allow for gpg keyrings to be
1007maintained using changesets. It was developed with the Debian keyring in mind,
1008and aims to solve the problem that a gpg keyring is a binary blob that's hard
1009for multiple people to collaboratively edit.
1010
1011With jetring, changesets can be submitted, reviewed to see exactly what they
1012will do, applied, and used to build a keyring. The origin of every change made
1013to the keyring is available for auditing, and gpg signatures can be used for
1014integrity guarantees.")
1015 (license license:gpl2+)))