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

stdenv.mkDerivation rec {
  pname = "soapyuhd";
  version = "0.4.1";

  src = fetchFromGitHub {
    owner = "pothosware";
    repo = "SoapyUHD";
    rev = "soapy-uhd-${version}";
    sha256 = "14rk9ap9ayks2ma6mygca08yfds9bgfmip8cvwl87l06hwhnlwhj";
  };

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

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

  postPatch = ''
    sed -i "s:DESTINATION .*uhd/modules:DESTINATION $out/lib/uhd/modules:" CMakeLists.txt
  '';

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