Skip to content

Commit 98948cd

Browse files
committed
expose temporary s2n-tls paths
1 parent bf68450 commit 98948cd

File tree

1 file changed

+52
-41
lines changed

1 file changed

+52
-41
lines changed

deps/s2n-tls/default.nix

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,66 @@
33
pkgs,
44
stdenv
55
}:
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+
};
1516

16-
buildInputs = [
17-
pkgs.pkgsStatic.openssl
18-
];
17+
buildInputs = [
18+
pkgs.pkgsStatic.openssl
19+
];
1920

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
2324
24-
make bin
25+
make bin
2526
26-
runHook postBuild
27-
'';
27+
runHook postBuild
28+
'';
2829

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;
3839

39-
# Upstream Makefile has no install target
40-
installPhase = ''
41-
runHook preInstall
40+
# Upstream Makefile has no install target
41+
installPhase = ''
42+
runHook preInstall
4243
43-
mkdir -p "$out/include"
44-
cp api/s2n.h "$out/include"
44+
mkdir -p "$out/include"
45+
cp api/s2n.h "$out/include"
4546
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"
4849
49-
runHook postInstall
50-
'';
50+
runHook postInstall
51+
'';
5152

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+
};
5658
};
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

Comments
 (0)