On Feb 17, 2012, at 8:05 AM, James Berry wrote:

> Sounds like there are at least several issues that MacPorts is facing with 
> Xcode, not all of which are new:
> 
>       (1) Make sure the Xcode terms have been accepted
> 
>       (2) Find the proper Xcode is use. We can no longer assume /Developer
> 
>       (3) Ensure the command line tools have been installed. While we use 
> xcrun now to find Xcode compilers, I think we still have a dependency on the 
> command line tools for thinks like the linker… (?) [the xcrun discovery code 
> is not yet in a release MacPorts]
> 
> 
> Some potential solutions to these issues:
> 
>       (1) Likely, we should examine the result from xcodebuild or 
> xcode-select to look for the case where the terms have not be accepted, and 
> ask the user to first run Xcode. I haven't explored this at all.
> 
>       (2) If developer_dir is not set, or is not correct, do the following, 
> in order
> 
>               (a) Use any valid value from: xcode-select -print-path (the 
> user has chosen an Xcode, or Xcode's default is correct)
> 
>               (b) Examine the output from: mdfind "kMDItemCFBundleIdentifier 
> == 'com.apple.dt.Xcode'"
> 
>                       - This may give multiple results if the user has 
> multiple Xcodes installed
>                       - The best solution to multiple results would likely to 
> display those results, and ask the user to run xcode-select to select one.
>                       - Alternatively, we could examine the versions from 
> mdls -name 'kMDItemVersion', and use the most recent version installed

I've basically implemented 2.a and 2.b in r88970-88971, btw. The only caveat 
being that if the user has explicitly set an invalid developer_dir in 
macports.conf, I don't catch or warn about that.

 I'm not working on 1 or 3 at the present time, btw, in case somebody else 
wants to.

James

> 
>       (3) If we do have a dependency on the command line tools package, we 
> could either look for key files we know we need (compilers, linker, etc) or 
> use pkgutil to ensure the package has been installed:
> 
>       pkgutil --pkgs | grep com.apple.pkg.DeveloperToolsCLI, potentially 
> followed by something like pkgutil -pkg-info or -verify
> 
>       (likely it would be easier to just look for some required tools and ask 
> them to install the command line tools)
> 
> 
>       
> 
> _______________________________________________
> macports-dev mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to