Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt5 fails to build on macOS 10.11 & 12 #5391

Closed
3 tasks done
MTCoster opened this issue Sep 29, 2016 · 20 comments
Closed
3 tasks done

qt5 fails to build on macOS 10.11 & 12 #5391

MTCoster opened this issue Sep 29, 2016 · 20 comments

Comments

@MTCoster
Copy link
Contributor

Please follow the general troubleshooting steps first:

  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • 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.

@retokromer
Copy link
Contributor

As brew doctor tells, please run first:

  • brew link ruby
  • brew install qt5

@bfontaine
Copy link
Contributor

@retokromer They can’t run brew install qt5 otherwise this issue wouldn’t exist 😉

@retokromer
Copy link
Contributor

As long as this is not Ruby related...

@bfontaine
Copy link
Contributor

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

@MTCoster
Copy link
Contributor Author

@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

@MTCoster
Copy link
Contributor Author

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

@retokromer
Copy link
Contributor

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

@DomT4
Copy link
Member

DomT4 commented Sep 29, 2016

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.

@DomT4
Copy link
Member

DomT4 commented Sep 30, 2016

@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

@jmonteiro
Copy link

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
Copy link

UdjinM6 commented Oct 2, 2016

@MTCoster try this maybe #4841 (comment)

@mantrasuser
Copy link

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

@UdjinM6
Copy link

UdjinM6 commented Oct 2, 2016

@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

@mantrasuser
Copy link

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

@steve3d
Copy link
Contributor

steve3d commented Oct 5, 2016

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

@sja
Copy link

sja commented Oct 5, 2016

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

@steve3d
Copy link
Contributor

steve3d commented Oct 5, 2016

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.

@steve3d
Copy link
Contributor

steve3d commented Oct 5, 2016

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.

@MikeMcQuaid
Copy link
Member

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

@ilovezfs
Copy link
Contributor

Closed via 3c4eff9 and #5843

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests