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