2018-06-28 22:25:19 +02:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, perl # Project uses Perl for scripting and testing
|
2018-11-22 13:08:30 +01:00
|
|
|
, python
|
2018-06-28 22:25:19 +02:00
|
|
|
|
|
|
|
, enableThreading ? true # Threading can be disabled to increase security https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
|
|
|
|
}:
|
2015-04-06 23:41:54 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "mbedtls";
|
2019-10-21 12:47:44 +02:00
|
|
|
name = "mbedtls-${version}";
|
2019-10-21 16:52:41 +02:00
|
|
|
version = "2.16.3"; # nixpkgs-update: no auto update
|
2015-04-06 23:41:54 +02:00
|
|
|
|
2018-01-28 02:10:04 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ARMmbed";
|
|
|
|
repo = "mbedtls";
|
2019-08-15 14:41:18 +02:00
|
|
|
rev = "${pname}-${version}";
|
2019-10-21 12:48:22 +02:00
|
|
|
sha256 = "1mzh92yyz93099a1gb2wvwc76jv12d1k1wg9k3dimbgczxgrkirc";
|
2015-04-06 23:41:54 +02:00
|
|
|
};
|
|
|
|
|
2018-11-22 13:08:30 +01:00
|
|
|
nativeBuildInputs = [ cmake ninja perl python ];
|
2016-12-10 17:29:50 +01:00
|
|
|
|
2018-06-28 22:25:19 +02:00
|
|
|
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.
|
2016-12-10 17:29:50 +01:00
|
|
|
'';
|
|
|
|
|
2018-06-28 22:25:19 +02:00
|
|
|
cmakeFlags = [ "-DUSE_SHARED_MBEDTLS_LIBRARY=on" ];
|
2015-04-06 23:41:54 +02:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://tls.mbed.org/";
|
2018-06-28 22:25:19 +02:00
|
|
|
description = "Portable cryptographic and TLS library, formerly known as PolarSSL";
|
|
|
|
license = licenses.asl20;
|
2015-04-06 23:41:54 +02:00
|
|
|
platforms = platforms.all;
|
2019-01-26 11:01:09 +01:00
|
|
|
maintainers = with maintainers; [ fpletz ];
|
2015-04-06 23:41:54 +02:00
|
|
|
};
|
|
|
|
}
|