# -*- 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: Portfile 79236 2011-06-06 03:20:23Z jmr@macports.org $

PortSystem	1.0
PortGroup   qt4 1.0

name		py-pyqt4
version		4.7.7
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     18213126857b7c6e6da6f7a1720d4870 \
                    sha1    e07f851b54fa5cf6ec3e146f07b1c234c5069ca3 \
                    rmd160  fe1a01ce93a012224a4c590b56dc3bfa8fcdbe74

depends_lib-append port:py-sip

#patchfiles	patch-configure.py

pre-configure {
	file copy -force ${qt_mkspecs_dir}/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_qmake_cmd} \
		--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} \
		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}
}
