[71214] trunk/dports/python

jameskyle at macports.org jameskyle at macports.org
Sat Sep 4 09:00:30 PDT 2010


Revision: 71214
          http://trac.macports.org/changeset/71214
Author:   jameskyle at macports.org
Date:     2010-09-04 09:00:28 -0700 (Sat, 04 Sep 2010)
Log Message:
-----------
Created a python 2.7 version for the pyqt4 port. This is just a straight copy with minor editing of the other pyqt4 ports and tested against a pyqt4 app.

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

Added: trunk/dports/python/py27-pyqt4/Portfile
===================================================================
--- trunk/dports/python/py27-pyqt4/Portfile	                        (rev 0)
+++ trunk/dports/python/py27-pyqt4/Portfile	2010-09-04 16:00:28 UTC (rev 71214)
@@ -0,0 +1,110 @@
+# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem	1.0
+
+name		py27-pyqt4
+version		4.7.5
+categories	python devel
+platforms	macosx
+maintainers     openmaintainer
+description	PyQt4 is a set of Python bindings for the Qt4 toolkit
+long_description \
+		PyQt4 is a set of Python bindings for the Qt4 toolkit. The \
+		bindings are implemented as a set of Python modules: qt, \
+		qtcanvas, qtgl, qtnetwork, qtsql, qttable, qtui and qtxml, \
+		and contains 300 classes and over 5,750 functions and methods.
+homepage	http://www.riverbankcomputing.co.uk/software/pyqt/intro
+master_sites	http://www.riverbankcomputing.com/static/Downloads/PyQt4/ \
+		http://pyqwt.sourceforge.net/support/
+distname	PyQt-mac-gpl-${version}
+dist_subdir         python
+
+
+depends_lib	port:py27-sip port:qt4-mac
+
+checksums           md5     8d03927be54f50eae64caab553e9dbed \
+                    sha1    6b1b74011c95c9fd999f05e9031ac7b7909302c6 \
+                    rmd160  672ba248ae34313d149e6f6d130ffc722b7b93d5
+
+set pyversion 2.7
+set qt_dir	${prefix}/libexec/qt4-mac
+
+# 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
+}
+
+pre-configure {
+	file copy -force ${qt_dir}/mkspecs/macx-g++/qmake.conf \
+		${worksrcpath}/qmake.conf
+
+	reinplace "s|-bundle|-bundle -flat_namespace -undefined suppress|" \
+		${worksrcpath}/qmake.conf
+}
+
+configure.cmd	"${prefix}/bin/python2.7 configure.py \
+		-q ${qt_dir}/bin/qmake \
+		--confirm-license"
+configure.pre_args
+configure.post_args	LFLAGS="-F${frameworks_dir} -L${prefix}/lib"
+
+variant universal {
+	configure.universal_args
+	configure.post_args	LFLAGS="-F${frameworks_dir} -L${prefix}/lib \
+								${configure.universal_ldflags}"
+	configure.post_args-append	CFLAGS="${configure.universal_cflags}"
+	configure.post_args-append	CXXFLAGS="${configure.universal_cxxflags}"
+
+}
+
+post-configure {
+	if {[variant_isset universal]} {
+		set conflags ""
+		foreach arch ${configure.universal_archs} {
+			if {${arch} == "i386"} {append conflags "x86 "} else {
+				if {${arch} == "ppc64"} {append conflags "ppc_64 "} else {
+					append conflags ${arch} " "
+				}
+			}
+		}
+
+		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_dir}/bin/qmake -spec ${qt_dir}/mkspecs/macx-g++ -macx \
+				-o Makefile python.pro"
+		}
+	}
+}
+
+
+build.target    all
+use_parallel_build yes
+
+test.run	yes
+test.cmd	cd qt && ${prefix}/bin/python${pyversion} -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}
+
+	xinstall -m 755 -d ${destroot}${prefix}/share/doc
+	file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
+	file copy ${worksrcpath}/examples \
+		${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 \
+		THANKS \
+		${destroot}${prefix}/share/doc/${name}
+}
+
+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"

Added: trunk/dports/python/py27-pyqt4/files/patch-configure.py
===================================================================
--- trunk/dports/python/py27-pyqt4/files/patch-configure.py	                        (rev 0)
+++ trunk/dports/python/py27-pyqt4/files/patch-configure.py	2010-09-04 16:00:28 UTC (rev 71214)
@@ -0,0 +1,11 @@
+--- configure.py.orig	2009-07-15 01:37:10.000000000 +1200
++++ configure.py	2009-07-19 18:28:19.000000000 +1200
+@@ -840,7 +840,7 @@
+                 if sys.platform == "darwin":
+                     # We need to work out how to specify the right framework
+                     # version.
+-                    link = "-framework Python"
++                    link = "%s @@MACPORTS_PYTHON_FRAMEWORK@@" % sipcfg.build_macros().get('LFLAGS', '')
+                 elif ("--enable-shared" in ducfg.get("CONFIG_ARGS", "") and
+                       glob.glob("%s/lib/libpython%d.%d*" % (ducfg["exec_prefix"], py_major, py_minor))):
+                     lib_dir_flag = quote("-L%s/lib" % ducfg["exec_prefix"])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100904/403022d0/attachment.html>


More information about the macports-changes mailing list