diff options
| author | Nikolaus Demmel | 2014-07-15 17:09:26 +0200 |
|---|---|---|
| committer | Mike McQuaid | 2014-08-05 12:55:24 +0100 |
| commit | 91d3c76973c412d15d813f4aa0d5925847eed444 (patch) | |
| tree | 5ad67ced603b51443cf9afb2e62cc574ea343326 /Library/Formula | |
| parent | 1f43cd319b336eb5eaca4a7600b4501f20d5ae70 (diff) | |
| download | homebrew-91d3c76973c412d15d813f4aa0d5925847eed444.tar.bz2 | |
pyqt 4.11.1
- the custom QMAKESPEC hacks for Mavericks seem to not be needed any longer
- creating the `pyconfig.py` file by running `python configure.py` in a
different folder seems to work, but I am not sure if this is actually still
needed, so for now I commented this out. I have sucessfully built and used
PyQWT even without this generated `pyqtconfig.py`. It's use is deprecated
anyway it seems. I don't know if not having it breaks other stuff, which is
why I left the code in the formula for now, albeit commented out.
Closes #30881.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/pyqt.rb | 83 |
1 files changed, 31 insertions, 52 deletions
diff --git a/Library/Formula/pyqt.rb b/Library/Formula/pyqt.rb index 984e8abf3..1fa1dc9fc 100644 --- a/Library/Formula/pyqt.rb +++ b/Library/Formula/pyqt.rb @@ -1,9 +1,9 @@ -require 'formula' +require "formula" class Pyqt < Formula - homepage 'http://www.riverbankcomputing.co.uk/software/pyqt' - url 'https://downloads.sf.net/project/pyqt/PyQt4/PyQt-4.10.4/PyQt-mac-gpl-4.10.4.tar.gz' - sha1 'ef3bb2a05a5c8c3ab7578a0991ef5a4e17c314c0' + homepage "http://www.riverbankcomputing.co.uk/software/pyqt" + url "https://downloads.sf.net/project/pyqt/PyQt4/PyQt-4.11.1/PyQt-mac-gpl-4.11.1.tar.gz" + sha1 "9d7478758957c60ac5007144a0dc7f157f4a5836" depends_on :python => :recommended depends_on :python3 => :optional @@ -20,14 +20,6 @@ class Pyqt < Formula depends_on "sip" end - # On Mavericks we want to target libc++, but this requires a user specified - # qmake makespec. Unfortunately user specified makespecs are broken in the - # configure.py script, so we have to fix the makespec path handling logic. - # Also qmake spec macro parsing does not properly handle inline comments, - # which can result in ignored build flags when they are concatenated together. - # Changes proposed upstream: http://www.riverbankcomputing.com/pipermail/pyqt/2013-December/033537.html - patch :DATA - def install # On Mavericks we want to target libc++, this requires a non default qt makespec if ENV.compiler == :clang and MacOS.version >= :mavericks @@ -35,7 +27,7 @@ class Pyqt < Formula end Language::Python.each_python(build) do |python, version| - ENV.append_path 'PYTHONPATH', HOMEBREW_PREFIX/"opt/sip/lib/python#{version}/site-packages" + ENV.append_path "PYTHONPATH", HOMEBREW_PREFIX/"opt/sip/lib/python#{version}/site-packages" args = ["--confirm-license", "--bindir=#{bin}", @@ -43,25 +35,38 @@ class Pyqt < Formula "--sipdir=#{HOMEBREW_PREFIX}/share/sip"] # We need to run "configure.py" so that pyqtconfig.py is generated, which - # is needed by 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. This method - # is deprecated and will be removed with SIP v5, so we do the actual compile - # using the newer configure-ng.py as recommended. - - inreplace "configure.py", "iteritems", "items" if python == "python3" - system python, "configure.py", *args - (lib/"python#{version}/site-packages/PyQt4").install "pyqtconfig.py" + # 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 + (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 and MacOS.version >= :mavericks args << "--spec" << "unsupported/macx-clang-libc++" end - system python, "./configure-ng.py", *args + system python, "configure-ng.py", *args system "make" system "make", "install" - system "make", "clean" + system "make", "clean" # for when building against multiple Pythons end end @@ -70,7 +75,7 @@ class Pyqt < Formula end test do - Pathname('test.py').write <<-EOS.undent + Pathname("test.py").write <<-EOS.undent import sys from PyQt4 import QtGui, QtCore @@ -81,7 +86,7 @@ class Pyqt < Formula self.setWindowTitle('Homebrew') QtGui.QLabel("Python " + "{0}.{1}.{2}".format(*sys.version_info[0:3]) + " working with PyQt4. Quitting now...", self).move(50, 50) - QtCore.QTimer.singleShot(1500, QtGui.qApp, QtCore.SLOT('quit()')) + QtCore.QTimer.singleShot(1500, QtGui.qApp, QtCore.SLOT("quit()")) app = QtGui.QApplication([]) window = Test() @@ -94,29 +99,3 @@ class Pyqt < Formula end end end -__END__ -diff --git a/configure.py b/configure.py -index a8e5dcd..a5f1474 100644 ---- a/configure.py -+++ b/configure.py -@@ -1886,7 +1886,7 @@ def get_build_macros(overrides): - if "QMAKESPEC" in list(os.environ.keys()): - fname = os.environ["QMAKESPEC"] - -- if not os.path.dirname(fname): -+ if not os.path.dirname(fname) or fname.startswith('unsupported'): - qt_macx_spec = fname - fname = os.path.join(qt_archdatadir, "mkspecs", fname) - elif sys.platform == "darwin": -@@ -1934,6 +1934,11 @@ def get_build_macros(overrides): - if macros is None: - return None - -+ # QMake macros may contain comments on the same line so we need to remove them -+ for macro, value in macros.iteritems(): -+ if "#" in value: -+ macros[macro] = value.split("#", 1)[0] -+ - # Qt5 doesn't seem to support the specific macros so add them if they are - # missing. - if macros.get("INCDIR_QT", "") == "": |
