Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
caeadfdd | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> |
80cc3a0a | 3 | ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org> |
29a7c98a | 4 | ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net> |
cc2b77df | 5 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> |
9fd0838b | 6 | ;;; Copyright © 2015 David Thompson <davet@gnu.org> |
12433a21 | 7 | ;;; Copyright © 2015, 2016 Leo Famulari <leo@famulari.name> |
3ea110b7 | 8 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
679b535b | 9 | ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is> |
375cef6c | 10 | ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com> |
7543f865 | 11 | ;;; |
233e7676 | 12 | ;;; This file is part of GNU Guix. |
7543f865 | 13 | ;;; |
233e7676 | 14 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
7543f865 LC |
15 | ;;; under the terms of the GNU General Public License as published by |
16 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
17 | ;;; your option) any later version. | |
18 | ;;; | |
233e7676 | 19 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
7543f865 LC |
20 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | ;;; GNU General Public License for more details. | |
23 | ;;; | |
24 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 25 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
7543f865 | 26 | |
a7fd7b68 | 27 | (define-module (gnu packages tls) |
e9aa8d0c | 28 | #:use-module ((guix licenses) #:prefix license:) |
7543f865 LC |
29 | #:use-module (guix packages) |
30 | #:use-module (guix download) | |
29a7c98a | 31 | #:use-module (guix utils) |
7543f865 | 32 | #:use-module (guix build-system gnu) |
cc2b77df | 33 | #:use-module (guix build-system perl) |
7890e3ba | 34 | #:use-module (guix build-system python) |
f61e0e79 | 35 | #:use-module (gnu packages compression) |
013ce67b | 36 | #:use-module (gnu packages) |
1ffa7090 | 37 | #:use-module (gnu packages guile) |
0581c273 | 38 | #:use-module (gnu packages libbsd) |
27e86bed | 39 | #:use-module (gnu packages libffi) |
866f469e | 40 | #:use-module (gnu packages libidn) |
5d4c90ae | 41 | #:use-module (gnu packages linux) |
7890e3ba | 42 | #:use-module (gnu packages ncurses) |
27e86bed | 43 | #:use-module (gnu packages nettle) |
1ffa7090 | 44 | #:use-module (gnu packages perl) |
27e86bed | 45 | #:use-module (gnu packages pkg-config) |
7890e3ba | 46 | #:use-module (gnu packages python) |
a31f4d35 | 47 | #:use-module (gnu packages texinfo) |
ce0614dd | 48 | #:use-module (gnu packages base)) |
7543f865 LC |
49 | |
50 | (define-public libtasn1 | |
51 | (package | |
52 | (name "libtasn1") | |
12433a21 | 53 | (version "4.9") |
7543f865 LC |
54 | (source |
55 | (origin | |
56 | (method url-fetch) | |
57 | (uri (string-append "mirror://gnu/libtasn1/libtasn1-" | |
58 | version ".tar.gz")) | |
59 | (sha256 | |
60 | (base32 | |
12433a21 | 61 | "0869cp6jx7cajgv6cnddsh3vc7bimmdkdjn80y1jpb4iss7plvsg")))) |
7543f865 | 62 | (build-system gnu-build-system) |
3ea110b7 | 63 | (native-inputs `(("perl" ,perl))) |
7543f865 | 64 | (home-page "http://www.gnu.org/software/libtasn1/") |
f50d2669 | 65 | (synopsis "ASN.1 library") |
7543f865 | 66 | (description |
79c311b8 LC |
67 | "GNU libtasn1 is a library implementing the ASN.1 notation. It is used |
68 | for transmitting machine-neutral encodings of data objects in computer | |
a22dc0c4 LC |
69 | networking, allowing for formal validation of data according to some |
70 | specifications.") | |
e9aa8d0c | 71 | (license license:lgpl2.0+))) |
7543f865 | 72 | |
375cef6c HG |
73 | (define-public asn1c |
74 | (package | |
75 | (name "asn1c") | |
76 | (version "0.9.27") | |
77 | (source (origin | |
78 | (method url-fetch) | |
79 | (uri (string-append "https://lionet.info/soft/asn1c-" | |
80 | version ".tar.gz")) | |
81 | (sha256 | |
82 | (base32 | |
83 | "17nvn2kzvlryasr9dzqg6gs27b9lvqpval0k31pb64bjqbhn8pq2")))) | |
84 | (build-system gnu-build-system) | |
85 | (native-inputs | |
86 | `(("perl" ,perl))) | |
87 | (home-page "https://lionet.info/asn1c") | |
88 | (synopsis "ASN.1 to C compiler") | |
89 | (description "The ASN.1 to C compiler takes ASN.1 module | |
90 | files and generates C++ compatible C source code. That code can be | |
91 | used to serialize the native C structures into compact and unambiguous | |
92 | BER/XER/PER-based data files, and deserialize the files back. | |
93 | ||
94 | Various ASN.1 based formats are widely used in the industry, such as to encode | |
95 | the X.509 certificates employed in the HTTPS handshake, to exchange control | |
96 | data between mobile phones and cellular networks, to car-to-car communication | |
97 | in intelligent transportation networks.") | |
98 | (license license:bsd-2))) | |
99 | ||
27e86bed AE |
100 | (define-public p11-kit |
101 | (package | |
102 | (name "p11-kit") | |
2b11b9ab | 103 | (version "0.23.2") |
27e86bed AE |
104 | (source |
105 | (origin | |
106 | (method url-fetch) | |
5cc3096c | 107 | (uri (string-append "https://p11-glue.freedesktop.org/releases/p11-kit-" |
27e86bed AE |
108 | version ".tar.gz")) |
109 | (sha256 | |
110 | (base32 | |
2b11b9ab | 111 | "1w7szm190phlkg7qx05ychlj2dbvkgkhx9gw6dx4d5rw62l6wwms")) |
27e86bed AE |
112 | (modules '((guix build utils))) ; for substitute* |
113 | (snippet | |
114 | '(begin | |
115 | ;; Drop one test that fails, also when trying to compile manually. | |
116 | ;; Reported upstream at | |
117 | ;; https://bugs.freedesktop.org/show_bug.cgi?id=89027 | |
118 | (substitute* "Makefile.in" | |
119 | (("test-module\\$\\(EXEEXT\\) ") "")))))) | |
120 | (build-system gnu-build-system) | |
121 | (native-inputs | |
122 | `(("pkg-config" ,pkg-config))) | |
123 | (inputs | |
124 | `(("libffi" ,libffi) | |
125 | ("libtasn1" ,libtasn1))) | |
126 | (arguments | |
127 | `(#:configure-flags '("--without-trust-paths"))) | |
128 | (home-page "http://p11-glue.freedesktop.org/p11-kit.html") | |
129 | (synopsis "PKCS#11 library") | |
130 | (description | |
131 | "p11-kit provides a way to load and enumerate PKCS#11 modules. It | |
132 | provides a standard configuration setup for installing PKCS#11 modules | |
133 | in such a way that they are discoverable. It also solves problems with | |
134 | coordinating the use of PKCS#11 by different components or libraries | |
135 | living in the same process.") | |
e9aa8d0c | 136 | (license license:bsd-3))) |
27e86bed | 137 | |
7543f865 LC |
138 | (define-public gnutls |
139 | (package | |
140 | (name "gnutls") | |
ce0b822e | 141 | (version "3.5.4") |
d7d408d5 LC |
142 | (source (origin |
143 | (method url-fetch) | |
144 | (uri | |
145 | ;; Note: Releases are no longer on ftp.gnu.org since the | |
146 | ;; schism (after version 3.1.5). | |
d93627e4 | 147 | (string-append "mirror://gnupg/gnutls/v" |
29a7c98a | 148 | (version-major+minor version) |
d93627e4 | 149 | "/gnutls-" version ".tar.xz")) |
d7d408d5 LC |
150 | (sha256 |
151 | (base32 | |
ce0b822e | 152 | "1sx8p7v452s9m854r2c5pvcd1k15a3caiv5h35fhrxz0691h2f2f")))) |
7543f865 | 153 | (build-system gnu-build-system) |
b94ae0b8 AK |
154 | (arguments |
155 | '(#:configure-flags | |
156 | (list (string-append "--with-guile-site-dir=" | |
157 | (assoc-ref %outputs "out") | |
aa7c7f21 MW |
158 | "/share/guile/site/2.0") |
159 | ;; GnuTLS doesn't consult any environment variables to specify | |
160 | ;; the location of the system-wide trust store. Instead it has a | |
161 | ;; configure-time option. Unless specified, its configure script | |
162 | ;; attempts to auto-detect the location by looking for common | |
8f65585b | 163 | ;; places in the file system, none of which are present in our |
aa7c7f21 MW |
164 | ;; chroot build environment. If not found, then no default trust |
165 | ;; store is used, so each program has to provide its own | |
166 | ;; fallback, and users have to configure each program | |
167 | ;; independently. This seems suboptimal. | |
866f469e MW |
168 | "--with-default-trust-store-dir=/etc/ssl/certs" |
169 | ||
170 | ;; FIXME: Temporarily disable p11-kit support since it is not | |
171 | ;; working on mips64el. | |
606c6380 LC |
172 | "--without-p11-kit") |
173 | ||
174 | #:phases (modify-phases %standard-phases | |
175 | (add-after | |
176 | 'install 'move-doc | |
177 | (lambda* (#:key outputs #:allow-other-keys) | |
178 | ;; Copy the 4.1 MiB of section 3 man pages to "doc". | |
179 | (let* ((out (assoc-ref outputs "out")) | |
180 | (doc (assoc-ref outputs "doc")) | |
9cdce047 | 181 | (mandir (string-append doc "/share/man/man3")) |
606c6380 LC |
182 | (oldman (string-append out "/share/man/man3"))) |
183 | (mkdir-p mandir) | |
184 | (copy-recursively oldman mandir) | |
185 | (delete-file-recursively oldman) | |
186 | #t)))))) | |
187 | (outputs '("out" ;4.4 MiB | |
188 | "debug" | |
189 | "doc")) ;4.1 MiB of man pages | |
a1db0975 | 190 | (native-inputs |
5d4c90ae LF |
191 | `(("net-tools" ,net-tools) |
192 | ("pkg-config" ,pkg-config) | |
d2fcfd3d | 193 | ("which" ,which))) |
7543f865 LC |
194 | (inputs |
195 | `(("guile" ,guile-2.0) | |
0cb9b456 | 196 | ("perl" ,perl))) |
7543f865 | 197 | (propagated-inputs |
d2fcfd3d | 198 | ;; These are all in the 'Requires.private' field of gnutls.pc. |
7543f865 | 199 | `(("libtasn1" ,libtasn1) |
866f469e MW |
200 | ("libidn" ,libidn) |
201 | ("nettle" ,nettle) | |
f61e0e79 | 202 | ("zlib" ,zlib))) |
c19700c3 | 203 | (home-page "https://www.gnu.org/software/gnutls/") |
f50d2669 | 204 | (synopsis "Transport layer security library") |
7543f865 | 205 | (description |
a22dc0c4 | 206 | "GnuTLS is a secure communications library implementing the SSL, TLS |
79c311b8 | 207 | and DTLS protocols. It is provided in the form of a C library to support the |
a22dc0c4 LC |
208 | protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other |
209 | required structures.") | |
63e8bb12 LC |
210 | (license license:lgpl2.1+) |
211 | (properties '((ftp-server . "ftp.gnutls.org") | |
212 | (ftp-directory . "/gcrypt/gnutls"))))) | |
cc2b77df AE |
213 | |
214 | (define-public openssl | |
215 | (package | |
216 | (name "openssl") | |
1d8de185 | 217 | (version "1.0.2j") |
cc2b77df | 218 | (source (origin |
4cff124b LC |
219 | (method url-fetch) |
220 | (uri (list (string-append "ftp://ftp.openssl.org/source/" | |
221 | name "-" version ".tar.gz") | |
222 | (string-append "ftp://ftp.openssl.org/source/old/" | |
223 | (string-trim-right version char-set:letter) | |
224 | "/" name "-" version ".tar.gz"))) | |
225 | (sha256 | |
226 | (base32 | |
1d8de185 | 227 | "0cf4ar97ijfc7mg35zdgpad6x8ivkdx9qii6mz35khi1ps9g5bz7")) |
fc1adab1 | 228 | (patches (search-patches "openssl-runpath.patch" |
1d8de185 | 229 | "openssl-c-rehash-in.patch")))) |
cc2b77df | 230 | (build-system gnu-build-system) |
8c78aeb7 | 231 | (outputs '("out" |
a909b576 | 232 | "doc" ;1.5MiB of man3 pages |
8c78aeb7 | 233 | "static")) ;6MiB of .a files |
cc2b77df AE |
234 | (native-inputs `(("perl" ,perl))) |
235 | (arguments | |
d03781c3 LC |
236 | `(#:disallowed-references (,perl) |
237 | #:parallel-build? #f | |
cc2b77df AE |
238 | #:parallel-tests? #f |
239 | #:test-target "test" | |
8c9ec203 LF |
240 | |
241 | ;; Changes to OpenSSL sometimes cause Perl to "sneak in" to the closure, | |
242 | ;; so we explicitly disallow it here. | |
243 | #:disallowed-references ,(list (canonical-package perl)) | |
cc2b77df | 244 | #:phases |
b6cb1358 | 245 | (modify-phases %standard-phases |
4fb254a3 | 246 | (add-before |
86c8f1da | 247 | 'configure 'patch-Makefile.org |
4fb254a3 LC |
248 | (lambda* (#:key outputs #:allow-other-keys) |
249 | ;; The default MANDIR is some unusual place. Fix that. | |
250 | (let ((out (assoc-ref outputs "out"))) | |
86c8f1da | 251 | (patch-makefile-SHELL "Makefile.org") |
4fb254a3 LC |
252 | (substitute* "Makefile.org" |
253 | (("^MANDIR[[:blank:]]*=.*$") | |
254 | (string-append "MANDIR = " out "/share/man\n"))) | |
255 | #t))) | |
b6cb1358 LC |
256 | (replace |
257 | 'configure | |
258 | (lambda* (#:key outputs #:allow-other-keys) | |
259 | (let ((out (assoc-ref outputs "out"))) | |
260 | (zero? | |
261 | (system* "./config" | |
262 | "shared" ;build shared libraries | |
263 | "--libdir=lib" | |
4fb254a3 LC |
264 | |
265 | ;; The default for this catch-all directory is | |
266 | ;; PREFIX/ssl. Change that to something more | |
267 | ;; conventional. | |
268 | (string-append "--openssldir=" out | |
269 | "/share/openssl-" ,version) | |
270 | ||
b6cb1358 LC |
271 | (string-append "--prefix=" out) |
272 | ||
273 | ;; XXX FIXME: Work around a code generation bug in GCC | |
274 | ;; 4.9.3 on ARM when compiled with -mfpu=neon. See: | |
275 | ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66917> | |
276 | ,@(if (and (not (%current-target-system)) | |
277 | (string-prefix? "armhf" (%current-system))) | |
278 | '("-mfpu=vfpv3") | |
279 | '())))))) | |
fe8199a8 LC |
280 | (add-after |
281 | 'install 'make-libraries-writable | |
282 | (lambda* (#:key outputs #:allow-other-keys) | |
283 | ;; Make libraries writable so that 'strip' does its job. | |
284 | (let ((out (assoc-ref outputs "out"))) | |
285 | (for-each (lambda (file) | |
286 | (chmod file #o644)) | |
287 | (find-files (string-append out "/lib") | |
288 | "\\.so")) | |
289 | #t))) | |
8c78aeb7 LC |
290 | (add-after 'install 'move-static-libraries |
291 | (lambda* (#:key outputs #:allow-other-keys) | |
292 | ;; Move static libraries to the "static" output. | |
293 | (let* ((out (assoc-ref outputs "out")) | |
294 | (lib (string-append out "/lib")) | |
295 | (static (assoc-ref outputs "static")) | |
296 | (slib (string-append static "/lib"))) | |
297 | (mkdir-p slib) | |
298 | (for-each (lambda (file) | |
299 | (install-file file slib) | |
300 | (delete-file file)) | |
301 | (find-files lib "\\.a$")) | |
302 | #t))) | |
a909b576 LC |
303 | (add-after 'install 'move-man3-pages |
304 | (lambda* (#:key outputs #:allow-other-keys) | |
305 | ;; Move section 3 man pages to "doc". | |
306 | (let* ((out (assoc-ref outputs "out")) | |
307 | (man3 (string-append out "/share/man/man3")) | |
308 | (doc (assoc-ref outputs "doc")) | |
309 | (target (string-append doc "/share/man/man3"))) | |
310 | (mkdir-p target) | |
311 | (for-each (lambda (file) | |
312 | (rename-file file | |
313 | (string-append target "/" | |
314 | (basename file)))) | |
315 | (find-files man3)) | |
5c838ec9 | 316 | (delete-file-recursively man3) |
a909b576 | 317 | #t))) |
b6cb1358 LC |
318 | (add-before |
319 | 'patch-source-shebangs 'patch-tests | |
320 | (lambda* (#:key inputs native-inputs #:allow-other-keys) | |
321 | (let ((bash (assoc-ref (or native-inputs inputs) "bash"))) | |
322 | (substitute* (find-files "test" ".*") | |
323 | (("/bin/sh") | |
324 | (string-append bash "/bin/bash")) | |
325 | (("/bin/rm") | |
86c8f1da MW |
326 | "rm")) |
327 | #t))) | |
784d6e91 LC |
328 | (add-after |
329 | 'install 'remove-miscellany | |
330 | (lambda* (#:key outputs #:allow-other-keys) | |
331 | ;; The 'misc' directory contains random undocumented shell and Perl | |
332 | ;; scripts. Remove them to avoid retaining a reference on Perl. | |
333 | (let ((out (assoc-ref outputs "out"))) | |
334 | (delete-file-recursively (string-append out "/share/openssl-" | |
335 | ,version "/misc")) | |
336 | #t)))))) | |
cc2b77df AE |
337 | (native-search-paths |
338 | ;; FIXME: These two variables must designate a single file or directory | |
339 | ;; and are not actually "search paths." In practice it works OK in user | |
340 | ;; profiles because there's always just one item that matches the | |
341 | ;; specification. | |
342 | (list (search-path-specification | |
343 | (variable "SSL_CERT_DIR") | |
344 | (files '("etc/ssl/certs"))) | |
345 | (search-path-specification | |
346 | (variable "SSL_CERT_FILE") | |
347 | (files '("etc/ssl/certs/ca-certificates.crt"))))) | |
348 | (synopsis "SSL/TLS implementation") | |
349 | (description | |
e881752c | 350 | "OpenSSL is an implementation of SSL/TLS.") |
e9aa8d0c | 351 | (license license:openssl) |
cc2b77df AE |
352 | (home-page "http://www.openssl.org/"))) |
353 | ||
763899f0 LF |
354 | (define-public openssl-next |
355 | (package | |
356 | (inherit openssl) | |
357 | (name "openssl") | |
9ad09652 | 358 | (version "1.1.0b") |
763899f0 LF |
359 | (source (origin |
360 | (method url-fetch) | |
361 | (uri (list (string-append "ftp://ftp.openssl.org/source/" | |
362 | name "-" version ".tar.gz") | |
363 | (string-append "ftp://ftp.openssl.org/source/old/" | |
364 | (string-trim-right version char-set:letter) | |
365 | "/" name "-" version ".tar.gz"))) | |
366 | (patches (search-patches "openssl-1.1.0-c-rehash-in.patch")) | |
367 | (sha256 | |
368 | (base32 | |
9ad09652 | 369 | "1xznrqvb1dbngv2k2nb6da6fdw00c01sy2i36yjdxr4vpxrf0pd4")))) |
763899f0 LF |
370 | (outputs '("out" |
371 | "doc" ;1.3MiB of man3 pages | |
372 | "static")) ; 5.5MiB of .a files | |
373 | (arguments | |
374 | (substitute-keyword-arguments (package-arguments openssl) | |
375 | ((#:phases phases) | |
376 | `(modify-phases ,phases | |
377 | (delete 'patch-tests) ; These two phases are not needed by | |
378 | (delete 'patch-Makefile.org) ; OpenSSL 1.1.0. | |
379 | ||
380 | (add-after 'configure 'patch-runpath | |
381 | (lambda* (#:key outputs #:allow-other-keys) | |
382 | (let ((lib (string-append (assoc-ref outputs "out") "/lib"))) | |
383 | (substitute* "Makefile.shared" | |
384 | (("\\$\\$\\{SHAREDCMD\\} \\$\\$\\{SHAREDFLAGS\\}") | |
385 | (string-append "$${SHAREDCMD} $${SHAREDFLAGS}" | |
386 | " -Wl,-rpath," lib))) | |
387 | #t))))))))) | |
388 | ||
cb6a802c AE |
389 | (define-public libressl |
390 | (package | |
391 | (name "libressl") | |
a7c9b062 | 392 | (version "2.5.0") |
cb6a802c AE |
393 | (source |
394 | (origin | |
395 | (method url-fetch) | |
396 | (uri (string-append | |
397 | "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-" | |
398 | version ".tar.gz")) | |
1a957c21 LF |
399 | (sha256 |
400 | (base32 | |
a7c9b062 | 401 | "1bkfvapi4z826slycmicvs7hwgk4l82gd8w6nqvznldbammvyll6")))) |
cb6a802c AE |
402 | (build-system gnu-build-system) |
403 | (native-search-paths | |
404 | ;; FIXME: These two variables must designate a single file or directory | |
405 | ;; and are not actually "search paths." In practice it works OK in | |
406 | ;; user profiles because there's always just one item that matches the | |
407 | ;; specification. | |
408 | (list (search-path-specification | |
409 | (variable "SSL_CERT_DIR") | |
410 | (files '("etc/ssl/certs"))) | |
411 | (search-path-specification | |
412 | (variable "SSL_CERT_FILE") | |
413 | (files '("etc/ssl/certs/ca-certificates.crt"))))) | |
414 | (home-page "http://www.libressl.org/") | |
415 | (synopsis "SSL/TLS implementation") | |
416 | (description "LibreSSL is a version of the TLS/crypto stack forked | |
417 | from OpenSSL in 2014, with the goals of modernizing the codebase, improving | |
418 | security, and applying best practice development processes.") | |
419 | ;; Files taken from OpenSSL keep their license, others are under various | |
420 | ;; non-copyleft licenses. | |
421 | (license (list license:openssl | |
422 | (license:non-copyleft | |
423 | "file://COPYING" | |
424 | "See COPYING in the distribution."))))) | |
425 | ||
6cefd53d | 426 | (define-public python-acme |
7890e3ba | 427 | (package |
6cefd53d | 428 | (name "python-acme") |
f349d36e | 429 | (version "0.9.3") |
7890e3ba | 430 | (source (origin |
9495cf9a | 431 | (method url-fetch) |
f349d36e | 432 | (uri (pypi-uri "acme" version)) |
7890e3ba LF |
433 | (sha256 |
434 | (base32 | |
f349d36e | 435 | "16a02bb0apnk1bm68bcabdmmwd6rnvnjzanrmcb46bpbapwz3vx6")))) |
7890e3ba LF |
436 | (build-system python-build-system) |
437 | (arguments | |
6cefd53d | 438 | `(#:phases |
9bee9d87 LF |
439 | (modify-phases %standard-phases |
440 | (add-before 'install 'disable-egg-compression | |
441 | (lambda _ | |
442 | ;; Do not compress the egg. | |
443 | ;; See <http://bugs.gnu.org/20765>. | |
444 | (let ((port (open-file "setup.cfg" "a"))) | |
445 | (display "\n[easy_install]\nzip_ok = 0\n" | |
446 | port) | |
447 | (close-port port) | |
50a7963a LF |
448 | #t))) |
449 | (add-after 'install 'docs | |
450 | (lambda* (#:key outputs #:allow-other-keys) | |
451 | (let* ((out (assoc-ref outputs "out")) | |
452 | (man (string-append out "/share/man/man1")) | |
453 | (info (string-append out "/info"))) | |
454 | (and (zero? (system* "make" "-C" "docs" "man" "info")) | |
455 | (install-file "docs/_build/texinfo/acme-python.info" info) | |
456 | (install-file "docs/_build/man/acme-python.1" man) | |
457 | #t))))))) | |
458 | ;; TODO: Add optional inputs for testing. | |
7890e3ba | 459 | (native-inputs |
6cefd53d | 460 | `(("python-mock" ,python-mock) |
50a7963a LF |
461 | ;; For documentation |
462 | ("python-sphinx" ,python-sphinx) | |
463 | ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput) | |
464 | ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme) | |
465 | ("python-setuptools" ,python-setuptools) | |
466 | ("texinfo" ,texinfo))) | |
7890e3ba | 467 | (propagated-inputs |
6cefd53d LF |
468 | `(("python-ndg-httpsclient" ,python-ndg-httpsclient) |
469 | ("python-werkzeug" ,python-werkzeug) | |
470 | ("python-six" ,python-six) | |
471 | ("python-requests" ,python-requests) | |
472 | ("python-pytz" ,python-pytz) | |
473 | ("python-pyrfc3339" ,python-pyrfc3339) | |
474 | ("python-pyasn1" ,python-pyasn1) | |
475 | ("python-cryptography" ,python-cryptography) | |
476 | ("python-pyopenssl" ,python-pyopenssl))) | |
7890e3ba LF |
477 | (home-page "https://github.com/letsencrypt/letsencrypt") |
478 | (synopsis "ACME protocol implementation in Python") | |
479 | (description "ACME protocol implementation in Python") | |
480 | (license license:asl2.0))) | |
481 | ||
6cefd53d LF |
482 | (define-public python2-acme |
483 | (package-with-python2 python-acme)) | |
484 | ||
9495cf9a | 485 | (define-public certbot |
9fd0838b | 486 | (package |
9495cf9a | 487 | (name "certbot") |
f349d36e | 488 | (version "0.9.3") |
9fd0838b DT |
489 | (source (origin |
490 | (method url-fetch) | |
f349d36e | 491 | (uri (pypi-uri name version)) |
9fd0838b DT |
492 | (sha256 |
493 | (base32 | |
f349d36e | 494 | "1c7k4lfq5j78d1rvrwrb9082ngwibz92cwkf4kazaa9b76w9q538")))) |
9fd0838b DT |
495 | (build-system python-build-system) |
496 | (arguments | |
f9263d9a LF |
497 | `(#:python ,python-2 |
498 | #:phases | |
499 | (modify-phases %standard-phases | |
234d0b69 | 500 | (add-after 'build 'docs |
f9263d9a LF |
501 | (lambda* (#:key outputs #:allow-other-keys) |
502 | (let* ((out (assoc-ref outputs "out")) | |
503 | (man1 (string-append out "/share/man/man1")) | |
504 | (man7 (string-append out "/share/man/man7")) | |
505 | (info (string-append out "/info"))) | |
f9263d9a LF |
506 | (and |
507 | (zero? (system* "make" "-C" "docs" "man" "info")) | |
9495cf9a LF |
508 | (install-file "docs/_build/texinfo/Certbot.info" info) |
509 | (install-file "docs/_build/man/certbot.1" man1) | |
510 | (install-file "docs/_build/man/certbot.7" man7) | |
f9263d9a LF |
511 | #t))))))) |
512 | ;; TODO: Add optional inputs for testing. | |
9fd0838b DT |
513 | (native-inputs |
514 | `(("python2-nose" ,python2-nose) | |
f9263d9a LF |
515 | ("python2-mock" ,python2-mock) |
516 | ;; For documentation | |
517 | ("python2-sphinx" ,python2-sphinx) | |
518 | ("python2-sphinx-rtd-theme" ,python2-sphinx-rtd-theme) | |
519 | ("python2-sphinx-repoze-autointerface" ,python2-sphinx-repoze-autointerface) | |
520 | ("python2-sphinxcontrib-programoutput" ,python2-sphinxcontrib-programoutput) | |
521 | ("texinfo" ,texinfo))) | |
9fd0838b | 522 | (propagated-inputs |
6cefd53d | 523 | `(("python2-acme" ,python2-acme) |
9fd0838b DT |
524 | ("python2-zope-interface" ,python2-zope-interface) |
525 | ("python2-pythondialog" ,python2-pythondialog) | |
526 | ("python2-pyrfc3339" ,python2-pyrfc3339) | |
527 | ("python2-pyopenssl" ,python2-pyopenssl) | |
528 | ("python2-configobj" ,python2-configobj) | |
529 | ("python2-configargparse" ,python2-configargparse) | |
530 | ("python2-zope-component" ,python2-zope-component) | |
531 | ("python2-parsedatetime" ,python2-parsedatetime) | |
532 | ("python2-six" ,python2-six) | |
533 | ("python2-psutil" ,python2-psutil) | |
534 | ("python2-requests" ,python2-requests) | |
535 | ("python2-pytz" ,python2-pytz))) | |
d8a1be63 | 536 | (synopsis "Let's Encrypt client by the Electronic Frontier Foundation") |
9fd0838b DT |
537 | (description "Tool to automatically receive and install X.509 certificates |
538 | to enable TLS on servers. The client will interoperate with the Let’s Encrypt CA which | |
539 | will be issuing browser-trusted certificates for free.") | |
24778368 | 540 | (home-page "https://certbot.eff.org/") |
9fd0838b DT |
541 | (license license:asl2.0))) |
542 | ||
9495cf9a LF |
543 | (define-public letsencrypt |
544 | (package (inherit certbot) | |
56ab55d1 LF |
545 | (name "letsencrypt") |
546 | (properties `((superseded . ,certbot))))) | |
9495cf9a | 547 | |
cc2b77df AE |
548 | (define-public perl-net-ssleay |
549 | (package | |
550 | (name "perl-net-ssleay") | |
551 | (version "1.68") | |
552 | (source (origin | |
553 | (method url-fetch) | |
554 | (uri (string-append "mirror://cpan/authors/id/M/MI/MIKEM/" | |
555 | "Net-SSLeay-" version ".tar.gz")) | |
556 | (sha256 | |
557 | (base32 | |
1084ec08 | 558 | "1m2wwzhjwsg0drlhp9w12fl6bsgj69v8gdz72jqrqll3qr7f408p")))) |
cc2b77df | 559 | (build-system perl-build-system) |
1084ec08 MW |
560 | (native-inputs |
561 | `(("patch" ,patch) | |
562 | ("patch/disable-ede-test" | |
563 | ,(search-patch "perl-net-ssleay-disable-ede-test.patch")))) | |
cc2b77df AE |
564 | (inputs `(("openssl" ,openssl))) |
565 | (arguments | |
1084ec08 MW |
566 | `(#:phases |
567 | (modify-phases %standard-phases | |
568 | (add-after | |
569 | 'unpack 'apply-patch | |
570 | (lambda* (#:key inputs #:allow-other-keys) | |
571 | ;; XXX We apply this patch here instead of in the 'origin' because | |
572 | ;; this package's build system fails badly when the source file | |
573 | ;; times are zeroed. | |
574 | ;; XXX Try removing this patch for perl-net-ssleay > 1.68 | |
575 | (zero? (system* "patch" "--force" "-p1" "-i" | |
576 | (assoc-ref inputs "patch/disable-ede-test"))))) | |
577 | (add-before | |
578 | 'configure 'set-ssl-prefix | |
579 | (lambda* (#:key inputs #:allow-other-keys) | |
580 | (setenv "OPENSSL_PREFIX" (assoc-ref inputs "openssl")) | |
581 | #t))))) | |
cc2b77df AE |
582 | (synopsis "Perl extension for using OpenSSL") |
583 | (description | |
584 | "This module offers some high level convenience functions for accessing | |
585 | web pages on SSL servers (for symmetry, the same API is offered for accessing | |
586 | http servers, too), an sslcat() function for writing your own clients, and | |
587 | finally access to the SSL api of the SSLeay/OpenSSL package so you can write | |
588 | servers or clients for more complicated applications.") | |
589 | (license (package-license perl)) | |
590 | (home-page "http://search.cpan.org/~mikem/Net-SSLeay-1.66/"))) | |
4532c0c0 DM |
591 | |
592 | (define-public perl-crypt-openssl-rsa | |
593 | (package | |
594 | (name "perl-crypt-openssl-rsa") | |
595 | (version "0.28") | |
596 | (source | |
597 | (origin | |
598 | (method url-fetch) | |
599 | (uri (string-append | |
600 | "mirror://cpan/authors/id/P/PE/PERLER/Crypt-OpenSSL-RSA-" | |
601 | version | |
602 | ".tar.gz")) | |
603 | (sha256 | |
604 | (base32 | |
605 | "1gnpvv09b2gpifwdzc5jnhama3d1a4c39lzj9hcaicsb8rvzjmsk")))) | |
606 | (build-system perl-build-system) | |
607 | (inputs | |
608 | `(("perl-crypt-openssl-bignum" ,perl-crypt-openssl-bignum) | |
609 | ("perl-crypt-openssl-random" ,perl-crypt-openssl-random) | |
610 | ("openssl" ,openssl))) | |
611 | (arguments perl-crypt-arguments) | |
612 | (home-page | |
613 | "http://search.cpan.org/dist/Crypt-OpenSSL-RSA") | |
614 | (synopsis | |
615 | "RSA encoding and decoding, using the openSSL libraries") | |
616 | (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the | |
617 | OpenSSL libraries).") | |
618 | (license (package-license perl)))) | |
adff71ca DM |
619 | |
620 | (define perl-crypt-arguments | |
621 | `(#:phases (modify-phases %standard-phases | |
622 | (add-before 'configure 'patch-Makefile.PL | |
623 | (lambda* (#:key inputs #:allow-other-keys) | |
624 | (substitute* "Makefile.PL" | |
625 | (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L" | |
626 | (assoc-ref inputs "openssl") | |
627 | "/lib -lcrypto'],"))) | |
628 | #t))))) | |
629 | ||
630 | (define-public perl-crypt-openssl-bignum | |
631 | (package | |
632 | (name "perl-crypt-openssl-bignum") | |
633 | (version "0.06") | |
634 | (source | |
635 | (origin | |
636 | (method url-fetch) | |
637 | (uri (string-append | |
638 | "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-" | |
639 | version | |
640 | ".tar.gz")) | |
641 | (sha256 | |
642 | (base32 | |
643 | "05yzrdglrrzp191krf77zrwfkmzrfwrsrx1vyskbj94522lszk67")))) | |
644 | (build-system perl-build-system) | |
645 | (inputs `(("openssl" ,openssl))) | |
646 | (arguments perl-crypt-arguments) | |
647 | (home-page | |
648 | "http://search.cpan.org/dist/Crypt-OpenSSL-Bignum") | |
649 | (synopsis | |
650 | "OpenSSL's multiprecision integer arithmetic in Perl") | |
651 | (description "Crypt::OpenSSL::Bignum provides multiprecision integer | |
652 | arithmetic in Perl.") | |
653 | ;; At your option either gpl1+ or the Artistic License | |
654 | (license (package-license perl)))) | |
cccb4d26 DM |
655 | |
656 | (define-public perl-crypt-openssl-random | |
657 | (package | |
658 | (name "perl-crypt-openssl-random") | |
659 | (version "0.11") | |
660 | (source | |
661 | (origin | |
662 | (method url-fetch) | |
663 | (uri (string-append | |
664 | "mirror://cpan/authors/id/R/RU/RURBAN/Crypt-OpenSSL-Random-" | |
665 | version | |
666 | ".tar.gz")) | |
667 | (sha256 | |
668 | (base32 | |
669 | "0yjcabkibrkafywvdkmd1xpi6br48skyk3l15ni176wvlg38335v")))) | |
670 | (build-system perl-build-system) | |
671 | (inputs `(("openssl" ,openssl))) | |
672 | (arguments perl-crypt-arguments) | |
673 | (home-page | |
674 | "http://search.cpan.org/dist/Crypt-OpenSSL-Random") | |
675 | (synopsis | |
676 | "OpenSSL/LibreSSL pseudo-random number generator access") | |
677 | (description "Crypt::OpenSSL::Random is a OpenSSL/LibreSSL pseudo-random | |
678 | number generator") | |
679 | (license (package-license perl)))) | |
0581c273 LF |
680 | |
681 | (define-public acme-client | |
682 | (package | |
683 | (name "acme-client") | |
684 | (version "0.1.11") | |
685 | (source (origin | |
686 | (method url-fetch) | |
687 | (uri (string-append "https://kristaps.bsd.lv/" name "/" | |
688 | "snapshots/" name "-portable-" | |
689 | version ".tgz")) | |
690 | (sha256 | |
691 | (base32 | |
692 | "09pipyfk448gxqr7ci56gsq5la8wlydv7wwn9wk0zgjxmlh7h6fb")))) | |
693 | (build-system gnu-build-system) | |
694 | (arguments | |
695 | '(#:tests? #f ; no test suite | |
696 | #:make-flags | |
697 | (list "CC=gcc" | |
698 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
699 | #:phases | |
700 | (modify-phases %standard-phases | |
701 | (delete 'configure)))) ; no './configure' script | |
702 | (inputs | |
703 | `(("libbsd" ,libbsd) | |
704 | ("libressl" ,libressl))) | |
705 | (synopsis "Let's Encrypt client by the OpenBSD project") | |
706 | (description "acme-client is a Let's Encrypt client implemented in C. It | |
707 | uses a modular design, and attempts to secure itself by dropping privileges and | |
708 | operating in a chroot where possible. acme-client is developed on OpenBSD and | |
709 | then ported to the GNU / Linux environment.") | |
710 | (home-page "https://kristaps.bsd.lv/acme-client/") | |
711 | ;; acme-client is distributed under the ISC license, but the files 'jsmn.h' | |
712 | ;; and 'jsmn.c' are distributed under the Expat license. | |
713 | (license (list license:isc license:expat)))) |