3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/mbedtls/default.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv
, fetchFromGitHub
, cmake
, ninja
, perl # Project uses Perl for scripting and testing
, enableThreading ? true # Threading can be disabled to increase security https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
}:
2015-04-06 22:41:54 +01:00
stdenv.mkDerivation rec {
name = "mbedtls-${version}";
version = "2.11.0";
2015-04-06 22:41:54 +01:00
2018-01-28 01:10:04 +00:00
src = fetchFromGitHub {
owner = "ARMmbed";
repo = "mbedtls";
rev = name;
2018-06-26 06:38:13 +01:00
sha256 = "1d4a0jc08q3h051amv8hhh3hmqp4f1rk5z7ffyfs2g8dassm78ir";
2015-04-06 22:41:54 +01:00
};
nativeBuildInputs = [ cmake ninja perl ];
postConfigure = stdenv.lib.optionals enableThreading ''
perl scripts/config.pl set MBEDTLS_THREADING_C # Threading abstraction layer
perl scripts/config.pl set MBEDTLS_THREADING_PTHREAD # POSIX thread wrapper layer for the threading layer.
'';
cmakeFlags = [ "-DUSE_SHARED_MBEDTLS_LIBRARY=on" ];
2015-04-06 22:41:54 +01:00
meta = with stdenv.lib; {
2016-07-10 00:06:24 +01:00
homepage = https://tls.mbed.org/;
description = "Portable cryptographic and TLS library, formerly known as PolarSSL";
license = licenses.asl20;
2015-04-06 22:41:54 +01:00
platforms = platforms.all;
2016-07-10 00:06:24 +01:00
maintainers = with maintainers; [ wkennington fpletz ];
2015-04-06 22:41:54 +01:00
};
}