Xcode INSTALL_PATH and framework paths

Ryan Schmidt ryandesign at macports.org
Thu Jun 13 08:58:54 UTC 2019

On Jun 13, 2019, at 02:01, Aaron Madlon-Kay wrote:

> I am working on a portfile for Sequel Pro (https://sequelpro.com/) and
> am reaching the limits of my understanding of the Xcode build system.
> Sequel Pro contains several framework subprojects, which get built
> along with the main target. If I build the project normally outside of
> MacPorts then the frameworks get built and placed alongside the app,
> but also copied to into the app at Sequel Pro.app/Contents/Frameworks;
> `otool -L` on the main binary shows they are relatively linked as e.g.
> @executable_path/../Frameworks/foo.
> However when I build in MacPorts, INSTALL_PATH is automatically set to
> ${applications_dir}, and this apparently causes the main binary to
> look for the frameworks at e.g. /Applications/MacPorts/foo instead of
> @executable_path/../Frameworks/foo. Thus when I destroot just Sequel
> Pro.app it can no longer find the framework and blows up on launch
> (plus MacPorts correctly detects it as a broken binary).
> What is the correct way to handle this?

You're right about all this. The xcode portgroup mangles INSTALL_PATH, which breaks some the ability of some projects with separate frameworks from tying themselves together properly. I think the xcode portgroup probably should not mangle INSTALL_PATH, but it's how the portgroup currently specifies where things should be installed. Maybe there is a better way for us to do that but I haven't looked into it, and we have to be careful making any changes to the xcode portgroup since it so old and so many ports have been using it for so long and probably relying on what it currently does.

When I ran into this situation, I just forced the portgroup not to set INSTALL_PATH. The portgroup doesn't expose that as a direct option, but ties it to xcode.destroot.type. So I just cleared xcode.destroot.type and handled the destroot phase manually:



P.S: Remember to use email addresses at lists.macports.org, not the older hostname you used which was deprecated in 2016.

More information about the macports-dev mailing list