2023-02-09 11:40:11 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchFromGitHub
|
2023-02-09 11:40:11 +00:00
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
, check
|
|
|
|
, pcsclite
|
|
|
|
, PCSC
|
|
|
|
, gengetopt
|
2024-01-02 11:29:13 +00:00
|
|
|
, help2man
|
2023-02-09 11:40:11 +00:00
|
|
|
, cmake
|
2024-01-02 11:29:13 +00:00
|
|
|
, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
, withApplePCSC ? stdenv.isDarwin
|
2024-01-02 11:29:13 +00:00
|
|
|
, nix-update-script
|
2023-02-09 11:40:11 +00:00
|
|
|
, testers
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "yubico-piv-tool";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2.5.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
outputs = [ "out" "dev" "man" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Yubico";
|
|
|
|
repo = "yubico-piv-tool";
|
|
|
|
rev = "refs/tags/yubico-piv-tool-${finalAttrs.version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-SBVYr6OcWqT+WKOZgIeZ1TmqCbcGAjbq/HaWIwPduFw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-11 15:47:08 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt --replace "-Werror" ""
|
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
cmake
|
|
|
|
gengetopt
|
|
|
|
help2man
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
check
|
|
|
|
zlib.dev
|
|
|
|
]
|
|
|
|
++ (if withApplePCSC then [ PCSC ] else [ pcsclite ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
cmakeFlags = [
|
2024-01-02 11:29:13 +00:00
|
|
|
"-DGENERATE_MAN_PAGES=ON"
|
2022-04-27 09:35:20 +00:00
|
|
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
|
|
|
"-DCMAKE_INSTALL_MANDIR=share/man"
|
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [ "--with-backend=${if withApplePCSC then "macscard" else "pcsc"}" ];
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
passthru = {
|
2024-01-02 11:29:13 +00:00
|
|
|
updateScript = nix-update-script {
|
|
|
|
extraArgs = [ "--version-regex" "yubico-piv-tool-([0-9.]+)$" ];
|
2023-02-09 11:40:11 +00:00
|
|
|
};
|
|
|
|
tests.version = testers.testVersion {
|
2024-01-02 11:29:13 +00:00
|
|
|
package = finalAttrs.finalPackage;
|
2023-02-09 11:40:11 +00:00
|
|
|
command = "yubico-piv-tool --version";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://developers.yubico.com/yubico-piv-tool/";
|
2023-02-09 11:40:11 +00:00
|
|
|
changelog = "https://developers.yubico.com/yubico-piv-tool/Release_Notes.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
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.
|
|
|
|
'';
|
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.all;
|
2022-09-11 15:47:08 +00:00
|
|
|
maintainers = with maintainers; [ viraptor anthonyroussel ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "yubico-piv-tool";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
})
|