|
3 | 3 | pkgs, |
4 | 4 | stdenv |
5 | 5 | }: |
6 | | -stdenv.mkDerivation rec { |
7 | | - pname = "s2n-tls"; |
8 | | - # ./conanfile.py lists 0.8, but there are not tags in the repo with version < 0.9.0 |
9 | | - version = "0.9.0"; |
10 | | - |
11 | | - src = pkgs.fetchzip { |
12 | | - url = "https://github.com/aws/s2n-tls/archive/v${version}.tar.gz"; |
13 | | - sha256 = "18qjqc2jrpiwdpzqxl6hl1cq0nfmqk8qas0ijpwr0g606av0aqm9"; |
14 | | - }; |
| 6 | +let |
| 7 | + self = stdenv.mkDerivation rec { |
| 8 | + pname = "s2n-tls"; |
| 9 | + # ./conanfile.py lists 0.8, but there are not tags in the repo with version < 0.9.0 |
| 10 | + version = "0.9.0"; |
| 11 | + |
| 12 | + src = pkgs.fetchzip { |
| 13 | + url = "https://github.com/aws/s2n-tls/archive/v${version}.tar.gz"; |
| 14 | + sha256 = "18qjqc2jrpiwdpzqxl6hl1cq0nfmqk8qas0ijpwr0g606av0aqm9"; |
| 15 | + }; |
15 | 16 |
|
16 | | - buildInputs = [ |
17 | | - pkgs.pkgsStatic.openssl |
18 | | - ]; |
| 17 | + buildInputs = [ |
| 18 | + pkgs.pkgsStatic.openssl |
| 19 | + ]; |
19 | 20 |
|
20 | | - # the default 'all' target depends on tests which are broken (see below) |
21 | | - buildPhase = '' |
22 | | - runHook preBuild |
| 21 | + # the default 'all' target depends on tests which are broken (see below) |
| 22 | + buildPhase = '' |
| 23 | + runHook preBuild |
23 | 24 |
|
24 | | - make bin |
| 25 | + make bin |
25 | 26 |
|
26 | | - runHook postBuild |
27 | | - ''; |
| 27 | + runHook postBuild |
| 28 | + ''; |
28 | 29 |
|
29 | | - # TODO: tests fail: |
30 | | - # make -C unit |
31 | | - # make[2]: Entering directory '/build/source/tests/unit' |
32 | | - # Running s2n_3des_test.c ... FAILED test 1 |
33 | | - # !((conn = s2n_connection_new(S2N_SERVER)) == (((void *)0))) is not true (s2n_3des_test.c line 44) |
34 | | - # Error Message: 'error calling mlock (Did you run prlimit?)' |
35 | | - # Debug String: 'Error encountered in s2n_mem.c line 103' |
36 | | - # make[2]: *** [Makefile:44: s2n_3des_test] Error 1 |
37 | | - doCheck = false; |
| 30 | + # TODO: tests fail: |
| 31 | + # make -C unit |
| 32 | + # make[2]: Entering directory '/build/source/tests/unit' |
| 33 | + # Running s2n_3des_test.c ... FAILED test 1 |
| 34 | + # !((conn = s2n_connection_new(S2N_SERVER)) == (((void *)0))) is not true (s2n_3des_test.c line 44) |
| 35 | + # Error Message: 'error calling mlock (Did you run prlimit?)' |
| 36 | + # Debug String: 'Error encountered in s2n_mem.c line 103' |
| 37 | + # make[2]: *** [Makefile:44: s2n_3des_test] Error 1 |
| 38 | + doCheck = false; |
38 | 39 |
|
39 | | - # Upstream Makefile has no install target |
40 | | - installPhase = '' |
41 | | - runHook preInstall |
| 40 | + # Upstream Makefile has no install target |
| 41 | + installPhase = '' |
| 42 | + runHook preInstall |
42 | 43 |
|
43 | | - mkdir -p "$out/include" |
44 | | - cp api/s2n.h "$out/include" |
| 44 | + mkdir -p "$out/include" |
| 45 | + cp api/s2n.h "$out/include" |
45 | 46 |
|
46 | | - mkdir -p "$out/lib" |
47 | | - cp lib/libs2n.a lib/libs2n.so "$out/lib" |
| 47 | + mkdir -p "$out/lib" |
| 48 | + cp lib/libs2n.a lib/libs2n.so "$out/lib" |
48 | 49 |
|
49 | | - runHook postInstall |
50 | | - ''; |
| 50 | + runHook postInstall |
| 51 | + ''; |
51 | 52 |
|
52 | | - meta = { |
53 | | - description = "An implementation of the TLS/SSL protocols"; |
54 | | - homepage = "https://github.com/aws/s2n-tls"; |
55 | | - license = pkgs.lib.licenses.asl20; |
| 53 | + meta = { |
| 54 | + description = "An implementation of the TLS/SSL protocols"; |
| 55 | + homepage = "https://github.com/aws/s2n-tls"; |
| 56 | + license = pkgs.lib.licenses.asl20; |
| 57 | + }; |
56 | 58 | }; |
57 | | -} |
| 59 | + dev = pkgs.lib.getDev self; |
| 60 | +in |
| 61 | + self.overrideAttrs (prev: { |
| 62 | + # TODO: verify the {include, lib} paths. commented are Gentoo artifacts |
| 63 | + passthru = (prev.passthru or {}) // { |
| 64 | + include_root = "${dev}/include"; # /usr/include/s2n.h |
| 65 | + include = "${dev}/include/s2n"; # /usr/include/s2n/unstable/*.h |
| 66 | + lib = "${self}/lib"; # /usr/lib64 on Gentoo... |
| 67 | + }; |
| 68 | + }) |
0 commit comments