From 100cad48588f8491afad78e7014791ce88f312b2 Mon Sep 17 00:00:00 2001 From: Raphael Robatsch Date: Sun, 4 Dec 2022 14:53:16 +0000 Subject: [PATCH] mbedtls_3: init at 3.2.1 mbedtls 3 is incompatible with mbedtls 2, so create a new package for version 3. Remove comment disabling nixpkgs-update, since the version information on repology looks correct now. --- pkgs/development/libraries/mbedtls/2.nix | 6 ++++++ pkgs/development/libraries/mbedtls/3.nix | 6 ++++++ .../mbedtls/{default.nix => generic.nix} | 20 +++++++++---------- pkgs/top-level/all-packages.nix | 3 ++- 4 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 pkgs/development/libraries/mbedtls/2.nix create mode 100644 pkgs/development/libraries/mbedtls/3.nix rename pkgs/development/libraries/mbedtls/{default.nix => generic.nix} (68%) diff --git a/pkgs/development/libraries/mbedtls/2.nix b/pkgs/development/libraries/mbedtls/2.nix new file mode 100644 index 000000000000..ba1f520b08cf --- /dev/null +++ b/pkgs/development/libraries/mbedtls/2.nix @@ -0,0 +1,6 @@ +{ callPackage }: + +callPackage ./generic.nix { + version = "2.28.1"; + hash = "sha256-brbZB3fINDeVWXf50ct4bxYkoBVyD6bBBijZyFQSnyw="; +} diff --git a/pkgs/development/libraries/mbedtls/3.nix b/pkgs/development/libraries/mbedtls/3.nix new file mode 100644 index 000000000000..d6f53feb086b --- /dev/null +++ b/pkgs/development/libraries/mbedtls/3.nix @@ -0,0 +1,6 @@ +{ callPackage }: + +callPackage ./generic.nix { + version = "3.2.1"; + hash = "sha256-+M36NvFe4gw2PRbld/2JV3yBGrqK6soWcmrSEkUNcrc="; +} diff --git a/pkgs/development/libraries/mbedtls/default.nix b/pkgs/development/libraries/mbedtls/generic.nix similarity index 68% rename from pkgs/development/libraries/mbedtls/default.nix rename to pkgs/development/libraries/mbedtls/generic.nix index 2bd924d870c7..bb87c6dbc8ad 100644 --- a/pkgs/development/libraries/mbedtls/default.nix +++ b/pkgs/development/libraries/mbedtls/generic.nix @@ -1,4 +1,7 @@ -{ lib, stdenv +{ lib +, stdenv +, version +, hash , fetchFromGitHub , cmake @@ -11,17 +14,13 @@ stdenv.mkDerivation rec { pname = "mbedtls"; - # Auto updates are disabled due to repology listing dev releases as release - # versions. See - # * https://github.com/NixOS/nixpkgs/pull/119838#issuecomment-822100428 - # * https://github.com/NixOS/nixpkgs/commit/0ee02a9d42b5fe1825b0f7cee7a9986bb4ba975d - version = "2.28.1"; # nixpkgs-update: no auto update + inherit version; src = fetchFromGitHub { - owner = "ARMmbed"; + owner = "Mbed-TLS"; repo = "mbedtls"; rev = "${pname}-${version}"; - sha256 = "sha256-brbZB3fINDeVWXf50ct4bxYkoBVyD6bBBijZyFQSnyw="; + inherit hash; }; nativeBuildInputs = [ cmake ninja perl python3 ]; @@ -40,10 +39,11 @@ stdenv.mkDerivation rec { ]; meta = with lib; { - homepage = "https://tls.mbed.org/"; + homepage = "https://www.trustedfirmware.org/projects/mbed-tls/"; + changelog = "https://github.com/Mbed-TLS/mbedtls/blob/${pname}-${version}/ChangeLog"; description = "Portable cryptographic and TLS library, formerly known as PolarSSL"; license = licenses.asl20; platforms = platforms.all; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ raphaelr ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 96d9cb14ea13..d650881ce20c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21486,7 +21486,8 @@ with pkgs; maxflow = callPackage ../development/libraries/maxflow { }; - mbedtls = callPackage ../development/libraries/mbedtls { }; + mbedtls = callPackage ../development/libraries/mbedtls/2.nix { }; + mbedtls_3 = callPackage ../development/libraries/mbedtls/3.nix { }; mdctags = callPackage ../development/tools/misc/mdctags { };