tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

OSX: No suitable Xcode SDK or Command Line Tools installed [patch/hack]


I've updated XCode on my system running OS X 10.10.5 the other day,
and now pkgsrc tells me:

	promise% make
	ERROR: This package has set PKG_FAIL_REASON:
===> 	ERROR: No suitable Xcode SDK or Command Line Tools installed.
	ERROR: graphviz-2.38.0nb9 requires a working dlopen().
	*** Error code 1

	bmake: stopped in /usr/pkgsrc/graphics/graphviz

Most likely not, at least helloworld.c builds & runs fine.
So, digging deeper apparently latest XCode thinks it's 10.11 time,
and thus (in pkgsrc/mk/pkatform/ OSX_VERS gets set wrong,
then the SDK version is of course wrong, and then no proper headers can be found, etc.

Digging deeper (see below), I whipped the attached patch together.

Any comments? Improvements (I'm sure there are many)?

 - Hubert

promise% sw_vers -productVersion

promise% xcodebuild -showsdks
        OS X 10.11                      -sdk macosx10.11

        iOS 9.1                         -sdk iphoneos9.1

iOS Simulator SDKs:
        Simulator - iOS 9.1             -sdk iphonesimulator9.1

tvOS SDKs:
        tvOS 9.0                        -sdk appletvos9.0

tvOS Simulator SDKs:
        Simulator - tvOS 9.0            -sdk appletvsimulator9.0

watchOS SDKs:
        watchOS 2.0                     -sdk watchos2.0

watchOS Simulator SDKs:
        Simulator - watchOS 2.0         -sdk watchsimulator2.0

promise% /usr/bin/xcrun --sdk macosx10.10 --show-sdk-path
xcodebuild: error: SDK "macosx10.10" cannot be located.
xcodebuild: error: SDK "macosx10.10" cannot be located.
xcrun: error: unable to lookup item 'Path' in SDK 'macosx10.10'

promise% /usr/bin/xcrun --sdk macosx10.11 --show-sdk-path

promise% uname -a
Darwin promise.local 14.5.0 Darwin Kernel Version 14.5.0: Tue Sep 1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64

Index: mk/platform/
RCS file: /cvsroot/pkgsrc/mk/platform/,v
retrieving revision 1.74
diff -u -r1.74
--- mk/platform/	10 Oct 2015 13:12:50 -0000	1.74
+++ mk/platform/	26 Nov 2015 18:35:12 -0000
@@ -95,6 +95,10 @@
 .  endif
 OSX_SDK_PATH!=	/usr/bin/xcrun --sdk macosx${OSX_VERS} --show-sdk-path 2>/dev/null || echo /nonexistent
+.  if !empty(OSX_SDK_PATH:M/nonexistent)
+OSX_VERS!=	/usr/bin/xcodebuild -showsdks | grep '.*-sdk macosx' | sed 's,.*macosx,,'
+OSX_SDK_PATH!=	/usr/bin/xcrun --sdk macosx${OSX_VERS} --show-sdk-path 2>/dev/null || echo /nonexistent
+.  endif
 .  if exists(${OSX_SDK_PATH}/usr/include/stdio.h)

Home | Main Index | Thread Index | Old Index