{
  lib,
  stdenv,
  fetchFromGitHub,
  libusb1,
  libusb-compat-0_1,
  pkg-config,
  libtool,
  autoreconfHook}:

stdenv.mkDerivation rec {
  pname = "libnfc-nci";
  version = "unstable-2024-07-15";

  src =  fetchFromGitHub {
    owner = "StarGate01";
    repo = "linux_libnfc-nci";
    rev = "4fc402ffd07642b1231fb259a6b956771d524e5e";
    hash = "sha256-mrGsTikxS/oR+Wh9a4aVCszbF/nbFAVBQfYN421vqU0=";
  };

  oldsrc = fetchFromGitHub {
    owner = "NXPNFCLinux";
    repo = "linux_libnfc-nci";
    rev = "449538e5e106666e5263afeaddacc5836fc23d3f";
    hash = "sha256-ngooArd2g8DBFRQ0M7BFYoJLlhWLX/R5YjuDkj6qh1Y=";
  };

  nativeBuildInputs = [
    autoreconfHook
    libtool
    pkg-config
  ];

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

  patches = [
		#./00_enable_debug.patch
		#./01_set_port_location.patch
  ];

  configureFlags = [
		"--enable-i2c"
  ];

  meta = with lib; {
    description = "Linux NFC stack for NCI based NXP NFC Controllers";
    homepage = "https://github.com/StarGate01/linux_libnfc-nci";
    license = licenses.asl20;
  };
}
