1{ lib, stdenv, fetchurl, fetchpatch, pkg-config, json_c, hidapi }:
2
3stdenv.mkDerivation rec {
4 pname = "libu2f-host";
5 version = "1.1.10";
6
7 src = fetchurl {
8 url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.xz";
9 sha256 = "0vrivl1dwql6nfi48z6dy56fwy2z13d7abgahgrs2mcmqng7hra2";
10 };
11
12 patches = [
13 # remove after updating to next release
14 (fetchpatch {
15 name = "json-c-0.14-support.patch";
16 url = "https://github.com/Yubico/libu2f-host/commit/840f01135d2892f45e71b9e90405de587991bd03.patch";
17 sha256 = "0xplx394ppsbsb4h4l8b9m4dv9shbl0zyck3y26vbm9i1g981ki7";
18 })
19 ];
20
21 nativeBuildInputs = [ pkg-config ];
22 buildInputs = [ json_c hidapi ];
23
24 doCheck = true;
25
26 meta = with lib; {
27 description = "A C library and command-line tool that implements the host-side of the U2F protocol";
28 homepage = "https://developers.yubico.com/libu2f-host";
29 license = with licenses; [ gpl3Plus lgpl21Plus ];
30 mainProgram = "u2f-host";
31 platforms = platforms.unix;
32 };
33}