3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/yubico-piv-tool/default.nix

89 lines
2.2 KiB
Nix
Raw Normal View History

2023-02-08 12:33:29 +00:00
{ lib
, stdenv
, fetchFromGitHub
2023-02-08 12:33:29 +00:00
, pkg-config
, openssl
, check
, pcsclite
, PCSC
, gengetopt
, help2man
2023-02-08 12:33:29 +00:00
, cmake
, zlib
, withApplePCSC ? stdenv.isDarwin
, nix-update-script
2023-02-08 12:33:29 +00:00
, testers
}:
2014-10-28 22:35:47 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "yubico-piv-tool";
2024-02-01 00:59:13 +00:00
version = "2.5.0";
2014-10-28 22:35:47 +00:00
2023-12-06 16:31:24 +00:00
outputs = [ "out" "dev" "man" ];
src = fetchFromGitHub {
owner = "Yubico";
repo = "yubico-piv-tool";
rev = "refs/tags/yubico-piv-tool-${finalAttrs.version}";
2024-02-01 00:59:13 +00:00
hash = "sha256-KSM/p6PMzgpVtXIR9GjGiP/UqXhbc1xSQ71elbE4JQE=";
2014-10-28 22:35:47 +00:00
};
2022-09-06 23:29:07 +01:00
postPatch = ''
substituteInPlace CMakeLists.txt --replace "-Werror" ""
'';
nativeBuildInputs = [
pkg-config
cmake
gengetopt
help2man
];
buildInputs = [
openssl
check
zlib.dev
]
++ (if withApplePCSC then [ PCSC ] else [ pcsclite ]);
2014-10-28 22:35:47 +00:00
cmakeFlags = [
"-DGENERATE_MAN_PAGES=ON"
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_MANDIR=share/man"
"-DCMAKE_INSTALL_LIBDIR=lib"
];
configureFlags = [ "--with-backend=${if withApplePCSC then "macscard" else "pcsc"}" ];
2014-10-28 22:35:47 +00:00
2023-02-08 12:33:29 +00:00
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version-regex" "yubico-piv-tool-([0-9.]+)$" ];
2023-02-08 12:33:29 +00:00
};
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
2023-02-08 12:33:29 +00:00
command = "yubico-piv-tool --version";
};
};
meta = with lib; {
homepage = "https://developers.yubico.com/yubico-piv-tool/";
2023-02-08 12:33:29 +00:00
changelog = "https://developers.yubico.com/yubico-piv-tool/Release_Notes.html";
description = ''
Used for interacting with the Privilege and Identification Card (PIV)
application on a YubiKey
'';
longDescription = ''
The Yubico PIV tool is used for interacting with the Privilege and
Identification Card (PIV) application on a YubiKey.
With it you may generate keys on the device, importing keys and
certificates, and create certificate requests, and other operations.
A shared library and a command-line tool is included.
'';
2014-10-28 22:35:47 +00:00
license = licenses.bsd2;
platforms = platforms.all;
maintainers = with maintainers; [ viraptor anthonyroussel ];
2023-11-27 01:17:53 +00:00
mainProgram = "yubico-piv-tool";
2014-10-28 22:35:47 +00:00
};
})