[142695] trunk/dports/science/gqrx

michaelld at macports.org michaelld at macports.org
Sat Dec 12 06:50:44 PST 2015


Revision: 142695
          https://trac.macports.org/changeset/142695
Author:   michaelld at macports.org
Date:     2015-11-20 08:00:30 -0800 (Fri, 20 Nov 2015)
Log Message:
-----------
gqrx:
+ update to 2f42e982 (20151119);
+ add temporary patch to fix use of std::complex, to make the code backward compatible to g++ 4.2 & thus libstdc++ (also, much cleaner code).

Modified Paths:
--------------
    trunk/dports/science/gqrx/Portfile

Added Paths:
-----------
    trunk/dports/science/gqrx/files/patch-fix_std_complex.diff

Modified: trunk/dports/science/gqrx/Portfile
===================================================================
--- trunk/dports/science/gqrx/Portfile	2015-11-20 15:03:18 UTC (rev 142694)
+++ trunk/dports/science/gqrx/Portfile	2015-11-20 16:00:30 UTC (rev 142695)
@@ -20,15 +20,19 @@
     long_description    ${description}  \
         This port is kept up with the Gqrx GIT 'master' branch, is typically updated weekly to monthly, and provides compatibility with the GNU Radio release 3.7 API: the gnuradio and gnuradio-devel ports.  ${description_common}
 
-    github.setup        csete gqrx b71c0cb986d51cb082a5f0da6d64b0e9cc825381
-    version             20151118
-    checksums           rmd160 47db6acc11ca3aeaf517efbdf55528b82e46427a \
-                        sha256 99176b5066d9e0a4f86075048d65dd13710096f2606f83f3a3436ac605a117cf
+    github.setup        csete gqrx 2f42e982ba4a0f0ef55df3a5136aac16aa9618f4
+    version             20151119
+    checksums           rmd160 a33271192e26a7f6a72276067a42487e0b51a424 \
+                        sha256 43b3a56b057128257c7fd95f61c8fc861dfe519d44c1bd8401744099b011e76e
 
     conflicts           gqrx-legacy
 
     patchfiles-append   patch-gqrx.pro.diff
 
+    # fix use of std::complex to be compatible back to g++ 4.2
+
+    patchfiles-append   patch-fix_std_complex.diff
+
     # allow gqrx to work with both gnuradio and gnuradio-devel ...
 
     depends_lib-append  port:gr-osmosdr \

Added: trunk/dports/science/gqrx/files/patch-fix_std_complex.diff
===================================================================
--- trunk/dports/science/gqrx/files/patch-fix_std_complex.diff	                        (rev 0)
+++ trunk/dports/science/gqrx/files/patch-fix_std_complex.diff	2015-11-20 16:00:30 UTC (rev 142695)
@@ -0,0 +1,94 @@
+--- src/dsp/rx_meter.cpp.orig
++++ src/dsp/rx_meter.cpp
+@@ -65,7 +65,7 @@
+     if (d_num == 0)
+     {
+         // first sample after a reset
+-        d_level = in[0].real()*in[0].real() + in[0].imag()*in[0].imag();
++        d_level = std::norm(in[0]);
+         d_sum = d_level;
+         d_sumsq = d_level*d_level;
+         i = 1;
+@@ -78,14 +78,14 @@
+     {
+     case DETECTOR_TYPE_SAMPLE:
+         // just take the first sample
+-        d_level = in[0].real()*in[0].real() + in[0].imag()*in[0].imag();
++        d_level = std::norm(in[0]);
+         break;
+ 
+     case DETECTOR_TYPE_MIN:
+         // minimum peak
+         while (i < noutput_items)
+         {
+-            pwr = in[i].real()*in[i].real() + in[i].imag()*in[i].imag();
++	    pwr = std::norm(in[i]);
+             if (pwr < d_level)
+                 d_level = pwr;
+             i++;
+@@ -96,7 +96,7 @@
+         // maximum peak
+         while (i < noutput_items)
+         {
+-            pwr = in[i].real()*in[i].real() + in[i].imag()*in[i].imag();
++            pwr = std::norm(in[i]);
+             if (pwr > d_level)
+                 d_level = pwr;
+             i++;
+@@ -107,7 +107,7 @@
+         // mean value
+         while (i < noutput_items)
+         {
+-            pwr = in[i].real()*in[i].real() + in[i].imag()*in[i].imag();
++            pwr = std::norm(in[i]);
+             d_sum += pwr;
+             i++;
+         }
+@@ -118,7 +118,7 @@
+         // root mean square
+         while (i < noutput_items)
+         {
+-            pwr = in[i].real()*in[i].real() + in[i].imag()*in[i].imag();
++            pwr = std::norm(in[i]);
+             d_sumsq += pwr*pwr;
+             i++;
+         }
+--- src/applications/gqrx/mainwindow.cpp.orig
++++ src/applications/gqrx/mainwindow.cpp
+@@ -1305,7 +1305,7 @@
+         }
+ 
+         /* calculate power in dBFS */
+-        pwr = pwr_scale * (pt.imag() * pt.imag() + pt.real() * pt.real());
++        pwr = pwr_scale * std::norm(pt);
+         d_realFftData[i] = 10.0 * log10f(pwr + 1.0e-20);
+ 
+         /* FFT averaging */
+@@ -1353,7 +1353,7 @@
+         }
+ 
+         /* calculate power in dBFS */
+-        pwr = pwr_scale * (pt.imag() * pt.imag() + pt.real() * pt.real());
++        pwr = pwr_scale * std::norm(pt);
+         d_realFftData[i] = 10.0 * log10f(pwr + 1.0e-20);
+     }
+ 
+--- src/dsp/filter/decimator.cpp.orig
++++ src/dsp/filter/decimator.cpp
+@@ -307,13 +307,9 @@
+ 
+     for(i = 0; i < (InLength - 11 - 6) / 2; i++)
+ 	{
+-        (*pOut).real( H0 * pIn[0].real() + H2 * pIn[2].real()
+-                + H4 * pIn[4].real() + H5 * pIn[5].real() + H6 * pIn[6].real()
+-                + H8 * pIn[8].real() + H10 * pIn[10].real());
+-        (*pOut++).imag( H0 * pIn[0].imag() + H2 * pIn[2].imag()
+-                + H4 * pIn[4].imag() + H5 * pIn[5].imag() + H6 * pIn[6].imag()
+-                + H8 * pIn[8].imag() + H10 * pIn[10].imag());
+-		pIn += 2;
++	  *pOut++ = (H0 * pIn[0]) + (H2 * pIn[2]) + (H4 * pIn[4]) +
++	    (H5 * pIn[5]) + (H6 * pIn[6]) + (H8 * pIn[8]) + (H10 * pIn[10]);
++	  pIn += 2;
+ 	}
+ 
+     // copy first outputs back into output array so outbuf can be same as inbuf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/c754e97c/attachment.html>


More information about the macports-changes mailing list