1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 sqlite,
7 wxGTK32,
8 libusb1,
9 soapysdr,
10 mesa_glu,
11 libX11,
12 gnuplot,
13 fltk,
14 withGui ? false,
15}:
16
17stdenv.mkDerivation rec {
18 pname = "limesuite";
19 version = "23.11.0";
20
21 src = fetchFromGitHub {
22 owner = "myriadrf";
23 repo = "LimeSuite";
24 rev = "v${version}";
25 sha256 = "sha256-f1cXrkVCIc1MqTvlCUBFqzHLhIVueybVxipNZRlF2gE=";
26 };
27
28 nativeBuildInputs = [ cmake ];
29
30 cmakeFlags = [
31 "-DOpenGL_GL_PREFERENCE=GLVND"
32 ]
33 ++ lib.optional (!withGui) "-DENABLE_GUI=OFF";
34
35 buildInputs = [
36 libusb1
37 sqlite
38 gnuplot
39 libusb1
40 soapysdr
41 ]
42 ++ lib.optionals withGui [
43 fltk
44 libX11
45 mesa_glu
46 wxGTK32
47 ];
48
49 doInstallCheck = true;
50
51 postInstall = ''
52 install -Dm444 -t $out/lib/udev/rules.d ../udev-rules/64-limesuite.rules
53 install -Dm444 -t $out/share/limesuite bin/Release/lms7suite_mcu/*
54 '';
55
56 meta = with lib; {
57 description = "Driver and GUI for LMS7002M-based SDR platforms";
58 homepage = "https://github.com/myriadrf/LimeSuite";
59 license = licenses.asl20;
60 maintainers = with maintainers; [ markuskowa ];
61 platforms = platforms.unix;
62 badPlatforms = lib.optionals withGui platforms.darwin; # withGui transitively depends on mesa, which is broken on darwin
63 };
64}