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