Merge branch 'core-updates'
[jackhill/guix/guix.git] / gnu / packages / gnupg.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
63e8bb12 2;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
a02ee3d7 3;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
4380a7b4 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
3a7261bf 5;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5dabdb75 6;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
8e71d661 7;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
ec089763 8;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
a05d1d82 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
e1b0b8f5 10;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
41edb23f 11;;; Copyright © 2016 Christopher Baines <mail@cbaines.net>
cd9ed6c1 12;;; Copyright © 2016 Mike Gerwitz <mtg@gnu.org>
0f391063 13;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
e3dd1f0c 14;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
8d1939e4 15;;;
233e7676 16;;; This file is part of GNU Guix.
8d1939e4 17;;;
233e7676 18;;; GNU Guix is free software; you can redistribute it and/or modify it
8d1939e4
LC
19;;; under the terms of the GNU General Public License as published by
20;;; the Free Software Foundation; either version 3 of the License, or (at
21;;; your option) any later version.
22;;;
233e7676 23;;; GNU Guix is distributed in the hope that it will be useful, but
8d1939e4
LC
24;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26;;; GNU General Public License for more details.
27;;;
28;;; You should have received a copy of the GNU General Public License
233e7676 29;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
8d1939e4 30
1ffa7090 31(define-module (gnu packages gnupg)
07157e8a 32 #:use-module ((guix licenses) #:prefix license:)
a05d1d82 33 #:use-module (gnu packages)
7b40296f 34 #:use-module (gnu packages adns)
01e11826
AE
35 #:use-module (gnu packages curl)
36 #:use-module (gnu packages openldap)
ea4d96c6 37 #:use-module (gnu packages perl)
1ffa7090 38 #:use-module (gnu packages pth)
ea4d96c6 39 #:use-module (gnu packages python)
54df7558 40 #:use-module (gnu packages qt)
1ffa7090 41 #:use-module (gnu packages readline)
07157e8a 42 #:use-module (gnu packages compression)
2d12284d 43 #:use-module (gnu packages databases)
40d806af
LC
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages glib)
d1d75c6a 46 #:use-module (gnu packages gnome)
40d806af
LC
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages ncurses)
cd9ed6c1 49 #:use-module (gnu packages security-token)
e3dd1f0c 50 #:use-module (gnu packages swig)
a7fd7b68 51 #:use-module (gnu packages tls)
8d1939e4 52 #:use-module (guix packages)
87f5d366 53 #:use-module (guix download)
0f391063 54 #:use-module (guix git-download)
14e2e44d
LC
55 #:use-module (guix build-system gnu)
56 #:use-module (guix build-system python))
8d1939e4
LC
57
58(define-public libgpg-error
59 (package
60 (name "libgpg-error")
8e71d661 61 (version "1.27")
8d1939e4
LC
62 (source
63 (origin
87f5d366 64 (method url-fetch)
0db342a5 65 (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
8d1939e4
LC
66 version ".tar.bz2"))
67 (sha256
68 (base32
8e71d661 69 "1li95ni122fzinzlmxbln63nmgij63irxfvi52ws4zfbzv3am4sg"))))
8d1939e4 70 (build-system gnu-build-system)
72fb1b24 71 (home-page "https://gnupg.org")
35b9e423 72 (synopsis "Library of error values for GnuPG components")
8d1939e4
LC
73 (description
74 "Libgpg-error is a small library that defines common error values
75for all GnuPG components. Among these are GPG, GPGSM, GPGME,
76GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard
77Daemon and possibly more in the future.")
63e8bb12
LC
78 (license license:lgpl2.0+)
79 (properties '((ftp-server . "ftp.gnupg.org")
80 (ftp-directory . "/gcrypt/libgpg-error")))))
8d1939e4
LC
81
82(define-public libgcrypt
83 (package
84 (name "libgcrypt")
6b86ad15 85 (version "1.7.8")
84a3e3b7
LC
86 (source (origin
87 (method url-fetch)
88 (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
89 version ".tar.bz2"))
90 (sha256
91 (base32
6b86ad15 92 "16f1rsv4y4w2pk1il2jbcqggsb6mrlfva5vayd205fp68zm7d0ll"))))
8d1939e4
LC
93 (build-system gnu-build-system)
94 (propagated-inputs
e0932742 95 `(("libgpg-error-host" ,libgpg-error)))
e766f699
JD
96 (native-inputs
97 ;; Needed here for the 'gpg-error' program.
e0932742 98 `(("libgpg-error-native" ,libgpg-error)))
e766f699
JD
99 (arguments
100 ;; The '--with-gpg-error-prefix' argument is needed because otherwise
101 ;; 'configure' uses 'gpg-error-config' to determine the '-L' flag, and
102 ;; the 'gpg-error-config' it runs is the native one---i.e., the wrong one.
103 `(#:configure-flags
104 (list (string-append "--with-gpg-error-prefix="
e0932742 105 (assoc-ref %build-inputs "libgpg-error-host")))))
40fed2d8 106 (outputs '("out" "debug"))
72fb1b24 107 (home-page "https://gnupg.org/")
f50d2669 108 (synopsis "Cryptographic function library")
8d1939e4 109 (description
a22dc0c4
LC
110 "Libgcrypt is a general-purpose cryptographic library. It provides the
111standard cryptographic building blocks such as symmetric ciphers, hash
112algorithms, public key algorithms, large integer functions and random number
113generation.")
63e8bb12
LC
114 (license license:lgpl2.0+)
115 (properties '((ftp-server . "ftp.gnupg.org")
116 (ftp-directory . "/gcrypt/libgcrypt")))))
8d1939e4
LC
117
118(define-public libassuan
119 (package
120 (name "libassuan")
f04a7943 121 (version "2.4.3")
8d1939e4
LC
122 (source
123 (origin
87f5d366 124 (method url-fetch)
0db342a5 125 (uri (string-append "mirror://gnupg/libassuan/libassuan-"
8d1939e4
LC
126 version ".tar.bz2"))
127 (sha256
128 (base32
f04a7943 129 "0w9bmasln4z8mn16s1is55a06w3nv8jbyal496z5jvr5vcxkm112"))))
8d1939e4
LC
130 (build-system gnu-build-system)
131 (propagated-inputs
132 `(("libgpg-error" ,libgpg-error) ("pth" ,pth)))
72fb1b24 133 (home-page "https://gnupg.org")
8d1939e4 134 (synopsis
35b9e423 135 "IPC library used by GnuPG and related software")
8d1939e4
LC
136 (description
137 "Libassuan is a small library implementing the so-called Assuan
138protocol. This protocol is used for IPC between most newer
139GnuPG components. Both, server and client side functions are
140provided.")
63e8bb12
LC
141 (license license:lgpl2.0+)
142 (properties '((ftp-server . "ftp.gnupg.org")
143 (ftp-directory . "/gcrypt/libassuan")))))
8d1939e4
LC
144
145(define-public libksba
146 (package
147 (name "libksba")
c95f7160 148 (version "1.3.5")
8d1939e4
LC
149 (source
150 (origin
87f5d366 151 (method url-fetch)
8d1939e4 152 (uri (string-append
0db342a5 153 "mirror://gnupg/libksba/libksba-"
8d1939e4
LC
154 version ".tar.bz2"))
155 (sha256
156 (base32
c95f7160 157 "0h53q4sns1jz1pkmhcz5wp9qrfn9f5g9i3vjv6dafwzzlvblyi21"))))
8d1939e4
LC
158 (build-system gnu-build-system)
159 (propagated-inputs
160 `(("libgpg-error" ,libgpg-error)))
e766f699
JD
161 (native-inputs
162 `(("libgpg-error" ,libgpg-error)))
163 (arguments
164 `(#:configure-flags
165 (list ,@(if (%current-target-system)
166 '("CC_FOR_BUILD=gcc")
167 '())
168 (string-append "--with-gpg-error-prefix="
169 (assoc-ref %build-inputs "libgpg-error")))))
72fb1b24 170 (home-page "https://www.gnupg.org")
35b9e423 171 (synopsis "CMS and X.509 access library")
8d1939e4
LC
172 (description
173 "KSBA (pronounced Kasbah) is a library to make X.509 certificates
174as well as the CMS easily accessible by other applications. Both
175specifications are building blocks of S/MIME and TLS.")
63e8bb12
LC
176 (license license:gpl3+)
177 (properties '((ftp-server . "ftp.gnupg.org")
178 (ftp-directory . "/gcrypt/libksba")))))
8d1939e4 179
c18ea90f
AE
180(define-public npth
181 (package
182 (name "npth")
f48a9d4a 183 (version "1.5")
c18ea90f
AE
184 (source
185 (origin
186 (method url-fetch)
89c83e8c 187 (uri (string-append "mirror://gnupg/npth/npth-" version ".tar.bz2"))
c18ea90f
AE
188 (sha256
189 (base32
f48a9d4a 190 "1hmkkp6vzyrh8v01c2ynzf9vwikyagp7p1lxhbnr4ysk3w66jji9"))))
c18ea90f 191 (build-system gnu-build-system)
72fb1b24 192 (home-page "https://www.gnupg.org")
c18ea90f
AE
193 (synopsis "Non-preemptive thread library")
194 (description
195 "Npth is a library to provide the GNU Pth API and thus a non-preemptive
196threads implementation.
197
198In contrast to GNU Pth is is based on the system's standard threads
199implementation. This allows the use of libraries which are not
200compatible to GNU Pth.")
07157e8a 201 (license (list license:lgpl3+ license:gpl2+)))) ; dual license
c18ea90f 202
8d1939e4
LC
203(define-public gnupg
204 (package
205 (name "gnupg")
10756b9e 206 (version "2.1.23")
58970d6a
LC
207 (source (origin
208 (method url-fetch)
209 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
210 ".tar.bz2"))
211 (sha256
212 (base32
10756b9e 213 "0xqd5nm4j3w9lwk35vg57gl2i8bfkmx7d24i44gkbscm2lwpci59"))))
8d1939e4 214 (build-system gnu-build-system)
08fa45b1
MW
215 (native-inputs
216 `(("pkg-config" ,pkg-config)))
8d1939e4 217 (inputs
e31d35de 218 `(("bzip2" ,bzip2)
01e11826 219 ("curl" ,curl)
08fa45b1 220 ("gnutls" ,gnutls)
8d1939e4
LC
221 ("libassuan" ,libassuan)
222 ("libgcrypt" ,libgcrypt)
01e11826 223 ("libgpg-error" ,libgpg-error)
8d1939e4 224 ("libksba" ,libksba)
cd064df7 225 ("npth" ,npth)
01e11826 226 ("openldap" ,openldap)
cd9ed6c1 227 ("pcsc-lite" ,pcsc-lite)
2d12284d
EF
228 ("readline" ,readline)
229 ("sqlite" ,sqlite)
230 ("zlib" ,zlib)))
30e9cbb4 231 (arguments
10756b9e 232 `(#:configure-flags '(;; Otherwise, the test suite looks for the `gpg`
f11275c9
LF
233 ;; executable in its installation directory in
234 ;; /gnu/store before it has been installed.
235 "--enable-gnupg-builddir-envvar")
163708a6 236 #:phases
45477c6a 237 (modify-phases %standard-phases
cd9ed6c1
MG
238 (add-before 'configure 'patch-paths
239 (lambda* (#:key inputs #:allow-other-keys)
cd9ed6c1
MG
240 (substitute* "scd/scdaemon.c"
241 (("\"(libpcsclite\\.so[^\"]*)\"" _ name)
242 (string-append "\"" (assoc-ref inputs "pcsc-lite")
243 "/lib/" name "\"")))
7deb5ee8
LF
244 #t))
245 (add-after 'build 'patch-scheme-tests
246 (lambda _
247 (substitute* (find-files "tests" ".\\.scm$")
248 (("/usr/bin/env gpgscm")
764c5662
LF
249 (string-append (getcwd) "/tests/gpgscm/gpgscm")))
250 #t))
f11275c9
LF
251 (add-before 'build 'patch-test-paths
252 (lambda* (#:key inputs #:allow-other-keys)
253 (let* ((coreutils (assoc-ref inputs "coreutils"))
254 (cat (string-append coreutils "/bin/cat"))
255 (pwd (string-append coreutils "/bin/pwd"))
256 (true (string-append coreutils "/bin/true"))
257 (false (string-append coreutils "/bin/false")))
258 (substitute* '("tests/inittests"
259 "tests/pkits/inittests"
260 "tests/Makefile"
261 "tests/pkits/common.sh"
262 "tests/pkits/Makefile"
263 )
264 (("/bin/pwd") pwd))
265 (substitute* "common/t-exectool.c"
266 (("/bin/cat") cat))
267 (substitute* "common/t-exectool.c"
268 (("/bin/true") true))
269 (substitute* "common/t-exectool.c"
270 (("/bin/false") false))
271 #t))))))
72fb1b24 272 (home-page "https://gnupg.org/")
f50d2669 273 (synopsis "GNU Privacy Guard")
8d1939e4 274 (description
a22dc0c4
LC
275 "The GNU Privacy Guard is a complete implementation of the OpenPGP
276standard. It is used to encrypt and sign data and communication. It
277features powerful key management and the ability to access public key
79c311b8 278servers. It includes several libraries: libassuan (IPC between GnuPG
58970d6a
LC
279components), libgpg-error (centralized GnuPG error values), and
280libskba (working with X.509 certificates and CMS data).")
63e8bb12
LC
281 (license license:gpl3+)
282 (properties '((ftp-server . "ftp.gnupg.org")
283 (ftp-directory . "/gcrypt/gnupg")))))
ea4d96c6 284
cd064df7
AE
285(define-public gnupg-2.0
286 (package (inherit gnupg)
b5afe6f0 287 (version "2.0.30")
cd064df7
AE
288 (source (origin
289 (method url-fetch)
290 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
291 ".tar.bz2"))
292 (sha256
293 (base32
b5afe6f0 294 "0wax4cy14hh0h7kg9hj0hjn9424b71z8lrrc5kbsasrn9xd7hag3"))))
08fa45b1 295 (native-inputs '())
cd064df7 296 (inputs
7b40296f
EF
297 `(("adns" ,adns)
298 ("bzip2" ,bzip2)
cd064df7
AE
299 ("curl" ,curl)
300 ("libassuan" ,libassuan)
301 ("libgcrypt" ,libgcrypt)
302 ("libgpg-error" ,libgpg-error)
303 ("libksba" ,libksba)
304 ("pth" ,pth)
305 ("openldap" ,openldap)
07157e8a 306 ("zlib" ,zlib)
cd064df7
AE
307 ("readline" ,readline)))
308 (arguments
309 `(#:phases
80c47cf8 310 (modify-phases %standard-phases
6b547d22
LC
311 (add-before 'configure 'patch-config-files
312 (lambda _
313 (substitute* "tests/openpgp/Makefile.in"
3a534f42 314 (("/bin/sh") (which "sh")))
bc85b127
LC
315 #t))
316 (add-after 'install 'rename-v2-commands
317 (lambda* (#:key outputs #:allow-other-keys)
318 ;; Upstream suggests removing the trailing '2' from command names:
319 ;; <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22883#58>.
320 (let ((out (assoc-ref outputs "out")))
321 (with-directory-excursion (string-append out "/bin")
322 (rename-file "gpgv2" "gpgv")
323 (rename-file "gpg2" "gpg")
324
325 ;; Keep the old name around to ease transition.
326 (symlink "gpgv" "gpgv2")
327 (symlink "gpg" "gpg2")
328 #t)))))))))
cd064df7 329
5249045c
MW
330(define-public gnupg-1
331 (package (inherit gnupg)
81ca29a6 332 (version "1.4.22")
58970d6a
LC
333 (source (origin
334 (method url-fetch)
335 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
336 ".tar.bz2"))
337 (sha256
338 (base32
81ca29a6 339 "1d1hz4szh1kvwhsw7w2zxa6q5ndrk3qy6hj289l1b8k3xi5s554m"))))
08fa45b1 340 (native-inputs '())
5249045c 341 (inputs
07157e8a
LC
342 `(("zlib" ,zlib)
343 ("bzip2" ,bzip2)
5249045c
MW
344 ("curl" ,curl)
345 ("readline" ,readline)
346 ("libgpg-error" ,libgpg-error)))
347 (arguments
29d90757
LF
348 `(#:phases
349 (modify-phases %standard-phases
350 (add-after 'unpack 'patch-check-sh
351 (lambda _
352 (substitute* "checks/Makefile.in"
2e4b67b9 353 (("/bin/sh") (which "sh"))))))))))
5249045c 354
09d5c166
AE
355(define-public gpgme
356 (package
357 (name "gpgme")
8439c9c0 358 (version "1.9.0")
09d5c166
AE
359 (source
360 (origin
361 (method url-fetch)
362 (uri (string-append "mirror://gnupg/gpgme/gpgme-" version
363 ".tar.bz2"))
364 (sha256
365 (base32
8439c9c0 366 "1ssc0gs02r4fasabk7c6v6r865k2j02mpb5g1vkpbmzsigdzwa8v"))))
09d5c166 367 (build-system gnu-build-system)
68640c3c
MW
368 (propagated-inputs
369 ;; Needs to be propagated because gpgme.h includes gpg-error.h.
370 `(("libgpg-error" ,libgpg-error)))
09d5c166 371 (inputs
ae3bded6 372 `(("gnupg" ,gnupg-2.0)
68640c3c 373 ("libassuan" ,libassuan)))
e10872cc
TD
374 (arguments
375 `(#:phases
376 (modify-phases %standard-phases
377 (add-after 'configure 'patch-cmake-file
378 (lambda _
379 ;; Work around <https://bugs.gnupg.org/gnupg/issue2877>.
380 (substitute* "lang/cpp/src/GpgmeppConfig.cmake.in"
381 (("@libsuffix@") ".so"))
382 #t)))))
72fb1b24 383 (home-page "https://www.gnupg.org/related_software/gpgme/")
35b9e423 384 (synopsis "Library providing simplified access to GnuPG functionality")
09d5c166
AE
385 (description
386 "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
387easier for applications. It provides a High-Level Crypto API for encryption,
388decryption, signing, signature verification and key management. Currently
389it uses GnuPG as its backend but the API isn't restricted to this engine.
390
391Because the direct use of GnuPG from an application can be a complicated
392programming task, it is suggested that all software should try to use GPGME
393instead. This way bug fixes or improvements can be done at a central place
394and every application benefits from this.")
07157e8a 395 (license license:lgpl2.1+)))
09d5c166 396
6b982a78
HG
397(define-public qgpgme
398 (package
399 (inherit gpgme)
400 (name "qgpgme")
401 (arguments
402 `(#:phases
403 (modify-phases %standard-phases
404 (add-before 'build 'chdir-and-symlink
405 (lambda* (#:key inputs #:allow-other-keys)
406 (let ((gpgme (assoc-ref inputs "gpgme")))
407 (symlink (string-append gpgme "/lib/libgpgmepp.la")
408 "lang/cpp/src/libgpgmepp.la")
409 (symlink (string-append gpgme "/lib/libgpgme.la")
410 "src/libgpgme.la"))
411 (chdir "lang/qt")
412 #t)))))
413 (native-inputs
414 `(("pkg-config" ,pkg-config)))
415 (inputs
416 `(("gpgme" ,gpgme)
417 ("qtbase" ,qtbase)
418 ,@(package-inputs gpgme)))
419 (synopsis "Qt API bindings for gpgme")
420 (description "QGpgme provides a very high level Qt API around GpgMEpp.
421
422QGpgME was originally developed as part of libkleo and incorporated into
423gpgpme starting with version 1.7.")
424 (license license:gpl2+))) ;; Note: this differs from gpgme
425
e3dd1f0c
LF
426(define-public python-gpg
427 (package
428 (name "python-gpg")
99c63f3f 429 (version "1.8.0")
e3dd1f0c
LF
430 (source (origin
431 (method url-fetch)
432 (uri (pypi-uri "gpg" version))
433 (sha256
434 (base32
435 "1x74i6q713c0bckls7rdm8kgsmllf9qvy9x62jghszlhgjkyh9nd"))))
436 (build-system python-build-system)
437 (arguments
438 '(#:tests? #f)) ; No test suite.
439 (inputs
440 `(("gpgme" ,gpgme)))
441 (native-inputs
442 `(("swig" ,swig)))
443 (home-page (package-home-page gpgme))
444 (synopsis "Python bindings for GPGME GnuPG cryptography library")
445 (description "This package provides Python bindings to the GPGME GnuPG
446cryptographic library. It is developed in the GPGME source code, and then
447distributed separately.")
448 (license license:lgpl2.1+)))
449
450(define-public python2-gpg
451 (package-with-python2 python-gpg))
452
a05d1d82
CAW
453(define-public python-pygpgme
454 (package
455 (name "python-pygpgme")
456 (version "0.3")
457 (source
458 (origin
459 (method url-fetch)
460 (uri (pypi-uri "pygpgme" version))
461 (sha256
462 (base32
463 "1q82p3gs6lwq8j8dxk4pvrwk3jpww1zqcjrzznl9clh10z28gn2z"))
464 ;; Unfortunately, we have to disable some tests due to some gpg-agent
465 ;; goofiness... see:
466 ;; https://bugs.launchpad.net/pygpgme/+bug/999949
1c9cea74
LF
467 (patches (search-patches "pygpgme-disable-problematic-tests.patch"
468 "python-pygpgme-fix-pinentry-tests.patch"))))
a05d1d82
CAW
469 (arguments
470 `(#:phases
471 (modify-phases %standard-phases
472 (add-before 'build 'make-build
473 (lambda _
474 (zero? (system* "make" "build"))))
475 (replace 'check
476 (lambda _
477 (zero? (system* "make" "check")))))))
478 (build-system python-build-system)
479 (inputs
a7843522 480 `(("gnupg" ,gnupg-2.0)
a05d1d82
CAW
481 ("gpgme" ,gpgme)))
482 (home-page "https://launchpad.net/pygpgme")
483 (synopsis "Python module for working with OpenPGP messages")
484 (description
485 "PyGPGME is a Python module that lets you sign, verify, encrypt and
486decrypt messages using the OpenPGP format by making use of GPGME.")
487 (license license:lgpl2.1+)))
488
489(define-public python2-pygpgme
5c31f4aa 490 (package-with-python2 python-pygpgme))
a05d1d82 491
22af9029
RW
492(define-public python-gnupg
493 (package
494 (name "python-gnupg")
5b669ba1 495 (version "0.3.8")
22af9029
RW
496 (source
497 (origin
498 (method url-fetch)
5b669ba1 499 (uri (pypi-uri "python-gnupg" version))
22af9029
RW
500 (sha256
501 (base32
5b669ba1 502 "0nkbs9c8f30lra7ca39kg91x8cyxn0jb61vih4qky839gpbwwwiq"))))
22af9029
RW
503 (build-system python-build-system)
504 (arguments
505 `(#:phases
506 (modify-phases %standard-phases
507 (replace 'check
ec089763
RW
508 (lambda _
509 (substitute* "test_gnupg.py"
510 ;; Exported keys don't have a version line!
511 (("del k1\\[1\\]") "#")
512 ;; Unsure why this test fails.
513 (("'test_search_keys'") "True")
514 (("def test_search_keys") "def disabled__search_keys"))
515 (setenv "USERNAME" "guixbuilder")
516 ;; The doctests are extremely slow and sometimes time out,
517 ;; so we disable them.
518 (zero? (system* "python"
519 "test_gnupg.py" "--no-doctests")))))))
22af9029
RW
520 (native-inputs
521 `(("gnupg" ,gnupg-1)))
72fb1b24 522 (home-page "https://packages.python.org/python-gnupg/index.html")
22af9029
RW
523 (synopsis "Wrapper for the GNU Privacy Guard")
524 (description
525 "This module allows easy access to GnuPG’s key management, encryption
526and signature functionality from Python programs.")
527 (license license:bsd-3)))
528
529(define-public python2-gnupg
530 (package-with-python2 python-gnupg))
531
ea4d96c6 532(define-public pius
cda0ef04
TS
533 (package
534 (name "pius")
1b34a47d 535 (version "2.2.4")
cda0ef04
TS
536 (source (origin
537 (method url-fetch)
538 (uri (string-append
539 "https://github.com/jaymzh/pius/releases/download/v"
540 version "/pius-" version ".tar.bz2"))
541 (sha256
542 (base32
1b34a47d 543 "0lgc0ipwdfqbq16zax8kn17wbv8xyw4ygc09fawl2yp459z0ql4n"))))
cda0ef04
TS
544 (build-system python-build-system)
545 (inputs `(("perl" ,perl) ;for 'pius-party-worksheet'
546 ("gpg" ,gnupg)))
547 (arguments
548 `(#:tests? #f
549 #:python ,python-2 ;uses the Python 2 'print' syntax
550 #:phases
551 (modify-phases %standard-phases
552 (add-before
553 'build 'set-gpg-file-name
554 (lambda* (#:key inputs outputs #:allow-other-keys)
555 (let* ((gpg (string-append (assoc-ref inputs "gpg")
556 "/bin/gpg")))
557 (substitute* "libpius/constants.py"
558 (("/usr/bin/gpg2") gpg))
559 #t))))))
560 (synopsis "Programs to simplify GnuPG key signing")
561 (description
562 "Pius (PGP Individual UID Signer) helps attendees of PGP keysigning
35b9e423
EB
563parties. It is the main utility and makes it possible to quickly and easily
564sign each UID on a set of PGP keys. It is designed to take the pain out of
ea4d96c6
AE
565the sign-all-the-keys part of PGP Keysigning Party while adding security
566to the process.
567
568pius-keyring-mgr and pius-party-worksheet help organisers of
569PGP keysigning parties.")
cda0ef04
TS
570 (license license:gpl2)
571 (home-page "https://www.phildev.net/pius/index.shtml")))
96be765c
AE
572
573(define-public signing-party
574 (package
575 (name "signing-party")
576 (version "1.1.4")
577 (source (origin
578 (method url-fetch)
807143b6
EF
579 (uri (string-append "mirror://debian/pool/main/s/signing-party/"
580 "signing-party_" version ".orig.tar.gz"))
96be765c
AE
581 (sha256 (base32
582 "188gp0prbh8qs29lq3pbf0qibfd6jq4fk7i0pfrybl8aahvm84rx"))))
583 (build-system gnu-build-system)
584 (inputs `(("perl" ,perl)))
585 (arguments
586 `(#:tests? #f
587 #:phases
6a90a614
EF
588 (modify-phases %standard-phases
589 (add-after 'unpack 'remove-spurious-links
590 (lambda _ (delete-file "keyanalyze/pgpring/depcomp")))
591 (replace 'configure
592 (lambda* (#:key outputs #:allow-other-keys)
593 (let ((out (assoc-ref outputs "out")))
594 (substitute* "keyanalyze/Makefile"
595 (("LDLIBS") (string-append "CC=" (which "gcc") "\nLDLIBS")))
596 (substitute* "keyanalyze/Makefile"
597 (("./configure") (string-append "./configure --prefix=" out)))
598 (substitute* "keyanalyze/pgpring/configure"
7ba02492 599 (("/bin/sh") (which "sh")))
6a90a614
EF
600 (substitute* "gpgwrap/Makefile"
601 (("\\} clean")
602 (string-append "} clean\ninstall:\n\tinstall -D bin/gpgwrap "
603 out "/bin/gpgwrap\n")))
604 (substitute* '("gpgsigs/Makefile" "keyanalyze/Makefile"
605 "keylookup/Makefile" "sig2dot/Makefile"
606 "springgraph/Makefile")
607 (("/usr") out)))))
608 (replace 'install
609 (lambda* (#:key outputs #:allow-other-keys #:rest args)
610 (let ((out (assoc-ref outputs "out"))
611 (install (assoc-ref %standard-phases 'install)))
612 (apply install args)
613 (for-each
614 (lambda (dir file)
615 (copy-file (string-append dir "/" file)
616 (string-append out "/bin/" file)))
617 '("caff" "caff" "caff" "gpgdir" "gpg-key2ps"
618 "gpglist" "gpg-mailkeys" "gpgparticipants")
619 '("caff" "pgp-clean" "pgp-fixkey" "gpgdir" "gpg-key2ps"
620 "gpglist" "gpg-mailkeys" "gpgparticipants"))
621 (for-each
622 (lambda (dir file)
623 (copy-file (string-append dir "/" file)
624 (string-append out "/share/man/man1/" file)))
625 '("caff" "caff" "caff" "gpgdir"
626 "gpg-key2ps" "gpglist" "gpg-mailkeys"
627 "gpgparticipants" "gpgsigs" "gpgwrap/doc"
628 "keyanalyze" "keyanalyze/pgpring" "keyanalyze")
629 '("caff.1" "pgp-clean.1" "pgp-fixkey.1" "gpgdir.1"
630 "gpg-key2ps.1" "gpglist.1" "gpg-mailkeys.1"
631 "gpgparticipants.1" "gpgsigs.1" "gpgwrap.1"
632 "process_keys.1" "pgpring.1" "keyanalyze.1"))))))))
35b9e423 633 (synopsis "Collection of scripts for simplifying gnupg key signing")
96be765c 634 (description
35b9e423 635 "Signing-party is a collection for all kinds of PGP/GnuPG related things,
96be765c 636including tools for signing keys, keyring analysis, and party preparation.
7ac53403
EF
637@enumerate
638@item caff: CA - Fire and Forget signs and mails a key
639@item pgp-clean: removes all non-self signatures from key
640@item pgp-fixkey: removes broken packets from keys
641@item gpg-mailkeys: simply mail out a signed key to its owner
642@item gpg-key2ps: generate PostScript file with fingerprint paper strips
643@item gpgdir: recursive directory encryption tool
644@item gpglist: show who signed which of your UIDs
645@item gpgsigs: annotates list of GnuPG keys with already done signatures
646@item gpgparticipants: create list of party participants for the organiser
647@item gpgwrap: a passphrase wrapper
648@item keyanalyze: minimum signing distance (MSD) analysis on keyrings
649@item keylookup: ncurses wrapper around gpg --search
650@item sig2dot: converts a list of GnuPG signatures to a .dot file
651@item springgraph: creates a graph from a .dot file
652@end enumerate")
96be765c
AE
653 ;; gpl2+ for almost all programs, except for keyanalyze: gpl2
654 ;; and caff and gpgsigs: bsd-3, see
655 ;; http://packages.debian.org/changelogs/pool/main/s/signing-party/current/copyright
07157e8a 656 (license license:gpl2)
72fb1b24 657 (home-page "https://pgp-tools.alioth.debian.org/")))
40d806af 658
c607b701 659(define-public pinentry-tty
40d806af 660 (package
c607b701 661 (name "pinentry-tty")
9b1d77f6 662 (version "1.0.0")
40d806af
LC
663 (source (origin
664 (method url-fetch)
665 (uri (string-append "mirror://gnupg/pinentry/pinentry-"
666 version ".tar.bz2"))
667 (sha256
668 (base32
9b1d77f6 669 "0ni7g4plq6x78p32al7m8h2zsakvg1rhfz0qbc3kdc7yq7nw4whn"))))
40d806af 670 (build-system gnu-build-system)
c607b701
EF
671 (arguments
672 `(#:configure-flags '("--enable-pinentry-tty")))
40d806af
LC
673 (inputs
674 `(("ncurses" ,ncurses)
18ed97d6 675 ("libassuan" ,libassuan)
c607b701 676 ("libsecret" ,libsecret "out")))
40d806af
LC
677 (native-inputs
678 `(("pkg-config" ,pkg-config)))
547cb17d 679 (home-page "https://gnupg.org/aegypten2/")
40d806af
LC
680 (synopsis "GnuPG's interface to passphrase input")
681 (description
c607b701 682 "Pinentry provides a console that allows users to enter a passphrase when
9614897b 683@code{gpg} is run and needs it.")
07157e8a 684 (license license:gpl2+)))
4380a7b4 685
c607b701
EF
686(define-public pinentry-gtk2
687 (package
688 (inherit pinentry-tty)
689 (name "pinentry-gtk2")
690 (inputs
691 `(("gtk+" ,gtk+-2)
692 ("glib" ,glib)
693 ,@(package-inputs pinentry-tty)))
694 (description
695 "Pinentry provides a console and a GTK+ GUI that allows users to enter a
9614897b 696passphrase when @code{gpg} is run and needs it.")))
c607b701 697
41edb23f
CB
698(define-public pinentry-gnome3
699 (package
700 (inherit pinentry-tty)
701 (name "pinentry-gnome3")
702 (inputs
703 `(("gtk+" ,gtk+-2)
704 ("gcr" ,gcr)
705 ("glib" ,glib)
706 ,@(package-inputs pinentry-tty)))
707 (arguments
708 `(#:configure-flags '("--enable-pinentry-gnome3")))
709 (description
710 "Pinentry provides a console and a GUI designed for use with GNOME@tie{}3
711that allows users to enter a passphrase when required by @code{gpg} or other
712software.")))
c607b701 713
54df7558
EF
714(define-public pinentry-qt
715 (package
716 (inherit pinentry-tty)
717 (name "pinentry-qt")
718 (inputs
e2788cef 719 `(("qtbase" ,qtbase)
54df7558 720 ,@(package-inputs pinentry-tty)))
984ad832
DC
721 (arguments
722 `(#:configure-flags '("CXXFLAGS=-std=gnu++11")))
54df7558
EF
723 (description
724 "Pinentry provides a console and a Qt GUI that allows users to enter a
9614897b 725passphrase when @code{gpg} is run and needs it.")))
54df7558 726
940f8d39
EF
727(define-public pinentry
728 (package (inherit pinentry-gtk2)
729 (name "pinentry")))
730
4380a7b4
EB
731(define-public paperkey
732 (package
733 (name "paperkey")
734 (version "1.3")
735 (source (origin
736 (method url-fetch)
737 (uri (string-append "http://www.jabberwocky.com/"
738 "software/paperkey/paperkey-"
739 version ".tar.gz"))
740 (sha256
741 (base32
742 "1yybj8bj68v4lxwpn596b6ismh2fyixw5vlqqg26byrn4d9dfmsv"))))
743 (build-system gnu-build-system)
744 (arguments
745 `(#:phases
e379d85c
EF
746 (modify-phases %standard-phases
747 (add-before 'check 'patch-check-scripts
748 (lambda _
749 (substitute* '("checks/roundtrip.sh"
750 "checks/roundtrip-raw.sh")
751 (("/bin/echo") "echo"))
752 #t)))))
4380a7b4
EB
753 (home-page "http://www.jabberwocky.com/software/paperkey/")
754 (synopsis "Backup OpenPGP keys to paper")
755 (description
756 "Paperkey extracts the secret bytes from an OpenPGP (GnuPG, PGP, etc) key
757for printing with paper and ink, which have amazingly long retention
758qualities. To reconstruct a secret key, you re-enter those
759bytes (whether by hand, OCR, QR code, or the like) and paperkey can use
760them to transform your existing public key into a secret key.")
07157e8a 761 (license license:gpl2+)))