gnu: libgcrypt: Ungraft.
[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")
5ecd5fef 73 (version "1.29")
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
5ecd5fef 81 "1smihcrhkfy58kazjaigmfbagy52rw98fqfsv1x7ml8razx2dsgc"))))
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")
9dfbf405 111 (version "1.8.3")
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
9dfbf405 118 "0z5gs1khzyknyfjr19k8gk4q148s6q987ya85cpn0iv70fz91v36"))))
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")
216c7266 233 (version "2.2.8")
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
216c7266 240 "1k8dnnfs9888yp713l7kg2jg110lw47s4krx0njna6fjrsw4qyvp"))))
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)
b6c675c6 351 (version "1.4.23")
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
b6c675c6 358 "1fkq4sqldvf6a25mm2qz95swv1qjg464736091w51djiwqbjyin9"))))
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"
b17f7238
MW
372 (("/bin/sh") (which "sh")))
373 #t)))))))
5249045c 374
09d5c166
AE
375(define-public gpgme
376 (package
377 (name "gpgme")
df9f6289 378 (version "1.11.1")
09d5c166
AE
379 (source
380 (origin
381 (method url-fetch)
382 (uri (string-append "mirror://gnupg/gpgme/gpgme-" version
383 ".tar.bz2"))
384 (sha256
385 (base32
df9f6289 386 "0vxx5xaag3rhp4g2arp5qm77gvz4kj0m3hnpvhkdvqyjfhbi26rd"))))
09d5c166 387 (build-system gnu-build-system)
b3ecb3fe
LF
388 (native-inputs
389 `(("gnupg" ,gnupg)))
68640c3c
MW
390 (propagated-inputs
391 ;; Needs to be propagated because gpgme.h includes gpg-error.h.
df9f6289 392 `(("libgpg-error" ,libgpg-error-1.31)))
09d5c166 393 (inputs
b3ecb3fe 394 `(("libassuan" ,libassuan)))
72fb1b24 395 (home-page "https://www.gnupg.org/related_software/gpgme/")
35b9e423 396 (synopsis "Library providing simplified access to GnuPG functionality")
09d5c166
AE
397 (description
398 "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
399easier for applications. It provides a High-Level Crypto API for encryption,
400decryption, signing, signature verification and key management. Currently
401it uses GnuPG as its backend but the API isn't restricted to this engine.
402
403Because the direct use of GnuPG from an application can be a complicated
404programming task, it is suggested that all software should try to use GPGME
405instead. This way bug fixes or improvements can be done at a central place
406and every application benefits from this.")
07157e8a 407 (license license:lgpl2.1+)))
09d5c166 408
6b982a78
HG
409(define-public qgpgme
410 (package
411 (inherit gpgme)
412 (name "qgpgme")
413 (arguments
414 `(#:phases
415 (modify-phases %standard-phases
416 (add-before 'build 'chdir-and-symlink
417 (lambda* (#:key inputs #:allow-other-keys)
418 (let ((gpgme (assoc-ref inputs "gpgme")))
419 (symlink (string-append gpgme "/lib/libgpgmepp.la")
420 "lang/cpp/src/libgpgmepp.la")
421 (symlink (string-append gpgme "/lib/libgpgme.la")
422 "src/libgpgme.la"))
423 (chdir "lang/qt")
424 #t)))))
425 (native-inputs
0684f1d6
LF
426 `(("pkg-config" ,pkg-config)
427 ,@(package-native-inputs gpgme)))
6b982a78
HG
428 (inputs
429 `(("gpgme" ,gpgme)
430 ("qtbase" ,qtbase)
431 ,@(package-inputs gpgme)))
432 (synopsis "Qt API bindings for gpgme")
433 (description "QGpgme provides a very high level Qt API around GpgMEpp.
434
435QGpgME was originally developed as part of libkleo and incorporated into
436gpgpme starting with version 1.7.")
437 (license license:gpl2+))) ;; Note: this differs from gpgme
438
e3dd1f0c
LF
439(define-public python-gpg
440 (package
441 (name "python-gpg")
99c63f3f 442 (version "1.8.0")
e3dd1f0c
LF
443 (source (origin
444 (method url-fetch)
445 (uri (pypi-uri "gpg" version))
446 (sha256
447 (base32
448 "1x74i6q713c0bckls7rdm8kgsmllf9qvy9x62jghszlhgjkyh9nd"))))
449 (build-system python-build-system)
450 (arguments
451 '(#:tests? #f)) ; No test suite.
452 (inputs
453 `(("gpgme" ,gpgme)))
454 (native-inputs
455 `(("swig" ,swig)))
456 (home-page (package-home-page gpgme))
457 (synopsis "Python bindings for GPGME GnuPG cryptography library")
458 (description "This package provides Python bindings to the GPGME GnuPG
459cryptographic library. It is developed in the GPGME source code, and then
460distributed separately.")
461 (license license:lgpl2.1+)))
462
463(define-public python2-gpg
464 (package-with-python2 python-gpg))
465
a05d1d82
CAW
466(define-public python-pygpgme
467 (package
468 (name "python-pygpgme")
469 (version "0.3")
470 (source
471 (origin
472 (method url-fetch)
473 (uri (pypi-uri "pygpgme" version))
474 (sha256
475 (base32
476 "1q82p3gs6lwq8j8dxk4pvrwk3jpww1zqcjrzznl9clh10z28gn2z"))
477 ;; Unfortunately, we have to disable some tests due to some gpg-agent
478 ;; goofiness... see:
479 ;; https://bugs.launchpad.net/pygpgme/+bug/999949
1c9cea74
LF
480 (patches (search-patches "pygpgme-disable-problematic-tests.patch"
481 "python-pygpgme-fix-pinentry-tests.patch"))))
a05d1d82
CAW
482 (arguments
483 `(#:phases
484 (modify-phases %standard-phases
485 (add-before 'build 'make-build
486 (lambda _
487 (zero? (system* "make" "build"))))
488 (replace 'check
489 (lambda _
490 (zero? (system* "make" "check")))))))
491 (build-system python-build-system)
e6f63412
LF
492 (native-inputs
493 `(("gnupg" ,gnupg-1)))
a05d1d82 494 (inputs
e6f63412 495 `(("gpgme" ,gpgme)))
a05d1d82
CAW
496 (home-page "https://launchpad.net/pygpgme")
497 (synopsis "Python module for working with OpenPGP messages")
498 (description
499 "PyGPGME is a Python module that lets you sign, verify, encrypt and
500decrypt messages using the OpenPGP format by making use of GPGME.")
501 (license license:lgpl2.1+)))
502
503(define-public python2-pygpgme
5c31f4aa 504 (package-with-python2 python-pygpgme))
a05d1d82 505
22af9029
RW
506(define-public python-gnupg
507 (package
508 (name "python-gnupg")
ff76a1e9 509 (version "0.4.3")
22af9029
RW
510 (source
511 (origin
512 (method url-fetch)
5b669ba1 513 (uri (pypi-uri "python-gnupg" version))
22af9029
RW
514 (sha256
515 (base32
ff76a1e9 516 "03dc8whhvk7ccspbk8vzfhkxli8cd9zfbss5p597g4jldgy8s59d"))))
22af9029
RW
517 (build-system python-build-system)
518 (arguments
519 `(#:phases
520 (modify-phases %standard-phases
521 (replace 'check
ec089763
RW
522 (lambda _
523 (substitute* "test_gnupg.py"
ec089763
RW
524 ;; Unsure why this test fails.
525 (("'test_search_keys'") "True")
526 (("def test_search_keys") "def disabled__search_keys"))
527 (setenv "USERNAME" "guixbuilder")
528 ;; The doctests are extremely slow and sometimes time out,
529 ;; so we disable them.
b262aba7
TGR
530 (invoke "python"
531 "test_gnupg.py" "--no-doctests"))))))
22af9029
RW
532 (native-inputs
533 `(("gnupg" ,gnupg-1)))
72fb1b24 534 (home-page "https://packages.python.org/python-gnupg/index.html")
22af9029
RW
535 (synopsis "Wrapper for the GNU Privacy Guard")
536 (description
537 "This module allows easy access to GnuPG’s key management, encryption
538and signature functionality from Python programs.")
539 (license license:bsd-3)))
540
541(define-public python2-gnupg
542 (package-with-python2 python-gnupg))
543
34ef5755
CB
544(define-public perl-gnupg-interface
545 (package
546 (name "perl-gnupg-interface")
547 (version "0.52")
9c2d0a03
RW
548 (source (origin
549 (method url-fetch)
550 (uri (string-append "mirror://cpan/authors/id/A/AL/ALEXMV/"
551 "GnuPG-Interface-" version ".tar.gz"))
552 (sha256
553 (base32
554 "0dgx8yhdsmhkazcrz14n4flrk1afv7azgl003hl4arxvi1d9yyi4"))))
34ef5755
CB
555 (build-system perl-build-system)
556 (arguments
9c2d0a03
RW
557 `(#:phases
558 (modify-phases %standard-phases
559 ;; FIXME: This test fails for unknown reasons
560 (add-after 'unpack 'delete-broken-test
561 (lambda _
562 (delete-file "t/encrypt_symmetrically.t")
563 #t)))))
34ef5755 564 (inputs
9c2d0a03 565 `(("gnupg" ,gnupg-1)))
34ef5755
CB
566 (propagated-inputs
567 `(("perl-moo" ,perl-moo)
9c2d0a03
RW
568 ("perl-moox-handlesvia" ,perl-moox-handlesvia)
569 ("perl-moox-late" ,perl-moox-late)))
570 (native-inputs
571 `(("which" ,which)
572 ("perl-module-install" ,perl-module-install)))
573 (home-page "http://search.cpan.org/dist/GnuPG-Interface/")
34ef5755 574 (synopsis "Perl interface to GnuPG")
9c2d0a03
RW
575 (description "@code{GnuPG::Interface} and its associated modules are
576designed to provide an object-oriented method for interacting with GnuPG,
577being able to perform functions such as but not limited to encrypting,
578signing, decryption, verification, and key-listing parsing.")
34ef5755
CB
579 (license license:perl-license)))
580
ea4d96c6 581(define-public pius
cda0ef04
TS
582 (package
583 (name "pius")
66eb91be 584 (version "2.2.6")
cda0ef04
TS
585 (source (origin
586 (method url-fetch)
587 (uri (string-append
588 "https://github.com/jaymzh/pius/releases/download/v"
589 version "/pius-" version ".tar.bz2"))
590 (sha256
591 (base32
a92d9726
AE
592 "1893hzpx3zv724drqv48csrn0cm98xw4ymb1zmhs2jvjj1778zfj"))
593 (patches (search-patches "pius.patch"))))
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
831f07a0
LC
625 ;; Upstream moved from alioth.debian.org to salsa.debian.org but the
626 ;; automatic svn import did not preserve tags apparently, so there's no real
627 ;; version number.
628 (let ((commit "d6f2296325605ee96ddf9f5b156e5e3f667a6df3")
629 (revision "0"))
630 (package
631 (name "signing-party")
632 (version (git-version "2.6" revision commit))
633 (home-page "https://salsa.debian.org/stappers/pgp-tools")
634 (source (origin
635 (method git-fetch)
636 (uri (git-reference
637 (url home-page)
638 (commit commit)))
639 (sha256
640 (base32
641 "00f7zasbwcbjzd92br2j10pyjxv0aw1qb4540qfz2dxzxgmdscrz"))))
642 (build-system gnu-build-system)
643 (native-inputs
644 `(("autoconf" ,autoconf-wrapper)
645 ("automake" ,automake)))
646 (inputs `(("perl" ,perl)
647 ("perl-text-template" ,perl-text-template)
648 ("perl-mime-tools" ,perl-mime-tools)
649 ("perl-gnupg-interface" ,perl-gnupg-interface)
650 ("perl-net-idn-encode" ,perl-net-idn-encode)
651 ("libmd" ,libmd)))
652 (arguments
653 `(#:tests? #f
654 #:phases
655 (modify-phases %standard-phases
656 (replace 'configure
657 (lambda* (#:key outputs #:allow-other-keys)
658 (let ((out (assoc-ref outputs "out")))
659 (substitute* "keyanalyze/Makefile"
660 (("LDLIBS") (string-append "CC=" (which "gcc") "\nLDLIBS")))
661 (substitute* "keyanalyze/Makefile"
662 (("\\./configure") (string-append "./configure --prefix=" out)))
663 (substitute* "gpgwrap/Makefile"
664 (("\\} clean")
665 (string-append "} clean\ninstall:\n\tinstall -D bin/gpgwrap "
666 out "/bin/gpgwrap\n")))
667 (substitute* '("gpgsigs/Makefile" "keyanalyze/Makefile"
668 "keylookup/Makefile" "sig2dot/Makefile"
669 "springgraph/Makefile")
670 (("/usr") out))
671 (setenv "CONFIG_SHELL" (which "sh")))))
672 (replace 'install
673 (lambda* (#:key outputs #:allow-other-keys #:rest args)
674 (let ((out (assoc-ref outputs "out"))
675 (install (assoc-ref %standard-phases 'install)))
676 (apply install args)
677 (for-each
678 (lambda (dir file)
679 (copy-file (string-append dir "/" file)
680 (string-append out "/bin/" file)))
681 '("caff" "caff" "caff" "gpgdir" "gpg-key2ps"
682 "gpglist" "gpg-mailkeys" "gpgparticipants")
683 '("caff" "pgp-clean" "pgp-fixkey" "gpgdir" "gpg-key2ps"
684 "gpglist" "gpg-mailkeys" "gpgparticipants"))
685 (for-each
686 (lambda (dir file)
687 (copy-file (string-append dir "/" file)
688 (string-append out "/share/man/man1/" file)))
689 '("caff" "caff" "caff" "gpgdir"
690 "gpg-key2ps" "gpglist" "gpg-mailkeys"
691 "gpgparticipants" "gpgsigs" "gpgwrap/doc"
692 "keyanalyze" "keyanalyze/pgpring" "keyanalyze")
693 '("caff.1" "pgp-clean.1" "pgp-fixkey.1" "gpgdir.1"
694 "gpg-key2ps.1" "gpglist.1" "gpg-mailkeys.1"
695 "gpgparticipants.1" "gpgsigs.1" "gpgwrap.1"
696 "process_keys.1" "pgpring.1" "keyanalyze.1")))))
697 (add-after 'install 'wrap-programs
698 (lambda* (#:key outputs #:allow-other-keys)
699 (let* ((out (assoc-ref outputs "out")))
700 (wrap-program
701 (string-append out "/bin/caff")
702 `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))))))))
703 (synopsis "Collection of scripts for simplifying gnupg key signing")
704 (description
705 "Signing-party is a collection for all kinds of PGP/GnuPG related things,
96be765c 706including tools for signing keys, keyring analysis, and party preparation.
7ac53403
EF
707@enumerate
708@item caff: CA - Fire and Forget signs and mails a key
709@item pgp-clean: removes all non-self signatures from key
710@item pgp-fixkey: removes broken packets from keys
711@item gpg-mailkeys: simply mail out a signed key to its owner
712@item gpg-key2ps: generate PostScript file with fingerprint paper strips
713@item gpgdir: recursive directory encryption tool
714@item gpglist: show who signed which of your UIDs
715@item gpgsigs: annotates list of GnuPG keys with already done signatures
716@item gpgparticipants: create list of party participants for the organiser
717@item gpgwrap: a passphrase wrapper
718@item keyanalyze: minimum signing distance (MSD) analysis on keyrings
719@item keylookup: ncurses wrapper around gpg --search
720@item sig2dot: converts a list of GnuPG signatures to a .dot file
721@item springgraph: creates a graph from a .dot file
722@end enumerate")
831f07a0
LC
723 ;; gpl2+ for almost all programs, except for keyanalyze: gpl2
724 ;; and caff and gpgsigs: bsd-3, see
725 ;; http://packages.debian.org/changelogs/pool/main/s/signing-party/current/copyright
726 (license license:gpl2))))
40d806af 727
c607b701 728(define-public pinentry-tty
40d806af 729 (package
c607b701 730 (name "pinentry-tty")
4498cbd7 731 (version "1.1.0")
40d806af
LC
732 (source (origin
733 (method url-fetch)
734 (uri (string-append "mirror://gnupg/pinentry/pinentry-"
735 version ".tar.bz2"))
736 (sha256
737 (base32
4498cbd7 738 "0w35ypl960pczg5kp6km3dyr000m1hf0vpwwlh72jjkjza36c1v8"))))
40d806af 739 (build-system gnu-build-system)
c607b701
EF
740 (arguments
741 `(#:configure-flags '("--enable-pinentry-tty")))
40d806af
LC
742 (inputs
743 `(("ncurses" ,ncurses)
18ed97d6 744 ("libassuan" ,libassuan)
c607b701 745 ("libsecret" ,libsecret "out")))
40d806af
LC
746 (native-inputs
747 `(("pkg-config" ,pkg-config)))
547cb17d 748 (home-page "https://gnupg.org/aegypten2/")
40d806af
LC
749 (synopsis "GnuPG's interface to passphrase input")
750 (description
c607b701 751 "Pinentry provides a console that allows users to enter a passphrase when
9614897b 752@code{gpg} is run and needs it.")
f8457932
LC
753 (license license:gpl2+)
754 (properties '((ftp-server . "ftp.gnupg.org")
755 (ftp-directory . "/gcrypt/pinentry")
756 (upstream-name . "pinentry")))))
4380a7b4 757
abc4a332
PN
758(define-public pinentry-emacs
759 (package
760 (inherit pinentry-tty)
761 (name "pinentry-emacs")
762 (arguments
763 `(#:configure-flags '("--enable-pinentry-emacs")))
764 (description
765 "Pinentry provides a console and an Emacs interface that allows users to
766enter a passphrase when required by @code{gpg} or other software.")))
767
c607b701
EF
768(define-public pinentry-gtk2
769 (package
770 (inherit pinentry-tty)
771 (name "pinentry-gtk2")
772 (inputs
773 `(("gtk+" ,gtk+-2)
774 ("glib" ,glib)
775 ,@(package-inputs pinentry-tty)))
776 (description
777 "Pinentry provides a console and a GTK+ GUI that allows users to enter a
9614897b 778passphrase when @code{gpg} is run and needs it.")))
c607b701 779
41edb23f
CB
780(define-public pinentry-gnome3
781 (package
782 (inherit pinentry-tty)
783 (name "pinentry-gnome3")
784 (inputs
785 `(("gtk+" ,gtk+-2)
786 ("gcr" ,gcr)
787 ("glib" ,glib)
788 ,@(package-inputs pinentry-tty)))
789 (arguments
790 `(#:configure-flags '("--enable-pinentry-gnome3")))
791 (description
792 "Pinentry provides a console and a GUI designed for use with GNOME@tie{}3
793that allows users to enter a passphrase when required by @code{gpg} or other
794software.")))
c607b701 795
54df7558
EF
796(define-public pinentry-qt
797 (package
798 (inherit pinentry-tty)
799 (name "pinentry-qt")
800 (inputs
e2788cef 801 `(("qtbase" ,qtbase)
54df7558 802 ,@(package-inputs pinentry-tty)))
984ad832
DC
803 (arguments
804 `(#:configure-flags '("CXXFLAGS=-std=gnu++11")))
54df7558
EF
805 (description
806 "Pinentry provides a console and a Qt GUI that allows users to enter a
9614897b 807passphrase when @code{gpg} is run and needs it.")))
54df7558 808
940f8d39
EF
809(define-public pinentry
810 (package (inherit pinentry-gtk2)
811 (name "pinentry")))
812
4380a7b4
EB
813(define-public paperkey
814 (package
815 (name "paperkey")
ae9877fe 816 (version "1.5")
4380a7b4
EB
817 (source (origin
818 (method url-fetch)
819 (uri (string-append "http://www.jabberwocky.com/"
820 "software/paperkey/paperkey-"
821 version ".tar.gz"))
822 (sha256
823 (base32
ae9877fe 824 "1prd2jaf4zjad3xhv160hmi5n408ssljfg7iz90jxs9w111pjwy4"))))
4380a7b4
EB
825 (build-system gnu-build-system)
826 (arguments
827 `(#:phases
e379d85c
EF
828 (modify-phases %standard-phases
829 (add-before 'check 'patch-check-scripts
830 (lambda _
831 (substitute* '("checks/roundtrip.sh"
832 "checks/roundtrip-raw.sh")
833 (("/bin/echo") "echo"))
834 #t)))))
4380a7b4
EB
835 (home-page "http://www.jabberwocky.com/software/paperkey/")
836 (synopsis "Backup OpenPGP keys to paper")
837 (description
838 "Paperkey extracts the secret bytes from an OpenPGP (GnuPG, PGP, etc) key
839for printing with paper and ink, which have amazingly long retention
840qualities. To reconstruct a secret key, you re-enter those
841bytes (whether by hand, OCR, QR code, or the like) and paperkey can use
842them to transform your existing public key into a secret key.")
07157e8a 843 (license license:gpl2+)))
8384499c 844
845(define-public gpa
846 (package
847 (name "gpa")
848 (version "0.9.10")
849 (source (origin
850 (method url-fetch)
851 (uri (string-append "mirror://gnupg/gpa/"
852 name "-" version ".tar.bz2"))
853 (sha256
854 (base32
855 "09xphbi2456qynwqq5n0yh0zdmdi2ggrj3wk4hsyh5lrzlvcrff3"))))
856 (build-system gnu-build-system)
857 (native-inputs
858 `(("pkg-config" ,pkg-config)))
859 (inputs
860 `(("gnupg" ,gnupg)
861 ("gpgme" ,gpgme)
862 ("libassuan" ,libassuan)
863 ("libgpg-error" ,libgpg-error)
864 ("gtk+-2" ,gtk+-2)))
865 (home-page "https://gnupg.org/software/gpa/")
866 (synopsis "Graphical user interface for GnuPG")
867 (description
868 "GPA, the GNU Privacy Assistant, is a graphical user interface for
869@uref{https://gnupg.org, GnuPG}. It can be used to encrypt, decrypt, and sign
870files, to verify signatures, and to manage the private and public keys.")
871 (license license:gpl3+)))
5aeb6611 872
15b08442
P
873(define-public parcimonie
874 (package
875 (name "parcimonie")
876 (version "0.10.3")
877 (source (origin
878 (method url-fetch)
879 (uri (string-append "https://gaffer.ptitcanardnoir.org/"
880 "intrigeri/files/parcimonie/App-Parcimonie-"
881 version ".tar.gz"))
882 (sha256
883 (base32
884 "1kf891117s1f3k6lxvbjdb21va9gxh29vlp9bd664ssgw266rcyb"))))
885 (build-system perl-build-system)
886 (inputs
887 `(("gnupg" ,gnupg-1) ; This is the version used by perl-gnupg-interface
888 ("perl-config-general" ,perl-config-general)
889 ("perl-clone" ,perl-clone)
890 ("perl-data" ,perl-data)
891 ("perl-exporter-tiny" ,perl-exporter-tiny)
892 ("perl-file-homedir" ,perl-file-homedir)
893 ("perl-file-sharedir" ,perl-file-sharedir)
894 ("perl-file-which" ,perl-file-which)
895 ("perl-getopt-long-descriptive" ,perl-getopt-long-descriptive)
896 ("perl-gnupg-interface" ,perl-gnupg-interface)
897 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
898 ("perl-list-moreutils" ,perl-list-moreutils)
899 ("perl-libintl-perl" ,perl-libintl-perl) ; Locale::TextDomain
900 ("perl-lwp-online" ,perl-lwp-online)
901 ("perl-module-build" ,perl-module-build)
902 ("perl-module-pluggable-object" ,perl-module-pluggable)
903 ("perl-moo" ,perl-moo)
904 ("perl-moox-handlesvia" ,perl-moox-handlesvia)
905 ("perl-moox-late" ,perl-moox-late)
906 ("perl-moox-options" ,perl-moox-options)
907 ("perl-namespace-clean" ,perl-namespace-clean)
908 ("perl-net-dbus" ,perl-net-dbus)
909 ("perl-net-dbus-glib" ,perl-net-dbus-glib)
910 ("perl-path-tiny" ,perl-path-tiny)
911 ("perl-test-most" ,perl-test-most)
912 ("perl-test-trap" ,perl-test-trap)
913 ("perl-time-duration" ,perl-time-duration)
914 ("perl-time-duration-parse" ,perl-time-duration-parse)
915 ("perl-try-tiny" ,perl-try-tiny)
916 ("perl-type-tiny" ,perl-type-tiny)
917 ("perl-types-path-tiny" ,perl-types-path-tiny)
918 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
919 ("perl-xml-parser" ,perl-xml-parser)
920 ("perl-xml-twig" ,perl-xml-twig)
921 ("torsocks" ,torsocks)))
922 (arguments
923 `(#:phases
924 (modify-phases %standard-phases
925 ;; Needed for using gpg-connect-agent during tests.
926 (add-before 'check 'set-HOME
927 (lambda _ (setenv "HOME" "/tmp") #t))
928 (add-before 'install 'fix-references
929 (lambda* (#:key inputs outputs #:allow-other-keys)
930 (substitute* "lib/App/Parcimonie/GnuPG/Interface.pm"
931 (("gpg2") "gpg")
932 ;; Skip check whether dependencies are in the PATH
933 (("defined which.*") "")
934 (("call\\('parcimonie-torified-gpg'\\)")
935 (string-append "call('" (assoc-ref outputs "out")
936 "/bin/parcimonie-torified-gpg')")))
937 (substitute* "bin/parcimonie-torified-gpg"
938 (("torsocks") (string-append (assoc-ref inputs "torsocks")
939 "/bin/torsocks")))
940 #t))
941 (add-after 'install 'wrap-program
942 (lambda* (#:key inputs outputs #:allow-other-keys)
943 (let* ((out (assoc-ref outputs "out"))
944 (perllib (string-append out "/lib/perl5/site_perl/"
945 ,(package-version perl))))
946 (wrap-program (string-append out "/bin/parcimonie")
947 `("PERL5LIB" ":"
948 prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))
949 #t))))))
950 (home-page "https://gaffer.ptitcanardnoir.org/intrigeri/code/parcimonie/")
951 (synopsis "Incrementally refreshes a GnuPG keyring")
952 (description "Parcimonie incrementaly refreshes a GnuPG keyring in a way
953that makes it hard to correlate the keyring content to an individual, and
954makes it hard to locate an individual based on an identifying subset of her
955keyring content. Parcimonie is a daemon that fetches one key at a time using
956the Tor network, waits a bit, changes the Tor circuit being used, and starts
957over.")
958 (license license:gpl1+)))
607d280e
EF
959
960(define-public jetring
961 (package
962 (name "jetring")
835cf37c 963 (version "0.27")
607d280e
EF
964 (source
965 (origin
966 (method url-fetch)
967 (uri (string-append "mirror://debian/pool/main/j/" name "/"
968 name "_" version ".tar.xz"))
969 (sha256
970 (base32
835cf37c 971 "0jy0x5zj7v87xgyldlsx1knzp0mv10wzamblrw1b61i2m1ii4pxz"))))
607d280e
EF
972 (build-system gnu-build-system)
973 (arguments
974 '(#:phases
975 (modify-phases %standard-phases
976 (delete 'configure) ; no configure script
977 (add-before 'install 'hardlink-gnupg
978 (lambda* (#:key inputs #:allow-other-keys)
979 (let ((gpg (string-append (assoc-ref inputs "gnupg")
980 "/bin/gpg")))
981 (substitute* (find-files "." "jetring-[[:alpha:]]+$")
982 (("gpg -") (string-append gpg " -"))
983 (("\\\"gpg\\\"") (string-append "\"" gpg "\"")))
984 #t)))
985 (replace 'install
986 (lambda* (#:key outputs #:allow-other-keys)
987 (let* ((out (assoc-ref outputs "out"))
988 (man (string-append out "/share/man")))
989 (for-each (lambda (file)
990 (install-file file (string-append out "/bin/")))
991 (find-files "." "jetring-[[:alpha:]]+$"))
992 (for-each (lambda (file)
993 (install-file file (string-append man "/man1/")))
994 (find-files "." ".*\\.1$"))
995 (install-file "jetring.7" (string-append man "/man7/"))
996 #t))))
997 #:tests? #f)) ; no test phase
998 (inputs
999 `(("gnupg" ,gnupg)
1000 ("perl" ,perl)))
1001 (home-page "https://joeyh.name/code/jetring/")
1002 (synopsis "GnuPG keyring maintenance using changesets")
1003 (description
1004 "Jetring is a collection of tools that allow for gpg keyrings to be
1005maintained using changesets. It was developed with the Debian keyring in mind,
1006and aims to solve the problem that a gpg keyring is a binary blob that's hard
1007for multiple people to collaboratively edit.
1008
1009With jetring, changesets can be submitted, reviewed to see exactly what they
1010will do, applied, and used to build a keyring. The origin of every change made
1011to the keyring is available for auditing, and gpg signatures can be used for
1012integrity guarantees.")
1013 (license license:gpl2+)))