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";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.0.2";
|
2021-07-04 02:40:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "paolostivanin";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-QvDYdplPhivG4a2otT4MuSY546a2Dw/amWly5aheabQ=";
|
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
|
|
|
};
|
|
|
|
}
|