4

I've hit a wall compiling a fork of phantomjs, following these instructions. I've installed full Xcode from Appstore, and accepted the licence agreement (e.g. sudo xcodebuild -license) which seems to be the issue for other SO questions on this error. But when I try to compile:

My-MBPX:phantomjs username$ python build.py
Password:
----------------------------------------
               WARNING
----------------------------------------

Building PhantomJS from source takes a very long time, anywhere from 30 minutes
to several hours (depending on the machine configuration). It is recommended to
use the premade binary packages on supported operating systems.

For details, please go the the web site: http://phantomjs.org/download.html.

Do you want to continue (Y/n)? Y
Executing in /Users/username/Documents/github/phantomjs: git submodule init
Executing in /Users/username/Documents/github/phantomjs: git submodule update --init
configuring Qt Base, please wait...
Found OpenSSL installed via Brew
Executing in /Users/username/Documents/github/phantomjs/src/qt/qtbase: /Users/username/Documents/github/phantomjs/src/qt/qtbase/configure -static -opensource -confirm-license -prefix /Users/username/Documents/github/phantomjs/src/qt/qtbase -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -nomake examples -nomake tools -nomake tests -no-qml-debug -no-dbus -no-opengl -no-audio-backend -D QT_NO_GRAPHICSVIEW -D QT_NO_GRAPHICSEFFECT -D QT_NO_STYLESHEET -D QT_NO_STYLE_CDE -D QT_NO_STYLE_CLEANLOOKS -D QT_NO_STYLE_MOTIF -D QT_NO_STYLE_PLASTIQUE -D QT_NO_PRINTPREVIEWDIALOG -qpa phantom -openssl -openssl-linked -no-openvg -no-eglfs -no-egl -no-glib -no-gtkstyle -no-cups -no-sm -no-xinerama -no-xkb -no-xcb -no-kms -no-linuxfb -no-directfb -no-mtdev -no-libudev -no-evdev -no-pulseaudio -no-alsa -no-feature-PRINTPREVIEWWIDGET -no-pkg-config -no-c++11 -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib -release

   Xcode not set up properly. You may need to confirm the license
   agreement by running /usr/bin/xcodebuild without arguments.

ERROR: Failed to build PhantomJS! Configuration of Qt Base failed.

Same result using sudo. Then running /usr/bin/xcodebuild as advised returns:

xcodebuild: error: The directory /Users/username/Documents/github/phantomjs does not contain an Xcode project.

I admittedly did have to upgrade Xtools on top of the existing commandline tools version, and change the path manually (sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer), but now correctly report:

xcode-select -p
/Applications/Xcode.app/Contents/Developer

Any advice gratefully received.

geotheory
  • 22,624
  • 29
  • 119
  • 196

1 Answers1

4

This solution appears to have worked:

cd /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s xcodebuild xcrun
geotheory
  • 22,624
  • 29
  • 119
  • 196