···
1
1
+
{
2
2
+
stdenv,
3
3
+
lib,
4
4
+
fetchFromGitHub,
5
5
+
fetchurl,
6
6
+
cmake,
7
7
+
pkg-config,
8
8
+
unzip,
9
9
+
libX11,
10
10
+
glfw,
11
11
+
glew,
12
12
+
fftw,
13
13
+
fftwFloat,
14
14
+
volk,
15
15
+
zstd,
16
16
+
libpulseaudio,
17
17
+
18
18
+
# Sources
19
19
+
airspy_source ? true,
20
20
+
airspy,
21
21
+
airspyhf_source ? true,
22
22
+
airspyhf,
23
23
+
audio_source ? true,
24
24
+
bladerf_source ? stdenv.hostPlatform.isLinux,
25
25
+
libbladeRF,
26
26
+
file_source ? true,
27
27
+
hackrf_source ? true,
28
28
+
hackrf,
29
29
+
hermes_source ? true,
30
30
+
hl2_source ? true,
31
31
+
kiwisdr_source ? true,
32
32
+
limesdr_source ? true,
33
33
+
limesuite,
34
34
+
network_source ? true,
35
35
+
plutosdr_source ? stdenv.hostPlatform.isLinux,
36
36
+
libiio,
37
37
+
libad9361,
38
38
+
rfspace_source ? true,
39
39
+
rtl_sdr_source ? true,
40
40
+
rtl-sdr-osmocom,
41
41
+
libusb1,
42
42
+
rtl_tcp_source ? true,
43
43
+
sdrplay_source ? false,
44
44
+
sdrplay,
45
45
+
sdrpp_server_source ? true,
46
46
+
soapy_source ? true,
47
47
+
soapysdr-with-plugins,
48
48
+
spectran_http_source ? true,
49
49
+
spyserver_source ? true,
50
50
+
usrp_source ? false,
51
51
+
uhd,
52
52
+
boost,
53
53
+
54
54
+
# Sinks
55
55
+
audio_sink ? true,
56
56
+
rtaudio,
57
57
+
mpeg_adts_sink ? false, # downloads lame at build time - disable for now
58
58
+
network_sink ? true,
59
59
+
portaudio_sink ? false,
60
60
+
portaudio,
61
61
+
62
62
+
# Decoders
63
63
+
atv_decoder ? true,
64
64
+
ch_extravhf_decoder ? false, # requires itpp/mbe libraries
65
65
+
ch_tetra_demodulator ? true,
66
66
+
dab_decoder ? false,
67
67
+
falcon9_decoder ? false,
68
68
+
ft8_decoder ? true,
69
69
+
kg_sstv_decoder ? false,
70
70
+
m17_decoder ? false,
71
71
+
codec2,
72
72
+
meteor_demodulator ? true,
73
73
+
pager_decoder ? true,
74
74
+
radio ? true,
75
75
+
weather_sat_decoder ? false,
76
76
+
77
77
+
# Misc
78
78
+
discord_presence ? true,
79
79
+
frequency_manager ? true,
80
80
+
iq_exporter ? true,
81
81
+
recorder ? true,
82
82
+
rigctl_client ? true,
83
83
+
rigctl_server ? true,
84
84
+
scanner ? true,
85
85
+
noise_reduction ? true,
86
86
+
}:
87
87
+
88
88
+
let
89
89
+
# ETSI TETRA codec - pre-fetched to avoid network access during build
90
90
+
etsiCodec = fetchurl {
91
91
+
url = "http://www.etsi.org/deliver/etsi_en/300300_300399/30039502/01.03.01_60/en_30039502v010301p0.zip";
92
92
+
hash = "sha256-H+GMR3PIzLUu8jyltKCwhBs41U3dXZx9huuLBg8TLzk=";
93
93
+
};
94
94
+
in
95
95
+
stdenv.mkDerivation (finalAttrs: {
96
96
+
pname = "sdrpp-brown";
97
97
+
98
98
+
version = "0-unstable-2025-12-29";
99
99
+
100
100
+
src = fetchFromGitHub {
101
101
+
owner = "sannysanoff";
102
102
+
repo = "SDRPlusPlusBrown";
103
103
+
rev = "f0feccfb10a9a102255c771ec3f5923c6f58ad9e";
104
104
+
hash = "sha256-2DeDWoWRTv6lcF+DQyaVx2oJsjlGsUf88MrF3+7T6Ew=";
105
105
+
};
106
106
+
107
107
+
nativeBuildInputs = [
108
108
+
cmake
109
109
+
pkg-config
110
110
+
] ++ lib.optional ch_tetra_demodulator unzip;
111
111
+
112
112
+
buildInputs =
113
113
+
[
114
114
+
glfw
115
115
+
glew
116
116
+
fftw
117
117
+
fftwFloat
118
118
+
volk
119
119
+
zstd
120
120
+
]
121
121
+
++ lib.optional stdenv.hostPlatform.isLinux libX11
122
122
+
++ lib.optional stdenv.hostPlatform.isLinux libpulseaudio
123
123
+
++ lib.optional airspy_source airspy
124
124
+
++ lib.optional airspyhf_source airspyhf
125
125
+
++ lib.optional bladerf_source libbladeRF
126
126
+
++ lib.optional hackrf_source hackrf
127
127
+
++ lib.optional limesdr_source limesuite
128
128
+
++ lib.optionals rtl_sdr_source [
129
129
+
rtl-sdr-osmocom
130
130
+
libusb1
131
131
+
]
132
132
+
++ lib.optional sdrplay_source sdrplay
133
133
+
++ lib.optional soapy_source soapysdr-with-plugins
134
134
+
++ lib.optionals plutosdr_source [
135
135
+
libiio
136
136
+
libad9361
137
137
+
]
138
138
+
++ lib.optionals usrp_source [
139
139
+
uhd
140
140
+
boost
141
141
+
]
142
142
+
++ lib.optional (audio_source || audio_sink) rtaudio
143
143
+
++ lib.optional portaudio_sink portaudio
144
144
+
++ lib.optional (dab_decoder || m17_decoder) codec2;
145
145
+
146
146
+
# Pre-place the ETSI codec in the build directory so CMake doesn't try to download it
147
147
+
preConfigure = lib.optionalString ch_tetra_demodulator ''
148
148
+
mkdir -p build/decoder_modules/ch_tetra_demodulator/etsi_codec
149
149
+
cp ${etsiCodec} build/decoder_modules/ch_tetra_demodulator/etsi_codec/etsi_tetra_codec.zip
150
150
+
'';
151
151
+
152
152
+
cmakeFlags = [
153
153
+
# Sources
154
154
+
(lib.cmakeBool "OPT_BUILD_AIRSPYHF_SOURCE" airspyhf_source)
155
155
+
(lib.cmakeBool "OPT_BUILD_AIRSPY_SOURCE" airspy_source)
156
156
+
(lib.cmakeBool "OPT_BUILD_AUDIO_SOURCE" audio_source)
157
157
+
(lib.cmakeBool "OPT_BUILD_BLADERF_SOURCE" bladerf_source)
158
158
+
(lib.cmakeBool "OPT_BUILD_FILE_SOURCE" file_source)
159
159
+
(lib.cmakeBool "OPT_BUILD_HACKRF_SOURCE" hackrf_source)
160
160
+
(lib.cmakeBool "OPT_BUILD_HERMES_SOURCE" hermes_source)
161
161
+
(lib.cmakeBool "OPT_BUILD_HL2_SOURCE" hl2_source)
162
162
+
(lib.cmakeBool "OPT_BUILD_KIWISDR_SOURCE" kiwisdr_source)
163
163
+
(lib.cmakeBool "OPT_BUILD_LIMESDR_SOURCE" limesdr_source)
164
164
+
(lib.cmakeBool "OPT_BUILD_NETWORK_SOURCE" network_source)
165
165
+
(lib.cmakeBool "OPT_BUILD_PLUTOSDR_SOURCE" plutosdr_source)
166
166
+
(lib.cmakeBool "OPT_BUILD_RFSPACE_SOURCE" rfspace_source)
167
167
+
(lib.cmakeBool "OPT_BUILD_RTL_SDR_SOURCE" rtl_sdr_source)
168
168
+
(lib.cmakeBool "OPT_BUILD_RTL_TCP_SOURCE" rtl_tcp_source)
169
169
+
(lib.cmakeBool "OPT_BUILD_SDRPLAY_SOURCE" sdrplay_source)
170
170
+
(lib.cmakeBool "OPT_BUILD_SDRPP_SERVER_SOURCE" sdrpp_server_source)
171
171
+
(lib.cmakeBool "OPT_BUILD_SOAPY_SOURCE" soapy_source)
172
172
+
(lib.cmakeBool "OPT_BUILD_SPECTRAN_HTTP_SOURCE" spectran_http_source)
173
173
+
(lib.cmakeBool "OPT_BUILD_SPYSERVER_SOURCE" spyserver_source)
174
174
+
(lib.cmakeBool "OPT_BUILD_USRP_SOURCE" usrp_source)
175
175
+
176
176
+
# Sinks
177
177
+
(lib.cmakeBool "OPT_BUILD_AUDIO_SINK" audio_sink)
178
178
+
(lib.cmakeBool "OPT_BUILD_MPEG_ADTS_SINK" mpeg_adts_sink)
179
179
+
(lib.cmakeBool "OPT_BUILD_NETWORK_SINK" network_sink)
180
180
+
(lib.cmakeBool "OPT_BUILD_NEW_PORTAUDIO_SINK" portaudio_sink)
181
181
+
182
182
+
# Decoders
183
183
+
(lib.cmakeBool "OPT_BUILD_ATV_DECODER" atv_decoder)
184
184
+
(lib.cmakeBool "OPT_BUILD_CH_EXTRAVHF_DECODER" ch_extravhf_decoder)
185
185
+
(lib.cmakeBool "OPT_BUILD_CH_TETRA_DEMODULATOR" ch_tetra_demodulator)
186
186
+
(lib.cmakeBool "OPT_BUILD_DAB_DECODER" dab_decoder)
187
187
+
(lib.cmakeBool "OPT_BUILD_FALCON9_DECODER" falcon9_decoder)
188
188
+
(lib.cmakeBool "OPT_BUILD_FT8_DECODER" ft8_decoder)
189
189
+
(lib.cmakeBool "OPT_BUILD_KG_SSTV_DECODER" kg_sstv_decoder)
190
190
+
(lib.cmakeBool "OPT_BUILD_M17_DECODER" m17_decoder)
191
191
+
(lib.cmakeBool "OPT_BUILD_METEOR_DEMODULATOR" meteor_demodulator)
192
192
+
(lib.cmakeBool "OPT_BUILD_PAGER_DECODER" pager_decoder)
193
193
+
(lib.cmakeBool "OPT_BUILD_RADIO" radio)
194
194
+
(lib.cmakeBool "OPT_BUILD_WEATHER_SAT_DECODER" weather_sat_decoder)
195
195
+
196
196
+
# Misc
197
197
+
(lib.cmakeBool "OPT_BUILD_DISCORD_PRESENCE" discord_presence)
198
198
+
(lib.cmakeBool "OPT_BUILD_FREQUENCY_MANAGER" frequency_manager)
199
199
+
(lib.cmakeBool "OPT_BUILD_IQ_EXPORTER" iq_exporter)
200
200
+
(lib.cmakeBool "OPT_BUILD_RECORDER" recorder)
201
201
+
(lib.cmakeBool "OPT_BUILD_RIGCTL_CLIENT" rigctl_client)
202
202
+
(lib.cmakeBool "OPT_BUILD_RIGCTL_SERVER" rigctl_server)
203
203
+
(lib.cmakeBool "OPT_BUILD_SCANNER" scanner)
204
204
+
(lib.cmakeBool "OPT_BUILD_NOISE_REDUCTION_LOGMMSE" noise_reduction)
205
205
+
];
206
206
+
207
207
+
env.NIX_CFLAGS_COMPILE = "-fpermissive";
208
208
+
209
209
+
hardeningDisable = lib.optional stdenv.cc.isClang "format";
210
210
+
211
211
+
meta = {
212
212
+
description = "SDR++ Brown Edition - Cross-Platform SDR Software with KiwiSDR support";
213
213
+
homepage = "https://github.com/sannysanoff/SDRPlusPlusBrown";
214
214
+
license = lib.licenses.gpl3Only;
215
215
+
platforms = lib.platforms.linux;
216
216
+
mainProgram = "sdrpp";
217
217
+
};
218
218
+
})