Installing MacPorts on MacOS “High Sierra”

Another year, another OS X update. I assume you are here because you downloaded the High Sierra GM from Apple, and were disappointed that there isn't a MacPorts installer yet. While I am sure they will release it soon, perhaps we can get you over the hump so you can beat up High Sierra before the official drop date. If you are comfortable compiling software by hand, we should be able to get thru this easy-peasy.

I am doing this on a clean install of High Sierra. If you are attempting an upgrade from any previous version, your process may vary in unexpected ways. You will want to make sure you've downloaded the latest version of Xcode, and you should probably follow the MacPorts uninstall instructions so you have less cruft around that could interfere with the process. If you have an upgrade issue, please comment here and I'll do my best to help you out and improve the instructions.

This is my first pass at getting it running. I'm going to share all my steps. One or two things I do might be unnecessary, and could be removed later if I refine the process; but I promise I wouldn't have hit the Publish button if the overall process didn't work.

At this point, you should be ready to start reinstalling your ports! Wee!

After manually installing MacPorts with the above instructions I was able to install subversion and wget, which are my usual two first validation tests. Subversion alone has a total of 33 dependencies alone, and combined they have 135 dependent packages; which does a pretty good job of verifying MacPorts is working.

I am running the High Sierra GM candidate and I could not get it working with Xcode 8 (last updated under Sierra).
I had problems with GNUSTEP_SYSTEM_ROOT and finding the foundation framework, although I had the correct paths and files.

I downloaded Xcode Version 9.0 (9A235) from the developer’s website and now it works.

I found two unlisted dependencies that break gcc6, but now I’m hanging on an include not finding stl_relops.h even though it exists in multiple locations. I’ll have to look at this more in depth later.

Hi, I did an upgrade of High Sierra yesterday. I’m now getting a message: Error: Current platform “darwin 17” does not match expected platform “darwin 16” whenever I run the port command. I want to make sure that I keep my previously installed packages. Should I try your method for installing or will this force me to reinstall my packages? I’m not even able to view the ones I previously had installed due to this error message. Thanks for any help.

Apparently, you need Xcode 9 and its command-line tools installed to get past the “GNUSTEP_SYSTEM_ROOT is not defined in your environment” problem/message, when installing MacPorts on MacOS “High Sierra”.

I suspected as much, which was why I asked about your version of xcode. I did get it to install with 8.3.3, but that was with the GM and not the release version so I should probably re-test that. Step 5-2 should have installed the command line tools. Did that not happen for you?