<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[142695] trunk/dports/science/gqrx</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/142695">142695</a></dd>
<dt>Author</dt> <dd>michaelld@macports.org</dd>
<dt>Date</dt> <dd>2015-11-20 08:00:30 -0800 (Fri, 20 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>gqrx:
+ update to 2f42e982 (20151119);
+ add temporary patch to fix use of std::complex, to make the code backward compatible to g++ 4.2 &amp; thus libstdc++ (also, much cleaner code).</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportssciencegqrxPortfile">trunk/dports/science/gqrx/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportssciencegqrxfilespatchfix_std_complexdiff">trunk/dports/science/gqrx/files/patch-fix_std_complex.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportssciencegqrxPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/science/gqrx/Portfile (142694 => 142695)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -20,15 +20,19 @@
</span><span class="cx">     long_description    ${description}  \
</span><span class="cx">         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}
</span><span class="cx"> 
</span><del>-    github.setup        csete gqrx b71c0cb986d51cb082a5f0da6d64b0e9cc825381
-    version             20151118
-    checksums           rmd160 47db6acc11ca3aeaf517efbdf55528b82e46427a \
-                        sha256 99176b5066d9e0a4f86075048d65dd13710096f2606f83f3a3436ac605a117cf
</del><ins>+    github.setup        csete gqrx 2f42e982ba4a0f0ef55df3a5136aac16aa9618f4
+    version             20151119
+    checksums           rmd160 a33271192e26a7f6a72276067a42487e0b51a424 \
+                        sha256 43b3a56b057128257c7fd95f61c8fc861dfe519d44c1bd8401744099b011e76e
</ins><span class="cx"> 
</span><span class="cx">     conflicts           gqrx-legacy
</span><span class="cx"> 
</span><span class="cx">     patchfiles-append   patch-gqrx.pro.diff
</span><span class="cx"> 
</span><ins>+    # fix use of std::complex to be compatible back to g++ 4.2
+
+    patchfiles-append   patch-fix_std_complex.diff
+
</ins><span class="cx">     # allow gqrx to work with both gnuradio and gnuradio-devel ...
</span><span class="cx"> 
</span><span class="cx">     depends_lib-append  port:gr-osmosdr \
</span></span></pre></div>
<a id="trunkdportssciencegqrxfilespatchfix_std_complexdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/science/gqrx/files/patch-fix_std_complex.diff (0 => 142695)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+--- 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 &lt; noutput_items)
+         {
+-            pwr = in[i].real()*in[i].real() + in[i].imag()*in[i].imag();
++            pwr = std::norm(in[i]);
+             if (pwr &lt; d_level)
+                 d_level = pwr;
+             i++;
+@@ -96,7 +96,7 @@
+         // maximum peak
+         while (i &lt; noutput_items)
+         {
+-            pwr = in[i].real()*in[i].real() + in[i].imag()*in[i].imag();
++            pwr = std::norm(in[i]);
+             if (pwr &gt; d_level)
+                 d_level = pwr;
+             i++;
+@@ -107,7 +107,7 @@
+         // mean value
+         while (i &lt; 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 &lt; 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 &lt; (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
</ins></span></pre>
</div>
</div>

</body>
</html>