pyqt: migrate to boneyard (#6817)

* pyqt: migrate to boneyard

* gnuradio: remove pyqt, build docs by default.
master
Mike McQuaid 2016-11-17 16:35:37 +00:00 committed by GitHub
parent a835e10ea0
commit 2a6d326a61
3 changed files with 4 additions and 121 deletions

View File

@ -12,17 +12,6 @@ class Gnuradio < Formula
sha256 "41eb9fdae72761b7a83f284f1e7613da9e3ce916e0f98f20ad3aafe417be5a4e" => :yosemite
end
# These python extension modules were linked directly to a Python
# framework binary.
# Replace -lpython with -undefined dynamic_lookup in linker flags.
# https://github.com/gnuradio/gnuradio/pull/604
patch do
url "https://github.com/gnuradio/gnuradio/pull/604.patch"
sha256 "9e1c612f0f4063d387d85517cc420f050f49c7903d36fab45b72e8d828549e3c"
end
option "with-python", "Build with python support"
option "with-documentation", "Build with documentation"
option :universal
depends_on "pkg-config" => :build
@ -34,19 +23,9 @@ class Gnuradio < Formula
depends_on "gsl"
depends_on "zeromq"
if build.with? "python"
depends_on "swig" => :build
depends_on "pygtk"
depends_on "wxpython"
depends_on "qt"
depends_on "qwt"
depends_on "pyqt"
end
if build.with? "documentation"
depends_on "doxygen" => :build
depends_on "sphinx-doc" => :build
end
# For documentation
depends_on "doxygen" => :build
depends_on "sphinx-doc" => :build
depends_on "uhd" => :recommended
depends_on "sdl" => :recommended
@ -140,7 +119,6 @@ class Gnuradio < Formula
enabled_components << "gr-wavelet"
enabled_components << "gr-video-sdl" if build.with? "sdl"
enabled_components << "gr-uhd" if build.with? "uhd"
enabled_components += %w[python gr-ctrlport grc gr-utils gr-qtgui gr-wxgui] if build.with? "python"
enabled_components += %w[doxygen sphinx] if build.with? "documentation"
enabled_components.each do |c|

View File

@ -1,96 +0,0 @@
class Pyqt < Formula
desc "Python bindings for Qt"
homepage "https://www.riverbankcomputing.com/software/pyqt/intro"
url "https://downloads.sf.net/project/pyqt/PyQt4/PyQt-4.11.4/PyQt-mac-gpl-4.11.4.tar.gz"
sha256 "f178ba12a814191df8e9f87fb95c11084a0addc827604f1a18a82944225ed918"
bottle do
rebuild 1
sha256 "6b388201f123ab3c390e08f4ff1c97e6c3ae7e4c8644fb86a2775a82bc812c19" => :el_capitan
sha256 "3e2e252c58bcf2692d948cfee0273f8aaf052c4d1084acbbad7ba44a43619aee" => :yosemite
sha256 "7fa85daa46dc9639ad1a5ce930cac1d06c722528b3caad466044b22221b2253d" => :mavericks
end
option "without-python", "Build without python 2 support"
depends_on :python3 => :optional
if build.without?("python3") && build.without?("python")
odie "pyqt: --with-python3 must be specified when using --without-python"
end
depends_on "qt"
if build.with? "python3"
depends_on "sip" => "with-python3"
else
depends_on "sip"
end
def install
# On Mavericks we want to target libc++, this requires a non default qt makespec
if ENV.compiler == :clang && MacOS.version >= :mavericks
ENV.append "QMAKESPEC", "unsupported/macx-clang-libc++"
end
Language::Python.each_python(build) do |python, version|
ENV.append_path "PYTHONPATH", "#{Formula["sip"].opt_lib}/python#{version}/site-packages"
args = %W[
--confirm-license
--bindir=#{bin}
--destdir=#{lib}/python#{version}/site-packages
--sipdir=#{share}/sip
]
# We need to run "configure.py" so that pyqtconfig.py is generated, which
# is needed by QGIS, PyQWT (and many other PyQt interoperable
# implementations such as the ROS GUI libs). This file is currently needed
# for generating build files appropriate for the qmake spec that was used
# to build Qt. The alternatives provided by configure-ng.py is not
# sufficient to replace pyqtconfig.py yet (see
# https://github.com/qgis/QGIS/pull/1508). Using configure.py is
# deprecated and will be removed with SIP v5, so we do the actual compile
# using the newer configure-ng.py as recommended. In order not to
# interfere with the build using configure-ng.py, we run configure.py in a
# temporary directory and only retain the pyqtconfig.py from that.
require "tmpdir"
dir = Dir.mktmpdir
begin
cp_r(Dir.glob("*"), dir)
cd dir do
system python, "configure.py", *args
inreplace "pyqtconfig.py", Formula["qt"].prefix, Formula["qt"].opt_prefix
(lib/"python#{version}/site-packages/PyQt4").install "pyqtconfig.py"
end
ensure
remove_entry_secure dir
end
# On Mavericks we want to target libc++, this requires a non default qt makespec
if ENV.compiler == :clang && MacOS.version >= :mavericks
args << "--spec" << "unsupported/macx-clang-libc++"
end
system python, "configure-ng.py", *args
system "make"
system "make", "install"
system "make", "clean" # for when building against multiple Pythons
end
end
def caveats
"Phonon support is broken."
end
test do
Pathname("test.py").write <<-EOS.undent
from PyQt4 import QtNetwork
QtNetwork.QNetworkAccessManager().networkAccessible()
EOS
Language::Python.each_python(build) do |python, _version|
system python, "test.py"
end
end
end

View File

@ -244,6 +244,7 @@
"pulse": "homebrew/boneyard",
"pyenv-pip-rehash": "homebrew/boneyard",
"pylucene": "homebrew/boneyard",
"pyqt": "homebrew/boneyard",
"pyqwt": "homebrew/boneyard",
"pyside": "homebrew/boneyard",
"pyside-tools": "homebrew/boneyard",