public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-wireless/gr-osmosdr/, net-wireless/gr-osmosdr/files/
@ 2018-09-05  2:38 Richard Farina
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Farina @ 2018-09-05  2:38 UTC (permalink / raw
  To: gentoo-commits

commit:     51b987a494bc696c6c2390f39c530ea61f6f0fcf
Author:     Zero_Chaos <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  5 02:38:33 2018 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Wed Sep  5 02:38:44 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51b987a4

net-wireless/gr-osmosdr: adding pluto support

with no keywords for right now, just to see what happens with
https://github.com/csete/gr-osmosdr-gqrx/issues/10

Package-Manager: Portage-2.3.48, Repoman-2.3.10

 net-wireless/gr-osmosdr/files/csete-iio.patch      | 640 +++++++++++++++++++++
 .../gr-osmosdr-0.1.4_p20180626-r1.ebuild           |  80 +++
 net-wireless/gr-osmosdr/metadata.xml               |   1 +
 3 files changed, 721 insertions(+)

diff --git a/net-wireless/gr-osmosdr/files/csete-iio.patch b/net-wireless/gr-osmosdr/files/csete-iio.patch
new file mode 100644
index 00000000000..678a8599d05
--- /dev/null
+++ b/net-wireless/gr-osmosdr/files/csete-iio.patch
@@ -0,0 +1,640 @@
+From 0eaf819be8a40896dfc3d810685a609a867a42e9 Mon Sep 17 00:00:00 2001
+From: Alexandru Csete <oz9aec@gmail.com>
+Date: Mon, 13 Feb 2017 01:05:50 +0100
+Subject: [PATCH] Add PlutoSDR source through gr-iio
+
+---
+ CMakeLists.txt                      |   1 +
+ cmake/Modules/FindGnuradioIIO.cmake |  34 ++++
+ cmake/Modules/FindIIO.cmake         |  28 +++
+ lib/CMakeLists.txt                  |   8 +
+ lib/config.h.in                     |   1 +
+ lib/device.cc                       |   8 +
+ lib/plutosdr/CMakeLists.txt         |  39 +++++
+ lib/plutosdr/plutosdr_source_c.cc   | 262 ++++++++++++++++++++++++++++
+ lib/plutosdr/plutosdr_source_c.h    | 105 +++++++++++
+ lib/source_impl.cc                  |  18 ++
+ 10 files changed, 504 insertions(+)
+ create mode 100644 cmake/Modules/FindGnuradioIIO.cmake
+ create mode 100644 cmake/Modules/FindIIO.cmake
+ create mode 100644 lib/plutosdr/CMakeLists.txt
+ create mode 100644 lib/plutosdr/plutosdr_source_c.cc
+ create mode 100644 lib/plutosdr/plutosdr_source_c.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 296456d..7871f39 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -159,6 +159,7 @@ endif()
+ find_package(GnuradioIQBalance)
+ find_package(UHD)
+ find_package(GnuradioUHD)
++find_package(GnuradioIIO)
+ find_package(GnuradioFCD)
+ find_package(GnuradioFCDPP)
+ find_package(LibOsmoSDR)
+diff --git a/cmake/Modules/FindGnuradioIIO.cmake b/cmake/Modules/FindGnuradioIIO.cmake
+new file mode 100644
+index 0000000..d3c011a
+--- /dev/null
++++ b/cmake/Modules/FindGnuradioIIO.cmake
+@@ -0,0 +1,34 @@
++INCLUDE(FindPkgConfig)
++PKG_CHECK_MODULES(PC_GNURADIO_IIO gnuradio-iio)
++
++FIND_PATH(
++    GNURADIO_IIO_INCLUDE_DIRS
++    NAMES gnuradio/iio/api.h
++    HINTS $ENV{GNURADIO_IIO_DIR}/include
++        ${PC_GNURADIO_IIO_INCLUDEDIR}
++    PATHS /usr/local/include
++          /usr/include
++)
++
++FIND_LIBRARY(
++    GNURADIO_IIO_LIBRARIES
++    NAMES gnuradio-iio
++    HINTS $ENV{GNURADIO_IIO_DIR}/lib
++        ${PC_GNURADIO_IIO_LIBDIR}
++    PATHS /usr/local/lib
++          /usr/local/lib64
++          /usr/lib
++          /usr/lib64
++)
++
++if(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
++  set(GNURADIO_IIO_FOUND TRUE CACHE INTERNAL "gnuradio-iio found")
++  message(STATUS "Found gnuradio-iio: ${GNURADIO_IIO_INCLUDE_DIRS}, ${GNURADIO_IIO_LIBRARIES}")
++else(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
++  set(GNURADIO_IIO_FOUND FALSE CACHE INTERNAL "gnuradio-iio found")
++  message(STATUS "gnuradio-iio not found.")
++endif(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
++
++INCLUDE(FindPackageHandleStandardArgs)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_IIO DEFAULT_MSG GNURADIO_IIO_LIBRARIES GNURADIO_IIO_INCLUDE_DIRS)
++MARK_AS_ADVANCED(GNURADIO_IIO_LIBRARIES GNURADIO_IIO_INCLUDE_DIRS)
+diff --git a/cmake/Modules/FindIIO.cmake b/cmake/Modules/FindIIO.cmake
+new file mode 100644
+index 0000000..bb87a4b
+--- /dev/null
++++ b/cmake/Modules/FindIIO.cmake
+@@ -0,0 +1,28 @@
++########################################################################
++# Find the IIO userspace library
++########################################################################
++
++INCLUDE(FindPkgConfig)
++PKG_CHECK_MODULES(PC_IIO iio)
++
++FIND_PATH(
++    IIO_INCLUDE_DIRS
++    NAMES iio.h
++    HINTS $ENV{IIO_DIR}/include
++        ${PC_IIO_INCLUDEDIR}
++    PATHS /usr/local/include
++          /usr/include
++)
++
++FIND_LIBRARY(
++    IIO_LIBRARIES
++    NAMES iio
++    HINTS $ENV{IIO_DIR}/lib
++        ${PC_IIO_LIBDIR}
++    PATHS /usr/local/lib
++          /usr/lib
++)
++
++INCLUDE(FindPackageHandleStandardArgs)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(IIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS)
++MARK_AS_ADVANCED(IIO_LIBRARIES IIO_INCLUDE_DIRS)
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index c05b8d9..936d84b 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -174,6 +174,14 @@ if(ENABLE_UHD)
+ GR_INCLUDE_SUBDIRECTORY(uhd)
+ endif(ENABLE_UHD)
+ 
++########################################################################
++# Setup IIO component
++########################################################################
++GR_REGISTER_COMPONENT("IIO Devices" ENABLE_IIO GNURADIO_IIO_FOUND)
++if(ENABLE_IIO)
++GR_INCLUDE_SUBDIRECTORY(plutosdr)
++endif(ENABLE_IIO)
++
+ ########################################################################
+ # Setup MiriSDR component
+ ########################################################################
+diff --git a/lib/config.h.in b/lib/config.h.in
+index 42e72f1..0fe2731 100644
+--- a/lib/config.h.in
++++ b/lib/config.h.in
+@@ -10,6 +10,7 @@
+ #cmakedefine ENABLE_RTL
+ #cmakedefine ENABLE_RTL_TCP
+ #cmakedefine ENABLE_UHD
++#cmakedefine ENABLE_IIO
+ #cmakedefine ENABLE_MIRI
+ #cmakedefine ENABLE_SDRPLAY
+ #cmakedefine ENABLE_HACKRF
+diff --git a/lib/device.cc b/lib/device.cc
+index 025a22b..77b271f 100644
+--- a/lib/device.cc
++++ b/lib/device.cc
+@@ -54,6 +54,10 @@
+ #include <uhd_source_c.h>
+ #endif
+ 
++#ifdef ENABLE_IIO
++#include <plutosdr_source_c.h>
++#endif
++
+ #ifdef ENABLE_MIRI
+ #include <miri_source_c.h>
+ #endif
+@@ -162,6 +166,10 @@ devices_t device::find(const device_t &hint)
+   BOOST_FOREACH( std::string dev, uhd_source_c::get_devices() )
+     devices.push_back( device_t(dev) );
+ #endif
++#ifdef ENABLE_IIO
++  BOOST_FOREACH( std::string dev, plutosdr_source_c::get_devices() )
++    devices.push_back( device_t(dev) );
++#endif
+ #ifdef ENABLE_MIRI
+   BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
+     devices.push_back( device_t(dev) );
+diff --git a/lib/plutosdr/CMakeLists.txt b/lib/plutosdr/CMakeLists.txt
+new file mode 100644
+index 0000000..b335885
+--- /dev/null
++++ b/lib/plutosdr/CMakeLists.txt
+@@ -0,0 +1,39 @@
++# Copyright 2012 Free Software Foundation, Inc.
++#
++# This file is part of GNU Radio
++#
++# GNU Radio is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3, or (at your option)
++# any later version.
++#
++# GNU Radio is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with GNU Radio; see the file COPYING.  If not, write to
++# the Free Software Foundation, Inc., 51 Franklin Street,
++# Boston, MA 02110-1301, USA.
++
++########################################################################
++# This file included, use CMake directory variables
++########################################################################
++
++include_directories(
++    ${CMAKE_CURRENT_SOURCE_DIR}
++    ${GNURADIO_IIO_INCLUDE_DIRS}
++    ${IIO_INCLUDE_DIRS}
++)
++
++set(iio_srcs
++#    ${CMAKE_CURRENT_SOURCE_DIR}/iio_sink_c.cc
++    ${CMAKE_CURRENT_SOURCE_DIR}/plutosdr_source_c.cc
++)
++
++########################################################################
++# Append gnuradio-osmosdr library sources
++########################################################################
++list(APPEND gr_osmosdr_srcs ${iio_srcs})
++list(APPEND gr_osmosdr_libs ${GNURADIO_IIO_LIBRARIES} ${IIO_LIBRARIES})
+diff --git a/lib/plutosdr/plutosdr_source_c.cc b/lib/plutosdr/plutosdr_source_c.cc
+new file mode 100644
+index 0000000..009d4b2
+--- /dev/null
++++ b/lib/plutosdr/plutosdr_source_c.cc
+@@ -0,0 +1,262 @@
++/* -*- c++ -*- */
++/*
++ * Copyright 2017 Dimitri Stolnikov <horiz0n@gmx.net>
++ *
++ * GNU Radio is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 3, or (at your option)
++ * any later version.
++ *
++ * GNU Radio is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with GNU Radio; see the file COPYING.  If not, write to
++ * the Free Software Foundation, Inc., 51 Franklin Street,
++ * Boston, MA 02110-1301, USA.
++ */
++#include <boost/assign.hpp>
++#include <iostream>
++
++#include "arg_helpers.h"
++#include "osmosdr/source.h"
++#include "plutosdr_source_c.h"
++
++using namespace boost::assign;
++
++plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args)
++{
++  return gnuradio::get_initial_sptr(new plutosdr_source_c(args));
++}
++
++plutosdr_source_c::plutosdr_source_c(const std::string &args) :
++    gr::hier_block2("plutosdr_source_c",
++                   gr::io_signature::make(0, 0, 0),
++                   gr::io_signature::make(1, 1, sizeof(gr_complex)))
++{
++  uri = "ip:pluto.local";
++  frequency = 434000000;
++  samplerate = 2500000;
++  decimation = 0;
++  bandwidth = 2000000;
++  buffer_size = 0x4000;
++  quadrature = true;
++  rfdc = true;
++  bbdc = true;
++  gain_auto = false;
++  gain_value = 50;
++  filter = "";
++  filter_auto = true;
++  _freq_corr = 0.0;
++
++  dict_t dict = params_to_dict(args);
++  if (dict.count("uri"))
++    uri = boost::lexical_cast< std::string >( dict["uri"] );
++
++  std::cerr << "Using PlutoSDR URI = " << uri << std::endl;
++
++  _src = gr::iio::pluto_source::make(uri, frequency, samplerate,
++                                     bandwidth, buffer_size,
++                                     quadrature, rfdc, bbdc,
++                                     "manual", gain_value,
++                                     filter.c_str(), filter_auto);
++
++  connect( _src, 0, self(), 0 );
++}
++
++plutosdr_source_c::~plutosdr_source_c()
++{
++}
++
++std::vector< std::string > plutosdr_source_c::get_devices()
++{
++  std::vector< std::string > devices;
++
++  std::string args = "plutosdr,label='PlutoSDR'";
++
++  devices.push_back( args );
++
++  return devices;
++}
++
++std::string plutosdr_source_c::name()
++{
++  return "PlutoSDR";
++}
++
++size_t plutosdr_source_c::get_num_channels()
++{
++  return output_signature()->max_streams();
++}
++
++osmosdr::meta_range_t plutosdr_source_c::get_sample_rates( void )
++{
++  osmosdr::meta_range_t rates;
++
++  rates += osmosdr::range_t( 2500000 );
++  rates += osmosdr::range_t( 5000000 );
++  rates += osmosdr::range_t( 10000000 );
++  rates += osmosdr::range_t( 20000000 );
++
++  return rates;
++}
++
++double plutosdr_source_c::set_sample_rate( double rate )
++{
++  samplerate = (unsigned long) rate;
++  set_params();
++
++  return samplerate;
++}
++
++double plutosdr_source_c::get_sample_rate( void )
++{
++  return samplerate;
++}
++
++osmosdr::freq_range_t plutosdr_source_c::get_freq_range( size_t chan )
++{
++  osmosdr::freq_range_t range;
++
++  range += osmosdr::range_t( 70.0e6, 6000.0e6, 1.0 );
++
++  return range;
++}
++
++double plutosdr_source_c::set_center_freq( double freq, size_t chan )
++{
++  frequency = (unsigned long long) freq;
++  set_params();
++
++  return freq;
++}
++
++double plutosdr_source_c::get_center_freq( size_t chan )
++{
++  return frequency;
++}
++
++double plutosdr_source_c::set_freq_corr( double ppm, size_t chan)
++{
++  _freq_corr = ppm;
++  set_params();
++
++  return ppm;
++}
++
++double plutosdr_source_c::get_freq_corr( size_t chan)
++{
++  return _freq_corr;
++}
++
++std::vector<std::string> plutosdr_source_c::get_gain_names( size_t chan )
++{
++  std::vector< std::string > gains;
++
++  gains.push_back( "RF" );
++
++  return gains;
++}
++
++osmosdr::gain_range_t plutosdr_source_c::get_gain_range( size_t chan)
++{
++  osmosdr::gain_range_t range;
++  range += osmosdr::range_t( -10, 77, 1 );   // https://wiki.analog.com/resources/tools-software/linux-drivers/iio-transceiver/ad9361#rx_gain_control
++
++  return range;
++}
++
++osmosdr::gain_range_t plutosdr_source_c::get_gain_range( const std::string & name,
++                                                         size_t chan)
++{
++  osmosdr::gain_range_t range;
++
++  range += osmosdr::range_t( -10, 77, 1 );
++
++  return range;
++}
++
++bool plutosdr_source_c::set_gain_mode( bool automatic, size_t chan )
++{
++  gain_auto = automatic;
++  set_params();
++
++  return automatic;
++}
++
++bool plutosdr_source_c::get_gain_mode( size_t chan )
++{
++  return gain_auto;
++}
++
++double plutosdr_source_c::set_gain( double gain, size_t chan )
++{
++  gain_value = gain;
++  set_params();
++
++  return gain;
++}
++
++double plutosdr_source_c::set_gain( double gain, const std::string & name, size_t chan )
++{
++  gain_value = gain;
++  set_params();
++
++  return gain;
++}
++
++double plutosdr_source_c::get_gain( size_t chan )
++{
++  return gain_value;
++}
++
++double plutosdr_source_c::get_gain( const std::string & name, size_t chan )
++{
++  return gain_value;
++}
++
++std::vector< std::string > plutosdr_source_c::get_antennas( size_t chan )
++{
++  std::vector< std::string > antennas;
++
++  antennas += get_antenna( chan );
++
++  return antennas;
++}
++
++std::string plutosdr_source_c::set_antenna( const std::string & antenna, size_t chan )
++{
++  return get_antenna( chan );
++}
++
++std::string plutosdr_source_c::get_antenna( size_t chan )
++{
++  return "A_BALANCED";
++}
++
++double plutosdr_source_c::set_bandwidth( double bw, size_t chan )
++{
++  if (bw == 0.0)
++    bw = 0.8 * samplerate;  // auto bandwidth
++
++  bandwidth = (unsigned long)bw;
++  set_params();
++  return bandwidth;
++}
++
++double plutosdr_source_c::get_bandwidth( size_t chan )
++{
++  return bandwidth;
++}
++
++void plutosdr_source_c::set_params( void )
++{
++  unsigned long long freq = ((double)frequency * (1.0 + _freq_corr * 0.000001));
++
++  // FIXME: gain_mode string can be manual / slow_attack / fast_attack / hybrid
++  _src->set_params( freq, samplerate, bandwidth, quadrature, rfdc, bbdc,
++                    gain_auto ? "fast_attack" : "manual", gain_value,
++                    filter.c_str(), filter_auto );
++}
+diff --git a/lib/plutosdr/plutosdr_source_c.h b/lib/plutosdr/plutosdr_source_c.h
+new file mode 100644
+index 0000000..efac91f
+--- /dev/null
++++ b/lib/plutosdr/plutosdr_source_c.h
+@@ -0,0 +1,105 @@
++/* -*- c++ -*- */
++/*
++ * Copyright 2017 Dimitri Stolnikov <horiz0n@gmx.net>
++ *
++ * GNU Radio is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 3, or (at your option)
++ * any later version.
++ *
++ * GNU Radio is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with GNU Radio; see the file COPYING.  If not, write to
++ * the Free Software Foundation, Inc., 51 Franklin Street,
++ * Boston, MA 02110-1301, USA.
++ */
++#ifndef PLUTOSDR_SOURCE_C_H
++#define PLUTOSDR_SOURCE_C_H
++
++#include <gnuradio/blocks/float_to_complex.h>
++#include <gnuradio/blocks/short_to_float.h>
++#include <gnuradio/hier_block2.h>
++#include <gnuradio/iio/pluto_source.h>
++
++#include "source_iface.h"
++
++class plutosdr_source_c;
++
++typedef boost::shared_ptr< plutosdr_source_c > plutosdr_source_c_sptr;
++
++plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args = "");
++
++class plutosdr_source_c :
++    public gr::hier_block2,
++    public source_iface
++{
++private:
++  friend plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args);
++
++  plutosdr_source_c(const std::string &args);
++
++public:
++  ~plutosdr_source_c();
++
++  static std::vector< std::string > get_devices();
++
++  std::string name();
++
++  size_t get_num_channels( void );
++
++  osmosdr::meta_range_t get_sample_rates( void );
++  double set_sample_rate( double rate );
++  double get_sample_rate( void );
++
++  osmosdr::freq_range_t get_freq_range( size_t chan = 0 );
++  double set_center_freq( double freq, size_t chan = 0 );
++  double get_center_freq( size_t chan = 0 );
++
++  double set_freq_corr( double ppm, size_t chan = 0 );
++  double get_freq_corr( size_t chan = 0 );
++
++  std::vector<std::string> get_gain_names( size_t chan = 0 );
++  osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
++  osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
++  bool set_gain_mode( bool automatic, size_t chan = 0 );
++  bool get_gain_mode( size_t chan = 0 );
++  double set_gain( double gain, size_t chan = 0 );
++  double set_gain( double gain, const std::string & name, size_t chan = 0 );
++  double get_gain( size_t chan = 0 );
++  double get_gain( const std::string & name, size_t chan = 0 );
++
++  std::vector< std::string > get_antennas( size_t chan = 0 );
++  std::string set_antenna( const std::string & antenna, size_t chan = 0 );
++  std::string get_antenna( size_t chan = 0 );
++
++  double set_bandwidth( double bw, size_t chan = 0 );
++  double get_bandwidth( size_t chan = 0 );
++
++private:
++
++  void set_params(void);
++
++  gr::iio::pluto_source::sptr       _src;
++
++  std::string   uri;
++  unsigned long long frequency;
++  unsigned long samplerate;
++  unsigned long decimation;
++  unsigned long bandwidth;
++  unsigned long buffer_size;
++  bool quadrature;
++  bool rfdc;
++  bool bbdc;
++  bool          gain_auto;
++  double        gain_value;
++  std::string   filter;
++  bool          filter_auto;
++
++  double _freq_corr;
++};
++
++#endif // PLUTOSDR_SOURCE_C_H
+diff --git a/lib/source_impl.cc b/lib/source_impl.cc
+index a28f314..2a153bc 100644
+--- a/lib/source_impl.cc
++++ b/lib/source_impl.cc
+@@ -56,6 +56,10 @@
+ #include <uhd_source_c.h>
+ #endif
+ 
++#ifdef ENABLE_IIO
++#include <plutosdr_source_c.h>
++#endif
++
+ #ifdef ENABLE_MIRI
+ #include <miri_source_c.h>
+ #endif
+@@ -144,6 +148,9 @@ source_impl::source_impl( const std::string &args )
+ #ifdef ENABLE_UHD
+   dev_types.push_back("uhd");
+ #endif
++#ifdef ENABLE_IIO
++  dev_types.push_back("plutosdr");
++#endif
+ #ifdef ENABLE_MIRI
+   dev_types.push_back("miri");
+ #endif
+@@ -216,6 +223,10 @@ source_impl::source_impl( const std::string &args )
+     BOOST_FOREACH( std::string dev, uhd_source_c::get_devices() )
+       dev_list.push_back( dev );
+ #endif
++#ifdef ENABLE_IIO
++    BOOST_FOREACH( std::string dev, plutosdr_source_c::get_devices() )
++      dev_list.push_back( dev );
++#endif
+ #ifdef ENABLE_MIRI
+     BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
+       dev_list.push_back( dev );
+@@ -316,6 +327,13 @@ source_impl::source_impl( const std::string &args )
+     }
+ #endif
+ 
++#ifdef ENABLE_IIO
++    if ( dict.count("plutosdr") ) {
++      plutosdr_source_c_sptr src = make_plutosdr_source_c( arg );
++      block = src; iface = src.get();
++    }
++#endif
++
+ #ifdef ENABLE_MIRI
+     if ( dict.count("miri") ) {
+       miri_source_c_sptr src = make_miri_source_c( arg );

diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.4_p20180626-r1.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-0.1.4_p20180626-r1.ebuild
new file mode 100644
index 00000000000..3c468c6f97e
--- /dev/null
+++ b/net-wireless/gr-osmosdr/gr-osmosdr-0.1.4_p20180626-r1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils python-single-r1
+
+DESCRIPTION="GNU Radio source block for OsmoSDR and rtlsdr and hackrf"
+HOMEPAGE="http://sdr.osmocom.org/trac/wiki/GrOsmoSDR"
+
+if [[ ${PV} == 9999* ]]; then
+	inherit git-r3
+	SRC_URI=""
+	EGIT_REPO_URI="git://git.osmocom.org/${PN}.git"
+	KEYWORDS=""
+else
+	#SRC_URI="http://cgit.osmocom.org/gr-osmosdr/snapshot/gr-osmosdr-${PV}.tar.xz"
+	#git clone git://git.osmocom.org/gr-osmosdr.git
+	#cd gr-osmosdr
+	#git archive --format=tar --prefix=gr-osmosdr-${PV}/ v${PV} | xz > ../gr-osmosdr-${PV}.tar.xz
+	SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/gr-osmosdr-${PV}.tar.xz"
+	KEYWORDS=""
+fi
+
+LICENSE="GPL-3"
+SLOT="0/${PV}"
+IUSE="bladerf fcd hackrf iio iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
+
+RDEPEND="${PYTHON_DEPS}
+	dev-libs/boost:=
+	>=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_USEDEP}]
+	bladerf? ( >=net-wireless/bladerf-2018.08_rc1:= )
+	hackrf? ( net-libs/libhackrf:= )
+	iio? ( net-wireless/gr-iio )
+	iqbalance? ( net-wireless/gr-iqbal:=[${PYTHON_USEDEP}] )
+	mirisdr? ( net-libs/libmirisdr:= )
+	rtlsdr? ( >=net-wireless/rtl-sdr-0.5.3:= )
+	sdrplay? ( net-wireless/sdrplay )
+	soapy? ( net-wireless/soapysdr )
+	uhd? ( net-wireless/uhd:=[${PYTHON_USEDEP}] )"
+DEPEND="${RDEPEND}
+	dev-python/cheetah"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_prepare() {
+	eapply "${FILESDIR}/csete-iio.patch"
+	cmake-utils_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DENABLE_DEFAULT=OFF
+		-DPYTHON_EXECUTABLE="${PYTHON}"
+		-DENABLE_FILE=ON
+		-DENABLE_BLADERF="$(usex bladerf)"
+		-DENABLE_FCD="$(usex fcd)"
+		-DENABLE_HACKRF="$(usex hackrf)"
+		-DENABLE_IIO="$(usex iio)"
+		-DENABLE_IQBALANCE="$(usex iqbalance)"
+		-DENABLE_MIRI="$(usex mirisdr)"
+		-DENABLE_PYTHON="$(usex python)"
+		-DENABLE_RTL="$(usex rtlsdr)"
+		-DENABLE_RTL_TCP="$(usex rtlsdr)"
+		-DENABLE_SOAPY="$(usex soapy)"
+		-DENABLE_UHD="$(usex uhd)"
+		-DENABLE_SDRPLAY="$(usex sdrplay)"
+		-DENABLE_NONFREE="$(usex sdrplay)"
+	)
+
+	cmake-utils_src_configure
+}
+
+src_install() {
+	cmake-utils_src_install
+	if use python; then
+		python_fix_shebang "${ED}"/usr/bin
+	fi
+}

diff --git a/net-wireless/gr-osmosdr/metadata.xml b/net-wireless/gr-osmosdr/metadata.xml
index 2ffcfa21c90..b55e17a0636 100644
--- a/net-wireless/gr-osmosdr/metadata.xml
+++ b/net-wireless/gr-osmosdr/metadata.xml
@@ -9,6 +9,7 @@
 	<flag name="bladerf">Build with Nuand BladeRF support</flag>
 	<flag name="fcd">Build with Funcube Dongle support</flag>
 	<flag name="hackrf">Build with Great Scott Gadgets HackRF support</flag>
+	<flag name="iio">Build with Industrial IO support for devices such as Analog Devices Pluto</flag>
 	<flag name="iqbalance">Enable support for I/Q balancing using gr-iqbal</flag>
 	<flag name="mirisdr">Build with Mirics MSi2500 + MSi001 SDR support</flag>
 	<flag name="rtlsdr">Build with Realtek RTL2832U (rtlsdr) support</flag>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/gr-osmosdr/, net-wireless/gr-osmosdr/files/
@ 2020-06-01 20:45 Rick Farina
  0 siblings, 0 replies; 4+ messages in thread
From: Rick Farina @ 2020-06-01 20:45 UTC (permalink / raw
  To: gentoo-commits

commit:     95d69b572c7e58574d352f7bec3b2f56af485a48
Author:     Rick Farina <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Sat May 30 02:51:56 2020 +0000
Commit:     Rick Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Mon Jun  1 20:43:08 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95d69b57

net-wireless/gr-osmosdr: bump

prep for gr3.8

Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Rick Farina <zerochaos <AT> gentoo.org>

 net-wireless/gr-osmosdr/Manifest                   |   2 +-
 net-wireless/gr-osmosdr/files/csete-iio.patch      | 640 ---------------------
 ...sdr-0.1.5.ebuild => gr-osmosdr-0.1.5-r1.ebuild} |   2 +-
 ...p20180626-r5.ebuild => gr-osmosdr-0.2.0.ebuild} |  31 +-
 net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild     |  10 +-
 net-wireless/gr-osmosdr/metadata.xml               |   1 -
 6 files changed, 16 insertions(+), 670 deletions(-)

diff --git a/net-wireless/gr-osmosdr/Manifest b/net-wireless/gr-osmosdr/Manifest
index f79d0e5e0b5..5a85526c102 100644
--- a/net-wireless/gr-osmosdr/Manifest
+++ b/net-wireless/gr-osmosdr/Manifest
@@ -1,2 +1,2 @@
-DIST gr-osmosdr-0.1.4_p20180626.tar.xz 179568 BLAKE2B 223d23bd17edd5f4ee78237e509c79e5e7e49bbfb516009c3b5a715f386fcd138beea48e417d4576a7749cdb440736b6d92c8766b614bf617ef6b2bb4a293fda SHA512 8540da1f4d6936e0a97fa2f3e24af1866d44620fd7e7bc65b323364f67f1527fe8e0efd7bf0349be5e3d61f2ed24fa736c924ea0038e44fa3ab72848fe254a28
 DIST gr-osmosdr-0.1.5.tar.gz 278257 BLAKE2B f63704bd8d7e1fc86cfab256e8813716ac56a4b962f37d9e027df6234ee8e6d78a9d8459408d31ace4a3d6f46edfca0cc1eb9c1004b7052332ead1528cc5ec4b SHA512 5c028dcacf3cb94696eecdd31f4f09b31158c8ce12646d577535ba20942103899e5e21f001f2dd7d0a56eb58f17c2aa849139b495c61e21b60dd6678444b0983
+DIST gr-osmosdr-0.2.0.tar.gz 251163 BLAKE2B 036a4439c5c27ae3143ef3be6e76f94bf3e0524509ffc58ad19379fa0adc9477bd704b7e88fffd46ed9e5528ae539d875b4e496a77ea392e8eef117fc57a3af1 SHA512 96eb8ff0a05cf0d5b49384cdc80e0a3d924ba452485acbe852266fd73a5335668b40454421d9f5a52ea610f7100557e51d6a5d9cf6931fe68e8757eb5f02d126

diff --git a/net-wireless/gr-osmosdr/files/csete-iio.patch b/net-wireless/gr-osmosdr/files/csete-iio.patch
deleted file mode 100644
index 678a8599d05..00000000000
--- a/net-wireless/gr-osmosdr/files/csete-iio.patch
+++ /dev/null
@@ -1,640 +0,0 @@
-From 0eaf819be8a40896dfc3d810685a609a867a42e9 Mon Sep 17 00:00:00 2001
-From: Alexandru Csete <oz9aec@gmail.com>
-Date: Mon, 13 Feb 2017 01:05:50 +0100
-Subject: [PATCH] Add PlutoSDR source through gr-iio
-
----
- CMakeLists.txt                      |   1 +
- cmake/Modules/FindGnuradioIIO.cmake |  34 ++++
- cmake/Modules/FindIIO.cmake         |  28 +++
- lib/CMakeLists.txt                  |   8 +
- lib/config.h.in                     |   1 +
- lib/device.cc                       |   8 +
- lib/plutosdr/CMakeLists.txt         |  39 +++++
- lib/plutosdr/plutosdr_source_c.cc   | 262 ++++++++++++++++++++++++++++
- lib/plutosdr/plutosdr_source_c.h    | 105 +++++++++++
- lib/source_impl.cc                  |  18 ++
- 10 files changed, 504 insertions(+)
- create mode 100644 cmake/Modules/FindGnuradioIIO.cmake
- create mode 100644 cmake/Modules/FindIIO.cmake
- create mode 100644 lib/plutosdr/CMakeLists.txt
- create mode 100644 lib/plutosdr/plutosdr_source_c.cc
- create mode 100644 lib/plutosdr/plutosdr_source_c.h
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 296456d..7871f39 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -159,6 +159,7 @@ endif()
- find_package(GnuradioIQBalance)
- find_package(UHD)
- find_package(GnuradioUHD)
-+find_package(GnuradioIIO)
- find_package(GnuradioFCD)
- find_package(GnuradioFCDPP)
- find_package(LibOsmoSDR)
-diff --git a/cmake/Modules/FindGnuradioIIO.cmake b/cmake/Modules/FindGnuradioIIO.cmake
-new file mode 100644
-index 0000000..d3c011a
---- /dev/null
-+++ b/cmake/Modules/FindGnuradioIIO.cmake
-@@ -0,0 +1,34 @@
-+INCLUDE(FindPkgConfig)
-+PKG_CHECK_MODULES(PC_GNURADIO_IIO gnuradio-iio)
-+
-+FIND_PATH(
-+    GNURADIO_IIO_INCLUDE_DIRS
-+    NAMES gnuradio/iio/api.h
-+    HINTS $ENV{GNURADIO_IIO_DIR}/include
-+        ${PC_GNURADIO_IIO_INCLUDEDIR}
-+    PATHS /usr/local/include
-+          /usr/include
-+)
-+
-+FIND_LIBRARY(
-+    GNURADIO_IIO_LIBRARIES
-+    NAMES gnuradio-iio
-+    HINTS $ENV{GNURADIO_IIO_DIR}/lib
-+        ${PC_GNURADIO_IIO_LIBDIR}
-+    PATHS /usr/local/lib
-+          /usr/local/lib64
-+          /usr/lib
-+          /usr/lib64
-+)
-+
-+if(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
-+  set(GNURADIO_IIO_FOUND TRUE CACHE INTERNAL "gnuradio-iio found")
-+  message(STATUS "Found gnuradio-iio: ${GNURADIO_IIO_INCLUDE_DIRS}, ${GNURADIO_IIO_LIBRARIES}")
-+else(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
-+  set(GNURADIO_IIO_FOUND FALSE CACHE INTERNAL "gnuradio-iio found")
-+  message(STATUS "gnuradio-iio not found.")
-+endif(GNURADIO_IIO_INCLUDE_DIRS AND GNURADIO_IIO_LIBRARIES)
-+
-+INCLUDE(FindPackageHandleStandardArgs)
-+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_IIO DEFAULT_MSG GNURADIO_IIO_LIBRARIES GNURADIO_IIO_INCLUDE_DIRS)
-+MARK_AS_ADVANCED(GNURADIO_IIO_LIBRARIES GNURADIO_IIO_INCLUDE_DIRS)
-diff --git a/cmake/Modules/FindIIO.cmake b/cmake/Modules/FindIIO.cmake
-new file mode 100644
-index 0000000..bb87a4b
---- /dev/null
-+++ b/cmake/Modules/FindIIO.cmake
-@@ -0,0 +1,28 @@
-+########################################################################
-+# Find the IIO userspace library
-+########################################################################
-+
-+INCLUDE(FindPkgConfig)
-+PKG_CHECK_MODULES(PC_IIO iio)
-+
-+FIND_PATH(
-+    IIO_INCLUDE_DIRS
-+    NAMES iio.h
-+    HINTS $ENV{IIO_DIR}/include
-+        ${PC_IIO_INCLUDEDIR}
-+    PATHS /usr/local/include
-+          /usr/include
-+)
-+
-+FIND_LIBRARY(
-+    IIO_LIBRARIES
-+    NAMES iio
-+    HINTS $ENV{IIO_DIR}/lib
-+        ${PC_IIO_LIBDIR}
-+    PATHS /usr/local/lib
-+          /usr/lib
-+)
-+
-+INCLUDE(FindPackageHandleStandardArgs)
-+FIND_PACKAGE_HANDLE_STANDARD_ARGS(IIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS)
-+MARK_AS_ADVANCED(IIO_LIBRARIES IIO_INCLUDE_DIRS)
-diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
-index c05b8d9..936d84b 100644
---- a/lib/CMakeLists.txt
-+++ b/lib/CMakeLists.txt
-@@ -174,6 +174,14 @@ if(ENABLE_UHD)
- GR_INCLUDE_SUBDIRECTORY(uhd)
- endif(ENABLE_UHD)
- 
-+########################################################################
-+# Setup IIO component
-+########################################################################
-+GR_REGISTER_COMPONENT("IIO Devices" ENABLE_IIO GNURADIO_IIO_FOUND)
-+if(ENABLE_IIO)
-+GR_INCLUDE_SUBDIRECTORY(plutosdr)
-+endif(ENABLE_IIO)
-+
- ########################################################################
- # Setup MiriSDR component
- ########################################################################
-diff --git a/lib/config.h.in b/lib/config.h.in
-index 42e72f1..0fe2731 100644
---- a/lib/config.h.in
-+++ b/lib/config.h.in
-@@ -10,6 +10,7 @@
- #cmakedefine ENABLE_RTL
- #cmakedefine ENABLE_RTL_TCP
- #cmakedefine ENABLE_UHD
-+#cmakedefine ENABLE_IIO
- #cmakedefine ENABLE_MIRI
- #cmakedefine ENABLE_SDRPLAY
- #cmakedefine ENABLE_HACKRF
-diff --git a/lib/device.cc b/lib/device.cc
-index 025a22b..77b271f 100644
---- a/lib/device.cc
-+++ b/lib/device.cc
-@@ -54,6 +54,10 @@
- #include <uhd_source_c.h>
- #endif
- 
-+#ifdef ENABLE_IIO
-+#include <plutosdr_source_c.h>
-+#endif
-+
- #ifdef ENABLE_MIRI
- #include <miri_source_c.h>
- #endif
-@@ -162,6 +166,10 @@ devices_t device::find(const device_t &hint)
-   BOOST_FOREACH( std::string dev, uhd_source_c::get_devices() )
-     devices.push_back( device_t(dev) );
- #endif
-+#ifdef ENABLE_IIO
-+  BOOST_FOREACH( std::string dev, plutosdr_source_c::get_devices() )
-+    devices.push_back( device_t(dev) );
-+#endif
- #ifdef ENABLE_MIRI
-   BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
-     devices.push_back( device_t(dev) );
-diff --git a/lib/plutosdr/CMakeLists.txt b/lib/plutosdr/CMakeLists.txt
-new file mode 100644
-index 0000000..b335885
---- /dev/null
-+++ b/lib/plutosdr/CMakeLists.txt
-@@ -0,0 +1,39 @@
-+# Copyright 2012 Free Software Foundation, Inc.
-+#
-+# This file is part of GNU Radio
-+#
-+# GNU Radio is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3, or (at your option)
-+# any later version.
-+#
-+# GNU Radio is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with GNU Radio; see the file COPYING.  If not, write to
-+# the Free Software Foundation, Inc., 51 Franklin Street,
-+# Boston, MA 02110-1301, USA.
-+
-+########################################################################
-+# This file included, use CMake directory variables
-+########################################################################
-+
-+include_directories(
-+    ${CMAKE_CURRENT_SOURCE_DIR}
-+    ${GNURADIO_IIO_INCLUDE_DIRS}
-+    ${IIO_INCLUDE_DIRS}
-+)
-+
-+set(iio_srcs
-+#    ${CMAKE_CURRENT_SOURCE_DIR}/iio_sink_c.cc
-+    ${CMAKE_CURRENT_SOURCE_DIR}/plutosdr_source_c.cc
-+)
-+
-+########################################################################
-+# Append gnuradio-osmosdr library sources
-+########################################################################
-+list(APPEND gr_osmosdr_srcs ${iio_srcs})
-+list(APPEND gr_osmosdr_libs ${GNURADIO_IIO_LIBRARIES} ${IIO_LIBRARIES})
-diff --git a/lib/plutosdr/plutosdr_source_c.cc b/lib/plutosdr/plutosdr_source_c.cc
-new file mode 100644
-index 0000000..009d4b2
---- /dev/null
-+++ b/lib/plutosdr/plutosdr_source_c.cc
-@@ -0,0 +1,262 @@
-+/* -*- c++ -*- */
-+/*
-+ * Copyright 2017 Dimitri Stolnikov <horiz0n@gmx.net>
-+ *
-+ * GNU Radio is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 3, or (at your option)
-+ * any later version.
-+ *
-+ * GNU Radio is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with GNU Radio; see the file COPYING.  If not, write to
-+ * the Free Software Foundation, Inc., 51 Franklin Street,
-+ * Boston, MA 02110-1301, USA.
-+ */
-+#include <boost/assign.hpp>
-+#include <iostream>
-+
-+#include "arg_helpers.h"
-+#include "osmosdr/source.h"
-+#include "plutosdr_source_c.h"
-+
-+using namespace boost::assign;
-+
-+plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args)
-+{
-+  return gnuradio::get_initial_sptr(new plutosdr_source_c(args));
-+}
-+
-+plutosdr_source_c::plutosdr_source_c(const std::string &args) :
-+    gr::hier_block2("plutosdr_source_c",
-+                   gr::io_signature::make(0, 0, 0),
-+                   gr::io_signature::make(1, 1, sizeof(gr_complex)))
-+{
-+  uri = "ip:pluto.local";
-+  frequency = 434000000;
-+  samplerate = 2500000;
-+  decimation = 0;
-+  bandwidth = 2000000;
-+  buffer_size = 0x4000;
-+  quadrature = true;
-+  rfdc = true;
-+  bbdc = true;
-+  gain_auto = false;
-+  gain_value = 50;
-+  filter = "";
-+  filter_auto = true;
-+  _freq_corr = 0.0;
-+
-+  dict_t dict = params_to_dict(args);
-+  if (dict.count("uri"))
-+    uri = boost::lexical_cast< std::string >( dict["uri"] );
-+
-+  std::cerr << "Using PlutoSDR URI = " << uri << std::endl;
-+
-+  _src = gr::iio::pluto_source::make(uri, frequency, samplerate,
-+                                     bandwidth, buffer_size,
-+                                     quadrature, rfdc, bbdc,
-+                                     "manual", gain_value,
-+                                     filter.c_str(), filter_auto);
-+
-+  connect( _src, 0, self(), 0 );
-+}
-+
-+plutosdr_source_c::~plutosdr_source_c()
-+{
-+}
-+
-+std::vector< std::string > plutosdr_source_c::get_devices()
-+{
-+  std::vector< std::string > devices;
-+
-+  std::string args = "plutosdr,label='PlutoSDR'";
-+
-+  devices.push_back( args );
-+
-+  return devices;
-+}
-+
-+std::string plutosdr_source_c::name()
-+{
-+  return "PlutoSDR";
-+}
-+
-+size_t plutosdr_source_c::get_num_channels()
-+{
-+  return output_signature()->max_streams();
-+}
-+
-+osmosdr::meta_range_t plutosdr_source_c::get_sample_rates( void )
-+{
-+  osmosdr::meta_range_t rates;
-+
-+  rates += osmosdr::range_t( 2500000 );
-+  rates += osmosdr::range_t( 5000000 );
-+  rates += osmosdr::range_t( 10000000 );
-+  rates += osmosdr::range_t( 20000000 );
-+
-+  return rates;
-+}
-+
-+double plutosdr_source_c::set_sample_rate( double rate )
-+{
-+  samplerate = (unsigned long) rate;
-+  set_params();
-+
-+  return samplerate;
-+}
-+
-+double plutosdr_source_c::get_sample_rate( void )
-+{
-+  return samplerate;
-+}
-+
-+osmosdr::freq_range_t plutosdr_source_c::get_freq_range( size_t chan )
-+{
-+  osmosdr::freq_range_t range;
-+
-+  range += osmosdr::range_t( 70.0e6, 6000.0e6, 1.0 );
-+
-+  return range;
-+}
-+
-+double plutosdr_source_c::set_center_freq( double freq, size_t chan )
-+{
-+  frequency = (unsigned long long) freq;
-+  set_params();
-+
-+  return freq;
-+}
-+
-+double plutosdr_source_c::get_center_freq( size_t chan )
-+{
-+  return frequency;
-+}
-+
-+double plutosdr_source_c::set_freq_corr( double ppm, size_t chan)
-+{
-+  _freq_corr = ppm;
-+  set_params();
-+
-+  return ppm;
-+}
-+
-+double plutosdr_source_c::get_freq_corr( size_t chan)
-+{
-+  return _freq_corr;
-+}
-+
-+std::vector<std::string> plutosdr_source_c::get_gain_names( size_t chan )
-+{
-+  std::vector< std::string > gains;
-+
-+  gains.push_back( "RF" );
-+
-+  return gains;
-+}
-+
-+osmosdr::gain_range_t plutosdr_source_c::get_gain_range( size_t chan)
-+{
-+  osmosdr::gain_range_t range;
-+  range += osmosdr::range_t( -10, 77, 1 );   // https://wiki.analog.com/resources/tools-software/linux-drivers/iio-transceiver/ad9361#rx_gain_control
-+
-+  return range;
-+}
-+
-+osmosdr::gain_range_t plutosdr_source_c::get_gain_range( const std::string & name,
-+                                                         size_t chan)
-+{
-+  osmosdr::gain_range_t range;
-+
-+  range += osmosdr::range_t( -10, 77, 1 );
-+
-+  return range;
-+}
-+
-+bool plutosdr_source_c::set_gain_mode( bool automatic, size_t chan )
-+{
-+  gain_auto = automatic;
-+  set_params();
-+
-+  return automatic;
-+}
-+
-+bool plutosdr_source_c::get_gain_mode( size_t chan )
-+{
-+  return gain_auto;
-+}
-+
-+double plutosdr_source_c::set_gain( double gain, size_t chan )
-+{
-+  gain_value = gain;
-+  set_params();
-+
-+  return gain;
-+}
-+
-+double plutosdr_source_c::set_gain( double gain, const std::string & name, size_t chan )
-+{
-+  gain_value = gain;
-+  set_params();
-+
-+  return gain;
-+}
-+
-+double plutosdr_source_c::get_gain( size_t chan )
-+{
-+  return gain_value;
-+}
-+
-+double plutosdr_source_c::get_gain( const std::string & name, size_t chan )
-+{
-+  return gain_value;
-+}
-+
-+std::vector< std::string > plutosdr_source_c::get_antennas( size_t chan )
-+{
-+  std::vector< std::string > antennas;
-+
-+  antennas += get_antenna( chan );
-+
-+  return antennas;
-+}
-+
-+std::string plutosdr_source_c::set_antenna( const std::string & antenna, size_t chan )
-+{
-+  return get_antenna( chan );
-+}
-+
-+std::string plutosdr_source_c::get_antenna( size_t chan )
-+{
-+  return "A_BALANCED";
-+}
-+
-+double plutosdr_source_c::set_bandwidth( double bw, size_t chan )
-+{
-+  if (bw == 0.0)
-+    bw = 0.8 * samplerate;  // auto bandwidth
-+
-+  bandwidth = (unsigned long)bw;
-+  set_params();
-+  return bandwidth;
-+}
-+
-+double plutosdr_source_c::get_bandwidth( size_t chan )
-+{
-+  return bandwidth;
-+}
-+
-+void plutosdr_source_c::set_params( void )
-+{
-+  unsigned long long freq = ((double)frequency * (1.0 + _freq_corr * 0.000001));
-+
-+  // FIXME: gain_mode string can be manual / slow_attack / fast_attack / hybrid
-+  _src->set_params( freq, samplerate, bandwidth, quadrature, rfdc, bbdc,
-+                    gain_auto ? "fast_attack" : "manual", gain_value,
-+                    filter.c_str(), filter_auto );
-+}
-diff --git a/lib/plutosdr/plutosdr_source_c.h b/lib/plutosdr/plutosdr_source_c.h
-new file mode 100644
-index 0000000..efac91f
---- /dev/null
-+++ b/lib/plutosdr/plutosdr_source_c.h
-@@ -0,0 +1,105 @@
-+/* -*- c++ -*- */
-+/*
-+ * Copyright 2017 Dimitri Stolnikov <horiz0n@gmx.net>
-+ *
-+ * GNU Radio is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 3, or (at your option)
-+ * any later version.
-+ *
-+ * GNU Radio is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with GNU Radio; see the file COPYING.  If not, write to
-+ * the Free Software Foundation, Inc., 51 Franklin Street,
-+ * Boston, MA 02110-1301, USA.
-+ */
-+#ifndef PLUTOSDR_SOURCE_C_H
-+#define PLUTOSDR_SOURCE_C_H
-+
-+#include <gnuradio/blocks/float_to_complex.h>
-+#include <gnuradio/blocks/short_to_float.h>
-+#include <gnuradio/hier_block2.h>
-+#include <gnuradio/iio/pluto_source.h>
-+
-+#include "source_iface.h"
-+
-+class plutosdr_source_c;
-+
-+typedef boost::shared_ptr< plutosdr_source_c > plutosdr_source_c_sptr;
-+
-+plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args = "");
-+
-+class plutosdr_source_c :
-+    public gr::hier_block2,
-+    public source_iface
-+{
-+private:
-+  friend plutosdr_source_c_sptr make_plutosdr_source_c(const std::string &args);
-+
-+  plutosdr_source_c(const std::string &args);
-+
-+public:
-+  ~plutosdr_source_c();
-+
-+  static std::vector< std::string > get_devices();
-+
-+  std::string name();
-+
-+  size_t get_num_channels( void );
-+
-+  osmosdr::meta_range_t get_sample_rates( void );
-+  double set_sample_rate( double rate );
-+  double get_sample_rate( void );
-+
-+  osmosdr::freq_range_t get_freq_range( size_t chan = 0 );
-+  double set_center_freq( double freq, size_t chan = 0 );
-+  double get_center_freq( size_t chan = 0 );
-+
-+  double set_freq_corr( double ppm, size_t chan = 0 );
-+  double get_freq_corr( size_t chan = 0 );
-+
-+  std::vector<std::string> get_gain_names( size_t chan = 0 );
-+  osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
-+  osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
-+  bool set_gain_mode( bool automatic, size_t chan = 0 );
-+  bool get_gain_mode( size_t chan = 0 );
-+  double set_gain( double gain, size_t chan = 0 );
-+  double set_gain( double gain, const std::string & name, size_t chan = 0 );
-+  double get_gain( size_t chan = 0 );
-+  double get_gain( const std::string & name, size_t chan = 0 );
-+
-+  std::vector< std::string > get_antennas( size_t chan = 0 );
-+  std::string set_antenna( const std::string & antenna, size_t chan = 0 );
-+  std::string get_antenna( size_t chan = 0 );
-+
-+  double set_bandwidth( double bw, size_t chan = 0 );
-+  double get_bandwidth( size_t chan = 0 );
-+
-+private:
-+
-+  void set_params(void);
-+
-+  gr::iio::pluto_source::sptr       _src;
-+
-+  std::string   uri;
-+  unsigned long long frequency;
-+  unsigned long samplerate;
-+  unsigned long decimation;
-+  unsigned long bandwidth;
-+  unsigned long buffer_size;
-+  bool quadrature;
-+  bool rfdc;
-+  bool bbdc;
-+  bool          gain_auto;
-+  double        gain_value;
-+  std::string   filter;
-+  bool          filter_auto;
-+
-+  double _freq_corr;
-+};
-+
-+#endif // PLUTOSDR_SOURCE_C_H
-diff --git a/lib/source_impl.cc b/lib/source_impl.cc
-index a28f314..2a153bc 100644
---- a/lib/source_impl.cc
-+++ b/lib/source_impl.cc
-@@ -56,6 +56,10 @@
- #include <uhd_source_c.h>
- #endif
- 
-+#ifdef ENABLE_IIO
-+#include <plutosdr_source_c.h>
-+#endif
-+
- #ifdef ENABLE_MIRI
- #include <miri_source_c.h>
- #endif
-@@ -144,6 +148,9 @@ source_impl::source_impl( const std::string &args )
- #ifdef ENABLE_UHD
-   dev_types.push_back("uhd");
- #endif
-+#ifdef ENABLE_IIO
-+  dev_types.push_back("plutosdr");
-+#endif
- #ifdef ENABLE_MIRI
-   dev_types.push_back("miri");
- #endif
-@@ -216,6 +223,10 @@ source_impl::source_impl( const std::string &args )
-     BOOST_FOREACH( std::string dev, uhd_source_c::get_devices() )
-       dev_list.push_back( dev );
- #endif
-+#ifdef ENABLE_IIO
-+    BOOST_FOREACH( std::string dev, plutosdr_source_c::get_devices() )
-+      dev_list.push_back( dev );
-+#endif
- #ifdef ENABLE_MIRI
-     BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
-       dev_list.push_back( dev );
-@@ -316,6 +327,13 @@ source_impl::source_impl( const std::string &args )
-     }
- #endif
- 
-+#ifdef ENABLE_IIO
-+    if ( dict.count("plutosdr") ) {
-+      plutosdr_source_c_sptr src = make_plutosdr_source_c( arg );
-+      block = src; iface = src.get();
-+    }
-+#endif
-+
- #ifdef ENABLE_MIRI
-     if ( dict.count("miri") ) {
-       miri_source_c_sptr src = make_miri_source_c( arg );

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
similarity index 96%
rename from net-wireless/gr-osmosdr/gr-osmosdr-0.1.5.ebuild
rename to net-wireless/gr-osmosdr/gr-osmosdr-0.1.5-r1.ebuild
index 69775452090..53e6a339276 100644
--- a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.5.ebuild
+++ b/net-wireless/gr-osmosdr/gr-osmosdr-0.1.5-r1.ebuild
@@ -23,7 +23,7 @@ IUSE="airspy bladerf fcd hackrf iqbalance mirisdr python rtlsdr sdrplay soapy uh
 
 RDEPEND="${PYTHON_DEPS}
 	dev-libs/boost:=
-	>=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_SINGLE_USEDEP}]
+	=net-wireless/gnuradio-3.7*:0=[fcd?,${PYTHON_SINGLE_USEDEP}]
 	airspy? ( net-wireless/airspy )
 	bladerf? ( >=net-wireless/bladerf-2018.08_rc1:= )
 	hackrf? ( net-libs/libhackrf:= )

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
similarity index 65%
rename from net-wireless/gr-osmosdr/gr-osmosdr-0.1.4_p20180626-r5.ebuild
rename to net-wireless/gr-osmosdr/gr-osmosdr-0.2.0.ebuild
index eb6cdd6fe1d..37c367da7f2 100644
--- a/net-wireless/gr-osmosdr/gr-osmosdr-0.1.4_p20180626-r5.ebuild
+++ b/net-wireless/gr-osmosdr/gr-osmosdr-0.2.0.ebuild
@@ -1,8 +1,8 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
-PYTHON_COMPAT=( python2_7 )
+EAPI=7
+PYTHON_COMPAT=( python3_{6,7,8} )
 
 inherit cmake-utils python-single-r1
 
@@ -11,51 +11,40 @@ HOMEPAGE="http://sdr.osmocom.org/trac/wiki/GrOsmoSDR"
 
 if [[ ${PV} == 9999* ]]; then
 	inherit git-r3
-	SRC_URI=""
-	EGIT_REPO_URI="git://git.osmocom.org/${PN}.git"
+	EGIT_REPO_URI="https://github.com/osmocom/gr-osmosdr.git"
 else
-	#SRC_URI="http://cgit.osmocom.org/gr-osmosdr/snapshot/gr-osmosdr-${PV}.tar.xz"
-	#git clone git://git.osmocom.org/gr-osmosdr.git
-	#cd gr-osmosdr
-	#git archive --format=tar --prefix=gr-osmosdr-${PV}/ v${PV} | xz > ../gr-osmosdr-${PV}.tar.xz
-	SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/gr-osmosdr-${PV}.tar.xz"
+	SRC_URI="https://github.com/osmocom/gr-osmosdr/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~x86"
 fi
 
 LICENSE="GPL-3"
 SLOT="0/${PV}"
-IUSE="bladerf fcd hackrf iio iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
+IUSE="airspy bladerf hackrf iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
 
 RDEPEND="${PYTHON_DEPS}
 	dev-libs/boost:=
-	>=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_SINGLE_USEDEP}]
+	=net-wireless/gnuradio-3.8*:0=[${PYTHON_SINGLE_USEDEP}]
+	airspy? ( net-wireless/airspy )
 	bladerf? ( >=net-wireless/bladerf-2018.08_rc1:= )
 	hackrf? ( net-libs/libhackrf:= )
-	iio? ( net-wireless/gr-iio )
 	iqbalance? ( net-wireless/gr-iqbal:=[${PYTHON_SINGLE_USEDEP}] )
 	mirisdr? ( net-libs/libmirisdr:= )
 	rtlsdr? ( >=net-wireless/rtl-sdr-0.5.4:= )
 	sdrplay? ( net-wireless/sdrplay )
 	soapy? ( net-wireless/soapysdr:= )
 	uhd? ( net-wireless/uhd:=[${PYTHON_SINGLE_USEDEP}] )"
-DEPEND="${RDEPEND}
-	dev-python/cheetah"
+DEPEND="${RDEPEND}"
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
-src_prepare() {
-	eapply "${FILESDIR}/csete-iio.patch"
-	cmake-utils_src_prepare
-}
-
 src_configure() {
 	local mycmakeargs=(
 		-DENABLE_DEFAULT=OFF
 		-DPYTHON_EXECUTABLE="${PYTHON}"
 		-DENABLE_FILE=ON
+		-DENABLE_AIRSPY="$(usex airspy)"
 		-DENABLE_BLADERF="$(usex bladerf)"
-		-DENABLE_FCD="$(usex fcd)"
 		-DENABLE_HACKRF="$(usex hackrf)"
-		-DENABLE_IIO="$(usex iio)"
 		-DENABLE_IQBALANCE="$(usex iqbalance)"
 		-DENABLE_MIRI="$(usex mirisdr)"
 		-DENABLE_PYTHON="$(usex python)"

diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild
index 69775452090..37c367da7f2 100644
--- a/net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild
+++ b/net-wireless/gr-osmosdr/gr-osmosdr-9999.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_{6,7,8} )
 
 inherit cmake-utils python-single-r1
 
@@ -19,11 +19,11 @@ fi
 
 LICENSE="GPL-3"
 SLOT="0/${PV}"
-IUSE="airspy bladerf fcd hackrf iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
+IUSE="airspy bladerf hackrf iqbalance mirisdr python rtlsdr sdrplay soapy uhd"
 
 RDEPEND="${PYTHON_DEPS}
 	dev-libs/boost:=
-	>=net-wireless/gnuradio-3.7_rc:0=[fcd?,${PYTHON_SINGLE_USEDEP}]
+	=net-wireless/gnuradio-3.8*:0=[${PYTHON_SINGLE_USEDEP}]
 	airspy? ( net-wireless/airspy )
 	bladerf? ( >=net-wireless/bladerf-2018.08_rc1:= )
 	hackrf? ( net-libs/libhackrf:= )
@@ -33,8 +33,7 @@ RDEPEND="${PYTHON_DEPS}
 	sdrplay? ( net-wireless/sdrplay )
 	soapy? ( net-wireless/soapysdr:= )
 	uhd? ( net-wireless/uhd:=[${PYTHON_SINGLE_USEDEP}] )"
-DEPEND="${RDEPEND}
-	dev-python/cheetah"
+DEPEND="${RDEPEND}"
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
@@ -45,7 +44,6 @@ src_configure() {
 		-DENABLE_FILE=ON
 		-DENABLE_AIRSPY="$(usex airspy)"
 		-DENABLE_BLADERF="$(usex bladerf)"
-		-DENABLE_FCD="$(usex fcd)"
 		-DENABLE_HACKRF="$(usex hackrf)"
 		-DENABLE_IQBALANCE="$(usex iqbalance)"
 		-DENABLE_MIRI="$(usex mirisdr)"

diff --git a/net-wireless/gr-osmosdr/metadata.xml b/net-wireless/gr-osmosdr/metadata.xml
index daafe681c99..68a1bf0f0a5 100644
--- a/net-wireless/gr-osmosdr/metadata.xml
+++ b/net-wireless/gr-osmosdr/metadata.xml
@@ -10,7 +10,6 @@
 	<flag name="bladerf">Build with Nuand BladeRF support</flag>
 	<flag name="fcd">Build with Funcube Dongle support</flag>
 	<flag name="hackrf">Build with Great Scott Gadgets HackRF support</flag>
-	<flag name="iio">Build with Industrial IO support for devices such as Analog Devices Pluto</flag>
 	<flag name="iqbalance">Enable support for I/Q balancing using gr-iqbal</flag>
 	<flag name="mirisdr">Build with Mirics MSi2500 + MSi001 SDR support</flag>
 	<flag name="rtlsdr">Build with Realtek RTL2832U (rtlsdr) support</flag>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/gr-osmosdr/, net-wireless/gr-osmosdr/files/
@ 2020-12-18 20:20 Rick Farina
  0 siblings, 0 replies; 4+ messages in thread
From: Rick Farina @ 2020-12-18 20:20 UTC (permalink / raw
  To: gentoo-commits

commit:     90142d8be10923b2c1b0c2a055b28fe8027c6f5b
Author:     Rick Farina <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 18 20:20:06 2020 +0000
Commit:     Rick Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Fri Dec 18 20:20:12 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90142d8b

net-wireless/gr-osmosdr: fix xtrx support

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Rick Farina <zerochaos <AT> gentoo.org>

 .../gr-osmosdr-0.2.3-use_xtrx_open_string.patch    | 23 ++++++++++++++++++++++
 net-wireless/gr-osmosdr/gr-osmosdr-0.2.3.ebuild    | 11 +++++++----
 net-wireless/gr-osmosdr/metadata.xml               |  1 +
 3 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/net-wireless/gr-osmosdr/files/gr-osmosdr-0.2.3-use_xtrx_open_string.patch b/net-wireless/gr-osmosdr/files/gr-osmosdr-0.2.3-use_xtrx_open_string.patch
new file mode 100644
index 00000000000..7699c81fed3
--- /dev/null
+++ b/net-wireless/gr-osmosdr/files/gr-osmosdr-0.2.3-use_xtrx_open_string.patch
@@ -0,0 +1,23 @@
+From ecca19615c588f771a131432f7161156efc274c2 Mon Sep 17 00:00:00 2001
+From: lain <code@hacktheinter.net>
+Date: Tue, 30 Jul 2019 15:59:38 -0700
+Subject: [PATCH] Quick patch to use xtrx_open_string() instead of the removed
+ xtrx_open_list().
+
+---
+ lib/xtrx/xtrx_obj.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/xtrx/xtrx_obj.cc b/lib/xtrx/xtrx_obj.cc
+index 1d58de5..5c73259 100644
+--- a/lib/xtrx/xtrx_obj.cc
++++ b/lib/xtrx/xtrx_obj.cc
+@@ -68,7 +68,7 @@ xtrx_obj::xtrx_obj(const std::string &path, unsigned loglevel, bool lmsreset)
+   unsigned xtrxflag = (loglevel & XTRX_O_LOGLVL_MASK) | ((lmsreset) ? XTRX_O_RESET : 0);
+   std::cerr << "xtrx_obj::xtrx_obj = " << xtrxflag << std::endl;
+ 
+-  int res = xtrx_open_list(path.c_str(), NULL, &_obj);
++  int res = xtrx_open_string(path.c_str(), &_obj);
+   if (res < 0) {
+     std::stringstream message;
+     message << "Couldn't open "  ": Error: " << -res;

diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-0.2.3.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-0.2.3.ebuild
index 33c1a0233fa..127e46a6032 100644
--- a/net-wireless/gr-osmosdr/gr-osmosdr-0.2.3.ebuild
+++ b/net-wireless/gr-osmosdr/gr-osmosdr-0.2.3.ebuild
@@ -19,9 +19,8 @@ fi
 
 LICENSE="GPL-3"
 SLOT="0/${PV}"
-IUSE="airspy bladerf hackrf iqbalance python rtlsdr sdrplay soapy uhd"
+IUSE="airspy bladerf hackrf iqbalance python rtlsdr sdrplay soapy uhd xtrx"
 
-#xtrx? ( net-wireless/libxtrx )
 RDEPEND="${PYTHON_DEPS}
 	dev-libs/boost:=
 	=net-wireless/gnuradio-3.8*:0=[${PYTHON_SINGLE_USEDEP}]
@@ -34,13 +33,17 @@ RDEPEND="${PYTHON_DEPS}
 	sdrplay? ( net-wireless/sdrplay )
 	soapy? ( net-wireless/soapysdr:= )
 	uhd? ( net-wireless/uhd:=[${PYTHON_SINGLE_USEDEP}] )
+	xtrx? ( net-wireless/libxtrx )
 	"
 DEPEND="${RDEPEND}"
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
+PATCHES=(
+	"${FILESDIR}/${P}-use_xtrx_open_string.patch"
+)
+
 src_configure() {
-	#-DENABLE_XTRX="$(usex xtrx ON OFF)"
 	local mycmakeargs=(
 		-DENABLE_DEFAULT=OFF
 		-DPYTHON_EXECUTABLE="${PYTHON}"
@@ -56,7 +59,7 @@ src_configure() {
 		-DENABLE_NONFREE="$(usex sdrplay ON OFF)"
 		-DENABLE_SOAPY="$(usex soapy ON OFF)"
 		-DENABLE_UHD="$(usex uhd ON OFF)"
-		-DENABLE_XTRX=OFF
+		-DENABLE_XTRX="$(usex xtrx ON OFF)"
 	)
 
 	cmake_src_configure

diff --git a/net-wireless/gr-osmosdr/metadata.xml b/net-wireless/gr-osmosdr/metadata.xml
index 39125bb505e..cc8249dcdf2 100644
--- a/net-wireless/gr-osmosdr/metadata.xml
+++ b/net-wireless/gr-osmosdr/metadata.xml
@@ -15,5 +15,6 @@
 	<flag name="sdrplay">Enable support for SDRplay devices through <pkg>net-wireless/sdrplay</pkg></flag>
 	<flag name="soapy">Build with SoapySDR support</flag>
 	<flag name="uhd">Build with Ettus Research USRP Hardware Driver support</flag>
+	<flag name="xtrx">Build with xtrx Hardware Driver support</flag>
 </use>
 </pkgmetadata>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-wireless/gr-osmosdr/, net-wireless/gr-osmosdr/files/
@ 2022-08-29 12:08 Thomas Beierlein
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Beierlein @ 2022-08-29 12:08 UTC (permalink / raw
  To: gentoo-commits

commit:     3bf04c51cb976faec35dbecdbb99a544b9d2282c
Author:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 12:02:58 2022 +0000
Commit:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 12:03:29 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bf04c51

net-wireless/gr-osmosdr: Fix build without python bindings

Closes: https://bugs.gentoo.org/865807
Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>

 .../gr-osmosdr-0.2.3_p20210128-fix-enable-python.patch    | 15 +++++++++++++++
 net-wireless/gr-osmosdr/gr-osmosdr-0.2.3_p20210128.ebuild |  6 +++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/net-wireless/gr-osmosdr/files/gr-osmosdr-0.2.3_p20210128-fix-enable-python.patch b/net-wireless/gr-osmosdr/files/gr-osmosdr-0.2.3_p20210128-fix-enable-python.patch
new file mode 100644
index 000000000000..2bf79b1fe20e
--- /dev/null
+++ b/net-wireless/gr-osmosdr/files/gr-osmosdr-0.2.3_p20210128-fix-enable-python.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 96a2c90..a3836f8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -187,9 +187,7 @@ find_package(Doxygen)
+ 
+     # Python
+     ##########
+-
+-find_package(PythonLibs 3)
+-find_package(pybind11)
++include(GrPybind)
+ 
+ GR_REGISTER_COMPONENT("Python support" ENABLE_PYTHON
+     PYTHONLIBS_FOUND

diff --git a/net-wireless/gr-osmosdr/gr-osmosdr-0.2.3_p20210128.ebuild b/net-wireless/gr-osmosdr/gr-osmosdr-0.2.3_p20210128.ebuild
index 518b27caa2a1..a481ca03c6f3 100644
--- a/net-wireless/gr-osmosdr/gr-osmosdr-0.2.3_p20210128.ebuild
+++ b/net-wireless/gr-osmosdr/gr-osmosdr-0.2.3_p20210128.ebuild
@@ -44,6 +44,10 @@ DEPEND="${RDEPEND}
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
+PATCHES=(
+	"${FILESDIR}"/${P}-fix-enable-python.patch
+)
+
 src_configure() {
 	local mycmakeargs=(
 		-DENABLE_DEFAULT=OFF
@@ -69,7 +73,7 @@ src_configure() {
 src_install() {
 	cmake_src_install
 	if use python; then
-		find "${D}" -name '*.py[oc]' -delete || die
+		find "${ED}" -name '*.py[oc]' -delete || die
 		python_fix_shebang "${ED}"/usr/bin
 		python_optimize
 	fi


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-29 12:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-18 20:20 [gentoo-commits] repo/gentoo:master commit in: net-wireless/gr-osmosdr/, net-wireless/gr-osmosdr/files/ Rick Farina
  -- strict thread matches above, loose matches on Subject: below --
2022-08-29 12:08 Thomas Beierlein
2020-06-01 20:45 Rick Farina
2018-09-05  2:38 Richard Farina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox