Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchurl,
5}:
6
7stdenv.mkDerivation rec {
8 pname = "bearssl";
9 version = "0.6";
10
11 src = fetchurl {
12 url = "https://www.bearssl.org/bearssl-${version}.tar.gz";
13 sha256 = "057zhgy9w4y8z2996r0pq5k2k39lpvmmvz4df8db8qa9f6hvn1b7";
14 };
15
16 outputs = [
17 "bin"
18 "lib"
19 "dev"
20 "out"
21 ];
22
23 enableParallelBuilding = true;
24
25 makeFlags = [
26 "AR=${stdenv.cc.targetPrefix}ar"
27 "CC=${stdenv.cc.targetPrefix}cc"
28 "LD=${stdenv.cc.targetPrefix}cc"
29 "LDDLL=${stdenv.cc.targetPrefix}cc"
30 ]
31 ++ lib.optional stdenv.hostPlatform.isStatic "DLL=no";
32
33 installPhase = ''
34 runHook preInstall
35 install -D build/brssl $bin/brssl
36 install -D build/testcrypto $bin/testcrypto
37 install -Dm644 -t $lib/lib build/libbearssl.*
38 install -Dm644 -t $dev/include inc/*.h
39 touch $out
40 runHook postInstall
41 '';
42
43 meta = {
44 homepage = "https://www.bearssl.org/";
45 description = "Implementation of the SSL/TLS protocol written in C";
46 longDescription = ''
47 BearSSL is an implementation of the SSL/TLS protocol (RFC 5246)
48 written in C. It aims at offering the following features:
49
50 * Be correct and secure. In particular, insecure protocol versions and
51 choices of algorithms are not supported, by design; cryptographic
52 algorithm implementations are constant-time by default.
53
54 * Be small, both in RAM and code footprint. For instance, a minimal
55 server implementation may fit in about 20 kilobytes of compiled code
56 and 25 kilobytes of RAM.
57
58 * Be highly portable. BearSSL targets not only “big” operating systems
59 like Linux and Windows, but also small embedded systems and even
60 special contexts like bootstrap code.
61
62 * Be feature-rich and extensible. SSL/TLS has many defined cipher
63 suites and extensions; BearSSL should implement most of them, and
64 allow extra algorithm implementations to be added afterwards,
65 possibly from third parties.
66 '';
67 license = lib.licenses.mit;
68 platforms = lib.platforms.all;
69 maintainers = [ ];
70 };
71
72}