[86452] users/eborisch/python/py-pyqt4/Portfile

eborisch at macports.org eborisch at macports.org
Tue Oct 25 18:56:41 PDT 2011


Revision: 86452
          http://trac.macports.org/changeset/86452
Author:   eborisch at macports.org
Date:     2011-10-25 18:56:39 -0700 (Tue, 25 Oct 2011)
Log Message:
-----------
py-pyqt4: (sandboxed) Attempt at unified portfile

Modified Paths:
--------------
    users/eborisch/python/py-pyqt4/Portfile

Modified: users/eborisch/python/py-pyqt4/Portfile
===================================================================
--- users/eborisch/python/py-pyqt4/Portfile	2011-10-26 01:29:24 UTC (rev 86451)
+++ users/eborisch/python/py-pyqt4/Portfile	2011-10-26 01:56:39 UTC (rev 86452)
@@ -3,9 +3,11 @@
 
 PortSystem	1.0
 PortGroup   qt4 1.0
+PortGroup   python 1.0
 
-name		py27-pyqt4
-version		4.8.4
+name		py-pyqt4
+version		4.8.5
+python.versions   24 25 26 27 31
 categories	python devel
 platforms	macosx
 maintainers     michaelld openmaintainer
@@ -22,22 +24,53 @@
 distname	PyQt-mac-gpl-${version}
 dist_subdir         python
 
-checksums           md5     c9114258f494cafa87fc2740364fa7f4 \
-                    sha1    7fbd01603cb1b203abad6331594d1c4b7a395920 \
-                    rmd160  96d7076162ae6b4b0518f91108572558268e529c
+checksums           md5     a085fdd5052d22a76e09f14943e8b988 \
+                    sha1    8a1152d4344212153b7c0140bc902077fb2171fe \
+                    rmd160  0e22ea863e5bd81df4ae81f839b8cd4fed2958dd
 
-set pyversion 2.7
-set pyversion_join [join [split ${pyversion} "."] ""]
+if {$subport != $name} {
 
-depends_lib-append port:py${pyversion_join}-sip
+depends_lib-append port:py${python.version}-sip
 
+configure.args-append   -e QtGui \
+                        -e QtHelp \
+                        -e QtMultimedia \
+                        -e QtNetwork \
+                        -e QtDeclarative \
+                        -e QtOpenGL \
+                        -e QtScript \
+                        -e QtScriptTools \
+                        -e QtSql \
+                        -e QtSvg \
+                        -e QtTest \
+                        -e QtWebKit \
+                        -e QtXml \
+                        -e QtXmlPatterns \
+                        -e QtAssistant \
+                        -e QtDesigner \
+                        -e QAxContainer \
+                        --no-qsci-api
+
+variant phonon description {Add phonon support} {
+    configure.args-append   -e phonon
+    depends_lib-append      port:phonon
+}
+
+variant scintilla description {Add QScintilla API file } {
+    configure.args-delete   --no-qsci-api
+    configure.args-append   --qsci-api
+    depends_lib-append      port:py27-qscintilla
+}
+
 # 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
 patchfiles	patch-configure.py
 post-patch {
-    reinplace "s|@@MACPORTS_PYTHON_FRAMEWORK@@|${frameworks_dir}/Python.framework/Versions/${pyversion}/Python|" ${worksrcpath}/configure.py
+    reinplace "s|@@MACPORTS_PYTHON_FRAMEWORK@@|${frameworks_dir}/Python.framework/Versions/${python.branch}/Python|" ${worksrcpath}/configure.py
 }
 
+use_configure yes
+
 pre-configure {
     # allow ccache, if specified by the user
     if {[tbool configure.ccache]} {
@@ -45,7 +78,7 @@
     }
 }
 
-configure.cmd	"${prefix}/bin/python${pyversion} configure.py \
+configure.cmd	"${python.bin} configure.py \
 		-q ${qt_qmake_cmd} --verbose --confirm-license"
 configure.pre_args
 configure.post_args	LFLAGS="-F${frameworks_dir} -L${prefix}/lib"
@@ -72,12 +105,14 @@
 		set profiles [exec find ${worksrcpath} -name "*.pro"]
 		foreach profile ${profiles} {
 			reinplace -E "s|^(CONFIG\[ \\t].*)|\\1 ${conflags}|" ${profile}
+		}
 		
 		# Cures an isolated case
-		system "cd ${worksrcpath}/designer && \
-			${qt_qmake_cmd} -spec ${qt_mkspecs_dir}/macx-g++ -macx \
-				-o Makefile python.pro"
-		}
+        if {[file exists ${worksrcpath}/designer/python.pro ]} {
+            system "cd ${worksrcpath}/designer && \
+                ${qt_qmake_cmd} -spec ${qt_mkspecs_dir}/macx-g++ \
+                    -o Makefile python.pro"
+        }
 	}
 }
 
@@ -88,15 +123,16 @@
     }
 }
 
+build.cmd         make
 build.target    all
 use_parallel_build yes
 
 test.run	yes
-test.cmd	cd qt && ${prefix}/bin/python${pyversion} -c 'import PyQt4'
+test.cmd	cd qt && ${python.bin} -c 'import PyQt4'
 
 post-destroot {
-    ln -s ${frameworks_dir}/Python.framework/Versions/${pyversion}/bin/pyrcc4 ${destroot}${prefix}/bin/pyrcc4-${pyversion}
-    ln -s ${frameworks_dir}/Python.framework/Versions/${pyversion}/bin/pyuic4 ${destroot}${prefix}/bin/pyuic4-${pyversion}
+    ln -s ${frameworks_dir}/Python.framework/Versions/${python.branch}/bin/pyrcc4 ${destroot}${prefix}/bin/pyrcc4-${python.branch}
+    ln -s ${frameworks_dir}/Python.framework/Versions/${python.branch}/bin/pyuic4 ${destroot}${prefix}/bin/pyuic4-${python.branch}
 
 	xinstall -m 755 -d ${destroot}${prefix}/share/doc
 	file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
@@ -104,24 +140,27 @@
 		${destroot}${prefix}/share/doc/${name}
 	xinstall -m 644 -W ${worksrcpath} \
 		GPL_EXCEPTION.TXT GPL_EXCEPTION_ADDENDUM.TXT \
-		LICENSE-MERGED-GPL2-GPL3 LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT NEWS README \
+		LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT NEWS README \
 		THANKS \
 		${destroot}${prefix}/share/doc/${name}
 
-    # rename Qt4 specific files
-    # (a) designer plugin
-    set old_name libpythonplugin.dylib
-    set new_name libpython${pyversion_join}plugin.dylib
+    # This file exists if Qt was installed non-universal. Easiest just to check if it was created
+    if {[file exists ${destroot}${qt_plugins_dir}/designer/libpythonplugin.dylib]} {
+        # rename Qt4 specific files
+        # (a) designer plugin
+        set old_name libpythonplugin.dylib
+        set new_name libpython${python.version}plugin.dylib
 
-    move ${destroot}${qt_plugins_dir}/designer/${old_name} \
-        ${destroot}${qt_plugins_dir}/designer/${new_name}
-    system "install_name_tool -id ${new_name} \
-        ${destroot}${qt_plugins_dir}/designer/${new_name}"
+        move ${destroot}${qt_plugins_dir}/designer/${old_name} \
+            ${destroot}${qt_plugins_dir}/designer/${new_name}
+        system "install_name_tool -id ${new_name} \
+            ${destroot}${qt_plugins_dir}/designer/${new_name}"
+    }
 
     # (b) Qsci API file, if it exists (if Qsci is installed at build time)
     if {[file exists ${destroot}${qt_data_dir}/qsci/api/python/PyQt4.api]} {
         move ${destroot}${qt_data_dir}/qsci/api/python/PyQt4.api \
-            ${destroot}${qt_data_dir}/qsci/api/python/PyQt4-Python${pyversion}.api
+            ${destroot}${qt_data_dir}/qsci/api/python/PyQt4-Python${python.branch}.api
     }
 }
 
@@ -129,6 +168,8 @@
     configure.cmd-append --debug
 }
 
+}
+
 livecheck.type   regex
 livecheck.url    http://www.riverbankcomputing.co.uk/software/pyqt/download
 livecheck.regex  "PyQt-mac-gpl-(\[0-9.\]\\.\[0-9.\]\\.\[0-9.\]).tar.gz"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111025/2ad16851/attachment-0001.html>


More information about the macports-changes mailing list