homebrew-core/Formula/pyqt.rb
2018-03-05 02:13:04 -08:00

66 lines
2.3 KiB
Ruby

class Pyqt < Formula
desc "Python bindings for v5 of Qt"
homepage "https://www.riverbankcomputing.com/software/pyqt/download5"
url "https://dl.bintray.com/homebrew/mirror/pyqt-5.10.1.tar.gz"
mirror "https://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-5.10.1/PyQt5_gpl-5.10.1.tar.gz"
sha256 "9932e971e825ece4ea08f84ad95017837fa8f3f29c6b0496985fa1093661e9ef"
bottle do
sha256 "cd346b8e55439c8492c3d62547663afe68ffe722eae98f79bc7dbc01af9b088c" => :high_sierra
sha256 "133864e1f65eac84555cfb21bc7108bc92c0e7d375f5094ad2d8d30080c8f388" => :sierra
sha256 "7befa5819255a5048171f493fbcb4fa62e19cd2f2d97b5e10388dcd4151eb069" => :el_capitan
end
option "with-debug", "Build with debug symbols"
option "with-docs", "Install HTML documentation and python examples"
deprecated_option "enable-debug" => "with-debug"
depends_on "qt"
depends_on "sip"
depends_on "python" => :recommended
depends_on "python@2" => :recommended
def install
Language::Python.each_python(build) do |python, version|
args = ["--confirm-license",
"--bindir=#{bin}",
"--destdir=#{lib}/python#{version}/site-packages",
"--stubsdir=#{lib}/python#{version}/site-packages/PyQt5",
"--sipdir=#{share}/sip/Qt5",
# sip.h could not be found automatically
"--sip-incdir=#{Formula["sip"].opt_include}",
"--qmake=#{Formula["qt"].bin}/qmake",
# Force deployment target to avoid libc++ issues
"QMAKE_MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}",
"--qml-plugindir=#{pkgshare}/plugins",
"--verbose"]
args << "--debug" if build.with? "debug"
system python, "configure.py", *args
system "make"
system "make", "install"
system "make", "clean"
end
doc.install "doc/html", "examples" if build.with? "docs"
end
test do
system "#{bin}/pyuic5", "--version"
system "#{bin}/pylupdate5", "-version"
Language::Python.each_python(build) do |python, _version|
system python, "-c", "import PyQt5"
%w[
Gui
Location
Multimedia
Network
Quick
Svg
WebEngineWidgets
Widgets
Xml
].each { |mod| system python, "-c", "import PyQt5.Qt#{mod}" }
end
end
end