Fix macOS CI (#597)

* ci(macos): fix attempt #1

* Revert "ci(macos): fix attempt #1"

This reverts commit b846490136973872ac3b724637cef303e3255083.

* ci(macos): provide QTDIR when building OBS

* Revert "ci(macos): provide QTDIR when building OBS"

This reverts commit 74a882fcf4b9e502b1125508d796b29b69ec0e73.

* ci(macos): use local qt formula

* ci(macos): update qt.rb
This commit is contained in:
Stéphane Lepin 2020-09-30 12:19:37 +02:00 committed by GitHub
parent f61f45fa23
commit ae4ee0332c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 123 additions and 146 deletions

View File

@ -35,13 +35,8 @@ done
# qtwebsockets deps # qtwebsockets deps
echo "[obs-websocket] Installing obs-websocket dependency 'QT 5.10.1'.." echo "[obs-websocket] Installing obs-websocket dependency 'QT 5.10.1'.."
# =!= NOTICE =!=
# When building QT5 from sources on macOS 10.13+, use local qt5 formula:
# brew install ./CI/macos/qt.rb
# Pouring from the bottle is much quicker though, so use bottle for now.
# =!= NOTICE =!=
brew install https://gist.githubusercontent.com/DDRBoxman/b3956fab6073335a4bf151db0dcbd4ad/raw/ed1342a8a86793ea8c10d8b4d712a654da121ace/qt.rb brew install ./CI/macos/qt.rb
# Pin this version of QT5 to avoid `brew upgrade` # Pin this version of QT5 to avoid `brew upgrade`
# upgrading it to incompatible version # upgrading it to incompatible version

View File

@ -3,10 +3,10 @@
class Qt < Formula class Qt < Formula
desc "Cross-platform application and UI framework" desc "Cross-platform application and UI framework"
homepage "https://www.qt.io/" homepage "https://www.qt.io/"
url "https://download.qt.io/archive/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" url "https://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
mirror "https://mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
sha256 "05ffba7b811b854ed558abf2be2ddbd3bb6ddd0b60ea4b5da75d277ac15e740a" sha256 "05ffba7b811b854ed558abf2be2ddbd3bb6ddd0b60ea4b5da75d277ac15e740a"
head "https://code.qt.io/qt/qt5.git", :branch => "5.10.1", :shallow => false head "https://code.qt.io/qt/qt5.git", :branch => "5.10", :shallow => false
bottle do bottle do
sha256 "8b4bad005596a5f8790150fe455db998ac2406f4e0f04140d6656205d844d266" => :high_sierra sha256 "8b4bad005596a5f8790150fe455db998ac2406f4e0f04140d6656205d844d266" => :high_sierra
@ -18,17 +18,16 @@ class Qt < Formula
option "with-docs", "Build documentation" option "with-docs", "Build documentation"
option "with-examples", "Build examples" option "with-examples", "Build examples"
option "without-proprietary-codecs", "Don't build with proprietary codecs (e.g. mp3)"
deprecated_option "with-mysql" => "with-mysql-client"
# OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference # OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference
# configuration and thus untested in practice. Builds on OS X 10.7 have been # configuration and thus untested in practice. Builds on OS X 10.7 have been
# reported to fail: <https://github.com/Homebrew/homebrew/issues/45284>. # reported to fail: <https://github.com/Homebrew/homebrew/issues/45284>.
depends_on :macos => :mountain_lion # depends_on :macos => :mountain_lion
depends_on "pkg-config" => :build depends_on "pkg-config" => :build
depends_on :xcode => :build depends_on :xcode => :build
depends_on "mysql-client" => :optional depends_on "mysql" => :optional
depends_on "postgresql" => :optional depends_on "postgresql" => :optional
# Restore `.pc` files for framework-based build of Qt 5 on OS X. This # Restore `.pc` files for framework-based build of Qt 5 on OS X. This
@ -44,23 +43,6 @@ class Qt < Formula
sha256 "48ff18be2f4050de7288bddbae7f47e949512ac4bcd126c2f504be2ac701158b" sha256 "48ff18be2f4050de7288bddbae7f47e949512ac4bcd126c2f504be2ac701158b"
end end
# Fix compile error on macOS 10.13 around QFixed:
# https://github.com/Homebrew/homebrew-core/issues/27095
# https://bugreports.qt.io/browse/QTBUG-67545
patch do
url "https://raw.githubusercontent.com/z00m1n/formula-patches/0de0e229/qt/QTBUG-67545.patch"
sha256 "4a115097c7582c7dce4207f5500d13feb8c990eb8a05a43f41953985976ebe6c"
end
# Fix compile error on macOS 10.13 caused by qtlocation dependency
# mapbox-gl-native using Boost 1.62.0 does not build with C++ 17:
# https://github.com/Homebrew/homebrew-core/issues/27095
# https://bugreports.qt.io/browse/QTBUG-67810
patch do
url "https://raw.githubusercontent.com/z00m1n/formula-patches/a1a1f0dd/qt/QTBUG-67810.patch"
sha256 "8ee0bf71df1043f08ebae3aa35036be29c4d9ebff8a27e3b0411a6bd635e9382"
end
def install def install
args = %W[ args = %W[
-verbose -verbose
@ -76,12 +58,11 @@ class Qt < Formula
-no-rpath -no-rpath
-pkg-config -pkg-config
-dbus-runtime -dbus-runtime
-no-assimp
] ]
args << "-nomake" << "examples" if build.without? "examples" args << "-nomake" << "examples" if build.without? "examples"
if build.with? "mysql-client" if build.with? "mysql"
args << "-plugin-sql-mysql" args << "-plugin-sql-mysql"
(buildpath/"brew_shim/mysql_config").write <<~EOS (buildpath/"brew_shim/mysql_config").write <<~EOS
#!/bin/sh #!/bin/sh
@ -96,6 +77,7 @@ class Qt < Formula
end end
args << "-plugin-sql-psql" if build.with? "postgresql" args << "-plugin-sql-psql" if build.with? "postgresql"
args << "-proprietary-codecs" if build.with? "proprietary-codecs"
system "./configure", *args system "./configure", *args
system "make" system "make"