[96669] trunk/dports/python/py-pyqt4

michaelld at macports.org michaelld at macports.org
Thu Aug 16 17:51:45 PDT 2012


Revision: 96669
          https://trac.macports.org/changeset/96669
Author:   michaelld at macports.org
Date:     2012-08-16 17:51:45 -0700 (Thu, 16 Aug 2012)
Log Message:
-----------
py-pyqt4:

* fixes ticket #28036 : remove port_v3 files if using Python 2, and port_v2 files if using Python 3;

* fixes ticket #35052 : fix location of Assistant.app;

* fixes ticket #35506 : fix PyQt4 when Qt4 is installed (by MacPorts) as a framework, because MacPorts' Qt4 installs frameworks into a non-standard location (${prefix}/Library/Frameworks).

Modified Paths:
--------------
    trunk/dports/python/py-pyqt4/Portfile
    trunk/dports/python/py-pyqt4/files/patch-configure.py

Added Paths:
-----------
    trunk/dports/python/py-pyqt4/files/patch-fix-qt_apps_dir.diff

Modified: trunk/dports/python/py-pyqt4/Portfile
===================================================================
--- trunk/dports/python/py-pyqt4/Portfile	2012-08-17 00:48:30 UTC (rev 96668)
+++ trunk/dports/python/py-pyqt4/Portfile	2012-08-17 00:51:45 UTC (rev 96669)
@@ -7,6 +7,7 @@
 
 name		py-pyqt4
 version		4.9.1
+revision    1
 python.versions   24 25 26 27 31 32
 categories	python devel
 platforms	macosx
@@ -68,11 +69,26 @@
         }
     }
 
-    # The patch file alters configure.py so that the qtdesigner plugin can link.
-    # - it ensures that both LFLAGS are included and that the relevant version framework is linked
+    # The patch file alters configure.py so that the qtdesigner plugin
+    # can link.  It ensures that both LFLAGS are included and that the
+    # relevant version framework is linked.  It also adds a
+    # "framework" directory concept to make the split in qt4-mac as of
+    # 4.8.0, and uses it where appropriate.
+
     patchfiles	patch-configure.py
+
+    # fix location of MacPorts'-installed Qt .apps, step 1
+
+    patchfiles-append patch-fix-qt_apps_dir.diff
+
     post-patch {
         reinplace "s|@@MACPORTS_PYTHON_FRAMEWORK@@|${frameworks_dir}/Python.framework/Versions/${python.branch}/Python|" ${worksrcpath}/configure.py
+
+    # fix location of MacPorts'-installed Qt .apps, step 2
+
+        reinplace "s|@QT_APPS_DIR@|${qt_apps_dir}|" \
+            ${worksrcpath}/examples/demos/qtdemo/menumanager.py \
+            examples/designer/plugins/plugins.py
     }
 
     use_configure yes
@@ -172,6 +188,13 @@
             move ${destroot}${qt_data_dir}/qsci/api/python/PyQt4.api \
                 ${destroot}${qt_data_dir}/qsci/api/python/PyQt4-Python${python.branch}.api
         }
+
+        # delete python3 code from python2 installs and vice versa
+        if {${python.version} >= 30} {
+            delete ${destroot}${python.pkgd}/PyQt4/uic/port_v2
+        } else {
+            delete ${destroot}${python.pkgd}/PyQt4/uic/port_v3
+        }
     }
 
     variant debug description "Build debug libraries" {

Modified: trunk/dports/python/py-pyqt4/files/patch-configure.py
===================================================================
--- trunk/dports/python/py-pyqt4/files/patch-configure.py	2012-08-17 00:48:30 UTC (rev 96668)
+++ trunk/dports/python/py-pyqt4/files/patch-configure.py	2012-08-17 00:51:45 UTC (rev 96669)
@@ -1,6 +1,14 @@
---- configure.py.orig	2011-05-03 09:10:13.000000000 -0600
-+++ configure.py	2011-05-03 09:10:47.000000000 -0600
-@@ -949,7 +949,7 @@
+--- configure.py.orig	2012-02-10 05:45:41.000000000 -0500
++++ configure.py	2012-08-16 15:34:24.000000000 -0400
+@@ -44,6 +44,7 @@
+ qt_dir = None
+ qt_incdir = None
+ qt_libdir = None
++qt_frameworkdir = None
+ qt_bindir = None
+ qt_datadir = None
+ qt_pluginsdir = None
+@@ -966,7 +967,7 @@
                  if sys.platform == "darwin":
                      # We need to work out how to specify the right framework
                      # version.
@@ -9,3 +17,105 @@
                  elif "--enable-shared" in ducfg.get("CONFIG_ARGS", ""):
                      if glob.glob("%s/lib/libpython%d.%d*" % (ducfg["exec_prefix"], py_major, py_minor)):
                          lib_dir_flag = quote("-L%s/lib" % ducfg["exec_prefix"])
+@@ -1075,7 +1076,11 @@
+ 
+     sipconfig.inform("SIP %s is being used." % sipcfg.sip_version_str)
+     sipconfig.inform("The Qt header files are in %s." % qt_incdir)
+-    sipconfig.inform("The %s Qt libraries are in %s." % (lib_type, qt_libdir))
++
++    if sys.platform == "darwin" and qt_framework:
++        sipconfig.inform("The %s Qt frameworks are in %s." % (lib_type, qt_frameworkdir))
++    else:
++        sipconfig.inform("The %s Qt libraries are in %s." % (lib_type, qt_libdir))
+     sipconfig.inform("The Qt binaries are in %s." % qt_bindir)
+     sipconfig.inform("The Qt mkspecs directory is in %s." % qt_datadir)
+     sipconfig.inform("These PyQt modules will be built: %s." % ", ".join(pyqt_modules))
+@@ -1133,7 +1138,8 @@
+         "qt_dir":             qt_dir,
+         "qt_data_dir":        qt_datadir,
+         "qt_inc_dir":         qt_incdir,
+-        "qt_lib_dir":         qt_libdir
++        "qt_lib_dir":         qt_libdir,
++        "qt_framework_dir":   qt_frameworkdir
+     }
+ 
+     sipconfig.create_config_module(module, template, content, macros)
+@@ -1871,11 +1877,13 @@
+     names = list(sipcfg.build_macros().keys())
+     names.append("INCDIR_QT")
+     names.append("LIBDIR_QT")
++    names.append("FRAMEWORKDIR_QT")
+     names.append("MOC")
+ 
+     properties = {
+         "QT_INSTALL_BINS":      qt_bindir,
+         "QT_INSTALL_HEADERS":   qt_incdir,
++        "QT_INSTALL_FRAMEWORKS": qt_frameworkdir,
+         "QT_INSTALL_LIBS":      qt_libdir
+     }
+ 
+@@ -1902,7 +1910,7 @@
+ 
+     # Work out how Qt was built on MacOS.
+     if sys.platform == "darwin":
+-        if os.access(os.path.join(qt_libdir, "QtCore.framework"), os.F_OK):
++        if os.access(os.path.join(qt_frameworkdir, "QtCore.framework"), os.F_OK):
+             global qt_framework
+             qt_framework = 1
+ 
+@@ -1919,6 +1927,7 @@
+     sipcfg.qt_threaded = 1
+     sipcfg.qt_dir = qt_dir
+     sipcfg.qt_lib_dir = qt_libdir
++    sipcfg.qt_framework_dir = qt_frameworkdir
+ 
+     return ConfigurePyQt4(generator)
+ 
+@@ -1934,7 +1943,7 @@
+ 
+ 
+ def get_qt_configuration():
+-    """Set the qt_dir, qt_incdir, qt_libdir, qt_bindir, qt_datadir,
++    """Set the qt_dir, qt_incdir, qt_libdir, qt_frameworkdir, qt_bindir, qt_datadir,
+     qt_pluginsdir and qt_xfeatures globals for the Qt installation.
+     """
+     sipconfig.inform("Determining the layout of your Qt installation...")
+@@ -1999,6 +2008,7 @@
+     out << QLibraryInfo::location(QLibraryInfo::PrefixPath) << '\\n';
+     out << QLibraryInfo::location(QLibraryInfo::HeadersPath) << '\\n';
+     out << QLibraryInfo::location(QLibraryInfo::LibrariesPath) << '\\n';
++    out << QLibraryInfo::location(QLibraryInfo::FrameworksPath) << '\\n';
+     out << QLibraryInfo::location(QLibraryInfo::BinariesPath) << '\\n';
+     out << QLibraryInfo::location(QLibraryInfo::DataPath) << '\\n';
+     out << QLibraryInfo::location(QLibraryInfo::PluginsPath) << '\\n';
+@@ -2117,20 +2127,21 @@
+     lines = f.read().strip().split("\n")
+     f.close()
+ 
+-    global qt_dir, qt_incdir, qt_libdir, qt_bindir, qt_datadir, qt_pluginsdir
++    global qt_dir, qt_incdir, qt_libdir, qt_frameworkdir, qt_bindir, qt_datadir, qt_pluginsdir
+     global qt_version, qt_edition, qt_licensee, qt_shared, qt_xfeatures
+ 
+     qt_dir = lines[0]
+     qt_incdir = lines[1]
+     qt_libdir = lines[2]
+-    qt_bindir = lines[3]
+-    qt_datadir = lines[4]
+-    qt_pluginsdir = lines[5]
+-    qt_version = lines[6]
+-    qt_edition = lines[7]
+-    qt_licensee = lines[8]
+-    qt_shared = lines[9]
+-    qt_xfeatures = lines[10:]
++    qt_frameworkdir = lines[3]
++    qt_bindir = lines[4]
++    qt_datadir = lines[5]
++    qt_pluginsdir = lines[6]
++    qt_version = lines[7]
++    qt_edition = lines[8]
++    qt_licensee = lines[9]
++    qt_shared = lines[10]
++    qt_xfeatures = lines[11:]
+ 
+     if opts.assume_shared:
+         qt_shared = "shared"

Added: trunk/dports/python/py-pyqt4/files/patch-fix-qt_apps_dir.diff
===================================================================
--- trunk/dports/python/py-pyqt4/files/patch-fix-qt_apps_dir.diff	                        (rev 0)
+++ trunk/dports/python/py-pyqt4/files/patch-fix-qt_apps_dir.diff	2012-08-17 00:51:45 UTC (rev 96669)
@@ -0,0 +1,22 @@
+--- examples/demos/qtdemo/menumanager.py.orig	2012-08-14 09:39:23.000000000 -0400
++++ examples/demos/qtdemo/menumanager.py	2012-08-14 09:40:38.000000000 -0400
+@@ -318,7 +318,7 @@
+             app = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.BinariesPath) + QtCore.QDir.separator()
+ 
+             if sys.platform == 'darwin':
+-                app += 'Assistant.app/Contents/MacOS/Assistant'
++                app = '@QT_APPS_DIR@/Assistant.app/Contents/MacOS/Assistant'
+             else:
+                 app += 'assistant'
+ 
+--- examples/designer/plugins/plugins.py.orig	2012-08-14 09:39:32.000000000 -0400
++++ examples/designer/plugins/plugins.py	2012-08-14 09:40:44.000000000 -0400
+@@ -75,7 +75,7 @@
+ designer_bin = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.BinariesPath)
+ 
+ if sys.platform == 'darwin':
+-    designer_bin += '/Designer.app/Contents/MacOS/Designer'
++    designer_bin = '@QT_APPS_DIR@/Designer.app/Contents/MacOS/Designer'
+ else:
+     designer_bin += '/designer'
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120816/a34201a7/attachment-0001.html>


More information about the macports-changes mailing list