nixpkgs/pkgs/development/libraries/mbedtls/default.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv
, fetchFromGitHub
, cmake
, ninja
, perl # Project uses Perl for scripting and testing
2018-11-22 12:08:30 +00:00
, python
, enableThreading ? true # Threading can be disabled to increase security https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
}:
2015-04-06 21:41:54 +00:00
stdenv.mkDerivation rec {
pname = "mbedtls";
name = "mbedtls-${version}";
version = "2.16.0";
2015-04-06 21:41:54 +00:00
2018-01-28 01:10:04 +00:00
src = fetchFromGitHub {
owner = "ARMmbed";
repo = "mbedtls";
rev = "${pname}-${version}";
sha256 = "14gw3rga9qr6j8ssfjy7k4l8spz37gamqxh9qcwas7w48303897l";
2015-04-06 21:41:54 +00:00
};
2018-11-22 12:08:30 +00:00
nativeBuildInputs = [ cmake ninja perl python ];
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 21:41:54 +00:00
meta = with stdenv.lib; {
2016-07-09 23:06:24 +00:00
homepage = https://tls.mbed.org/;
description = "Portable cryptographic and TLS library, formerly known as PolarSSL";
license = licenses.asl20;
2015-04-06 21:41:54 +00:00
platforms = platforms.all;
maintainers = with maintainers; [ fpletz ];
2015-04-06 21:41:54 +00:00
};
}