gnu: Move test packages from perl to perl-check.
[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>
5aeb6611 8;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
a05d1d82 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
8384499c 10;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
41edb23f 11;;; Copyright © 2016 Christopher Baines <mail@cbaines.net>
cd9ed6c1 12;;; Copyright © 2016 Mike Gerwitz <mtg@gnu.org>
0f391063 13;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
e3dd1f0c 14;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
5aeb6611 15;;; Copyright © 2017 Petter <petter@mykolab.ch>
8d1939e4 16;;;
233e7676 17;;; This file is part of GNU Guix.
8d1939e4 18;;;
233e7676 19;;; GNU Guix is free software; you can redistribute it and/or modify it
8d1939e4
LC
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
233e7676 24;;; GNU Guix is distributed in the hope that it will be useful, but
8d1939e4
LC
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
233e7676 30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
8d1939e4 31
1ffa7090 32(define-module (gnu packages gnupg)
07157e8a 33 #:use-module ((guix licenses) #:prefix license:)
a05d1d82 34 #:use-module (gnu packages)
7b40296f 35 #:use-module (gnu packages adns)
c9ce8e17 36 #:use-module (gnu packages autotools)
34ef5755 37 #:use-module (gnu packages base)
01e11826 38 #:use-module (gnu packages curl)
c9ce8e17 39 #:use-module (gnu packages crypto)
01e11826 40 #:use-module (gnu packages openldap)
ea4d96c6 41 #:use-module (gnu packages perl)
5ccde207 42 #:use-module (gnu packages perl-check)
1ffa7090 43 #:use-module (gnu packages pth)
ea4d96c6 44 #:use-module (gnu packages python)
54df7558 45 #:use-module (gnu packages qt)
1ffa7090 46 #:use-module (gnu packages readline)
07157e8a 47 #:use-module (gnu packages compression)
2d12284d 48 #:use-module (gnu packages databases)
40d806af
LC
49 #:use-module (gnu packages gtk)
50 #:use-module (gnu packages glib)
d1d75c6a 51 #:use-module (gnu packages gnome)
40d806af
LC
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages ncurses)
cd9ed6c1 54 #:use-module (gnu packages security-token)
e3dd1f0c 55 #:use-module (gnu packages swig)
a7fd7b68 56 #:use-module (gnu packages tls)
15b08442
P
57 #:use-module (gnu packages tor)
58 #:use-module (gnu packages web)
59 #:use-module (gnu packages xml)
8d1939e4 60 #:use-module (guix packages)
87f5d366 61 #:use-module (guix download)
0f391063 62 #:use-module (guix git-download)
14e2e44d 63 #:use-module (guix build-system gnu)
34ef5755 64 #:use-module (guix build-system perl)
14e2e44d 65 #:use-module (guix build-system python))
8d1939e4
LC
66
67(define-public libgpg-error
68 (package
69 (name "libgpg-error")
8e71d661 70 (version "1.27")
8d1939e4
LC
71 (source
72 (origin
87f5d366 73 (method url-fetch)
0db342a5 74 (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
8d1939e4
LC
75 version ".tar.bz2"))
76 (sha256
77 (base32
8e71d661 78 "1li95ni122fzinzlmxbln63nmgij63irxfvi52ws4zfbzv3am4sg"))))
8d1939e4 79 (build-system gnu-build-system)
72fb1b24 80 (home-page "https://gnupg.org")
35b9e423 81 (synopsis "Library of error values for GnuPG components")
8d1939e4
LC
82 (description
83 "Libgpg-error is a small library that defines common error values
84for all GnuPG components. Among these are GPG, GPGSM, GPGME,
85GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard
86Daemon and possibly more in the future.")
63e8bb12
LC
87 (license license:lgpl2.0+)
88 (properties '((ftp-server . "ftp.gnupg.org")
89 (ftp-directory . "/gcrypt/libgpg-error")))))
8d1939e4
LC
90
91(define-public libgcrypt
92 (package
08cba8cc 93 (replacement libgcrypt/fixed)
8d1939e4 94 (name "libgcrypt")
6b86ad15 95 (version "1.7.8")
84a3e3b7
LC
96 (source (origin
97 (method url-fetch)
98 (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
99 version ".tar.bz2"))
100 (sha256
101 (base32
6b86ad15 102 "16f1rsv4y4w2pk1il2jbcqggsb6mrlfva5vayd205fp68zm7d0ll"))))
8d1939e4
LC
103 (build-system gnu-build-system)
104 (propagated-inputs
e0932742 105 `(("libgpg-error-host" ,libgpg-error)))
e766f699
JD
106 (native-inputs
107 ;; Needed here for the 'gpg-error' program.
e0932742 108 `(("libgpg-error-native" ,libgpg-error)))
e766f699
JD
109 (arguments
110 ;; The '--with-gpg-error-prefix' argument is needed because otherwise
111 ;; 'configure' uses 'gpg-error-config' to determine the '-L' flag, and
112 ;; the 'gpg-error-config' it runs is the native one---i.e., the wrong one.
113 `(#:configure-flags
114 (list (string-append "--with-gpg-error-prefix="
e0932742 115 (assoc-ref %build-inputs "libgpg-error-host")))))
40fed2d8 116 (outputs '("out" "debug"))
72fb1b24 117 (home-page "https://gnupg.org/")
f50d2669 118 (synopsis "Cryptographic function library")
8d1939e4 119 (description
a22dc0c4
LC
120 "Libgcrypt is a general-purpose cryptographic library. It provides the
121standard cryptographic building blocks such as symmetric ciphers, hash
122algorithms, public key algorithms, large integer functions and random number
123generation.")
63e8bb12
LC
124 (license license:lgpl2.0+)
125 (properties '((ftp-server . "ftp.gnupg.org")
126 (ftp-directory . "/gcrypt/libgcrypt")))))
8d1939e4 127
08cba8cc
EF
128(define libgcrypt/fixed
129 (package
130 (inherit libgcrypt)
131 (version "1.8.1")
132 (source (origin
133 (method url-fetch)
134 (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
135 version ".tar.bz2"))
136 (sha256
137 (base32
138 "1cvqd9jk5qshbh48yh3ixw4zyr4n5k50r3475rrh20xfn7w7aa3s"))))))
139
8d1939e4
LC
140(define-public libassuan
141 (package
142 (name "libassuan")
f04a7943 143 (version "2.4.3")
8d1939e4
LC
144 (source
145 (origin
87f5d366 146 (method url-fetch)
0db342a5 147 (uri (string-append "mirror://gnupg/libassuan/libassuan-"
8d1939e4
LC
148 version ".tar.bz2"))
149 (sha256
150 (base32
f04a7943 151 "0w9bmasln4z8mn16s1is55a06w3nv8jbyal496z5jvr5vcxkm112"))))
8d1939e4
LC
152 (build-system gnu-build-system)
153 (propagated-inputs
154 `(("libgpg-error" ,libgpg-error) ("pth" ,pth)))
72fb1b24 155 (home-page "https://gnupg.org")
8d1939e4 156 (synopsis
35b9e423 157 "IPC library used by GnuPG and related software")
8d1939e4
LC
158 (description
159 "Libassuan is a small library implementing the so-called Assuan
160protocol. This protocol is used for IPC between most newer
161GnuPG components. Both, server and client side functions are
162provided.")
63e8bb12
LC
163 (license license:lgpl2.0+)
164 (properties '((ftp-server . "ftp.gnupg.org")
165 (ftp-directory . "/gcrypt/libassuan")))))
8d1939e4
LC
166
167(define-public libksba
168 (package
169 (name "libksba")
c95f7160 170 (version "1.3.5")
8d1939e4
LC
171 (source
172 (origin
87f5d366 173 (method url-fetch)
8d1939e4 174 (uri (string-append
0db342a5 175 "mirror://gnupg/libksba/libksba-"
8d1939e4
LC
176 version ".tar.bz2"))
177 (sha256
178 (base32
c95f7160 179 "0h53q4sns1jz1pkmhcz5wp9qrfn9f5g9i3vjv6dafwzzlvblyi21"))))
8d1939e4
LC
180 (build-system gnu-build-system)
181 (propagated-inputs
182 `(("libgpg-error" ,libgpg-error)))
e766f699
JD
183 (native-inputs
184 `(("libgpg-error" ,libgpg-error)))
185 (arguments
186 `(#:configure-flags
187 (list ,@(if (%current-target-system)
188 '("CC_FOR_BUILD=gcc")
189 '())
190 (string-append "--with-gpg-error-prefix="
191 (assoc-ref %build-inputs "libgpg-error")))))
72fb1b24 192 (home-page "https://www.gnupg.org")
35b9e423 193 (synopsis "CMS and X.509 access library")
8d1939e4
LC
194 (description
195 "KSBA (pronounced Kasbah) is a library to make X.509 certificates
196as well as the CMS easily accessible by other applications. Both
197specifications are building blocks of S/MIME and TLS.")
63e8bb12
LC
198 (license license:gpl3+)
199 (properties '((ftp-server . "ftp.gnupg.org")
200 (ftp-directory . "/gcrypt/libksba")))))
8d1939e4 201
c18ea90f
AE
202(define-public npth
203 (package
204 (name "npth")
f48a9d4a 205 (version "1.5")
c18ea90f
AE
206 (source
207 (origin
208 (method url-fetch)
89c83e8c 209 (uri (string-append "mirror://gnupg/npth/npth-" version ".tar.bz2"))
c18ea90f
AE
210 (sha256
211 (base32
f48a9d4a 212 "1hmkkp6vzyrh8v01c2ynzf9vwikyagp7p1lxhbnr4ysk3w66jji9"))))
c18ea90f 213 (build-system gnu-build-system)
72fb1b24 214 (home-page "https://www.gnupg.org")
c18ea90f
AE
215 (synopsis "Non-preemptive thread library")
216 (description
217 "Npth is a library to provide the GNU Pth API and thus a non-preemptive
218threads implementation.
219
220In contrast to GNU Pth is is based on the system's standard threads
221implementation. This allows the use of libraries which are not
222compatible to GNU Pth.")
07157e8a 223 (license (list license:lgpl3+ license:gpl2+)))) ; dual license
c18ea90f 224
8d1939e4
LC
225(define-public gnupg
226 (package
227 (name "gnupg")
174807b9 228 (version "2.2.2")
58970d6a
LC
229 (source (origin
230 (method url-fetch)
231 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
232 ".tar.bz2"))
233 (sha256
234 (base32
174807b9 235 "15w1q0bib742jqnir67bk07mc6ph9yik8wbc5i1bkcyf29s2rdmz"))))
8d1939e4 236 (build-system gnu-build-system)
08fa45b1
MW
237 (native-inputs
238 `(("pkg-config" ,pkg-config)))
8d1939e4 239 (inputs
e31d35de 240 `(("bzip2" ,bzip2)
01e11826 241 ("curl" ,curl)
08fa45b1 242 ("gnutls" ,gnutls)
8d1939e4
LC
243 ("libassuan" ,libassuan)
244 ("libgcrypt" ,libgcrypt)
01e11826 245 ("libgpg-error" ,libgpg-error)
8d1939e4 246 ("libksba" ,libksba)
cd064df7 247 ("npth" ,npth)
01e11826 248 ("openldap" ,openldap)
cd9ed6c1 249 ("pcsc-lite" ,pcsc-lite)
2d12284d
EF
250 ("readline" ,readline)
251 ("sqlite" ,sqlite)
252 ("zlib" ,zlib)))
30e9cbb4 253 (arguments
10756b9e 254 `(#:configure-flags '(;; Otherwise, the test suite looks for the `gpg`
f11275c9
LF
255 ;; executable in its installation directory in
256 ;; /gnu/store before it has been installed.
e184de57
EF
257 "--enable-gnupg-builddir-envvar"
258 "--enable-all-tests")
163708a6 259 #:phases
45477c6a 260 (modify-phases %standard-phases
cd9ed6c1
MG
261 (add-before 'configure 'patch-paths
262 (lambda* (#:key inputs #:allow-other-keys)
cd9ed6c1
MG
263 (substitute* "scd/scdaemon.c"
264 (("\"(libpcsclite\\.so[^\"]*)\"" _ name)
265 (string-append "\"" (assoc-ref inputs "pcsc-lite")
266 "/lib/" name "\"")))
7deb5ee8
LF
267 #t))
268 (add-after 'build 'patch-scheme-tests
269 (lambda _
270 (substitute* (find-files "tests" ".\\.scm$")
271 (("/usr/bin/env gpgscm")
764c5662
LF
272 (string-append (getcwd) "/tests/gpgscm/gpgscm")))
273 #t))
f11275c9 274 (add-before 'build 'patch-test-paths
92cc6a58
EF
275 (lambda _
276 (substitute* '("tests/inittests"
277 "tests/pkits/inittests"
278 "tests/Makefile"
279 "tests/pkits/common.sh"
280 "tests/pkits/Makefile")
281 (("/bin/pwd") (which "pwd")))
282 (substitute* "common/t-exectool.c"
283 (("/bin/cat") (which "cat"))
284 (("/bin/true") (which "true"))
285 (("/bin/false") (which "false")))
286 #t)))))
72fb1b24 287 (home-page "https://gnupg.org/")
f50d2669 288 (synopsis "GNU Privacy Guard")
8d1939e4 289 (description
a22dc0c4
LC
290 "The GNU Privacy Guard is a complete implementation of the OpenPGP
291standard. It is used to encrypt and sign data and communication. It
292features powerful key management and the ability to access public key
79c311b8 293servers. It includes several libraries: libassuan (IPC between GnuPG
58970d6a
LC
294components), libgpg-error (centralized GnuPG error values), and
295libskba (working with X.509 certificates and CMS data).")
63e8bb12
LC
296 (license license:gpl3+)
297 (properties '((ftp-server . "ftp.gnupg.org")
298 (ftp-directory . "/gcrypt/gnupg")))))
ea4d96c6 299
cd064df7
AE
300(define-public gnupg-2.0
301 (package (inherit gnupg)
b5afe6f0 302 (version "2.0.30")
cd064df7
AE
303 (source (origin
304 (method url-fetch)
305 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
306 ".tar.bz2"))
307 (sha256
308 (base32
b5afe6f0 309 "0wax4cy14hh0h7kg9hj0hjn9424b71z8lrrc5kbsasrn9xd7hag3"))))
08fa45b1 310 (native-inputs '())
cd064df7 311 (inputs
7b40296f
EF
312 `(("adns" ,adns)
313 ("bzip2" ,bzip2)
cd064df7
AE
314 ("curl" ,curl)
315 ("libassuan" ,libassuan)
316 ("libgcrypt" ,libgcrypt)
317 ("libgpg-error" ,libgpg-error)
318 ("libksba" ,libksba)
319 ("pth" ,pth)
320 ("openldap" ,openldap)
07157e8a 321 ("zlib" ,zlib)
cd064df7
AE
322 ("readline" ,readline)))
323 (arguments
324 `(#:phases
80c47cf8 325 (modify-phases %standard-phases
6b547d22
LC
326 (add-before 'configure 'patch-config-files
327 (lambda _
328 (substitute* "tests/openpgp/Makefile.in"
3a534f42 329 (("/bin/sh") (which "sh")))
bc85b127
LC
330 #t))
331 (add-after 'install 'rename-v2-commands
332 (lambda* (#:key outputs #:allow-other-keys)
333 ;; Upstream suggests removing the trailing '2' from command names:
334 ;; <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22883#58>.
335 (let ((out (assoc-ref outputs "out")))
336 (with-directory-excursion (string-append out "/bin")
337 (rename-file "gpgv2" "gpgv")
338 (rename-file "gpg2" "gpg")
339
340 ;; Keep the old name around to ease transition.
341 (symlink "gpgv" "gpgv2")
342 (symlink "gpg" "gpg2")
343 #t)))))))))
cd064df7 344
5249045c
MW
345(define-public gnupg-1
346 (package (inherit gnupg)
81ca29a6 347 (version "1.4.22")
58970d6a
LC
348 (source (origin
349 (method url-fetch)
350 (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
351 ".tar.bz2"))
352 (sha256
353 (base32
81ca29a6 354 "1d1hz4szh1kvwhsw7w2zxa6q5ndrk3qy6hj289l1b8k3xi5s554m"))))
08fa45b1 355 (native-inputs '())
5249045c 356 (inputs
07157e8a
LC
357 `(("zlib" ,zlib)
358 ("bzip2" ,bzip2)
5249045c
MW
359 ("curl" ,curl)
360 ("readline" ,readline)
361 ("libgpg-error" ,libgpg-error)))
362 (arguments
29d90757
LF
363 `(#:phases
364 (modify-phases %standard-phases
365 (add-after 'unpack 'patch-check-sh
366 (lambda _
367 (substitute* "checks/Makefile.in"
2e4b67b9 368 (("/bin/sh") (which "sh"))))))))))
5249045c 369
09d5c166
AE
370(define-public gpgme
371 (package
372 (name "gpgme")
8439c9c0 373 (version "1.9.0")
09d5c166
AE
374 (source
375 (origin
376 (method url-fetch)
377 (uri (string-append "mirror://gnupg/gpgme/gpgme-" version
378 ".tar.bz2"))
379 (sha256
380 (base32
8439c9c0 381 "1ssc0gs02r4fasabk7c6v6r865k2j02mpb5g1vkpbmzsigdzwa8v"))))
09d5c166 382 (build-system gnu-build-system)
68640c3c
MW
383 (propagated-inputs
384 ;; Needs to be propagated because gpgme.h includes gpg-error.h.
385 `(("libgpg-error" ,libgpg-error)))
09d5c166 386 (inputs
ae3bded6 387 `(("gnupg" ,gnupg-2.0)
68640c3c 388 ("libassuan" ,libassuan)))
e10872cc
TD
389 (arguments
390 `(#:phases
391 (modify-phases %standard-phases
392 (add-after 'configure 'patch-cmake-file
393 (lambda _
394 ;; Work around <https://bugs.gnupg.org/gnupg/issue2877>.
395 (substitute* "lang/cpp/src/GpgmeppConfig.cmake.in"
396 (("@libsuffix@") ".so"))
397 #t)))))
72fb1b24 398 (home-page "https://www.gnupg.org/related_software/gpgme/")
35b9e423 399 (synopsis "Library providing simplified access to GnuPG functionality")
09d5c166
AE
400 (description
401 "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
402easier for applications. It provides a High-Level Crypto API for encryption,
403decryption, signing, signature verification and key management. Currently
404it uses GnuPG as its backend but the API isn't restricted to this engine.
405
406Because the direct use of GnuPG from an application can be a complicated
407programming task, it is suggested that all software should try to use GPGME
408instead. This way bug fixes or improvements can be done at a central place
409and every application benefits from this.")
07157e8a 410 (license license:lgpl2.1+)))
09d5c166 411
6b982a78
HG
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 (inputs
431 `(("gpgme" ,gpgme)
432 ("qtbase" ,qtbase)
433 ,@(package-inputs gpgme)))
434 (synopsis "Qt API bindings for gpgme")
435 (description "QGpgme provides a very high level Qt API around GpgMEpp.
436
437QGpgME was originally developed as part of libkleo and incorporated into
438gpgpme starting with version 1.7.")
439 (license license:gpl2+))) ;; Note: this differs from gpgme
440
e3dd1f0c
LF
441(define-public python-gpg
442 (package
443 (name "python-gpg")
99c63f3f 444 (version "1.8.0")
e3dd1f0c
LF
445 (source (origin
446 (method url-fetch)
447 (uri (pypi-uri "gpg" version))
448 (sha256
449 (base32
450 "1x74i6q713c0bckls7rdm8kgsmllf9qvy9x62jghszlhgjkyh9nd"))))
451 (build-system python-build-system)
452 (arguments
453 '(#:tests? #f)) ; No test suite.
454 (inputs
455 `(("gpgme" ,gpgme)))
456 (native-inputs
457 `(("swig" ,swig)))
458 (home-page (package-home-page gpgme))
459 (synopsis "Python bindings for GPGME GnuPG cryptography library")
460 (description "This package provides Python bindings to the GPGME GnuPG
461cryptographic library. It is developed in the GPGME source code, and then
462distributed separately.")
463 (license license:lgpl2.1+)))
464
465(define-public python2-gpg
466 (package-with-python2 python-gpg))
467
a05d1d82
CAW
468(define-public python-pygpgme
469 (package
470 (name "python-pygpgme")
471 (version "0.3")
472 (source
473 (origin
474 (method url-fetch)
475 (uri (pypi-uri "pygpgme" version))
476 (sha256
477 (base32
478 "1q82p3gs6lwq8j8dxk4pvrwk3jpww1zqcjrzznl9clh10z28gn2z"))
479 ;; Unfortunately, we have to disable some tests due to some gpg-agent
480 ;; goofiness... see:
481 ;; https://bugs.launchpad.net/pygpgme/+bug/999949
1c9cea74
LF
482 (patches (search-patches "pygpgme-disable-problematic-tests.patch"
483 "python-pygpgme-fix-pinentry-tests.patch"))))
a05d1d82
CAW
484 (arguments
485 `(#:phases
486 (modify-phases %standard-phases
487 (add-before 'build 'make-build
488 (lambda _
489 (zero? (system* "make" "build"))))
490 (replace 'check
491 (lambda _
492 (zero? (system* "make" "check")))))))
493 (build-system python-build-system)
494 (inputs
a7843522 495 `(("gnupg" ,gnupg-2.0)
a05d1d82
CAW
496 ("gpgme" ,gpgme)))
497 (home-page "https://launchpad.net/pygpgme")
498 (synopsis "Python module for working with OpenPGP messages")
499 (description
500 "PyGPGME is a Python module that lets you sign, verify, encrypt and
501decrypt messages using the OpenPGP format by making use of GPGME.")
502 (license license:lgpl2.1+)))
503
504(define-public python2-pygpgme
5c31f4aa 505 (package-with-python2 python-pygpgme))
a05d1d82 506
22af9029
RW
507(define-public python-gnupg
508 (package
509 (name "python-gnupg")
5b669ba1 510 (version "0.3.8")
22af9029
RW
511 (source
512 (origin
513 (method url-fetch)
5b669ba1 514 (uri (pypi-uri "python-gnupg" version))
22af9029
RW
515 (sha256
516 (base32
5b669ba1 517 "0nkbs9c8f30lra7ca39kg91x8cyxn0jb61vih4qky839gpbwwwiq"))))
22af9029
RW
518 (build-system python-build-system)
519 (arguments
520 `(#:phases
521 (modify-phases %standard-phases
522 (replace 'check
ec089763
RW
523 (lambda _
524 (substitute* "test_gnupg.py"
525 ;; Exported keys don't have a version line!
526 (("del k1\\[1\\]") "#")
527 ;; Unsure why this test fails.
528 (("'test_search_keys'") "True")
529 (("def test_search_keys") "def disabled__search_keys"))
530 (setenv "USERNAME" "guixbuilder")
531 ;; The doctests are extremely slow and sometimes time out,
532 ;; so we disable them.
533 (zero? (system* "python"
534 "test_gnupg.py" "--no-doctests")))))))
22af9029
RW
535 (native-inputs
536 `(("gnupg" ,gnupg-1)))
72fb1b24 537 (home-page "https://packages.python.org/python-gnupg/index.html")
22af9029
RW
538 (synopsis "Wrapper for the GNU Privacy Guard")
539 (description
540 "This module allows easy access to GnuPG’s key management, encryption
541and signature functionality from Python programs.")
542 (license license:bsd-3)))
543
544(define-public python2-gnupg
545 (package-with-python2 python-gnupg))
546
34ef5755
CB
547(define-public perl-gnupg-interface
548 (package
549 (name "perl-gnupg-interface")
550 (version "0.52")
551 (source
552 (origin
553 (method url-fetch)
554 (uri (string-append
555 "mirror://cpan/authors/id/A/AL/ALEXMV/GnuPG-Interface-"
556 version
557 ".tar.gz"))
558 (sha256
559 (base32
560 "0dgx8yhdsmhkazcrz14n4flrk1afv7azgl003hl4arxvi1d9yyi4"))))
561 (build-system perl-build-system)
562 (arguments
563 '(;; Result: FAIL
564 ;; Failed 10/20 test programs. 21/52 subtests failed.
565 #:tests? #f))
566 (native-inputs
567 `(("perl-module-install" ,perl-module-install)
568 ("which" ,which)))
569 (inputs
570 `(("gnupg" ,gnupg)))
571 (propagated-inputs
572 `(("perl-moo" ,perl-moo)
573 ("perl-moox-late" ,perl-moox-late)
574 ("perl-moox-handlesvia" ,perl-moox-handlesvia)))
575 (home-page "http://search.cpan.org/~alexmv/GnuPG-Interface/")
576 (synopsis "Perl interface to GnuPG")
577 (description
578 "@code{GnuPG::Interface} and its associated modules are designed to
579provide an object-oriented method for interacting with GnuPG, being able to
580perform functions such as but not limited to encrypting, signing, decryption,
581verification, and key-listing parsing.")
582 (license license:perl-license)))
583
ea4d96c6 584(define-public pius
cda0ef04
TS
585 (package
586 (name "pius")
1b34a47d 587 (version "2.2.4")
cda0ef04
TS
588 (source (origin
589 (method url-fetch)
590 (uri (string-append
591 "https://github.com/jaymzh/pius/releases/download/v"
592 version "/pius-" version ".tar.bz2"))
593 (sha256
594 (base32
1b34a47d 595 "0lgc0ipwdfqbq16zax8kn17wbv8xyw4ygc09fawl2yp459z0ql4n"))))
cda0ef04
TS
596 (build-system python-build-system)
597 (inputs `(("perl" ,perl) ;for 'pius-party-worksheet'
598 ("gpg" ,gnupg)))
599 (arguments
600 `(#:tests? #f
601 #:python ,python-2 ;uses the Python 2 'print' syntax
602 #:phases
603 (modify-phases %standard-phases
604 (add-before
605 'build 'set-gpg-file-name
606 (lambda* (#:key inputs outputs #:allow-other-keys)
607 (let* ((gpg (string-append (assoc-ref inputs "gpg")
608 "/bin/gpg")))
609 (substitute* "libpius/constants.py"
610 (("/usr/bin/gpg2") gpg))
611 #t))))))
612 (synopsis "Programs to simplify GnuPG key signing")
613 (description
614 "Pius (PGP Individual UID Signer) helps attendees of PGP keysigning
35b9e423
EB
615parties. It is the main utility and makes it possible to quickly and easily
616sign each UID on a set of PGP keys. It is designed to take the pain out of
ea4d96c6
AE
617the sign-all-the-keys part of PGP Keysigning Party while adding security
618to the process.
619
620pius-keyring-mgr and pius-party-worksheet help organisers of
621PGP keysigning parties.")
cda0ef04
TS
622 (license license:gpl2)
623 (home-page "https://www.phildev.net/pius/index.shtml")))
96be765c
AE
624
625(define-public signing-party
626 (package
627 (name "signing-party")
c9ce8e17 628 (version "2.6")
96be765c
AE
629 (source (origin
630 (method url-fetch)
807143b6
EF
631 (uri (string-append "mirror://debian/pool/main/s/signing-party/"
632 "signing-party_" version ".orig.tar.gz"))
96be765c 633 (sha256 (base32
c9ce8e17 634 "1n5bpcfpl9vg1xp6r1jhbyahrgdyxp05b5pria1rh4m0qnv8sifr"))))
96be765c 635 (build-system gnu-build-system)
c9ce8e17
CB
636 (native-inputs
637 `(("autoconf" ,(autoconf-wrapper))
638 ("automake" ,automake)))
639 (inputs `(("perl" ,perl)
640 ("perl-text-template" ,perl-text-template)
641 ("perl-mime-tools" ,perl-mime-tools)
642 ("perl-gnupg-interface" ,perl-gnupg-interface)
643 ("perl-net-idn-encode" ,perl-net-idn-encode)
644 ("libmd" ,libmd)))
96be765c
AE
645 (arguments
646 `(#:tests? #f
647 #:phases
6a90a614 648 (modify-phases %standard-phases
c9ce8e17
CB
649 (add-before 'configure 'change-directory
650 (lambda _
651 ;; The build system in the unpack phase changes to a less useful
652 ;; subdirectory, so move up one level
653 (chdir (dirname (getcwd)))))
6a90a614
EF
654 (replace 'configure
655 (lambda* (#:key outputs #:allow-other-keys)
656 (let ((out (assoc-ref outputs "out")))
657 (substitute* "keyanalyze/Makefile"
658 (("LDLIBS") (string-append "CC=" (which "gcc") "\nLDLIBS")))
659 (substitute* "keyanalyze/Makefile"
c9ce8e17
CB
660 (("\\./configure") (string-append "./configure --prefix=" out)))
661 (substitute* "gpgwrap/src/Makefile"
6a90a614
EF
662 (("\\} clean")
663 (string-append "} clean\ninstall:\n\tinstall -D bin/gpgwrap "
664 out "/bin/gpgwrap\n")))
665 (substitute* '("gpgsigs/Makefile" "keyanalyze/Makefile"
666 "keylookup/Makefile" "sig2dot/Makefile"
667 "springgraph/Makefile")
c9ce8e17
CB
668 (("/usr") out))
669 (setenv "CONFIG_SHELL" (which "sh")))))
6a90a614
EF
670 (replace 'install
671 (lambda* (#:key outputs #:allow-other-keys #:rest args)
672 (let ((out (assoc-ref outputs "out"))
673 (install (assoc-ref %standard-phases 'install)))
674 (apply install args)
675 (for-each
676 (lambda (dir file)
677 (copy-file (string-append dir "/" file)
678 (string-append out "/bin/" file)))
679 '("caff" "caff" "caff" "gpgdir" "gpg-key2ps"
680 "gpglist" "gpg-mailkeys" "gpgparticipants")
681 '("caff" "pgp-clean" "pgp-fixkey" "gpgdir" "gpg-key2ps"
682 "gpglist" "gpg-mailkeys" "gpgparticipants"))
683 (for-each
684 (lambda (dir file)
685 (copy-file (string-append dir "/" file)
686 (string-append out "/share/man/man1/" file)))
687 '("caff" "caff" "caff" "gpgdir"
688 "gpg-key2ps" "gpglist" "gpg-mailkeys"
689 "gpgparticipants" "gpgsigs" "gpgwrap/doc"
690 "keyanalyze" "keyanalyze/pgpring" "keyanalyze")
691 '("caff.1" "pgp-clean.1" "pgp-fixkey.1" "gpgdir.1"
692 "gpg-key2ps.1" "gpglist.1" "gpg-mailkeys.1"
693 "gpgparticipants.1" "gpgsigs.1" "gpgwrap.1"
c9ce8e17
CB
694 "process_keys.1" "pgpring.1" "keyanalyze.1")))))
695 (add-after 'install 'wrap-programs
696 (lambda* (#:key outputs #:allow-other-keys)
697 (let* ((out (assoc-ref outputs "out")))
698 (wrap-program
699 (string-append out "/bin/caff")
700 `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))))))))
35b9e423 701 (synopsis "Collection of scripts for simplifying gnupg key signing")
96be765c 702 (description
35b9e423 703 "Signing-party is a collection for all kinds of PGP/GnuPG related things,
96be765c 704including tools for signing keys, keyring analysis, and party preparation.
7ac53403
EF
705@enumerate
706@item caff: CA - Fire and Forget signs and mails a key
707@item pgp-clean: removes all non-self signatures from key
708@item pgp-fixkey: removes broken packets from keys
709@item gpg-mailkeys: simply mail out a signed key to its owner
710@item gpg-key2ps: generate PostScript file with fingerprint paper strips
711@item gpgdir: recursive directory encryption tool
712@item gpglist: show who signed which of your UIDs
713@item gpgsigs: annotates list of GnuPG keys with already done signatures
714@item gpgparticipants: create list of party participants for the organiser
715@item gpgwrap: a passphrase wrapper
716@item keyanalyze: minimum signing distance (MSD) analysis on keyrings
717@item keylookup: ncurses wrapper around gpg --search
718@item sig2dot: converts a list of GnuPG signatures to a .dot file
719@item springgraph: creates a graph from a .dot file
720@end enumerate")
96be765c
AE
721 ;; gpl2+ for almost all programs, except for keyanalyze: gpl2
722 ;; and caff and gpgsigs: bsd-3, see
723 ;; http://packages.debian.org/changelogs/pool/main/s/signing-party/current/copyright
07157e8a 724 (license license:gpl2)
72fb1b24 725 (home-page "https://pgp-tools.alioth.debian.org/")))
40d806af 726
c607b701 727(define-public pinentry-tty
40d806af 728 (package
c607b701 729 (name "pinentry-tty")
9b1d77f6 730 (version "1.0.0")
40d806af
LC
731 (source (origin
732 (method url-fetch)
733 (uri (string-append "mirror://gnupg/pinentry/pinentry-"
734 version ".tar.bz2"))
735 (sha256
736 (base32
9b1d77f6 737 "0ni7g4plq6x78p32al7m8h2zsakvg1rhfz0qbc3kdc7yq7nw4whn"))))
40d806af 738 (build-system gnu-build-system)
c607b701
EF
739 (arguments
740 `(#:configure-flags '("--enable-pinentry-tty")))
40d806af
LC
741 (inputs
742 `(("ncurses" ,ncurses)
18ed97d6 743 ("libassuan" ,libassuan)
c607b701 744 ("libsecret" ,libsecret "out")))
40d806af
LC
745 (native-inputs
746 `(("pkg-config" ,pkg-config)))
547cb17d 747 (home-page "https://gnupg.org/aegypten2/")
40d806af
LC
748 (synopsis "GnuPG's interface to passphrase input")
749 (description
c607b701 750 "Pinentry provides a console that allows users to enter a passphrase when
9614897b 751@code{gpg} is run and needs it.")
07157e8a 752 (license license:gpl2+)))
4380a7b4 753
c607b701
EF
754(define-public pinentry-gtk2
755 (package
756 (inherit pinentry-tty)
757 (name "pinentry-gtk2")
758 (inputs
759 `(("gtk+" ,gtk+-2)
760 ("glib" ,glib)
761 ,@(package-inputs pinentry-tty)))
762 (description
763 "Pinentry provides a console and a GTK+ GUI that allows users to enter a
9614897b 764passphrase when @code{gpg} is run and needs it.")))
c607b701 765
41edb23f
CB
766(define-public pinentry-gnome3
767 (package
768 (inherit pinentry-tty)
769 (name "pinentry-gnome3")
770 (inputs
771 `(("gtk+" ,gtk+-2)
772 ("gcr" ,gcr)
773 ("glib" ,glib)
774 ,@(package-inputs pinentry-tty)))
775 (arguments
776 `(#:configure-flags '("--enable-pinentry-gnome3")))
777 (description
778 "Pinentry provides a console and a GUI designed for use with GNOME@tie{}3
779that allows users to enter a passphrase when required by @code{gpg} or other
780software.")))
c607b701 781
54df7558
EF
782(define-public pinentry-qt
783 (package
784 (inherit pinentry-tty)
785 (name "pinentry-qt")
786 (inputs
e2788cef 787 `(("qtbase" ,qtbase)
54df7558 788 ,@(package-inputs pinentry-tty)))
984ad832
DC
789 (arguments
790 `(#:configure-flags '("CXXFLAGS=-std=gnu++11")))
54df7558
EF
791 (description
792 "Pinentry provides a console and a Qt GUI that allows users to enter a
9614897b 793passphrase when @code{gpg} is run and needs it.")))
54df7558 794
940f8d39
EF
795(define-public pinentry
796 (package (inherit pinentry-gtk2)
797 (name "pinentry")))
798
4380a7b4
EB
799(define-public paperkey
800 (package
801 (name "paperkey")
802 (version "1.3")
803 (source (origin
804 (method url-fetch)
805 (uri (string-append "http://www.jabberwocky.com/"
806 "software/paperkey/paperkey-"
807 version ".tar.gz"))
808 (sha256
809 (base32
810 "1yybj8bj68v4lxwpn596b6ismh2fyixw5vlqqg26byrn4d9dfmsv"))))
811 (build-system gnu-build-system)
812 (arguments
813 `(#:phases
e379d85c
EF
814 (modify-phases %standard-phases
815 (add-before 'check 'patch-check-scripts
816 (lambda _
817 (substitute* '("checks/roundtrip.sh"
818 "checks/roundtrip-raw.sh")
819 (("/bin/echo") "echo"))
820 #t)))))
4380a7b4
EB
821 (home-page "http://www.jabberwocky.com/software/paperkey/")
822 (synopsis "Backup OpenPGP keys to paper")
823 (description
824 "Paperkey extracts the secret bytes from an OpenPGP (GnuPG, PGP, etc) key
825for printing with paper and ink, which have amazingly long retention
826qualities. To reconstruct a secret key, you re-enter those
827bytes (whether by hand, OCR, QR code, or the like) and paperkey can use
828them to transform your existing public key into a secret key.")
07157e8a 829 (license license:gpl2+)))
8384499c 830
831(define-public gpa
832 (package
833 (name "gpa")
834 (version "0.9.10")
835 (source (origin
836 (method url-fetch)
837 (uri (string-append "mirror://gnupg/gpa/"
838 name "-" version ".tar.bz2"))
839 (sha256
840 (base32
841 "09xphbi2456qynwqq5n0yh0zdmdi2ggrj3wk4hsyh5lrzlvcrff3"))))
842 (build-system gnu-build-system)
843 (native-inputs
844 `(("pkg-config" ,pkg-config)))
845 (inputs
846 `(("gnupg" ,gnupg)
847 ("gpgme" ,gpgme)
848 ("libassuan" ,libassuan)
849 ("libgpg-error" ,libgpg-error)
850 ("gtk+-2" ,gtk+-2)))
851 (home-page "https://gnupg.org/software/gpa/")
852 (synopsis "Graphical user interface for GnuPG")
853 (description
854 "GPA, the GNU Privacy Assistant, is a graphical user interface for
855@uref{https://gnupg.org, GnuPG}. It can be used to encrypt, decrypt, and sign
856files, to verify signatures, and to manage the private and public keys.")
857 (license license:gpl3+)))
5aeb6611
RW
858
859(define-public perl-gnupg-interface
860 (package
861 (name "perl-gnupg-interface")
862 (version "0.52")
863 (source (origin
864 (method url-fetch)
865 (uri (string-append "mirror://cpan/authors/id/A/AL/ALEXMV/"
866 "GnuPG-Interface-" version ".tar.gz"))
867 (sha256
868 (base32
869 "0dgx8yhdsmhkazcrz14n4flrk1afv7azgl003hl4arxvi1d9yyi4"))))
870 (build-system perl-build-system)
871 (arguments
872 `(#:phases
873 (modify-phases %standard-phases
874 ;; FIXME: This test fails for unknown reasons
875 (add-after 'unpack 'delete-broken-test
876 (lambda _
877 (delete-file "t/encrypt_symmetrically.t")
878 #t)))))
879 (inputs
880 `(("gnupg" ,gnupg-1)))
881 (propagated-inputs
882 `(("perl-moo" ,perl-moo)
883 ("perl-moox-handlesvia" ,perl-moox-handlesvia)
884 ("perl-moox-late" ,perl-moox-late)))
885 (native-inputs
886 `(("which" ,which)
887 ("perl-module-install" ,perl-module-install)))
888 (home-page "http://search.cpan.org/dist/GnuPG-Interface/")
889 (synopsis "Perl interface to GnuPG")
890 (description "@code{GnuPG::Interface} and its associated modules are
891designed to provide an object-oriented method for interacting with GnuPG,
892being able to perform functions such as but not limited to encrypting,
893signing, decryption, verification, and key-listing parsing.")
894 (license license:perl-license)))
15b08442
P
895
896(define-public parcimonie
897 (package
898 (name "parcimonie")
899 (version "0.10.3")
900 (source (origin
901 (method url-fetch)
902 (uri (string-append "https://gaffer.ptitcanardnoir.org/"
903 "intrigeri/files/parcimonie/App-Parcimonie-"
904 version ".tar.gz"))
905 (sha256
906 (base32
907 "1kf891117s1f3k6lxvbjdb21va9gxh29vlp9bd664ssgw266rcyb"))))
908 (build-system perl-build-system)
909 (inputs
910 `(("gnupg" ,gnupg-1) ; This is the version used by perl-gnupg-interface
911 ("perl-config-general" ,perl-config-general)
912 ("perl-clone" ,perl-clone)
913 ("perl-data" ,perl-data)
914 ("perl-exporter-tiny" ,perl-exporter-tiny)
915 ("perl-file-homedir" ,perl-file-homedir)
916 ("perl-file-sharedir" ,perl-file-sharedir)
917 ("perl-file-which" ,perl-file-which)
918 ("perl-getopt-long-descriptive" ,perl-getopt-long-descriptive)
919 ("perl-gnupg-interface" ,perl-gnupg-interface)
920 ("perl-ipc-system-simple" ,perl-ipc-system-simple)
921 ("perl-list-moreutils" ,perl-list-moreutils)
922 ("perl-libintl-perl" ,perl-libintl-perl) ; Locale::TextDomain
923 ("perl-lwp-online" ,perl-lwp-online)
924 ("perl-module-build" ,perl-module-build)
925 ("perl-module-pluggable-object" ,perl-module-pluggable)
926 ("perl-moo" ,perl-moo)
927 ("perl-moox-handlesvia" ,perl-moox-handlesvia)
928 ("perl-moox-late" ,perl-moox-late)
929 ("perl-moox-options" ,perl-moox-options)
930 ("perl-namespace-clean" ,perl-namespace-clean)
931 ("perl-net-dbus" ,perl-net-dbus)
932 ("perl-net-dbus-glib" ,perl-net-dbus-glib)
933 ("perl-path-tiny" ,perl-path-tiny)
934 ("perl-test-most" ,perl-test-most)
935 ("perl-test-trap" ,perl-test-trap)
936 ("perl-time-duration" ,perl-time-duration)
937 ("perl-time-duration-parse" ,perl-time-duration-parse)
938 ("perl-try-tiny" ,perl-try-tiny)
939 ("perl-type-tiny" ,perl-type-tiny)
940 ("perl-types-path-tiny" ,perl-types-path-tiny)
941 ("perl-unicode-linebreak" ,perl-unicode-linebreak)
942 ("perl-xml-parser" ,perl-xml-parser)
943 ("perl-xml-twig" ,perl-xml-twig)
944 ("torsocks" ,torsocks)))
945 (arguments
946 `(#:phases
947 (modify-phases %standard-phases
948 ;; Needed for using gpg-connect-agent during tests.
949 (add-before 'check 'set-HOME
950 (lambda _ (setenv "HOME" "/tmp") #t))
951 (add-before 'install 'fix-references
952 (lambda* (#:key inputs outputs #:allow-other-keys)
953 (substitute* "lib/App/Parcimonie/GnuPG/Interface.pm"
954 (("gpg2") "gpg")
955 ;; Skip check whether dependencies are in the PATH
956 (("defined which.*") "")
957 (("call\\('parcimonie-torified-gpg'\\)")
958 (string-append "call('" (assoc-ref outputs "out")
959 "/bin/parcimonie-torified-gpg')")))
960 (substitute* "bin/parcimonie-torified-gpg"
961 (("torsocks") (string-append (assoc-ref inputs "torsocks")
962 "/bin/torsocks")))
963 #t))
964 (add-after 'install 'wrap-program
965 (lambda* (#:key inputs outputs #:allow-other-keys)
966 (let* ((out (assoc-ref outputs "out"))
967 (perllib (string-append out "/lib/perl5/site_perl/"
968 ,(package-version perl))))
969 (wrap-program (string-append out "/bin/parcimonie")
970 `("PERL5LIB" ":"
971 prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))
972 #t))))))
973 (home-page "https://gaffer.ptitcanardnoir.org/intrigeri/code/parcimonie/")
974 (synopsis "Incrementally refreshes a GnuPG keyring")
975 (description "Parcimonie incrementaly refreshes a GnuPG keyring in a way
976that makes it hard to correlate the keyring content to an individual, and
977makes it hard to locate an individual based on an identifying subset of her
978keyring content. Parcimonie is a daemon that fetches one key at a time using
979the Tor network, waits a bit, changes the Tor circuit being used, and starts
980over.")
981 (license license:gpl1+)))
7756eab0 982
983(define-public python2-pgpdump
984 (package
985 (name "python2-pgpdump")
986 (version "1.5")
987 (source
988 (origin
989 (method url-fetch)
990 (uri (pypi-uri "pgpdump" version))
991 (sha256
992 (base32
993 "0s4nh8h7qsdj2yf29bspjs1zvxd4lcd11r6g11dp7fppgf2h0iqw"))))
994 (build-system python-build-system)
995
996 ;; Currently fails to build with Python 3.
997 (arguments `(#:python ,python-2))
998
999 (home-page "https://github.com/toofishes/python-pgpdump")
1000 (synopsis "Python library for parsing PGP packets")
1001 (description
1002 "Python-pgpdump is an OpenPGP packet parser based on
1003@uref{http://www.mew.org/~kazu/proj/pgpdump/, pgpdump}. It notably supports:
1004
1005@itemize
1006@item signature packets;
1007@item public key packets;
1008@item secret key packets;
1009@item trust, user ID, and user attribute packets;
1010@item ASCII-armor decoding and CRC check.
1011@end itemize\n")
1012 (license license:bsd-3)))