Cmake build problem workaround

Randolph M. Fritz rmfritz3 at gmail.com
Mon Jun 18 19:20:37 UTC 2018


This is what I ended up with. I don't like it at all.

pre-destroot {
    # This fixes what may be a cmake error
    catch {
# look for DESTDIR in the fixup_bundle arguments
exec grep -q {fixup_bundle.*DESTDIR}
${workpath}/build/InstallRules/dependencies.cmake
    } res opt
    # if it's not present, add it
    if [string equal "$res" "child process exited abnormally"] {
        reinplace "/fixup_bundle(\"/s//&\$ENV{DESTDIR}/"
${workpath}/build/InstallRules/dependencies.cmake
    }
}


-- 
Randolph M. Fritz || +1 206 659-8617 || rmfritz3 at gmail.com

On Mon, Jun 18, 2018 at 9:43 AM, Randolph M. Fritz <rmfritz3 at gmail.com>
wrote:

> This is a continuation of work on a very old problem, which you can see at:
>   https://lists.macports.org/pipermail/macports-dev/2012-
> August/020015.html
>
> 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:
>
> pre-destroot {
>>     # This fixes what may be a cmake error. (It also confuses emacs
>> tcl-mode.)
>>     reinplace {/fixup_bundle("/s//&$ENV{DESTDIR}/} ${workpath}/build/
>> InstallRules/dependencies.cmake
>> }
>
>
> 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:
>   if { {${workpath}/build/InstallRules/dependencies.cmake} does not
> contain … } then {
>      reinplace …
>   }
>
> 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?
> --
> Randolph M. Fritz || +1 206 659-8617 || rmfritz3 at gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20180618/88ffc1ac/attachment.html>


More information about the macports-dev mailing list