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