2021-01-09 10:05:03 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, openssl }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-03-09 03:18:52 +00:00
|
|
|
pname = "s2n-tls";
|
2021-08-18 13:19:15 +00:00
|
|
|
version = "1.0.16";
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-03-09 03:18:52 +00:00
|
|
|
owner = "aws";
|
2021-01-09 10:05:03 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-08-18 13:19:15 +00:00
|
|
|
sha256 = "sha256-gF4VhNEq/gpxXqOKvBtWZ5iZ3Jf98vSuSZYUu8r1jKA=";
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
outputs = [ "out" "dev"];
|
|
|
|
|
|
|
|
buildInputs = [ openssl ]; # s2n-config has find_dependency(LibCrypto).
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
2021-06-04 09:07:49 +00:00
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
|
2021-01-09 10:05:03 +00:00
|
|
|
];
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
propagatedBuildInputs = [ openssl ]; # s2n-config has find_dependency(LibCrypto).
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace $out/lib/s2n/cmake/shared/s2n-targets.cmake \
|
|
|
|
--replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES ""'
|
|
|
|
'';
|
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "C99 implementation of the TLS/SSL protocols";
|
2021-03-09 03:18:52 +00:00
|
|
|
homepage = "https://github.com/aws/s2n-tls";
|
2021-01-09 10:05:03 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ orivej ];
|
|
|
|
};
|
|
|
|
}
|