homebrew-core/Formula/qt.rb

108 lines
3 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Qt < Formula
2012-12-21 11:16:09 +00:00
homepage 'http://qt-project.org/'
2014-04-30 02:15:38 +00:00
url "http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz"
sha1 "ddf9c20ca8309a116e0466c42984238009525da6"
head 'git://gitorious.org/qt/qt.git', :branch => '4.8'
2013-07-16 15:53:29 +00:00
bottle do
2014-05-07 07:46:58 +00:00
revision 5
sha1 "34d66e17aaed4d2067297d4a64482d56f2382339" => :mavericks
sha1 "9ab96caa65e8b707deeb27caaff9ad8b1e906b2c" => :mountain_lion
sha1 "18b1d1a4aa89f92c4b9a9f202a95cc0896e03a9d" => :lion
2013-07-16 15:53:29 +00:00
end
option :universal
option 'with-qt3support', 'Build with deprecated Qt3Support module support'
option 'with-docs', 'Build documentation'
option 'developer', 'Build and link with developer options'
depends_on "d-bus" => :optional
2013-03-02 11:39:20 +00:00
depends_on "mysql" => :optional
def install
2013-08-04 23:50:33 +00:00
ENV.universal_binary if build.universal?
2013-03-02 11:39:20 +00:00
args = ["-prefix", prefix,
"-system-zlib",
"-qt-libtiff", "-qt-libpng", "-qt-libjpeg",
"-confirm-license", "-opensource",
"-nomake", "demos", "-nomake", "examples",
"-cocoa", "-fast", "-release"]
if ENV.compiler == :clang
args << "-platform"
if MacOS.version >= :mavericks
args << "unsupported/macx-clang-libc++"
else
args << "unsupported/macx-clang"
end
end
2013-03-02 11:39:20 +00:00
args << "-plugin-sql-mysql" if build.with? 'mysql'
if build.with? 'd-bus'
2014-02-27 04:33:12 +00:00
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
2013-03-02 11:39:20 +00:00
if build.with? 'qt3support'
args << "-qt3support"
else
args << "-no-qt3support"
end
2013-12-23 18:33:47 +00:00
args << "-nomake" << "docs" if build.without? 'docs'
if MacOS.prefer_64_bit? or build.universal?
args << '-arch' << 'x86_64'
end
if !MacOS.prefer_64_bit? or build.universal?
args << '-arch' << 'x86'
2009-10-12 18:51:17 +00:00
end
args << '-developer-build' if build.include? 'developer'
system "./configure", *args
system "make"
ENV.j1
system "make install"
2009-12-23 14:27:37 +00:00
# what are these anyway?
(bin+'pixeltool.app').rmtree
(bin+'qhelpconverter.app').rmtree
2009-12-23 14:27:37 +00:00
# remove porting file for non-humans
(prefix+'q3porting.xml').unlink if build.without? 'qt3support'
# Some config scripts will only find Qt in a "Frameworks" folder
2014-03-26 03:36:32 +00:00
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.
2014-03-26 03:36:32 +00:00
Pathname.glob("#{lib}/*.framework/Headers") do |path|
include.install_symlink path => path.parent.basename(".framework")
end
2014-03-26 03:36:32 +00:00
Pathname.glob("#{bin}/*.app") { |app| mv app, prefix }
end
2013-03-02 11:39:20 +00:00
test do
system "#{bin}/qmake", '-project'
2012-03-28 23:26:46 +00:00
end
2011-07-26 14:30:15 +00:00
def caveats; <<-EOS.undent
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.
EOS
end
2009-09-12 16:06:43 +00:00
end