From 8e15df471550f875284109797d9942eeb6280fa6 Mon Sep 17 00:00:00 2001 From: Oliver Richter Date: Mon, 31 Jul 2023 12:17:25 +0200 Subject: [PATCH] libkcapi: init at 1.4.0 Linux Kernel Crypto API User Space Interface Library. libkcapi allows user-space to access the Linux kernel crypto API. The esdm package may include support for libkcapi in the jittentropy source in a future release. Therefor having this package upstream would be prefered. Signed-off-by: Oliver Richter --- .../libraries/libkcapi/default.nix | 53 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 55 insertions(+) create mode 100644 pkgs/development/libraries/libkcapi/default.nix diff --git a/pkgs/development/libraries/libkcapi/default.nix b/pkgs/development/libraries/libkcapi/default.nix new file mode 100644 index 000000000000..bee1ac93598c --- /dev/null +++ b/pkgs/development/libraries/libkcapi/default.nix @@ -0,0 +1,53 @@ +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, buildPackages + # libkcapi offers multiple tools. They can be disabled for minimization. +, kcapi-test ? true +, kcapi-speed ? true +, kcapi-hasher ? true +, kcapi-rngapp ? true +, kcapi-encapp ? true +, kcapi-dgstapp ? true +}: + +stdenv.mkDerivation rec { + pname = "libkcapi"; + version = "1.4.0"; + + src = fetchFromGitHub { + owner = "smuellerDD"; + repo = "libkcapi"; + rev = "v${version}"; + hash = "sha256-G/4G8179Gc8RfQfQImOCsBC8WXKK7jQJfUSXm0hYLJ0="; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + # libkcapi looks also for a host c compiler when cross-compiling + # otherwise you obtain following error message: + # "error: no acceptable C compiler found in $PATH" + depsBuildBuild = [ + buildPackages.stdenv.cc + ]; + + enableParallelBuilding = true; + + configureFlags = + lib.optional kcapi-test "--enable-kcapi-test" ++ + lib.optional kcapi-speed "--enable-kcapi-speed" ++ + lib.optional kcapi-hasher "--enable-kcapi-hasher" ++ + lib.optional kcapi-rngapp "--enable-kcapi-rngapp" ++ + lib.optional kcapi-encapp "--enable-kcapi-encapp" ++ + lib.optional kcapi-dgstapp "--enable-kcapi-dgstapp" + ; + + meta = { + homepage = "http://www.chronox.de/libkcapi.html"; + description = "Linux Kernel Crypto API User Space Interface Library"; + license = with lib.licenses; [ bsd3 gpl2Only ]; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ orichter thillux ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 877a88a0ff10..e3944ad801e2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22464,6 +22464,8 @@ with pkgs; libinklevel = callPackage ../development/libraries/libinklevel { }; + libkcapi = callPackage ../development/libraries/libkcapi { }; + libnats-c = callPackage ../development/libraries/libnats-c { }; liburing = callPackage ../development/libraries/liburing { };