# $Id: Portfile 62211 2009-12-31 21:36:31Z ryandesign@macports.org $

PortSystem	1.0

name		py-pyqt4
version		4.4.3
revision        1
platforms	macosx
categories	python devel
maintainers	gmail.com:tim.stoop
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/pyqt/index.php
master_sites    http://www.riverbankcomputing.com/static/Downloads/PyQt4/ \
                http://pyqwt.sourceforge.net/support/
distname	PyQt-mac-gpl-${version}

checksums md5 6d2a11cd1372ce98b486e9bc5de3c0fc \
          sha1 6d1f3a717e551cd762b0adbd9c50f213c3ce8cbe \
          rmd160 da91bedccfb6b1e3cbc69f527dd57ead83eb647e

depends_lib	port:py-sip path:bin/qmake-mac:qt4-mac

#patchfiles	patch-configure.py

set qt_dir	${prefix}/libexec/qt4-mac

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.4 configure.py \
		-g -q ${qt_dir}/bin/qmake \
		--confirm-license"
configure.pre_args
configure.post_args	LFLAGS="-F${prefix}/Library/Frameworks -L${prefix}/lib"

test.run	yes
test.cmd	cd qt && ${prefix}/bin/python2.4 -c 'import PyQt4'

post-destroot {
	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} \
		ChangeLog GPL_EXCEPTION.TXT GPL_EXCEPTION_ADDENDUM.TXT \
		LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT NEWS README \
		THANKS \
		${destroot}${prefix}/share/doc/${name}
}
