summary refs log tree commit diff
path: root/pkgs/development/libraries/libnfc/default.nix
blob: 88bc909ea0e6f6789e944f047f4baaa575be2658 (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
{ lib
, stdenv
, fetchFromGitHub
, libusb-compat-0_1
, readline
, cmake
, pkg-config
}:

stdenv.mkDerivation rec {
  pname = "libnfc";
  version = "1.8.0";

  src = fetchFromGitHub {
    owner = "nfc-tools";
    repo = pname;
    rev = "libnfc-${version}";
    sha256 = "5gMv/HajPrUL/vkegEqHgN2d6Yzf01dTMrx4l34KMrQ=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    libusb-compat-0_1
    readline
  ];

  configureFlags = [
    "sysconfdir=/etc"
  ];

  cmakeFlags = lib.optionals stdenv.isDarwin [
    "-DLIBNFC_DRIVER_PN532_I2C=OFF"
    "-DLIBNFC_DRIVER_PN532_SPI=OFF"
  ];

  meta = with lib; {
    description = "Library for Near Field Communication (NFC)";
    homepage = "https://github.com/nfc-tools/libnfc";
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ offline ];
    platforms = platforms.unix;
  };
}