From 40733622e731d5f15db7d138369b4d7490434042 Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Thu, 21 Apr 2022 22:44:30 +0100 Subject: [PATCH] yubihsm-shell: init at 2.3.1 Co-authored-by: Jan Tojnar Co-authored-by: 06kellyjac --- pkgs/tools/security/yubihsm-shell/default.nix | 59 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 61 insertions(+) create mode 100644 pkgs/tools/security/yubihsm-shell/default.nix diff --git a/pkgs/tools/security/yubihsm-shell/default.nix b/pkgs/tools/security/yubihsm-shell/default.nix new file mode 100644 index 000000000000..06a1452400de --- /dev/null +++ b/pkgs/tools/security/yubihsm-shell/default.nix @@ -0,0 +1,59 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, openssl +, libusb1 +, libedit +, curl +, gengetopt +, pkg-config +, pcsclite +, help2man +}: + +stdenv.mkDerivation rec { + pname = "yubihsm-shell"; + version = "2.3.1"; + + src = fetchFromGitHub { + owner = "Yubico"; + repo = "yubihsm-shell"; + rev = version; + sha256 = "D0kXiwc+i6mKA4oHuHjgXUmLMsmY5o/VI+1aCWtNjC0="; + }; + + nativeBuildInputs = [ + pkg-config + cmake + help2man + gengetopt + ]; + + buildInputs = [ + libusb1 + libedit + curl + pcsclite + openssl + ]; + + cmakeFlags = [ + # help2man fails without this + "-DCMAKE_SKIP_BUILD_RPATH=OFF" + ]; + + postPatch = '' + # Can't find libyubihsm at runtime because of dlopen() in C code + substituteInPlace lib/yubihsm.c \ + --replace "libyubihsm_usb.so" "$out/lib/libyubihsm_usb.so" \ + --replace "libyubihsm_http.so" "$out/lib/libyubihsm_http.so" + ''; + + meta = with lib; { + description = "yubihsm-shell and libyubihsm"; + homepage = "https://github.com/Yubico/yubihsm-shell"; + maintainers = with maintainers; [ matthewcroughan ]; + license = licenses.asl20; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 789360728dfd..76e02d1c253a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21056,6 +21056,8 @@ with pkgs; yubikey-touch-detector = callPackage ../tools/security/yubikey-touch-detector { }; + yubihsm-shell = callPackage ../tools/security/yubihsm-shell { }; + zchunk = callPackage ../development/libraries/zchunk { }; zeitgeist = callPackage ../development/libraries/zeitgeist { };