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