Skip to content

Commit

Permalink
sdrpp: 1.0.4 -> 1.1.0-20240121
Browse files Browse the repository at this point in the history
sdrpp switched to a rolling release, so take a git hash from head.
  • Loading branch information
hzeller committed Jan 22, 2024
1 parent 4253fc8 commit dc98857
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 19 deletions.
59 changes: 42 additions & 17 deletions pkgs/applications/radio/sdrpp/default.nix
Original file line number Diff line number Diff line change
@@ -1,45 +1,57 @@
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config
, libX11, glfw, glew, fftwFloat, volk, AppKit
, libX11, glfw, glew, fftwFloat, volk, zstd, AppKit
# Sources
, airspy_source ? true, airspy
, airspyhf_source ? true, airspyhf
, bladerf_source ? false, libbladeRF
, bladerf_source ? true, libbladeRF
, file_source ? true
, hackrf_source ? true, hackrf
, limesdr_source ? false, limesuite
, sddc_source ? false
, rtl_sdr_source ? true, rtl-sdr, libusb1
, limesdr_source ? true, limesuite
, perseus_source ? false # needs libperseus-sdr, not yet available in nixpks
, plutosdr_source ? stdenv.isLinux, libiio, libad9361
, rfspace_source ? true
, rtl_sdr_source ? true, rtl-sdr-osmocom, libusb1 # osmocom better w/ rtlsdr v4
, rtl_tcp_source ? true
, sdrplay_source ? false, sdrplay
, soapy_source ? true, soapysdr
, spyserver_source ? true
, plutosdr_source ? stdenv.isLinux, libiio, libad9361
, usrp_source ? true, uhd, boost

# Sinks
, audio_sink ? true, rtaudio
, portaudio_sink ? false, portaudio
, network_sink ? true
, portaudio_sink ? false, portaudio

# Decoders
, falcon9_decoder ? false
, m17_decoder ? false, codec2
, meteor_demodulator ? true
, radio ? true
, weather_sat_decoder ? true
, weather_sat_decoder ? false # is missing some dsp/pll.h

# Misc
, discord_presence ? true
, frequency_manager ? true
, recorder ? true
, rigctl_server ? true
, scanner ? true
}:

stdenv.mkDerivation rec {
pname = "sdrpp";
version = "1.0.4";

# SDR++ uses a rolling release model.
# Choose a git hash from head and use the date from that commit as
# version qualifier
git_hash = "3e58d4ba31eb0e78e85afdd811d80a32249fce19";
git_date = "20240121";
version = "1.1.0-" + git_date;

src = fetchFromGitHub {
owner = "AlexandreRouma";
repo = "SDRPlusPlus";
rev = version;
hash = "sha256-g9tpWvVRMXRhPfgvOeJhX6IMouF9+tLUr9wo5r35i/c=";
rev = git_hash;
hash = "sha256-nrPkVyMP8Ef8YTZghTtHX2oGpfKBfo8rBVJ7claV0yU=";
};

patches = [ ./runtime-prefix.patch ];
Expand All @@ -50,53 +62,66 @@ stdenv.mkDerivation rec {
--replace "set(CMAKE_INSTALL_PREFIX" "#set(CMAKE_INSTALL_PREFIX"
substituteInPlace decoder_modules/m17_decoder/src/m17dsp.h \
--replace "codec2.h" "codec2/codec2.h"
# Since the __TIME_ and __DATE__ is canonicalized in the build, add
# use our qualified version shown in the programs window title.
substituteInPlace core/src/version.h --replace "1.1.0" "$version"
'';

nativeBuildInputs = [ cmake pkg-config ];

buildInputs = [ glfw glew fftwFloat volk ]
buildInputs = [ glfw glew fftwFloat volk zstd ]
++ lib.optional stdenv.isDarwin AppKit
++ lib.optional stdenv.isLinux libX11
++ lib.optional airspy_source airspy
++ lib.optional airspyhf_source airspyhf
++ lib.optional bladerf_source libbladeRF
++ lib.optional hackrf_source hackrf
++ lib.optional limesdr_source limesuite
++ lib.optionals rtl_sdr_source [ rtl-sdr libusb1 ]
++ lib.optionals rtl_sdr_source [ rtl-sdr-osmocom libusb1 ]
++ lib.optional sdrplay_source sdrplay
++ lib.optional soapy_source soapysdr
++ lib.optionals plutosdr_source [ libiio libad9361 ]
++ lib.optionals usrp_source [ uhd boost ]
++ lib.optional audio_sink rtaudio
++ lib.optional portaudio_sink portaudio
++ lib.optional m17_decoder codec2;

cmakeFlags = lib.mapAttrsToList (k: v: "-D${k}=${if v then "ON" else "OFF"}") {
OPT_BUILD_AIRSPY_SOURCE = airspy_source;
# Sources
OPT_BUILD_AIRSPYHF_SOURCE = airspyhf_source;
OPT_BUILD_AIRSPY_SOURCE = airspy_source;
OPT_BUILD_BLADERF_SOURCE = bladerf_source;
OPT_BUILD_FILE_SOURCE = file_source;
OPT_BUILD_HACKRF_SOURCE = hackrf_source;
OPT_BUILD_LIMESDR_SOURCE = limesdr_source;
OPT_BUILD_SDDC_SOURCE = sddc_source;
OPT_BUILD_PERSEUS_SOURCE = perseus_source;
OPT_BUILD_PLUTOSDR_SOURCE = plutosdr_source;
OPT_BUILD_RFSPACE_SOURCE = rfspace_source;
OPT_BUILD_RTL_SDR_SOURCE = rtl_sdr_source;
OPT_BUILD_RTL_TCP_SOURCE = rtl_tcp_source;
OPT_BUILD_SDRPLAY_SOURCE = sdrplay_source;
OPT_BUILD_SOAPY_SOURCE = soapy_source;
OPT_BUILD_SPYSERVER_SOURCE = spyserver_source;
OPT_BUILD_PLUTOSDR_SOURCE = plutosdr_source;
OPT_BUILD_USRP_SOURCE = usrp_source;

# Sinks
OPT_BUILD_AUDIO_SINK = audio_sink;
OPT_BUILD_PORTAUDIO_SINK = portaudio_sink;
OPT_BUILD_NETWORK_SINK = network_sink;
OPT_BUILD_NEW_PORTAUDIO_SINK = portaudio_sink;

# Decoders
OPT_BUILD_FALCON9_DECODER = falcon9_decoder;
OPT_BUILD_M17_DECODER = m17_decoder;
OPT_BUILD_METEOR_DEMODULATOR = meteor_demodulator;
OPT_BUILD_RADIO = radio;
OPT_BUILD_WEATHER_SAT_DECODER = weather_sat_decoder;

# Misc
OPT_BUILD_DISCORD_PRESENCE = discord_presence;
OPT_BUILD_FREQUENCY_MANAGER = frequency_manager;
OPT_BUILD_RECORDER = recorder;
OPT_BUILD_RIGCTL_SERVER = rigctl_server;
OPT_BUILD_SCANNER = scanner;
};

env.NIX_CFLAGS_COMPILE = "-fpermissive";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24914,9 +24914,9 @@ with pkgs;

sdrplay = callPackage ../applications/radio/sdrplay { };

sdrpp = pin-to-gcc12-if-gcc13 (callPackage ../applications/radio/sdrpp {
sdrpp = callPackage ../applications/radio/sdrpp {
inherit (darwin.apple_sdk.frameworks) AppKit;
});
};

sigdigger = libsForQt5.callPackage ../applications/radio/sigdigger { };

Expand Down

0 comments on commit dc98857

Please sign in to comment.