<div dir="ltr">This is what I ended up with. I don't like it at all.<div><br></div><div><div><font face="monospace, monospace">pre-destroot {</font></div><div><font face="monospace, monospace">    # This fixes what may be a cmake error</font></div><div><font face="monospace, monospace">    catch {</font></div><div><font face="monospace, monospace"><span style="white-space:pre">        </span># look for DESTDIR in the fixup_bundle arguments</font></div><div><font face="monospace, monospace"><span style="white-space:pre">       </span>exec grep -q {fixup_bundle.*DESTDIR} ${workpath}/build/InstallRules/dependencies.cmake</font></div><div><font face="monospace, monospace">    } res opt</font></div><div><font face="monospace, monospace">    # if it's not present, add it</font></div><div><font face="monospace, monospace">    if [string equal "$res" "child process exited abnormally"] {</font></div><div><font face="monospace, monospace">        reinplace "/fixup_bundle(\"/s//&\$ENV{DESTDIR}/" ${workpath}/build/InstallRules/dependencies.cmake</font></div><div><font face="monospace, monospace">    }</font></div><div><font face="monospace, monospace">}</font></div></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br>Randolph M. Fritz || <span><span title="Call with Google Voice">+1 206 659-8617</span> || </span><a href="mailto:rmfritz3@gmail.com" target="_blank">rmfritz3@gmail.com</a></div></div></div></div>
<br><div class="gmail_quote">On Mon, Jun 18, 2018 at 9:43 AM, Randolph M. Fritz <span dir="ltr"><<a href="mailto:rmfritz3@gmail.com" target="_blank">rmfritz3@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>This is a continuation of work on a very old problem, which you can see at:</div><div>  <a href="https://lists.macports.org/pipermail/macports-dev/2012-August/020015.html" target="_blank">https://lists.macports.org/<wbr>pipermail/macports-dev/2012-<wbr>August/020015.html</a></div><div><br></div><div>I picked this up again, after an absence of years, and have made some progress. There is a problem with DESTDIR and the generated cmake dependencies file, which I can repair with the following pre-destroot command:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">pre-destroot {<br>    # This fixes what may be a cmake error. (It also confuses emacs tcl-mode.)<br>    reinplace {/fixup_bundle("/s//&$ENV{<wbr>DESTDIR}/} ${workpath}/build/<wbr>InstallRules/dependencies.<wbr>cmake<br>}</font></blockquote></div><div><br></div>Problem is, if this problem is the result of a cmake bug, as I suspect, and that bug is fixed, this portfile will break. So I would like to write something like:<div><font face="monospace, monospace">  if { {${workpath}/build/<wbr>InstallRules/dependencies.<wbr>cmake} does not contain … } then {</font></div><div><font face="monospace, monospace">     <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">reinplace …</span></font></div><div><font face="monospace, monospace">  }</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">This looks like a fairly straightforward thing to do, but when I try to code it, it elaborates into some fairly messy code. Does anyone have suggestions as to how to approach this problem?<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></font><span class="HOEnZb"><font color="#888888"><div><div class="m_4639024439888874376gmail_signature"><div dir="ltr"><div>-- <br>Randolph M. Fritz || <span><span title="Call with Google Voice"><span id="m_4639024439888874376gmail-gc-number-2" class="m_4639024439888874376gmail-gc-cs-link" title="Call with Google Voice"><span id="m_4639024439888874376gmail-gc-number-11" class="m_4639024439888874376gmail-gc-cs-link" title="Call with Google Voice"><span id="m_4639024439888874376gmail-gc-number-17" class="m_4639024439888874376gmail-gc-cs-link" title="Call with Google Voice"><span id="m_4639024439888874376gc-number-18" class="m_4639024439888874376gc-cs-link" title="Call with Google Voice">+1 206 659-8617</span></span></span></span></span> || </span><a href="mailto:rmfritz3@gmail.com" target="_blank">rmfritz3@gmail.com</a></div></div></div></div>
</font></span></div></div>
</blockquote></div><br></div>