From 376fcb9dce53dadf5ae4d042339b13477cf5c478 Mon Sep 17 00:00:00 2001 From: nviets Date: Sun, 4 Sep 2022 07:29:04 -0500 Subject: [PATCH] nng: added tls and mbedtls support (#188668) --- maintainers/maintainer-list.nix | 6 ++++++ pkgs/development/libraries/nng/default.nix | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index f2697542783d..a217f72b46c6 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -9686,6 +9686,12 @@ github = "numkem"; githubId = 332423; }; + nviets = { + email = "nathan.g.viets@gmail.com"; + github = "nviets"; + githubId = 16027994; + name = "Nathan Viets"; + }; nyanloutre = { email = "paul@nyanlout.re"; github = "nyanloutre"; diff --git a/pkgs/development/libraries/nng/default.nix b/pkgs/development/libraries/nng/default.nix index 69fde25bb5c9..9acc64fea642 100644 --- a/pkgs/development/libraries/nng/default.nix +++ b/pkgs/development/libraries/nng/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, ninja }: +{ lib, stdenv, fetchFromGitHub, cmake, ninja, mbedtlsSupport ? true, mbedtls }: stdenv.mkDerivation rec { pname = "nng"; @@ -11,9 +11,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-qbjMLpPk5FxH710Mf8AIraY0mERbaxVVhTT94W0EV+k="; }; - nativeBuildInputs = [ cmake ninja ]; + nativeBuildInputs = [ cmake ninja ] + ++ lib.optionals mbedtlsSupport [ mbedtls ]; - cmakeFlags = [ "-G Ninja" ]; + buildInputs = lib.optional mbedtlsSupport [ mbedtls ]; + + cmakeFlags = [ "-G Ninja" "-DNNG_ENABLE_TLS=ON" ] + ++ lib.optionals mbedtlsSupport [ "-DMBEDTLS_ROOT_DIR=${mbedtls}" ]; meta = with lib; { homepage = "https://nng.nanomsg.org/"; @@ -21,5 +25,6 @@ stdenv.mkDerivation rec { license = licenses.mit; mainProgram = "nngcat"; platforms = platforms.unix; + maintainers = with maintainers; [ nviets ]; }; }