is there a way to use MacPorts to use a local source folder as source for builds?

Ryan Schmidt ryandesign at macports.org
Fri May 8 07:39:06 UTC 2020



On May 6, 2020, at 15:18, Ken Cunningham wrote:

> I would like to use MacPorts to work on several large projects hosted on github, that I clone locally and add incremental patches to. Think LLVM, qt4, qt5, etc, etc.
> 
> During the MacPorts build, I would like MacPorts to use my local cloned folder of source as the source code for the build. For incremental patches, which I seem to do a lot of, this would be a real timesaver.
> 
> I have not (yet) come across this MacPorts feature, if it exists.
> 
> I am thinking perhaps that the “fetch” phase of the portfile could be overridden with something that makes a symlink from the source folder into the appropriate place in the work folder?
> 
> Like maybe something like this?
> 
> fetch {
>    system “ln -s /path/to/my/source/folder ${worksrcpath}
> }
> 
> If not, what “ln -s” line would be the safest, so as to not somehow trash my source folder?
> 
> Or some parameter that points to the source that might be modified to do that?
> 
> set ${worksrcpath} /path/to/my/sourcecode
> 
> It comes to mind that I can’t possibly be the first person who ever asked for this — is this an existing feature of MacPorts I haven’t used?

I'm not aware of any MacPorts feature to do what you want. Modifying the fetch or extract phases to make symlinks as you suggest may work. I don't know what MacPorts will do when it cleans the port, so test on an unimportant external directory in case MacPorts ends up deleting it. Note that there is no need to use system to call the ln shell command because MacPorts has a built in Tcl ln procedure for making symlinks.



More information about the macports-dev mailing list