6 , perl # Project uses Perl for scripting and testing
9 , enableThreading ? true # Threading can be disabled to increase security https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
12 stdenv.mkDerivation rec {
14 # Auto updates are disabled due to repology listing dev releases as release
16 # * https://github.com/NixOS/nixpkgs/pull/119838#issuecomment-822100428
17 # * https://github.com/NixOS/nixpkgs/commit/0ee02a9d42b5fe1825b0f7cee7a9986bb4ba975d
18 version = "2.28.0"; # nixpkgs-update: no auto update
20 src = fetchFromGitHub {
23 rev = "${pname}-${version}";
24 sha256 = "sha256-VDoIUBaK2e0E5nkwU1u3Wvxc+s6OzBSdIeHsJKJuZ2g=";
27 nativeBuildInputs = [ cmake ninja perl python3 ];
31 postConfigure = lib.optionalString enableThreading ''
32 perl scripts/config.pl set MBEDTLS_THREADING_C # Threading abstraction layer
33 perl scripts/config.pl set MBEDTLS_THREADING_PTHREAD # POSIX thread wrapper layer for the threading layer.
36 cmakeFlags = [ "-DUSE_SHARED_MBEDTLS_LIBRARY=on" ];
37 NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
39 "-Wno-error=format-truncation"
43 homepage = "https://tls.mbed.org/";
44 description = "Portable cryptographic and TLS library, formerly known as PolarSSL";
45 license = licenses.asl20;
46 platforms = platforms.all;
47 maintainers = with maintainers; [ ];