Gentoo Archives: gentoo-commits

From: Rick Farina <zerochaos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-wireless/gr-osmosdr/, net-wireless/gr-osmosdr/files/
Date: Mon, 01 Jun 2020 20:46:05
Message-Id: 1591044188.95d69b572c7e58574d352f7bec3b2f56af485a48.zerochaos@gentoo
1 commit: 95d69b572c7e58574d352f7bec3b2f56af485a48
2 Author: Rick Farina <zerochaos <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 30 02:51:56 2020 +0000
4 Commit: Rick Farina <zerochaos <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 1 20:43:08 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95d69b57
7
8 net-wireless/gr-osmosdr: bump
9
10 prep for gr3.8
11
12 Package-Manager: Portage-2.3.100, Repoman-2.3.22
13 Signed-off-by: Rick Farina <zerochaos <AT> gentoo.org>
14
15 net-wireless/gr-osmosdr/Manifest | 2 +-
16 net-wireless/gr-osmosdr/files/csete-iio.patch | 640 ---------------------
17 ...sdr-0.1.5.ebuild => gr-osmosdr-0.1.5-r1.ebuild} | 2 +-
18 ...p20180626-r5.ebuild => gr-osmosdr-0.2.0.ebuild} | 31 +-
19 net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild | 10 +-
20 net-wireless/gr-osmosdr/metadata.xml | 1 -
21 6 files changed, 16 insertions(+), 670 deletions(-)
22
23 diff --git a/net-wireless/gr-osmosdr/Manifest b/net-wireless/gr-osmosdr/Manifest
24 index f79d0e5e0b5..5a85526c102 100644
25 --- a/net-wireless/gr-osmosdr/Manifest
26 +++ b/net-wireless/gr-osmosdr/Manifest
27 @@ -1,2 +1,2 @@
28 -DIST gr-osmosdr-0.1.4_p20180626.tar.xz 179568 BLAKE2B 223d23bd17edd5f4ee78237e509c79e5e7e49bbfb516009c3b5a715f386fcd138beea48e417d4576a7749cdb440736b6d92c8766b614bf617ef6b2bb4a293fda SHA512 8540da1f4d6936e0a97fa2f3e24af1866d44620fd7e7bc65b323364f67f1527fe8e0efd7bf0349be5e3d61f2ed24fa736c924ea0038e44fa3ab72848fe254a28
29 DIST gr-osmosdr-0.1.5.tar.gz 278257 BLAKE2B f63704bd8d7e1fc86cfab256e8813716ac56a4b962f37d9e027df6234ee8e6d78a9d8459408d31ace4a3d6f46edfca0cc1eb9c1004b7052332ead1528cc5ec4b SHA512 5c028dcacf3cb94696eecdd31f4f09b31158c8ce12646d577535ba20942103899e5e21f001f2dd7d0a56eb58f17c2aa849139b495c61e21b60dd6678444b0983
30 +DIST gr-osmosdr-0.2.0.tar.gz 251163 BLAKE2B 036a4439c5c27ae3143ef3be6e76f94bf3e0524509ffc58ad19379fa0adc9477bd704b7e88fffd46ed9e5528ae539d875b4e496a77ea392e8eef117fc57a3af1 SHA512 96eb8ff0a05cf0d5b49384cdc80e0a3d924ba452485acbe852266fd73a5335668b40454421d9f5a52ea610f7100557e51d6a5d9cf6931fe68e8757eb5f02d126
31
32 diff --git a/net-wireless/gr-osmosdr/files/csete-iio.patch b/net-wireless/gr-osmosdr/files/csete-iio.patch
33 deleted file mode 100644
34 index 678a8599d05..00000000000
35 --- a/net-wireless/gr-osmosdr/files/csete-iio.patch
36 +++ /dev/null
37 @@ -1,640 +0,0 @@
38 -From 0eaf819be8a40896dfc3d810685a609a867a42e9 Mon Sep 17 00:00:00 2001
39 -From: Alexandru Csete <oz9aec@×××××.com>
40 -Date: Mon, 13 Feb 2017 01:05:50 +0100
41 -Subject: [PATCH] Add PlutoSDR source through gr-iio
42 -
43 ----
44 - CMakeLists.txt | 1 +
45 - cmake/Modules/FindGnuradioIIO.cmake | 34 ++++
46 - cmake/Modules/FindIIO.cmake | 28 +++
47 - lib/CMakeLists.txt | 8 +
48 - lib/config.h.in | 1 +
49 - lib/device.cc | 8 +
50 - lib/plutosdr/CMakeLists.txt | 39 +++++
51 - lib/plutosdr/plutosdr_source_c.cc | 262 ++++++++++++++++++++++++++++
52 - lib/plutosdr/plutosdr_source_c.h | 105 +++++++++++
53 - lib/source_impl.cc | 18 ++
54 - 10 files changed, 504 insertions(+)
55 - create mode 100644 cmake/Modules/FindGnuradioIIO.cmake
56 - create mode 100644 cmake/Modules/FindIIO.cmake
57 - create mode 100644 lib/plutosdr/CMakeLists.txt
58 - create mode 100644 lib/plutosdr/plutosdr_source_c.cc
59 - create mode 100644 lib/plutosdr/plutosdr_source_c.h
60 -
61 -diff --git a/CMakeLists.txt b/CMakeLists.txt
62 -index 296456d..7871f39 100644
63 ---- a/CMakeLists.txt
64 -+++ b/CMakeLists.txt
65 -@@ -159,6 +159,7 @@ endif()
66 - find_package(GnuradioIQBalance)
67 - find_package(UHD)
68 - find_package(GnuradioUHD)
69 -+find_package(GnuradioIIO)
70 - find_package(GnuradioFCD)
71 - find_package(GnuradioFCDPP)
72 - find_package(LibOsmoSDR)
73 -diff --git a/cmake/Modules/FindGnuradioIIO.cmake b/cmake/Modules/FindGnuradioIIO.cmake
74 -new file mode 100644
75 -index 0000000..d3c011a
76 ---- /dev/null
77 -+++ b/cmake/Modules/FindGnuradioIIO.cmake
78 -@@ -0,0 +1,34 @@
79 -+INCLUDE(FindPkgConfig)
80 -+PKG_CHECK_MODULES(PC_GNURADIO_IIO gnuradio-iio)
81 -+
82 -+FIND_PATH(
83 -+ GNURADIO_IIO_INCLUDE_DIRS
84 -+ NAMES gnuradio/iio/api.h
85 -+ HINTS $ENV{GNURADIO_IIO_DIR}/include
86 -+ ${PC_GNURADIO_IIO_INCLUDEDIR}
87 -+ PATHS /usr/local/include
88 -+ /usr/include
89 -+)
90 -+
91 -+FIND_LIBRARY(
92 -+ GNURADIO_IIO_LIBRARIES
93 -+ NAMES gnuradio-iio
94 -+ HINTS $ENV{GNURADIO_IIO_DIR}/lib
95 -+ ${PC_GNURADIO_IIO_LIBDIR}
96 -+ PATHS /usr/local/lib
97 -+ /usr/local/lib64
98 -+ /usr/lib
99 -+ /usr/lib64
100 -+)
101 -+
102 -+if(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
103 -+ set(GNURADIO_IIO_FOUND TRUE CACHE INTERNAL "gnuradio-iio found")
104 -+ message(STATUS "Found gnuradio-iio: ${GNURADIO_IIO_INCLUDE_DIRS}, ${GNURADIO_IIO_LIBRARIES}")
105 -+else(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
106 -+ set(GNURADIO_IIO_FOUND FALSE CACHE INTERNAL "gnuradio-iio found")
107 -+ message(STATUS "gnuradio-iio not found.")
108 -+endif(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
109 -+
110 -+INCLUDE(FindPackageHandleStandardArgs)
111 -+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_IIO DEFAULT_MSG GNURADIO_IIO_LIBRARIES GNURADIO_IIO_INCLUDE_DIRS)
112 -+MARK_AS_ADVANCED(GNURADIO_IIO_LIBRARIES GNURADIO_IIO_INCLUDE_DIRS)
113 -diff --git a/cmake/Modules/FindIIO.cmake b/cmake/Modules/FindIIO.cmake
114 -new file mode 100644
115 -index 0000000..bb87a4b
116 ---- /dev/null
117 -+++ b/cmake/Modules/FindIIO.cmake
118 -@@ -0,0 +1,28 @@
119 -+########################################################################
120 -+# Find the IIO userspace library
121 -+########################################################################
122 -+
123 -+INCLUDE(FindPkgConfig)
124 -+PKG_CHECK_MODULES(PC_IIO iio)
125 -+
126 -+FIND_PATH(
127 -+ IIO_INCLUDE_DIRS
128 -+ NAMES iio.h
129 -+ HINTS $ENV{IIO_DIR}/include
130 -+ ${PC_IIO_INCLUDEDIR}
131 -+ PATHS /usr/local/include
132 -+ /usr/include
133 -+)
134 -+
135 -+FIND_LIBRARY(
136 -+ IIO_LIBRARIES
137 -+ NAMES iio
138 -+ HINTS $ENV{IIO_DIR}/lib
139 -+ ${PC_IIO_LIBDIR}
140 -+ PATHS /usr/local/lib
141 -+ /usr/lib
142 -+)
143 -+
144 -+INCLUDE(FindPackageHandleStandardArgs)
145 -+FIND_PACKAGE_HANDLE_STANDARD_ARGS(IIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS)
146 -+MARK_AS_ADVANCED(IIO_LIBRARIES IIO_INCLUDE_DIRS)
147 -diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
148 -index c05b8d9..936d84b 100644
149 ---- a/lib/CMakeLists.txt
150 -+++ b/lib/CMakeLists.txt
151 -@@ -174,6 +174,14 @@ if(ENABLE_UHD)
152 - GR_INCLUDE_SUBDIRECTORY(uhd)
153 - endif(ENABLE_UHD)
154 -
155 -+########################################################################
156 -+# Setup IIO component
157 -+########################################################################
158 -+GR_REGISTER_COMPONENT("IIO Devices" ENABLE_IIO GNURADIO_IIO_FOUND)
159 -+if(ENABLE_IIO)
160 -+GR_INCLUDE_SUBDIRECTORY(plutosdr)
161 -+endif(ENABLE_IIO)
162 -+
163 - ########################################################################
164 - # Setup MiriSDR component
165 - ########################################################################
166 -diff --git a/lib/config.h.in b/lib/config.h.in
167 -index 42e72f1..0fe2731 100644
168 ---- a/lib/config.h.in
169 -+++ b/lib/config.h.in
170 -@@ -10,6 +10,7 @@
171 - #cmakedefine ENABLE_RTL
172 - #cmakedefine ENABLE_RTL_TCP
173 - #cmakedefine ENABLE_UHD
174 -+#cmakedefine ENABLE_IIO
175 - #cmakedefine ENABLE_MIRI
176 - #cmakedefine ENABLE_SDRPLAY
177 - #cmakedefine ENABLE_HACKRF
178 -diff --git a/lib/device.cc b/lib/device.cc
179 -index 025a22b..77b271f 100644
180 ---- a/lib/device.cc
181 -+++ b/lib/device.cc
182 -@@ -54,6 +54,10 @@
183 - #include <uhd_source_c.h>
184 - #endif
185 -
186 -+#ifdef ENABLE_IIO
187 -+#include <plutosdr_source_c.h>
188 -+#endif
189 -+
190 - #ifdef ENABLE_MIRI
191 - #include <miri_source_c.h>
192 - #endif
193 -@@ -162,6 +166,10 @@ devices_t device::find(const device_t &hint)
194 - BOOST_FOREACH( std::string dev, uhd_source_c::get_devices() )
195 - devices.push_back( device_t(dev) );
196 - #endif
197 -+#ifdef ENABLE_IIO
198 -+ BOOST_FOREACH( std::string dev, plutosdr_source_c::get_devices() )
199 -+ devices.push_back( device_t(dev) );
200 -+#endif
201 - #ifdef ENABLE_MIRI
202 - BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
203 - devices.push_back( device_t(dev) );
204 -diff --git a/lib/plutosdr/CMakeLists.txt b/lib/plutosdr/CMakeLists.txt
205 -new file mode 100644
206 -index 0000000..b335885
207 ---- /dev/null
208 -+++ b/lib/plutosdr/CMakeLists.txt
209 -@@ -0,0 +1,39 @@
210 -+# Copyright 2012 Free Software Foundation, Inc.
211 -+#
212 -+# This file is part of GNU Radio
213 -+#
214 -+# GNU Radio is free software; you can redistribute it and/or modify
215 -+# it under the terms of the GNU General Public License as published by
216 -+# the Free Software Foundation; either version 3, or (at your option)
217 -+# any later version.
218 -+#
219 -+# GNU Radio is distributed in the hope that it will be useful,
220 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
221 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
222 -+# GNU General Public License for more details.
223 -+#
224 -+# You should have received a copy of the GNU General Public License
225 -+# along with GNU Radio; see the file COPYING. If not, write to
226 -+# the Free Software Foundation, Inc., 51 Franklin Street,
227 -+# Boston, MA 02110-1301, USA.
228 -+
229 -+########################################################################
230 -+# This file included, use CMake directory variables
231 -+########################################################################
232 -+
233 -+include_directories(
234 -+ ${CMAKE_CURRENT_SOURCE_DIR}
235 -+ ${GNURADIO_IIO_INCLUDE_DIRS}
236 -+ ${IIO_INCLUDE_DIRS}
237 -+)
238 -+
239 -+set(iio_srcs
240 -+# ${CMAKE_CURRENT_SOURCE_DIR}/iio_sink_c.cc
241 -+ ${CMAKE_CURRENT_SOURCE_DIR}/plutosdr_source_c.cc
242 -+)
243 -+
244 -+########################################################################
245 -+# Append gnuradio-osmosdr library sources
246 -+########################################################################
247 -+list(APPEND gr_osmosdr_srcs ${iio_srcs})
248 -+list(APPEND gr_osmosdr_libs ${GNURADIO_IIO_LIBRARIES} ${IIO_LIBRARIES})
249 -diff --git a/lib/plutosdr/plutosdr_source_c.cc b/lib/plutosdr/plutosdr_source_c.cc
250 -new file mode 100644
251 -index 0000000..009d4b2
252 ---- /dev/null
253 -+++ b/lib/plutosdr/plutosdr_source_c.cc
254 -@@ -0,0 +1,262 @@
255 -+/* -*- c++ -*- */
256 -+/*
257 -+ * Copyright 2017 Dimitri Stolnikov <horiz0n@×××.net>
258 -+ *
259 -+ * GNU Radio is free software; you can redistribute it and/or modify
260 -+ * it under the terms of the GNU General Public License as published by
261 -+ * the Free Software Foundation; either version 3, or (at your option)
262 -+ * any later version.
263 -+ *
264 -+ * GNU Radio is distributed in the hope that it will be useful,
265 -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
266 -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
267 -+ * GNU General Public License for more details.
268 -+ *
269 -+ * You should have received a copy of the GNU General Public License
270 -+ * along with GNU Radio; see the file COPYING. If not, write to
271 -+ * the Free Software Foundation, Inc., 51 Franklin Street,
272 -+ * Boston, MA 02110-1301, USA.
273 -+ */
274 -+#include <boost/assign.hpp>
275 -+#include <iostream>
276 -+
277 -+#include "arg_helpers.h"
278 -+#include "osmosdr/source.h"
279 -+#include "plutosdr_source_c.h"
280 -+
281 -+using namespace boost::assign;
282 -+
283 -+plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args)
284 -+{
285 -+ return gnuradio::get_initial_sptr(new plutosdr_source_c(args));
286 -+}
287 -+
288 -+plutosdr_source_c::plutosdr_source_c(const std::string &args) :
289 -+ gr::hier_block2("plutosdr_source_c",
290 -+ gr::io_signature::make(0, 0, 0),
291 -+ gr::io_signature::make(1, 1, sizeof(gr_complex)))
292 -+{
293 -+ uri = "ip:pluto.local";
294 -+ frequency = 434000000;
295 -+ samplerate = 2500000;
296 -+ decimation = 0;
297 -+ bandwidth = 2000000;
298 -+ buffer_size = 0x4000;
299 -+ quadrature = true;
300 -+ rfdc = true;
301 -+ bbdc = true;
302 -+ gain_auto = false;
303 -+ gain_value = 50;
304 -+ filter = "";
305 -+ filter_auto = true;
306 -+ _freq_corr = 0.0;
307 -+
308 -+ dict_t dict = params_to_dict(args);
309 -+ if (dict.count("uri"))
310 -+ uri = boost::lexical_cast< std::string >( dict["uri"] );
311 -+
312 -+ std::cerr << "Using PlutoSDR URI = " << uri << std::endl;
313 -+
314 -+ _src = gr::iio::pluto_source::make(uri, frequency, samplerate,
315 -+ bandwidth, buffer_size,
316 -+ quadrature, rfdc, bbdc,
317 -+ "manual", gain_value,
318 -+ filter.c_str(), filter_auto);
319 -+
320 -+ connect( _src, 0, self(), 0 );
321 -+}
322 -+
323 -+plutosdr_source_c::~plutosdr_source_c()
324 -+{
325 -+}
326 -+
327 -+std::vector< std::string > plutosdr_source_c::get_devices()
328 -+{
329 -+ std::vector< std::string > devices;
330 -+
331 -+ std::string args = "plutosdr,label='PlutoSDR'";
332 -+
333 -+ devices.push_back( args );
334 -+
335 -+ return devices;
336 -+}
337 -+
338 -+std::string plutosdr_source_c::name()
339 -+{
340 -+ return "PlutoSDR";
341 -+}
342 -+
343 -+size_t plutosdr_source_c::get_num_channels()
344 -+{
345 -+ return output_signature()->max_streams();
346 -+}
347 -+
348 -+osmosdr::meta_range_t plutosdr_source_c::get_sample_rates( void )
349 -+{
350 -+ osmosdr::meta_range_t rates;
351 -+
352 -+ rates += osmosdr::range_t( 2500000 );
353 -+ rates += osmosdr::range_t( 5000000 );
354 -+ rates += osmosdr::range_t( 10000000 );
355 -+ rates += osmosdr::range_t( 20000000 );
356 -+
357 -+ return rates;
358 -+}
359 -+
360 -+double plutosdr_source_c::set_sample_rate( double rate )
361 -+{
362 -+ samplerate = (unsigned long) rate;
363 -+ set_params();
364 -+
365 -+ return samplerate;
366 -+}
367 -+
368 -+double plutosdr_source_c::get_sample_rate( void )
369 -+{
370 -+ return samplerate;
371 -+}
372 -+
373 -+osmosdr::freq_range_t plutosdr_source_c::get_freq_range( size_t chan )
374 -+{
375 -+ osmosdr::freq_range_t range;
376 -+
377 -+ range += osmosdr::range_t( 70.0e6, 6000.0e6, 1.0 );
378 -+
379 -+ return range;
380 -+}
381 -+
382 -+double plutosdr_source_c::set_center_freq( double freq, size_t chan )
383 -+{
384 -+ frequency = (unsigned long long) freq;
385 -+ set_params();
386 -+
387 -+ return freq;
388 -+}
389 -+
390 -+double plutosdr_source_c::get_center_freq( size_t chan )
391 -+{
392 -+ return frequency;
393 -+}
394 -+
395 -+double plutosdr_source_c::set_freq_corr( double ppm, size_t chan)
396 -+{
397 -+ _freq_corr = ppm;
398 -+ set_params();
399 -+
400 -+ return ppm;
401 -+}
402 -+
403 -+double plutosdr_source_c::get_freq_corr( size_t chan)
404 -+{
405 -+ return _freq_corr;
406 -+}
407 -+
408 -+std::vector<std::string> plutosdr_source_c::get_gain_names( size_t chan )
409 -+{
410 -+ std::vector< std::string > gains;
411 -+
412 -+ gains.push_back( "RF" );
413 -+
414 -+ return gains;
415 -+}
416 -+
417 -+osmosdr::gain_range_t plutosdr_source_c::get_gain_range( size_t chan)
418 -+{
419 -+ osmosdr::gain_range_t range;
420 -+ range += osmosdr::range_t( -10, 77, 1 ); // https://wiki.analog.com/resources/tools-software/linux-drivers/iio-transceiver/ad9361#rx_gain_control
421 -+
422 -+ return range;
423 -+}
424 -+
425 -+osmosdr::gain_range_t plutosdr_source_c::get_gain_range( const std::string & name,
426 -+ size_t chan)
427 -+{
428 -+ osmosdr::gain_range_t range;
429 -+
430 -+ range += osmosdr::range_t( -10, 77, 1 );
431 -+
432 -+ return range;
433 -+}
434 -+
435 -+bool plutosdr_source_c::set_gain_mode( bool automatic, size_t chan )
436 -+{
437 -+ gain_auto = automatic;
438 -+ set_params();
439 -+
440 -+ return automatic;
441 -+}
442 -+
443 -+bool plutosdr_source_c::get_gain_mode( size_t chan )
444 -+{
445 -+ return gain_auto;
446 -+}
447 -+
448 -+double plutosdr_source_c::set_gain( double gain, size_t chan )
449 -+{
450 -+ gain_value = gain;
451 -+ set_params();
452 -+
453 -+ return gain;
454 -+}
455 -+
456 -+double plutosdr_source_c::set_gain( double gain, const std::string & name, size_t chan )
457 -+{
458 -+ gain_value = gain;
459 -+ set_params();
460 -+
461 -+ return gain;
462 -+}
463 -+
464 -+double plutosdr_source_c::get_gain( size_t chan )
465 -+{
466 -+ return gain_value;
467 -+}
468 -+
469 -+double plutosdr_source_c::get_gain( const std::string & name, size_t chan )
470 -+{
471 -+ return gain_value;
472 -+}
473 -+
474 -+std::vector< std::string > plutosdr_source_c::get_antennas( size_t chan )
475 -+{
476 -+ std::vector< std::string > antennas;
477 -+
478 -+ antennas += get_antenna( chan );
479 -+
480 -+ return antennas;
481 -+}
482 -+
483 -+std::string plutosdr_source_c::set_antenna( const std::string & antenna, size_t chan )
484 -+{
485 -+ return get_antenna( chan );
486 -+}
487 -+
488 -+std::string plutosdr_source_c::get_antenna( size_t chan )
489 -+{
490 -+ return "A_BALANCED";
491 -+}
492 -+
493 -+double plutosdr_source_c::set_bandwidth( double bw, size_t chan )
494 -+{
495 -+ if (bw == 0.0)
496 -+ bw = 0.8 * samplerate; // auto bandwidth
497 -+
498 -+ bandwidth = (unsigned long)bw;
499 -+ set_params();
500 -+ return bandwidth;
501 -+}
502 -+
503 -+double plutosdr_source_c::get_bandwidth( size_t chan )
504 -+{
505 -+ return bandwidth;
506 -+}
507 -+
508 -+void plutosdr_source_c::set_params( void )
509 -+{
510 -+ unsigned long long freq = ((double)frequency * (1.0 + _freq_corr * 0.000001));
511 -+
512 -+ // FIXME: gain_mode string can be manual / slow_attack / fast_attack / hybrid
513 -+ _src->set_params( freq, samplerate, bandwidth, quadrature, rfdc, bbdc,
514 -+ gain_auto ? "fast_attack" : "manual", gain_value,
515 -+ filter.c_str(), filter_auto );
516 -+}
517 -diff --git a/lib/plutosdr/plutosdr_source_c.h b/lib/plutosdr/plutosdr_source_c.h
518 -new file mode 100644
519 -index 0000000..efac91f
520 ---- /dev/null
521 -+++ b/lib/plutosdr/plutosdr_source_c.h
522 -@@ -0,0 +1,105 @@
523 -+/* -*- c++ -*- */
524 -+/*
525 -+ * Copyright 2017 Dimitri Stolnikov <horiz0n@×××.net>
526 -+ *
527 -+ * GNU Radio is free software; you can redistribute it and/or modify
528 -+ * it under the terms of the GNU General Public License as published by
529 -+ * the Free Software Foundation; either version 3, or (at your option)
530 -+ * any later version.
531 -+ *
532 -+ * GNU Radio is distributed in the hope that it will be useful,
533 -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
534 -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
535 -+ * GNU General Public License for more details.
536 -+ *
537 -+ * You should have received a copy of the GNU General Public License
538 -+ * along with GNU Radio; see the file COPYING. If not, write to
539 -+ * the Free Software Foundation, Inc., 51 Franklin Street,
540 -+ * Boston, MA 02110-1301, USA.
541 -+ */
542 -+#ifndef PLUTOSDR_SOURCE_C_H
543 -+#define PLUTOSDR_SOURCE_C_H
544 -+
545 -+#include <gnuradio/blocks/float_to_complex.h>
546 -+#include <gnuradio/blocks/short_to_float.h>
547 -+#include <gnuradio/hier_block2.h>
548 -+#include <gnuradio/iio/pluto_source.h>
549 -+
550 -+#include "source_iface.h"
551 -+
552 -+class plutosdr_source_c;
553 -+
554 -+typedef boost::shared_ptr< plutosdr_source_c > plutosdr_source_c_sptr;
555 -+
556 -+plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args = "");
557 -+
558 -+class plutosdr_source_c :
559 -+ public gr::hier_block2,
560 -+ public source_iface
561 -+{
562 -+private:
563 -+ friend plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args);
564 -+
565 -+ plutosdr_source_c(const std::string &args);
566 -+
567 -+public:
568 -+ ~plutosdr_source_c();
569 -+
570 -+ static std::vector< std::string > get_devices();
571 -+
572 -+ std::string name();
573 -+
574 -+ size_t get_num_channels( void );
575 -+
576 -+ osmosdr::meta_range_t get_sample_rates( void );
577 -+ double set_sample_rate( double rate );
578 -+ double get_sample_rate( void );
579 -+
580 -+ osmosdr::freq_range_t get_freq_range( size_t chan = 0 );
581 -+ double set_center_freq( double freq, size_t chan = 0 );
582 -+ double get_center_freq( size_t chan = 0 );
583 -+
584 -+ double set_freq_corr( double ppm, size_t chan = 0 );
585 -+ double get_freq_corr( size_t chan = 0 );
586 -+
587 -+ std::vector<std::string> get_gain_names( size_t chan = 0 );
588 -+ osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
589 -+ osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
590 -+ bool set_gain_mode( bool automatic, size_t chan = 0 );
591 -+ bool get_gain_mode( size_t chan = 0 );
592 -+ double set_gain( double gain, size_t chan = 0 );
593 -+ double set_gain( double gain, const std::string & name, size_t chan = 0 );
594 -+ double get_gain( size_t chan = 0 );
595 -+ double get_gain( const std::string & name, size_t chan = 0 );
596 -+
597 -+ std::vector< std::string > get_antennas( size_t chan = 0 );
598 -+ std::string set_antenna( const std::string & antenna, size_t chan = 0 );
599 -+ std::string get_antenna( size_t chan = 0 );
600 -+
601 -+ double set_bandwidth( double bw, size_t chan = 0 );
602 -+ double get_bandwidth( size_t chan = 0 );
603 -+
604 -+private:
605 -+
606 -+ void set_params(void);
607 -+
608 -+ gr::iio::pluto_source::sptr _src;
609 -+
610 -+ std::string uri;
611 -+ unsigned long long frequency;
612 -+ unsigned long samplerate;
613 -+ unsigned long decimation;
614 -+ unsigned long bandwidth;
615 -+ unsigned long buffer_size;
616 -+ bool quadrature;
617 -+ bool rfdc;
618 -+ bool bbdc;
619 -+ bool gain_auto;
620 -+ double gain_value;
621 -+ std::string filter;
622 -+ bool filter_auto;
623 -+
624 -+ double _freq_corr;
625 -+};
626 -+
627 -+#endif // PLUTOSDR_SOURCE_C_H
628 -diff --git a/lib/source_impl.cc b/lib/source_impl.cc
629 -index a28f314..2a153bc 100644
630 ---- a/lib/source_impl.cc
631 -+++ b/lib/source_impl.cc
632 -@@ -56,6 +56,10 @@
633 - #include <uhd_source_c.h>
634 - #endif
635 -
636 -+#ifdef ENABLE_IIO
637 -+#include <plutosdr_source_c.h>
638 -+#endif
639 -+
640 - #ifdef ENABLE_MIRI
641 - #include <miri_source_c.h>
642 - #endif
643 -@@ -144,6 +148,9 @@ source_impl::source_impl( const std::string &args )
644 - #ifdef ENABLE_UHD
645 - dev_types.push_back("uhd");
646 - #endif
647 -+#ifdef ENABLE_IIO
648 -+ dev_types.push_back("plutosdr");
649 -+#endif
650 - #ifdef ENABLE_MIRI
651 - dev_types.push_back("miri");
652 - #endif
653 -@@ -216,6 +223,10 @@ source_impl::source_impl( const std::string &args )
654 - BOOST_FOREACH( std::string dev, uhd_source_c::get_devices() )
655 - dev_list.push_back( dev );
656 - #endif
657 -+#ifdef ENABLE_IIO
658 -+ BOOST_FOREACH( std::string dev, plutosdr_source_c::get_devices() )
659 -+ dev_list.push_back( dev );
660 -+#endif
661 - #ifdef ENABLE_MIRI
662 - BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
663 - dev_list.push_back( dev );
664 -@@ -316,6 +327,13 @@ source_impl::source_impl( const std::string &args )
665 - }
666 - #endif
667 -
668 -+#ifdef ENABLE_IIO
669 -+ if ( dict.count("plutosdr") ) {
670 -+ plutosdr_source_c_sptr src = make_plutosdr_source_c( arg );
671 -+ block = src; iface = src.get();
672 -+ }
673 -+#endif
674 -+
675 - #ifdef ENABLE_MIRI
676 - if ( dict.count("miri") ) {
677 - miri_source_c_sptr src = make_miri_source_c( arg );
678
679 diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.5.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-0.1.5-r1.ebuild
680 similarity index 96%
681 rename from net-wireless/gr-osmosdr/gr-osmosdr-0.1.5.ebuild
682 rename to net-wireless/gr-osmosdr/gr-osmosdr-0.1.5-r1.ebuild
683 index 69775452090..53e6a339276 100644
684 --- a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.5.ebuild
685 +++ b/net-wireless/gr-osmosdr/gr-osmosdr-0.1.5-r1.ebuild
686 @@ -23,7 +23,7 @@ IUSE="airspy bladerf fcd hackrf iqbalance mirisdr python rtlsdr sdrplay soapy uh
687
688 RDEPEND="${PYTHON_DEPS}
689 dev-libs/boost:=
690 - >=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_SINGLE_USEDEP}]
691 + =net-wireless/gnuradio-3.7*:0=[fcd?,${PYTHON_SINGLE_USEDEP}]
692 airspy? ( net-wireless/airspy )
693 bladerf? ( >=net-wireless/bladerf-2018.08_rc1:= )
694 hackrf? ( net-libs/libhackrf:= )
695
696 diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.4_p20180626-r5.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-0.2.0.ebuild
697 similarity index 65%
698 rename from net-wireless/gr-osmosdr/gr-osmosdr-0.1.4_p20180626-r5.ebuild
699 rename to net-wireless/gr-osmosdr/gr-osmosdr-0.2.0.ebuild
700 index eb6cdd6fe1d..37c367da7f2 100644
701 --- a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.4_p20180626-r5.ebuild
702 +++ b/net-wireless/gr-osmosdr/gr-osmosdr-0.2.0.ebuild
703 @@ -1,8 +1,8 @@
704 # Copyright 1999-2020 Gentoo Authors
705 # Distributed under the terms of the GNU General Public License v2
706
707 -EAPI=6
708 -PYTHON_COMPAT=( python2_7 )
709 +EAPI=7
710 +PYTHON_COMPAT=( python3_{6,7,8} )
711
712 inherit cmake-utils python-single-r1
713
714 @@ -11,51 +11,40 @@ HOMEPAGE="http://sdr.osmocom.org/trac/wiki/GrOsmoSDR"
715
716 if [[ ${PV} == 9999* ]]; then
717 inherit git-r3
718 - SRC_URI=""
719 - EGIT_REPO_URI="git://git.osmocom.org/${PN}.git"
720 + EGIT_REPO_URI="https://github.com/osmocom/gr-osmosdr.git"
721 else
722 - #SRC_URI="http://cgit.osmocom.org/gr-osmosdr/snapshot/gr-osmosdr-${PV}.tar.xz"
723 - #git clone git://git.osmocom.org/gr-osmosdr.git
724 - #cd gr-osmosdr
725 - #git archive --format=tar --prefix=gr-osmosdr-${PV}/ v${PV} | xz > ../gr-osmosdr-${PV}.tar.xz
726 - SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/gr-osmosdr-${PV}.tar.xz"
727 + SRC_URI="https://github.com/osmocom/gr-osmosdr/archive/v${PV}.tar.gz -> ${P}.tar.gz"
728 + KEYWORDS="~amd64 ~arm ~x86"
729 fi
730
731 LICENSE="GPL-3"
732 SLOT="0/${PV}"
733 -IUSE="bladerf fcd hackrf iio iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
734 +IUSE="airspy bladerf hackrf iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
735
736 RDEPEND="${PYTHON_DEPS}
737 dev-libs/boost:=
738 - >=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_SINGLE_USEDEP}]
739 + =net-wireless/gnuradio-3.8*:0=[${PYTHON_SINGLE_USEDEP}]
740 + airspy? ( net-wireless/airspy )
741 bladerf? ( >=net-wireless/bladerf-2018.08_rc1:= )
742 hackrf? ( net-libs/libhackrf:= )
743 - iio? ( net-wireless/gr-iio )
744 iqbalance? ( net-wireless/gr-iqbal:=[${PYTHON_SINGLE_USEDEP}] )
745 mirisdr? ( net-libs/libmirisdr:= )
746 rtlsdr? ( >=net-wireless/rtl-sdr-0.5.4:= )
747 sdrplay? ( net-wireless/sdrplay )
748 soapy? ( net-wireless/soapysdr:= )
749 uhd? ( net-wireless/uhd:=[${PYTHON_SINGLE_USEDEP}] )"
750 -DEPEND="${RDEPEND}
751 - dev-python/cheetah"
752 +DEPEND="${RDEPEND}"
753
754 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
755
756 -src_prepare() {
757 - eapply "${FILESDIR}/csete-iio.patch"
758 - cmake-utils_src_prepare
759 -}
760 -
761 src_configure() {
762 local mycmakeargs=(
763 -DENABLE_DEFAULT=OFF
764 -DPYTHON_EXECUTABLE="${PYTHON}"
765 -DENABLE_FILE=ON
766 + -DENABLE_AIRSPY="$(usex airspy)"
767 -DENABLE_BLADERF="$(usex bladerf)"
768 - -DENABLE_FCD="$(usex fcd)"
769 -DENABLE_HACKRF="$(usex hackrf)"
770 - -DENABLE_IIO="$(usex iio)"
771 -DENABLE_IQBALANCE="$(usex iqbalance)"
772 -DENABLE_MIRI="$(usex mirisdr)"
773 -DENABLE_PYTHON="$(usex python)"
774
775 diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild
776 index 69775452090..37c367da7f2 100644
777 --- a/net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild
778 +++ b/net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild
779 @@ -2,7 +2,7 @@
780 # Distributed under the terms of the GNU General Public License v2
781
782 EAPI=7
783 -PYTHON_COMPAT=( python2_7 )
784 +PYTHON_COMPAT=( python3_{6,7,8} )
785
786 inherit cmake-utils python-single-r1
787
788 @@ -19,11 +19,11 @@ fi
789
790 LICENSE="GPL-3"
791 SLOT="0/${PV}"
792 -IUSE="airspy bladerf fcd hackrf iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
793 +IUSE="airspy bladerf hackrf iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
794
795 RDEPEND="${PYTHON_DEPS}
796 dev-libs/boost:=
797 - >=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_SINGLE_USEDEP}]
798 + =net-wireless/gnuradio-3.8*:0=[${PYTHON_SINGLE_USEDEP}]
799 airspy? ( net-wireless/airspy )
800 bladerf? ( >=net-wireless/bladerf-2018.08_rc1:= )
801 hackrf? ( net-libs/libhackrf:= )
802 @@ -33,8 +33,7 @@ RDEPEND="${PYTHON_DEPS}
803 sdrplay? ( net-wireless/sdrplay )
804 soapy? ( net-wireless/soapysdr:= )
805 uhd? ( net-wireless/uhd:=[${PYTHON_SINGLE_USEDEP}] )"
806 -DEPEND="${RDEPEND}
807 - dev-python/cheetah"
808 +DEPEND="${RDEPEND}"
809
810 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
811
812 @@ -45,7 +44,6 @@ src_configure() {
813 -DENABLE_FILE=ON
814 -DENABLE_AIRSPY="$(usex airspy)"
815 -DENABLE_BLADERF="$(usex bladerf)"
816 - -DENABLE_FCD="$(usex fcd)"
817 -DENABLE_HACKRF="$(usex hackrf)"
818 -DENABLE_IQBALANCE="$(usex iqbalance)"
819 -DENABLE_MIRI="$(usex mirisdr)"
820
821 diff --git a/net-wireless/gr-osmosdr/metadata.xml b/net-wireless/gr-osmosdr/metadata.xml
822 index daafe681c99..68a1bf0f0a5 100644
823 --- a/net-wireless/gr-osmosdr/metadata.xml
824 +++ b/net-wireless/gr-osmosdr/metadata.xml
825 @@ -10,7 +10,6 @@
826 <flag name="bladerf">Build with Nuand BladeRF support</flag>
827 <flag name="fcd">Build with Funcube Dongle support</flag>
828 <flag name="hackrf">Build with Great Scott Gadgets HackRF support</flag>
829 - <flag name="iio">Build with Industrial IO support for devices such as Analog Devices Pluto</flag>
830 <flag name="iqbalance">Enable support for I/Q balancing using gr-iqbal</flag>
831 <flag name="mirisdr">Build with Mirics MSi2500 + MSi001 SDR support</flag>
832 <flag name="rtlsdr">Build with Realtek RTL2832U (rtlsdr) support</flag>