about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libfprint/default.nix
blob: 9a6db72ae058367dd3222e8b29fc88a4a333d6e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ thinkpad ? false
, stdenv
, fetchFromGitHub
, fetchurl
, pkgconfig
, meson
, ninja
, libusb
, pixman
, glib
, nss
, gtk3
, coreutils
, gtk-doc
, docbook_xsl
, docbook_xml_dtd_43
, openssl ? null
}:

assert thinkpad -> openssl != null;

stdenv.mkDerivation rec {
  pname = "libfprint" + stdenv.lib.optionalString thinkpad "-thinkpad";
  version = "1.0";

  src = {
    libfprint-thinkpad =
      fetchFromGitHub {
        owner = "3v1n0";
        repo = "libfprint";
        rev = "2e2e3821717e9042e93a995bdbd3d00f2df0be9c";
        sha256 = "1vps1wrp7hskf13f7jrv0dwry2fcid76x2w463wplngp63cj7b3b";
      };
    libfprint = fetchurl {
      url = "https://gitlab.freedesktop.org/libfprint/libfprint/uploads/aff93e9921d1cff53d7c070944952ff9/libfprint-${version}.tar.xz";
      sha256 = "0v84pd12v016m8iimhq39fgzamlarqccsr7d98cvrrwrzrgcixrd";
    };
  }.${pname};

  nativeBuildInputs = [
    pkgconfig
    meson
    ninja
    gtk-doc
    docbook_xsl
    docbook_xml_dtd_43
  ];

  buildInputs = [
    libusb
    pixman
    glib
    nss
    gtk3
  ]
  ++ stdenv.lib.optional thinkpad openssl
  ;

  mesonFlags = [
    "-Dudev_rules_dir=${placeholder "out"}/lib/udev/rules.d"
    "-Dx11-examples=false"
  ];

  postPatch = ''
    substituteInPlace libfprint/meson.build \
      --replace /bin/echo ${coreutils}/bin/echo
  '';

  meta = with stdenv.lib; {
    homepage = https://fprint.freedesktop.org/;
    description = "A library designed to make it easy to add support for consumer fingerprint readers";
    license = licenses.lgpl21;
    platforms = platforms.linux;
    maintainers = with maintainers; [ abbradar ];
  };
}