nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (3542B)


      1 { stdenv, lib, fetchFromGitHub, cmake, pkg-config
      2 , libX11, glfw, glew, fftwFloat, volk
      3 # Sources
      4 , airspy_source ? true, airspy
      5 , airspyhf_source ? true, airspyhf
      6 , bladerf_source ? false, libbladeRF
      7 , file_source ? true
      8 , hackrf_source ? true, hackrf
      9 , limesdr_source ? false, limesuite
     10 , sddc_source ? false
     11 , rtl_sdr_source ? true, librtlsdr, libusb1
     12 , rtl_tcp_source ? true
     13 , sdrplay_source ? false, sdrplay
     14 , soapy_source ? true, soapysdr
     15 , spyserver_source ? true
     16 , plutosdr_source ? true, libiio, libad9361
     17 # Sinks
     18 , audio_sink ? true, rtaudio
     19 , portaudio_sink ? false, portaudio
     20 , network_sink ? true
     21 # Decoders
     22 , falcon9_decoder ? false
     23 , m17_decoder ? false, codec2
     24 , meteor_demodulator ? true
     25 , radio ? true
     26 , weather_sat_decoder ? true
     27 # Misc
     28 , discord_presence ? true
     29 , frequency_manager ? true
     30 , recorder ? true
     31 , rigctl_server ? true
     32 }:
     33 
     34 stdenv.mkDerivation rec {
     35   pname = "sdrpp";
     36   version = "1.0.4";
     37 
     38   src = fetchFromGitHub {
     39     owner = "AlexandreRouma";
     40     repo = "SDRPlusPlus";
     41     rev = version;
     42     hash = "sha256-g9tpWvVRMXRhPfgvOeJhX6IMouF9+tLUr9wo5r35i/c=";
     43   };
     44 
     45   postPatch = ''
     46     substituteInPlace CMakeLists.txt \
     47       --replace "/usr" $out
     48     substituteInPlace decoder_modules/m17_decoder/src/m17dsp.h \
     49       --replace "codec2.h" "codec2/codec2.h"
     50   '';
     51 
     52   nativeBuildInputs = [ cmake pkg-config ];
     53 
     54   buildInputs = [ glfw glew fftwFloat volk ]
     55     ++ lib.optional stdenv.isLinux libX11
     56     ++ lib.optional airspy_source airspy
     57     ++ lib.optional airspyhf_source airspyhf
     58     ++ lib.optional bladerf_source libbladeRF
     59     ++ lib.optional hackrf_source hackrf
     60     ++ lib.optional limesdr_source limesuite
     61     ++ lib.optionals rtl_sdr_source [ librtlsdr libusb1 ]
     62     ++ lib.optional sdrplay_source sdrplay
     63     ++ lib.optional soapy_source soapysdr
     64     ++ lib.optionals plutosdr_source [ libiio libad9361 ]
     65     ++ lib.optional audio_sink rtaudio
     66     ++ lib.optional portaudio_sink portaudio
     67     ++ lib.optional m17_decoder codec2;
     68 
     69   cmakeFlags = lib.mapAttrsToList (k: v: "-D${k}=${if v then "ON" else "OFF"}") {
     70     OPT_BUILD_AIRSPY_SOURCE = airspy_source;
     71     OPT_BUILD_AIRSPYHF_SOURCE = airspyhf_source;
     72     OPT_BUILD_BLADERF_SOURCE = bladerf_source;
     73     OPT_BUILD_FILE_SOURCE = file_source;
     74     OPT_BUILD_HACKRF_SOURCE = hackrf_source;
     75     OPT_BUILD_LIMESDR_SOURCE = limesdr_source;
     76     OPT_BUILD_SDDC_SOURCE = sddc_source;
     77     OPT_BUILD_RTL_SDR_SOURCE = rtl_sdr_source;
     78     OPT_BUILD_RTL_TCP_SOURCE = rtl_tcp_source;
     79     OPT_BUILD_SDRPLAY_SOURCE = sdrplay_source;
     80     OPT_BUILD_SOAPY_SOURCE = soapy_source;
     81     OPT_BUILD_SPYSERVER_SOURCE = spyserver_source;
     82     OPT_BUILD_PLUTOSDR_SOURCE = plutosdr_source;
     83     OPT_BUILD_AUDIO_SINK = audio_sink;
     84     OPT_BUILD_PORTAUDIO_SINK = portaudio_sink;
     85     OPT_BUILD_NETWORK_SINK = network_sink;
     86     OPT_BUILD_NEW_PORTAUDIO_SINK = portaudio_sink;
     87     OPT_BUILD_FALCON9_DECODER = falcon9_decoder;
     88     OPT_BUILD_M17_DECODER = m17_decoder;
     89     OPT_BUILD_METEOR_DEMODULATOR = meteor_demodulator;
     90     OPT_BUILD_RADIO = radio;
     91     OPT_BUILD_WEATHER_SAT_DECODER = weather_sat_decoder;
     92     OPT_BUILD_DISCORD_PRESENCE = discord_presence;
     93     OPT_BUILD_FREQUENCY_MANAGER = frequency_manager;
     94     OPT_BUILD_RECORDER = recorder;
     95     OPT_BUILD_RIGCTL_SERVER = rigctl_server;
     96   };
     97 
     98   NIX_CFLAGS_COMPILE = "-fpermissive";
     99 
    100   meta = with lib; {
    101     description = "Cross-Platform SDR Software";
    102     inherit (src.meta) homepage;
    103     license = licenses.gpl3Only;
    104     platforms = platforms.linux;
    105     maintainers = [ maintainers.sikmir ];
    106     skip.ci = stdenv.isDarwin;
    107   };
    108 }