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 5.6.2 #5843

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 16 additions & 34 deletions Formula/qt5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ def message; <<-EOS.undent
class Qt5 < Formula
desc "Version 5 of the Qt framework"
homepage "https://www.qt.io/"
url "https://download.qt.io/official_releases/qt/5.6/5.6.1-1/single/qt-everywhere-opensource-src-5.6.1-1.tar.xz"
mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.6/5.6.1-1/single/qt-everywhere-opensource-src-5.6.1-1.tar.xz"
sha256 "ce08a7eb54661705f55fb283d895a089b267c688fabe017062bd71b9231736db"
url "https://download.qt.io/official_releases/qt/5.6/5.6.2/single/qt-everywhere-opensource-src-5.6.2.tar.xz"
sha256 "83e61bfc78bba230770704e828fa4d23fe3bbfdcfa4a8f5db37ce149731d89b3"

head "https://code.qt.io/qt/qt5.git", :branch => "5.6", :shallow => false

Expand All @@ -27,28 +26,6 @@ class Qt5 < Formula
sha256 "73d33dd2563c39542844c276a7bd43463f2974fde141e7afeb3057168adbe606" => :mavericks
end

# Restore `.pc` files for framework-based build of Qt 5 on OS X. This
# partially reverts <https://codereview.qt-project.org/#/c/140954/> merged
# between the 5.5.1 and 5.6.0 releases. (Remove this as soon as feasible!)
#
# Core formulae known to fail without this patch (as of 2016-03-17):
# * mkvtoolnix (with `--with-qt5` option, silent build failure)
# * poppler (with `--with-qt5` option)
# * wireshark (with `--with-qt5` option)
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/e8fe6567/qt5/restore-pc-files.patch"
sha256 "48ff18be2f4050de7288bddbae7f47e949512ac4bcd126c2f504be2ac701158b"
end

# Fix build error due to missing Mac QtBase widget example targets, detected
# by logic introduced in <https://codereview.qt-project.org/#/c/156610/> and
# corrected in <https://codereview.qt-project.org/#/c/161001/>.
# Should land in either 5.6.2 and/or 5.7.1.
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/6ffd0e250d374193613a51beda8830dda9b67e56/qt5/QTBUG-54110.patch"
sha256 "2cf77b820f46f0c404284882b4a4a97bf005b680062842cdc53e107a821deeda"
end

keg_only "Qt 5 conflicts Qt 4"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think getting rid of this would still be a mistake, FWIW.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DomT4 Can you elaborate a bit more?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it's still going to be very breaking, especially as Homebrew moves stuff from qt to qt5. The Qt ecosystem isn't exactly known for its rapid response to upstream changes. Up to y'all though, I'm no longer around really, just noticed this and thought I'd add the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DomT4 thanks for chiming in. For the formulae mentioned in the comment, the situation currently is

  • wireshark: upstream fixed it
  • mkvtoolnix: upstream provides the configure option --without-qt-pkg-config and then checks the environment variables QT_CFLAGS and QT_LIBS
  • poppler: upstream checks the environment variables POPPLER_QT5_CFLAGS, POPPLER_QT5_LIBS, POPPLER_QT5_TEST_CFLAGS, and POPPLER_QT5_TEST_LIBS as an alternative to pkg-config.

So if the patch is removed, these are the required diffs:

diff --git a/Formula/mkvtoolnix.rb b/Formula/mkvtoolnix.rb
index cd2e296..17ed39d 100644
--- a/Formula/mkvtoolnix.rb
+++ b/Formula/mkvtoolnix.rb
@@ -64,6 +64,10 @@ class Mkvtoolnix < Formula
     if build.with?("qt5")
       qt5 = Formula["qt5"]

+      ENV["QT_CFLAGS"] = "-I#{qt5.opt_include} -I#{qt5.opt_include}/QtNetwork -I#{qt5.opt_include}/QtWidgets -I#{qt5.opt_include}/QtGui -I#{qt5.opt_include}/QtCore"
+      ENV["QT_LIBS"] = "-F#{qt5.opt_lib} -framework QtNetwork -framework QtWidgets -framework QtGui -framework QtCore"
+
+      args << "--without-qt-pkg-config"
       args << "--with-moc=#{qt5.opt_bin}/moc"
       args << "--with-uic=#{qt5.opt_bin}/uic"
       args << "--with-rcc=#{qt5.opt_bin}/rcc"
diff --git a/Formula/poppler.rb b/Formula/poppler.rb
index a405768..f860c15 100644
--- a/Formula/poppler.rb
+++ b/Formula/poppler.rb
@@ -53,6 +53,13 @@ class Poppler < Formula
     ]

     if build.with? "qt5"
+      qt5 = Formula["qt5"]
+
+      ENV["POPPLER_QT5_CFLAGS"] = "-I#{qt5.opt_include} -I#{qt5.opt_include}/QtXml -I#{qt5.opt_include}/QtWidgets -I#{qt5.opt_include}/QtGui -I#{qt5.opt_include}/QtCore"
+      ENV["POPPLER_QT5_LIBS"] = "-F#{qt5.opt_lib} -framework QtXml -framework QtWidgets -framework QtGui -framework QtCore"
+      ENV["POPPLER_QT5_TEST_CFLAGS"] = "-I#{qt5.opt_include} -I#{qt5.opt_include}/QtTest -I#{qt5.opt_include}/QtCore"
+      ENV["POPPLER_QT5_TEST_LIBS"] = "-F#{qt5.opt_lib} -framework QtTest -framework QtCore"
+
       args << "--enable-poppler-qt5"
     else
       args << "--disable-poppler-qt5"

There are probably similar changes that would be needed in other taps too. If upstream is not going to reverse its decision to remove the pkg-config files, it seems at some point we need to bite the bullet and make the requisite changes (and do the corresponding upstream reporting) in formulae that are affected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems at some point we need to bite the bullet and make the requisite changes (and do the corresponding upstream reporting) in formulae that are affected.

Agreed. We should stick to the upstream version wherever possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poppler qt5 option fixed in #5864
mkvtoolnix qt5 option fixed in #5865

option "with-docs", "Build documentation"
Expand All @@ -74,8 +51,20 @@ class Qt5 < Formula

resource "qt-webkit" do
# http://lists.qt-project.org/pipermail/development/2016-March/025358.html
url "https://download.qt.io/community_releases/5.6/5.6.1/qtwebkit-opensource-src-5.6.1.tar.gz"
sha256 "f5ba5afc5846fc755575dd04081a90a9536f920e312f18f6fb1f5a0c33f477b0"
url "https://download.qt.io/community_releases/5.6/5.6.2/qtwebkit-opensource-src-5.6.2.tar.xz"
sha256 "528a6b8b1c5095367b26e8ce4f3a46bb739e2e9913ff4dfc6ef58a04fcd73966"
end

# qtconnectivity bluetooth fix
patch do
url "https://gist.githubusercontent.com/ilovezfs/9d9f17b166b37a68f5f33a1df381675f/raw/5dd9b3ee82d486fc78373ca1e8bd16bbbc1ff84f/gistfile1.txt"
sha256 "41fd73cba0018180015c2be191d63b3c33289f19132c136f482f5c7477620931"
end

# qtwebengine bluetooth fix
patch do
url "https://gist.githubusercontent.com/ilovezfs/eedb11ddbceaaa5eb1f4ffd8baa40c32/raw/f2518f204a459da5f200739ce7553f1a8f151215/gistfile1.txt"
sha256 "218b8682d7e8a3f74618d0bd87e4797e13fc2cbfe49c21a2845e64da3fe8868a"
end

def install
Expand Down Expand Up @@ -159,13 +148,6 @@ def install
end
end

def post_install
# Upstream "configure and mkspecs: Don't try to find xcrun with xcrun"
# https://code.qt.io/cgit/qt/qtbase.git/patch/?id=77a71c32c9d19b87f79b208929e71282e8d8b5d9
inreplace prefix/"mkspecs/features/mac/default_pre.prf",
"xcrun -find xcrun", "xcrun -find xcodebuild"
end

def caveats; <<-EOS.undent
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.
Expand Down