<!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>[125804] trunk/dports/pure/pure-stldict</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/125804">125804</a></dd>
<dt>Author</dt> <dd>ryandesign@macports.org</dd>
<dt>Date</dt> <dd>2014-09-26 13:50:48 -0700 (Fri, 26 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>pure-stldict: add tr1 support for systems with libstdc++</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportspurepurestldictPortfile">trunk/dports/pure/pure-stldict/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportspurepurestldictfilespatchtr1supportdiff">trunk/dports/pure/pure-stldict/files/patch-tr1-support.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportspurepurestldictPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/pure/pure-stldict/Portfile (125803 => 125804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/pure/pure-stldict/Portfile        2014-09-26 20:49:02 UTC (rev 125803)
+++ trunk/dports/pure/pure-stldict/Portfile        2014-09-26 20:50:48 UTC (rev 125804)
</span><span class="lines">@@ -17,12 +17,19 @@
</span><span class="cx"> checksums               rmd160  edd27eea378ae97f444909e271307b5c30e313ad \
</span><span class="cx">                         sha256  5b894ae6dc574c7022258e2732bea649c82c959ec4d0be13fb5a3e8ba8488f28
</span><span class="cx"> 
</span><ins>+depends_build-append    port:pkgconfig
+
</ins><span class="cx"> patchfiles              patch-Makefile.diff
</span><ins>+patchfiles-append       patch-tr1-support.diff
</ins><span class="cx"> 
</span><del>-depends_build-append    port:pkgconfig
-
</del><span class="cx"> # These are set in the Makefile but the pure portgroup overrides them.
</span><span class="cx"> configure.cxxflags-append -g -std=c++0x -Wall
</span><span class="cx"> 
</span><ins>+# No auto-detection of TR1 support yet.
+# https://bitbucket.org/purelang/pure-lang/issue/29/pure-stldict-08-fails-to-build-on-os-x-108
+if {${configure.cxx_stdlib} eq &quot;libstdc++&quot;} {
+    configure.cxxflags-append -DHAVE_TR1
+}
+
</ins><span class="cx"> test.run                yes
</span><span class="cx"> test.target             check
</span></span></pre></div>
<a id="trunkdportspurepurestldictfilespatchtr1supportdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/pure/pure-stldict/files/patch-tr1-support.diff (0 => 125804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/pure/pure-stldict/files/patch-tr1-support.diff                                (rev 0)
+++ trunk/dports/pure/pure-stldict/files/patch-tr1-support.diff        2014-09-26 20:50:48 UTC (rev 125804)
</span><span class="lines">@@ -0,0 +1,123 @@
</span><ins>+https://bitbucket.org/purelang/pure-lang/issue/29/pure-stldict-08-fails-to-build-on-os-x-108
+--- hashdict.cc.orig        Fri Sep 26 07:21:36 2014 +0200
++++ hashdict.cc        Fri Sep 26 07:40:50 2014 +0200
+@@ -5,8 +5,22 @@
+ #include &lt;stdlib.h&gt;
+ #include &lt;string.h&gt;
+ #include &lt;pure/runtime.h&gt;
++#include &lt;algorithm&gt;
++
++/* Define this for C++ TR1 extensions support. This is needed to get tuple and
++   unordered_map for some older C++ libraries which don't provide full C++11
++   support yet. */
++//#define HAVE_TR1
++#ifdef HAVE_TR1
++#include &lt;tr1/unordered_map&gt;
++#include &lt;tr1/tuple&gt;
++using namespace std;
++using namespace std::tr1;
++#else
+ #include &lt;unordered_map&gt;
+-#include &lt;algorithm&gt;
++#include &lt;tuple&gt;
++using namespace std;
++#endif

+ // Enable this for some additional (possibly costly) assertions in the code.
+ //#define DEBUG 1
+@@ -117,8 +131,6 @@
+   return true;
+ }

+-using namespace std;
+-
+ // Hashing and comparing Pure expressions. The required functionality is in
+ // the Pure runtime (hash() and same() functions, see pure/runtime.h).

+@@ -560,8 +572,6 @@
+   return eqchk(x.second, y.second);
+ }

+-#include &lt;tuple&gt;
+-
+ #ifdef HAVE_STD_IS_PERMUTATION
+ #define my_is_permutation is_permutation
+ #else
+@@ -575,18 +585,18 @@
+                               ForwardIterator2 d_first, BinaryPredicate p)
+ {
+   // skip common prefix
+-  std::tie(first, d_first) = std::mismatch(first, last, d_first, p);
++  tie(first, d_first) = mismatch(first, last, d_first, p);
+   // iterate over the rest, counting how many times each element
+   // from [first, last) appears in [d_first, d_last)
+   if (first != last) {
+     ForwardIterator2 d_last = d_first;
+-    std::advance(d_last, std::distance(first, last));
++    advance(d_last, distance(first, last));
+     for (ForwardIterator1 i = first; i != last; ++i) {
+-      using std::placeholders::_1;
+-      if (i != std::find_if(first, i, std::bind(p, _1, *i)))
++      using placeholders::_1;
++      if (i != find_if(first, i, bind(p, _1, *i)))
+         continue; // already counted this *i
+-      auto m = std::count_if(d_first, d_last, std::bind(p, _1, *i));
+-      if (m==0 || std::count_if(i, last, std::bind(p, _1, *i)) != m) {
++      auto m = count_if(d_first, d_last, bind(p, _1, *i));
++      if (m==0 || count_if(i, last, bind(p, _1, *i)) != m) {
+         return false;
+       }
+     }
+--- orddict.cc.orig        Fri Sep 26 07:21:36 2014 +0200
++++ orddict.cc        Fri Sep 26 07:40:50 2014 +0200
+@@ -8,6 +8,19 @@
+ #include &lt;map&gt;
+ #include &lt;algorithm&gt;

++/* Define this for C++ TR1 extensions support. This is needed to get tuple and
++   unordered_map for some older C++ libraries which don't provide full C++11
++   support yet. */
++//#define HAVE_TR1
++#ifdef HAVE_TR1
++#include &lt;tr1/tuple&gt;
++using namespace std;
++using namespace std::tr1;
++#else
++#include &lt;tuple&gt;
++using namespace std;
++#endif
++
+ // Enable this for some additional (possibly costly) assertions in the code.
+ //#define DEBUG 1

+@@ -582,8 +595,6 @@
+   return eqchk(x.second, y.second);
+ }

+-#include &lt;tuple&gt;
+-
+ #ifdef HAVE_STD_IS_PERMUTATION
+ #define my_is_permutation is_permutation
+ #else
+@@ -595,16 +606,16 @@
+                               ForwardIterator2 d_first, BinaryPredicate p)
+ {
+   // skip common prefix
+-  std::tie(first, d_first) = std::mismatch(first, last, d_first, p);
++  tie(first, d_first) = mismatch(first, last, d_first, p);
+   // iterate over the rest, counting how many times each element
+   // from [first, last) appears in [d_first, d_last)
+   if (first != last) {
+     ForwardIterator2 d_last = d_first;
+-    std::advance(d_last, std::distance(first, last));
++    advance(d_last, distance(first, last));
+     for (ForwardIterator1 i = first; i != last; ++i) {
+-      if (i != std::find(first, i, *i)) continue; // already counted this *i
+-      auto m = std::count(d_first, d_last, *i);
+-      if (m==0 || std::count(i, last, *i) != m) {
++      if (i != find(first, i, *i)) continue; // already counted this *i
++      auto m = count(d_first, d_last, *i);
++      if (m==0 || count(i, last, *i) != m) {
+         return false;
+       }
+     }
</ins></span></pre>
</div>
</div>

</body>
</html>