nixpkgs/pkgs/development/libraries/s2n-tls/default.nix

40 lines
1.0 KiB
Nix
Raw Normal View History

2020-12-26 07:03:42 +03:00
{ lib, stdenv, fetchFromGitHub, cmake, openssl }:
stdenv.mkDerivation rec {
pname = "s2n-tls";
2021-03-19 23:38:32 +03:00
version = "1.0.1";
2020-12-26 07:03:42 +03:00
src = fetchFromGitHub {
owner = "aws";
2020-12-26 07:03:42 +03:00
repo = pname;
rev = "v${version}";
2021-03-19 23:38:32 +03:00
sha256 = "sha256-V/ZtO6t+Jxu/HmAEVzjkXuGWbZFwkGLsab1UCSG2tdk=";
2020-12-26 07:03:42 +03:00
};
nativeBuildInputs = [ cmake ];
outputs = [ "out" "dev"];
buildInputs = [ openssl ]; # s2n-config has find_dependency(LibCrypto).
2020-12-26 07:03:42 +03:00
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
2020-12-26 07:03:42 +03: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 ""'
'';
2020-12-26 07:03:42 +03:00
meta = with lib; {
description = "C99 implementation of the TLS/SSL protocols";
homepage = "https://github.com/aws/s2n-tls";
2020-12-26 07:03:42 +03:00
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ orivej ];
};
}