This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
forked from PX4/homebrew-px4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qt54.rb
129 lines (102 loc) · 4.23 KB
/
qt54.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
class OracleHomeVarRequirement < Requirement
fatal true
satisfy(:build_env => false) { ENV["ORACLE_HOME"] }
def message; <<-EOS.undent
To use --with-oci you have to set the ORACLE_HOME environment variable.
Check Oracle Instant Client documentation for more information.
EOS
end
end
class Qt54 < Formula
desc "Version 5 of the Qt framework"
homepage "https://www.qt.io/"
url "https://download.qt.io/official_releases/qt/5.4/5.4.2/single/qt-everywhere-opensource-src-5.4.2.tar.xz"
mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.4/5.4.2/single/qt-everywhere-opensource-src-5.4.2.tar.xz"
sha256 "8c6d070613b721452f8cffdea6bddc82ce4f32f96703e3af02abb91a59f1ea25"
bottle do
root_url "https://github.com/PX4/homebrew-px4/releases/download/v1.0.0/"
revision 1
sha256 "d2299857a7c3f71a87df86ab12e4f621874e3e2474324abfe90087c7192d66ad" => :yosemite
end
head "https://code.qt.io/qt/qt5.git", :branch => "5.4", :shallow => false
keg_only "Qt 5 conflicts Qt 4 (which is currently much more widely used)."
option :universal
option "with-docs", "Build documentation"
option "with-examples", "Build examples"
option "with-developer", "Build and link with developer options"
option "with-oci", "Build with Oracle OCI plugin"
deprecated_option "developer" => "with-developer"
deprecated_option "qtdbus" => "with-d-bus"
# Snow Leopard is untested and support has been removed in 5.4
# https://qt.gitorious.org/qt/qtbase/commit/5be81925d7be19dd0f1022c3cfaa9c88624b1f08
depends_on :macos => :lion
depends_on "pkg-config" => :build
depends_on "d-bus" => :optional
depends_on :mysql => :optional
depends_on :xcode => :build
# There needs to be an OpenSSL dep here ideally, but qt keeps ignoring it.
# Keep nagging upstream for a fix to this problem, and revision when possible.
# https://github.com/Homebrew/homebrew/pull/34929
# https://bugreports.qt.io/browse/QTBUG-42161
# https://bugreports.qt.io/browse/QTBUG-43456
depends_on OracleHomeVarRequirement if build.with? "oci"
def install
ENV.universal_binary if build.universal?
args = ["-prefix", prefix,
"-system-zlib",
"-qt-libpng", "-qt-libjpeg",
"-confirm-license", "-opensource",
"-nomake", "tests", "-release"]
args << "-nomake" << "examples" if build.without? "examples"
args << "-plugin-sql-mysql" if build.with? "mysql"
if build.with? "d-bus"
dbus_opt = Formula["d-bus"].opt_prefix
args << "-I#{dbus_opt}/lib/dbus-1.0/include"
args << "-I#{dbus_opt}/include/dbus-1.0"
args << "-L#{dbus_opt}/lib"
args << "-ldbus-1"
args << "-dbus-linked"
end
if MacOS.prefer_64_bit? || build.universal?
args << "-arch" << "x86_64"
end
if !MacOS.prefer_64_bit? || build.universal?
args << "-arch" << "x86"
end
if build.with? "oci"
args << "-I#{ENV["ORACLE_HOME"]}/sdk/include"
args << "-L#{ENV["ORACLE_HOME"]}"
args << "-plugin-sql-oci"
end
args << "-developer-build" if build.with? "developer"
system "./configure", *args
system "make"
ENV.j1
system "make", "install"
if build.with? "docs"
system "make", "docs"
system "make", "install_docs"
end
# Some config scripts will only find Qt in a "Frameworks" folder
frameworks.install_symlink Dir["#{lib}/*.framework"]
# The pkg-config files installed suggest that headers can be found in the
# `include` directory. Make this so by creating symlinks from `include` to
# the Frameworks' Headers folders.
Pathname.glob("#{lib}/*.framework/Headers") do |path|
include.install_symlink path => path.parent.basename(".framework")
end
# configure saved PKG_CONFIG_LIBDIR set up by superenv; remove it
# see: https://github.com/Homebrew/homebrew/issues/27184
inreplace prefix/"mkspecs/qconfig.pri", /\n\n# pkgconfig/, ""
inreplace prefix/"mkspecs/qconfig.pri", /\nPKG_CONFIG_.*=.*$/, ""
Pathname.glob("#{bin}/*.app") { |app| mv app, prefix }
end
test do
system "#{bin}/qmake", "-project"
end
def caveats; <<-EOS.undent
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.
EOS
end
end