unorthodox build setup?
Mark Brethen
mark.brethen at gmail.com
Thu Oct 4 17:24:08 UTC 2018
I only need to set it during build and destroot. How about setting the variable in the pre-build and pre-destroot phases?
Mark Brethen
mark.brethen at gmail.com
> On Oct 4, 2018, at 12:09 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
>
>
>
> On Oct 4, 2018, at 12:05, Mark Brethen wrote:
>
>> On Oct 4, 2018, at 11:57 AM, Ryan Schmidt wrote:
>>
>>> On Oct 4, 2018, at 11:55, Mark Brethen wrote:
>>>
>>>> There’s just one glitch, the name of the build directory is determined by
>>>>
>>>> BUILD = $(shell ../../scripts/findhost.sh $(shell src/config.guess))
>>>>
>>>> I can set it after the extract phase like so
>>>>
>>>> post-extract {
>>>> set builddir [exec ${worksrcpath}/scripts/findhost.sh [exec ${worksrcpath}/config.guess]]
>>>> configure.dir ${worksrcdir}/${builddir}
>>>> }
>>>>
>>>> but then configure.dir isn't global for the config/build phases, is it?
>>>
>>> That's correct.
>>>
>>> Can you fix the build system so that it uses a predictable build directory name (such as "build"), and then use that name in the portfile?
>>
>> I’d have to patch makefile and config.ac, at least.
>
> Another option could be to patch findhost.sh.
>
>> Can set variables be exported to global?
>
> Well I wasn't completely accurate. If you set configure.dir inside post-extract, it is set for all phases that run after that in this invocation of the port command. But you don't know for certain that the configure phase will run in this invocation of the port command. The user might run "sudo port extract yourport" (which in your example will set configure.dir) and then later run "sudo port configure yourport" (and configure.dir will be back to its default value). So don't set options in one phase and expect them to be available in another phase.
>
More information about the macports-dev
mailing list