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