about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/radio/airspy/default.nix
blob: 6299fe21d29dda8191d4b7f12f3a1458a636075a (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
{ stdenv, lib, fetchFromGitHub
, cmake , pkg-config, libusb1
}:

stdenv.mkDerivation rec {
  pname = "airspy";
  version = "1.0.9";

  src = fetchFromGitHub {
    owner = "airspy";
    repo = "airspyone_host";
    rev = "v${version}";
    sha256 = "04kx2p461sqd4q354n1a99zcabg9h29dwcnyhakykq8bpg3mgf1x";
  };

  postPatch = ''
    substituteInPlace airspy-tools/CMakeLists.txt --replace "/etc/udev/rules.d" "$out/etc/udev/rules.d"
  '';

  nativeBuildInputs = [ cmake pkg-config ];
  buildInputs = [ libusb1 ];

  cmakeFlags =
    lib.optionals stdenv.isLinux [ "-DINSTALL_UDEV_RULES=ON" ];

  meta = with lib; {
    homepage = "https://github.com/airspy/airspyone_host";
    description = "Host tools and driver library for the AirSpy SDR";
    license = licenses.bsd3;
    platforms = with platforms; linux ++ darwin;
    maintainers = with maintainers; [ markuskowa ];
  };
}