2013-07-17 17:32:18 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pyqt5 < Formula
|
2014-09-19 06:16:34 +00:00
|
|
|
homepage "http://www.riverbankcomputing.co.uk/software/pyqt/download5"
|
|
|
|
url "https://downloads.sf.net/project/pyqt/PyQt5/PyQt-5.3.2/PyQt-gpl-5.3.2.tar.gz"
|
|
|
|
sha1 "bb34d826a50b0735d1319dc51be6a094ba64b800"
|
2013-07-17 17:32:18 +00:00
|
|
|
|
|
|
|
option 'enable-debug', "Build with debug symbols"
|
2014-04-21 21:24:05 +00:00
|
|
|
option 'with-docs', "Install HTML documentation and python examples"
|
2013-07-17 17:32:18 +00:00
|
|
|
|
2014-02-07 19:17:14 +00:00
|
|
|
depends_on :python3 => :recommended
|
|
|
|
depends_on :python => :optional
|
|
|
|
|
2014-03-07 18:07:58 +00:00
|
|
|
if build.without?("python3") && build.without?("python")
|
2014-02-10 14:45:44 +00:00
|
|
|
odie "pyqt5: --with-python3 must be specified when using --without-python"
|
2014-02-07 19:17:14 +00:00
|
|
|
end
|
|
|
|
|
2013-07-17 17:32:18 +00:00
|
|
|
depends_on 'qt5'
|
2014-02-07 19:17:14 +00:00
|
|
|
|
|
|
|
if build.with? 'python3'
|
|
|
|
depends_on 'sip' => 'with-python3'
|
|
|
|
else
|
|
|
|
depends_on 'sip'
|
|
|
|
end
|
|
|
|
|
2013-07-17 17:32:18 +00:00
|
|
|
def install
|
2014-10-21 09:18:16 +00:00
|
|
|
# addresses https://github.com/Homebrew/homebrew/issues/32370
|
|
|
|
inreplace "configure.py", "qmake_QT=['webkitwidgets']", "qmake_QT=['webkitwidgets', 'printsupport']"
|
2014-03-07 18:07:58 +00:00
|
|
|
Language::Python.each_python(build) do |python, version|
|
2014-02-07 19:17:14 +00:00
|
|
|
args = [ "--confirm-license",
|
|
|
|
"--bindir=#{bin}",
|
|
|
|
"--destdir=#{lib}/python#{version}/site-packages",
|
2014-02-10 14:45:44 +00:00
|
|
|
# To avoid conflicts with PyQt (for Qt4):
|
2014-02-07 19:17:14 +00:00
|
|
|
"--sipdir=#{share}/sip/Qt5/",
|
|
|
|
# sip.h could not be found automatically
|
2014-03-06 05:28:31 +00:00
|
|
|
"--sip-incdir=#{Formula["sip"].opt_include}",
|
2014-02-28 08:45:18 +00:00
|
|
|
# Make sure the qt5 version of qmake is found.
|
|
|
|
# If qt4 is linked it will pickup that version otherwise.
|
|
|
|
"--qmake=#{Formula["qt5"].bin}/qmake",
|
2014-02-07 19:17:14 +00:00
|
|
|
# Force deployment target to avoid libc++ issues
|
2014-09-19 16:58:16 +00:00
|
|
|
"QMAKE_MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}",
|
|
|
|
"--verbose"]
|
2014-02-07 19:17:14 +00:00
|
|
|
args << '--debug' if build.include? 'enable-debug'
|
|
|
|
|
|
|
|
system python, "configure.py", *args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
2014-03-07 18:07:58 +00:00
|
|
|
system "make", "clean"
|
2014-02-07 19:17:14 +00:00
|
|
|
end
|
2014-04-21 21:24:05 +00:00
|
|
|
doc.install 'doc/html', 'examples' if build.with? "docs"
|
2013-07-17 17:32:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-02-07 19:17:14 +00:00
|
|
|
system "pyuic5", "--version"
|
|
|
|
system "pylupdate5", "-version"
|
2014-03-07 18:07:58 +00:00
|
|
|
Language::Python.each_python(build) do |python, version|
|
2014-02-07 19:17:14 +00:00
|
|
|
system python, "-c", "import PyQt5"
|
|
|
|
end
|
2013-07-17 17:32:18 +00:00
|
|
|
end
|
|
|
|
end
|