[MacPorts] #66389: gr-osmosdr @20210117-cffef690_3 Build error

MacPorts noreply at macports.org
Sun Dec 4 00:31:49 UTC 2022


#66389: gr-osmosdr @20210117-cffef690_3 Build error
-------------------------+-----------------------
  Reporter:  dwyerk      |      Owner:  michaelld
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  gr-osmosdr  |
-------------------------+-----------------------

Comment (by dwyerk):

 Digging around in the osmosdr code I found this really suspicious bit of
 code:
 {{{
 // Workaround for a SWIG 2.0.4 bug with templates. Probably needs to be
 looked in to.
 %{
 #if PY_VERSION_HEX >= 0x03020000
 # define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
 #else
 # define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
 #endif
 %}
 }}}
 This patch at least lets it build. I copied the newer syntax that swig
 uses into this section. Presumably this is because macports is on to
 SWIG-4.1.0?
 {{{
 diff --git a/swig/osmosdr_swig.i b/swig/osmosdr_swig.i
 index 550008b..cd44507 100644
 --- a/swig/osmosdr_swig.i
 +++ b/swig/osmosdr_swig.i
 @@ -18,13 +18,16 @@

  // Workaround for a SWIG 2.0.4 bug with templates. Probably needs to be
 looked in to.
  %{
 +#include <iostream>
 +
  #if PY_VERSION_HEX >= 0x03020000
 -# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
 +# define SWIGPY_SLICEOBJECT PyObject
  #else
 -# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
 +# define SWIGPY_SLICEOBJECT PySliceObject
  #endif
  %}

 +
  %template(string_vector_t) std::vector<std::string>;

  //%template(size_vector_t) std::vector<size_t>;
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/66389#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list