2023-01-20 10:41:00 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libgcrypt }:
|
2021-07-04 02:40:35 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libcotp";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "3.1.0";
|
2021-07-04 02:40:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "paolostivanin";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
sha256 = "sha256-Ol/vWaXcbDcy+d8V//fK4SYUpnYmwuYJxkO3/+kqgdM=";
|
2021-07-04 02:40:35 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
postPatch = lib.optionalString stdenv.cc.isClang ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace "add_link_options(-Wl," "# add_link_options(-Wl,"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ libgcrypt ];
|
2021-07-04 02:40:35 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "C library that generates TOTP and HOTP";
|
|
|
|
homepage = "https://github.com/paolostivanin/libcotp";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ alexbakker ];
|
2023-01-20 10:41:00 +00:00
|
|
|
platforms = platforms.all;
|
2021-07-04 02:40:35 +00:00
|
|
|
};
|
|
|
|
}
|