about summary refs log tree commit diff
path: root/pkgs/applications/radio/soapyhackrf/default.nix
blob: be621c0d3135e05c23dfe51237ad41537afdcb5d (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
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
, hackrf, soapysdr
, libobjc, IOKit, Security
} :

let
  version = "0.3.4";

in stdenv.mkDerivation {
  pname = "soapyhackrf";
  inherit version;

  src = fetchFromGitHub {
    owner = "pothosware";
    repo = "SoapyHackRF";
    rev = "soapy-hackrf-${version}";
    sha256 = "sha256-fzPYHJAPX8FkFxPXpLlUagTd/NoamRX0YnxHwkbV1nI=";
  };

  nativeBuildInputs = [ cmake pkg-config ];
  buildInputs = [ hackrf soapysdr ]
    ++ lib.optionals stdenv.isDarwin [ libobjc IOKit Security ];

  cmakeFlags = [ "-DSoapySDR_DIR=${soapysdr}/share/cmake/SoapySDR/" ];

  meta = with lib; {
    homepage = "https://github.com/pothosware/SoapyHackRF";
    description = "SoapySDR plugin for HackRF devices";
    license = licenses.mit;
    maintainers = with maintainers; [ markuskowa ];
    platforms = platforms.unix;
  };
}