I am having trouble getting MacPorts to function properly. I just installed OSX Lion 10.7.3 I downloaded and installed MacPorts first, and then after reading the requirements, I
You should definitely run sudo xcode-select -switch /Applications/Xcode.app
like everyone here says, that'll fix many problems, but certainly not all.
Afaik, all the remaining problems exist within the configuration information for various packages. You might simply reinstall MacPorts as described in the migration instructions, but I found another solution.
You should begin finding all effected port files using commands like grep /Developer/ ...
, after executing sudo bash
and cd /opt/local
naturally.
You should identify all effected ports by using port provides ...
, which I piped through sed
and sort | uniq
. You could simply reinstall all these ports using either port -n upgrade --force ...
or separate port uninstall ...
and port install ...
commands.
I recommend using one large port -n upgrade --force ...
command to avoid duplicate rebuilds of dependencies, using the separate uninstall and install commands afterwards.
There are of course various ports for which /Developer
exists only inside text config files, meaning you can fix them manually with sed -i -e 's/\/Developer//g' ...
, but you cannot do so with binaries obviously.
I'm afraid you must at minimum rebuild all your Python and Perl installations, making this upgrade an ideal time to clean out packages that depend upon older versions, ala python26
and perl5.8
.
There are several technically effected ports I decided against rebuilding like fuse4x-kext
, who contained /Developer
inside Library/Extensions/fuse4x.kext/Contents/MacOS/fuse4x
but hasn't prevented sshfs
from working correctly.
Please see the MacPorts migration instructions for Xcode 4.3.
The instructions are pretty involved. You need to run xcode-select
to set a new tools path, update developer_dir
in macports.conf
(as described by Henk Poley), re-install MacPorts (ouch), and finally uninstall and re-install all of your ports (double ouch).
Edit: libpvx
still wouldn't install after the above. Two extra steps were required:
sudo ln -s /Developer /
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /SDKs
YMMV if you have different ports installed!
Also in /opt/local/etc/macports/macports.conf
change the line with developer_dir
to point to /
instead of /Developer
.
Everything will start working fine after installation of "Command Line Tools for Xcode" package. You can get it from here: https://developer.apple.com/downloads/index.action#
In theory this should work if you have Xcode4.3 installed (in /Applications):
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
(And you've installed the optional command line tools)