Homebrew-core: qt5 fails to build on macOS 10.11 & 12

Created on 29 Sep 2016  路  20Comments  路  Source: Homebrew/homebrew-core

Please follow the general troubleshooting steps first:

  • [X] Ran brew update and retried your prior step?
  • [X] Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • [X] If you're seeing permission errors tried running sudo chown -R $(whoami) $(brew --prefix)?

After running for approximately 2.5 hours, the build fails with no clear error; just a dump from make. Here is the output of brew gist-logs qt5.

Please do not hesitate to ask for any further details.

Most helpful comment

All 20 comments

As brew doctor tells, please run first:

  • brew link ruby
  • brew install qt5

@retokromer They can鈥檛 run brew install qt5 otherwise this issue wouldn鈥檛 exist :wink:

As long as this is not Ruby related...

Re 10.12, see #4841. @MTCoster Why did you put 10.11 in the issue title? Your logs show you鈥檙e running 10.12.

@retokromer I'm running it again now after brew link --overwrite ruby (didn't work without --overwrite). I'll update you when it finishes/errors out.

@bfontaine I forgot to mention in the OP, but I originally had this problem under 10.11 - it just continued to be an issue after the upgrade to 10.12

@retokromer This time the build finished in 12 minutes, with the same non-error (See the new brew gist-logs qt5 dump).

Thank you, @MTCoster, for the feedback. It worked on my side, therefore...

qt5's build is known to be FUBAR on 10.12 at the moment. I've been working on it, but it hasn't been going entirely well. In an ideal world upstream would cut a new release with that compatibility in place.

@jakepetroules Any idea what the release schedule is on 5.6.2 or 5.7.1? FWIW, as of yesterday none of the tips of the 5.6, 5.7 or dev branches worked for me on Sierra. The most recent 5.7 branch build still has Bluetooth issues: https://gist.github.com/DomT4/0a3d2e9af56b531f6afed1d9df4dd857

Not a solution, but if anyone lands here trying to install Qt5 on macOS Sierra and you just want to get the job done, here's how to do it using the official binaries: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#macos-sierra-1012

@UdjinM6 dear Udjin how can I apply your suggestion in your comment to install gnuplot by using the command brew install gnuplot --with-qt?

@mantrasuser apply patch to qt5, install it, install gnuplot. Worked for me:

brew install gnuplot --with-qt
Warning: gnuplot: --with-qt was deprecated; using --with-qt5 instead!
==> Using the sandbox
==> Downloading https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.0.4/gnuplot-5.0.4.tar.gz
==> Downloading from http://freefr.dl.sourceforge.net/project/gnuplot/gnuplot/5.0.4/gnuplot-5.0.4.tar.gz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/gnuplot/5.0.4_1 --with-readline=/usr/local/opt/readline --disable-wxwidgets --without-cairo --with-qt --with
==> make
==> make install
馃嵑  /usr/local/Cellar/gnuplot/5.0.4_1: 47 files, 2.6M, built in 2 minutes 34 seconds

@UdjinM6 it works like a charm. thank you a lot

it just failed with bluetooth header,
If you check file qtconnectivity/src/bluetooth/osx/corebluetoothwrapper_p.h ,

in this file if QT_OSX_BLUETOOTH is defined then it includes CoreBluetooth/CoreBluetooth.h, if not then it includes IOBluetooth/IOBluetooth.h

the real problem this here, under macOS Sierra, the IOBluetooth header don't have the CBUUID, CBService class.

so the simple solution is add

#import <CoreBluetooth/CoreBluetooth.h>

after

#import <IOBluetooth/IOBluetooth.h>

then the qtconnectivity compiles fine.

this works for qt 5.7, and I think it should also works for qt 5.6 under Sierra

@steve3d Cool, but I cannot find corebluetoothwrapper_p.h to patch it. Neither in /private/tmpnor /usr/local.

here is a simple patch for qt-5.6/5.7 under macOS 10.11/12

diff -ru qt-everywhere-opensource-src-5.7.0.original/qtconnectivity/src/bluetooth/osx/corebluetoothwrapper_p.h qt-everywhere-opensource-src-5.7.0/qtconnectivity/src/bluetooth/osx/corebluetoothwrapper_p.h
--- qt-everywhere-opensource-src-5.7.0.original/qtconnectivity/src/bluetooth/osx/corebluetoothwrapper_p.h   2016-06-08 19:25:53.000000000 +0800
+++ qt-everywhere-opensource-src-5.7.0/qtconnectivity/src/bluetooth/osx/corebluetoothwrapper_p.h    2016-10-05 18:54:03.000000000 +0800
@@ -76,6 +76,7 @@
 #endif

 #import <IOBluetooth/IOBluetooth.h>
+#import <CoreBluetooth/CoreBluetooth.h>

 #ifdef CB_ERROR_WORKAROUND_REQUIRED
 #undef __attribute__
diff -ru qt-everywhere-opensource-src-5.7.0.original/qtwebengine/src/3rdparty/chromium/base/mac/sdk_forward_declarations.h qt-everywhere-opensource-src-5.7.0/qtwebengine/src/3rdparty/chromium/base/mac/sdk_forward_declarations.h
--- qt-everywhere-opensource-src-5.7.0.original/qtwebengine/src/3rdparty/chromium/base/mac/sdk_forward_declarations.h   2016-05-26 21:53:47.000000000 +0800
+++ qt-everywhere-opensource-src-5.7.0/qtwebengine/src/3rdparty/chromium/base/mac/sdk_forward_declarations.h    2016-10-05 18:53:52.000000000 +0800
@@ -15,6 +15,7 @@
 #import <CoreWLAN/CoreWLAN.h>
 #import <ImageCaptureCore/ImageCaptureCore.h>
 #import <IOBluetooth/IOBluetooth.h>
+#import <CoreBluetooth/CoreBluetooth.h>
 #include <stdint.h>

 #include "base/base_export.h"
diff -ru qt-everywhere-opensource-src-5.7.0.original/qtwebengine/src/3rdparty/chromium/printing/backend/print_backend_cups.cc qt-everywhere-opensource-src-5.7.0/qtwebengine/src/3rdparty/chromium/printing/backend/print_backend_cups.cc
--- qt-everywhere-opensource-src-5.7.0.original/qtwebengine/src/3rdparty/chromium/printing/backend/print_backend_cups.cc    2016-05-26 21:53:47.000000000 +0800
+++ qt-everywhere-opensource-src-5.7.0/qtwebengine/src/3rdparty/chromium/printing/backend/print_backend_cups.cc 2016-10-05 18:54:33.000000000 +0800
@@ -18,6 +18,7 @@
 #include "printing/backend/cups_helper.h"
 #include "printing/backend/print_backend_consts.h"
 #include "url/gurl.h"
+#include <cups/ppd.h>

 namespace printing {

@sja , those files will be deleted after brew exit, so you won't find any files to patch, the file is indeed under /tmp/qt-{somedate} when the brew process is running.

and I've found a few more problem related to qt5

  1. when build qt with --with-mysql the mysql_config returned libs which include openssl libs, but there is no -L/usr/local/opt/openssl/lib, so the mysql will always fail.
  2. why build qt to use it's own proxy settings instead of system proxy settings? I think it's easier to use system proxy settings.
  3. I believe the openssl problem with mysql will also exists with --with-postgresql, postgresql will also use openssl.

If you'd like Homebrew to support Qt5:

  1. submit patches to Qt's code review process: https://codereview.qt-project.org/#/q/status:open,n,z
  2. after 1): submit patches to Homebrew to use the patch in our formula
Was this page helpful?
0 / 5 - 0 ratings

Related issues

kiendang picture kiendang  路  3Comments

ghostbar picture ghostbar  路  4Comments

bantl23 picture bantl23  路  3Comments

Thirudhas picture Thirudhas  路  4Comments

jyutzler picture jyutzler  路  4Comments