about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libcotp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libcotp')
-rw-r--r--nixpkgs/pkgs/development/libraries/libcotp/default.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libcotp/default.nix b/nixpkgs/pkgs/development/libraries/libcotp/default.nix
new file mode 100644
index 000000000000..80b418e3065d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcotp/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libgcrypt }:
+
+stdenv.mkDerivation rec {
+  pname = "libcotp";
+  version = "3.0.0";
+
+  src = fetchFromGitHub {
+    owner = "paolostivanin";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-/IIzUMms4aS63psyxwL+Ynj78c38R3WwbD2HIpdHF88=";
+  };
+
+  postPatch = lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace CMakeLists.txt \
+      --replace "add_link_options(-Wl," "# add_link_options(-Wl,"
+  '';
+
+  buildInputs = [ libgcrypt ];
+  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 ];
+    platforms = platforms.all;
+  };
+}